summaryrefslogtreecommitdiffstats
path: root/domx
diff options
context:
space:
mode:
authorHashcode <hashcode0f@gmail.com>2015-01-30 16:34:26 -0800
committerHashcode <hashcode0f@gmail.com>2015-01-30 16:34:26 -0800
commit8c08a2cd67903c6708579a84245bbef17dbc7e36 (patch)
treeb42b25b1f9b0b7f88b4d611839d7fe044c6dcb82 /domx
parent7a5b1ab9a136796f7a07dd1738b50dc8165cc953 (diff)
downloadhardware_ti_omap4-8c08a2cd67903c6708579a84245bbef17dbc7e36.zip
hardware_ti_omap4-8c08a2cd67903c6708579a84245bbef17dbc7e36.tar.gz
hardware_ti_omap4-8c08a2cd67903c6708579a84245bbef17dbc7e36.tar.bz2
domx: create subdir for domx to merge into omap4-next
Diffstat (limited to 'domx')
-rw-r--r--domx/Android.mk83
-rw-r--r--domx/Makefile76
-rw-r--r--domx/domx/Android.mk41
-rw-r--r--domx/domx/Makefile111
-rwxr-xr-xdomx/domx/memmgr_rpc/src/Android.mk (renamed from domx/memmgr_rpc/src/Android.mk)0
-rwxr-xr-xdomx/domx/omx_proxy_common.h (renamed from domx/omx_proxy_common.h)0
-rw-r--r--domx/domx/omx_proxy_common/src/omx_proxy_common.c (renamed from domx/omx_proxy_common/src/omx_proxy_common.c)0
-rwxr-xr-xdomx/domx/omx_rpc.h (renamed from domx/omx_rpc.h)0
-rwxr-xr-xdomx/domx/omx_rpc/inc/omx_rpc_internal.h (renamed from domx/omx_rpc/inc/omx_rpc_internal.h)0
-rwxr-xr-xdomx/domx/omx_rpc/inc/omx_rpc_skel.h (renamed from domx/omx_rpc/inc/omx_rpc_skel.h)0
-rwxr-xr-xdomx/domx/omx_rpc/inc/omx_rpc_stub.h (renamed from domx/omx_rpc/inc/omx_rpc_stub.h)0
-rwxr-xr-xdomx/domx/omx_rpc/inc/omx_rpc_utils.h (renamed from domx/omx_rpc/inc/omx_rpc_utils.h)0
-rwxr-xr-xdomx/domx/omx_rpc/src/omx_rpc.c (renamed from domx/omx_rpc/src/omx_rpc.c)0
-rwxr-xr-xdomx/domx/omx_rpc/src/omx_rpc_config.c (renamed from domx/omx_rpc/src/omx_rpc_config.c)0
-rwxr-xr-xdomx/domx/omx_rpc/src/omx_rpc_platform.c (renamed from domx/omx_rpc/src/omx_rpc_platform.c)0
-rwxr-xr-xdomx/domx/omx_rpc/src/omx_rpc_skel.c (renamed from domx/omx_rpc/src/omx_rpc_skel.c)0
-rwxr-xr-xdomx/domx/omx_rpc/src/omx_rpc_stub.c (renamed from domx/omx_rpc/src/omx_rpc_stub.c)0
-rwxr-xr-xdomx/domx/omx_rpc/src/omx_rpc_utils.c (renamed from domx/omx_rpc/src/omx_rpc_utils.c)0
-rw-r--r--domx/domx/plugins/inc/memplugin.h (renamed from domx/plugins/inc/memplugin.h)0
-rwxr-xr-xdomx/domx/plugins/inc/memplugin_ion.h (renamed from domx/plugins/inc/memplugin_ion.h)0
-rw-r--r--domx/domx/plugins/memplugin.c (renamed from domx/plugins/memplugin.c)0
-rwxr-xr-xdomx/domx/plugins/memplugin_ion.c (renamed from domx/plugins/memplugin_ion.c)0
-rw-r--r--domx/domx/plugins/memplugin_table.c (renamed from domx/plugins/memplugin_table.c)0
-rw-r--r--domx/domx/profiling/inc/profile.h (renamed from domx/profiling/inc/profile.h)0
-rw-r--r--domx/domx/profiling/src/profile.c (renamed from domx/profiling/src/profile.c)0
-rw-r--r--domx/domx/rpmsg_omx_defs.h (renamed from domx/rpmsg_omx_defs.h)0
-rw-r--r--domx/make/build.mk379
-rw-r--r--domx/make/start.mk101
-rw-r--r--domx/mm_osal/Android.mk30
-rw-r--r--domx/mm_osal/Makefile61
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_error.h175
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_events.h81
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_interfaces.h72
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_memory.h105
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_mutex.h71
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_osal.h68
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_pipes.h89
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_semaphores.h79
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_task.h89
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_trace.h217
-rwxr-xr-xdomx/mm_osal/inc/timm_osal_types.h124
-rwxr-xr-xdomx/mm_osal/src/timm_osal.c99
-rwxr-xr-xdomx/mm_osal/src/timm_osal_events.c420
-rwxr-xr-xdomx/mm_osal/src/timm_osal_memory.c250
-rwxr-xr-xdomx/mm_osal/src/timm_osal_mutex.c244
-rwxr-xr-xdomx/mm_osal/src/timm_osal_pipes.c415
-rwxr-xr-xdomx/mm_osal/src/timm_osal_semaphores.c297
-rwxr-xr-xdomx/mm_osal/src/timm_osal_task.c262
-rwxr-xr-xdomx/mm_osal/src/timm_osal_trace.c172
-rw-r--r--domx/omx_core/Android.mk20
-rw-r--r--domx/omx_core/Makefile99
-rw-r--r--domx/omx_core/inc/OMX_Audio.h1345
-rw-r--r--domx/omx_core/inc/OMX_Component.h596
-rwxr-xr-xdomx/omx_core/inc/OMX_ComponentExt.h61
-rwxr-xr-xdomx/omx_core/inc/OMX_ComponentRegistry.h68
-rw-r--r--domx/omx_core/inc/OMX_ContentPipe.h212
-rw-r--r--domx/omx_core/inc/OMX_Core.h1448
-rwxr-xr-xdomx/omx_core/inc/OMX_CoreExt.h73
-rwxr-xr-xdomx/omx_core/inc/OMX_Core_Wrapper.h83
-rwxr-xr-xdomx/omx_core/inc/OMX_Debug.h170
-rwxr-xr-xdomx/omx_core/inc/OMX_DebugMem.h71
-rw-r--r--domx/omx_core/inc/OMX_IVCommon.h947
-rw-r--r--domx/omx_core/inc/OMX_Image.h345
-rw-r--r--domx/omx_core/inc/OMX_Index.h276
-rwxr-xr-xdomx/omx_core/inc/OMX_IndexExt.h87
-rw-r--r--domx/omx_core/inc/OMX_Other.h354
-rwxr-xr-xdomx/omx_core/inc/OMX_TI_Common.h343
-rwxr-xr-xdomx/omx_core/inc/OMX_TI_Core.h107
-rwxr-xr-xdomx/omx_core/inc/OMX_TI_IVCommon.h4906
-rwxr-xr-xdomx/omx_core/inc/OMX_TI_Image.h63
-rw-r--r--domx/omx_core/inc/OMX_TI_Index.h302
-rw-r--r--domx/omx_core/inc/OMX_TI_Video.h2695
-rw-r--r--domx/omx_core/inc/OMX_Types.h364
-rw-r--r--domx/omx_core/inc/OMX_Video.h1078
-rwxr-xr-xdomx/omx_core/inc/OMX_VideoExt.h69
-rw-r--r--domx/omx_core/src/OMX_Core.c910
-rwxr-xr-xdomx/omx_core/src/OMX_Core_Wrapper.c168
-rw-r--r--domx/omx_proxy_component/Android.mk332
-rwxr-xr-xdomx/omx_proxy_component/Makefile88
-rw-r--r--domx/omx_proxy_component/omx_camera/inc/omx_proxy_camera.h107
-rwxr-xr-xdomx/omx_proxy_component/omx_camera/src/omx_proxy_camera.c591
-rw-r--r--domx/omx_proxy_component/omx_camera/src/proxy_camera_android_glue.c254
-rwxr-xr-xdomx/omx_proxy_component/omx_sample/Makefile101
-rwxr-xr-xdomx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c109
-rwxr-xr-xdomx/omx_proxy_component/omx_video_dec/Makefile102
-rwxr-xr-xdomx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec.c813
-rw-r--r--domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c153
-rwxr-xr-xdomx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_utils.c319
-rw-r--r--domx/omx_proxy_component/omx_video_enc/inc/omx_proxy_video_encoder.h97
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/Makefile101
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc.c1113
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc_secure.c1115
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/Makefile101
-rw-r--r--domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/src/omx_proxy_h264svcenc.c1067
-rw-r--r--domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/Makefile101
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c1076
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/Makefile102
-rwxr-xr-xdomx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/src/omx_proxy_vc1enc.c1172
-rw-r--r--domx/test/Makefile95
-rw-r--r--domx/test/sample_proxy/Makefile98
-rwxr-xr-xdomx/test/sample_proxy/test_sample_proxy.c1222
101 files changed, 31810 insertions, 90 deletions
diff --git a/domx/Android.mk b/domx/Android.mk
index 66c90b9..9003fe6 100644
--- a/domx/Android.mk
+++ b/domx/Android.mk
@@ -1,41 +1,42 @@
-LOCAL_PATH:= $(call my-dir)
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES:= \
- omx_rpc/src/omx_rpc.c \
- omx_rpc/src/omx_rpc_skel.c \
- omx_rpc/src/omx_rpc_stub.c \
- omx_rpc/src/omx_rpc_config.c \
- omx_rpc/src/omx_rpc_platform.c \
- omx_proxy_common/src/omx_proxy_common.c \
- profiling/src/profile.c \
- plugins/memplugin.c \
- plugins/memplugin_table.c \
- plugins/memplugin_ion.c
-
-LOCAL_C_INCLUDES += \
- $(LOCAL_PATH)/omx_rpc/inc \
- $(LOCAL_PATH)/../omx_core/inc \
- $(LOCAL_PATH)/../mm_osal/inc \
- $(LOCAL_PATH)/profiling/inc \
- $(HARDWARE_TI_OMAP4_BASE)/hwc/ \
- $(HARDWARE_TI_OMAP4_BASE)/include/ \
- system/core/include/cutils \
- $(HARDWARE_TI_OMAP4_BASE)/../../libhardware/include \
- $(LOCAL_PATH)/plugins/inc/
-
-LOCAL_CFLAGS += -D_Android -DENABLE_GRALLOC_BUFFERS -DUSE_ENHANCED_PORTRECONFIG -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
-
-
-LOCAL_SHARED_LIBRARIES := \
- libmm_osal \
- libc \
- liblog \
- libion_ti \
- libcutils
-
-LOCAL_MODULE:= libdomx
-LOCAL_MODULE_TAGS:= optional
-
-include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+#DOMX is not supported on J6 yet. Supported only on omap4 and omap5
+ifeq ($(TARGET_BOARD_PLATFORM), $(filter $(TARGET_BOARD_PLATFORM), omap4 omap5))
+ifeq ($(ENHANCED_DOMX),true)
+
+ # DOMX not used in OMAP3 program
+ ifneq ($(TARGET_BOARD_PLATFORM),omap3)
+
+ LOCAL_PATH:= $(call my-dir)
+ HARDWARE_TI_OMAP4_BASE:= $(LOCAL_PATH)/../omap4xxx
+ OMAP4_DEBUG_MEMLEAK:= false
+
+ ifeq ($(OMAP4_DEBUG_MEMLEAK),true)
+
+ OMAP4_DEBUG_CFLAGS:= -DHEAPTRACKER
+ OMAP4_DEBUG_LDFLAGS:= $(foreach f, $(strip malloc realloc calloc free), -Wl,--wrap=$(f))
+ OMAP4_DEBUG_SHARED_LIBRARIES:= liblog
+ BUILD_HEAPTRACKED_SHARED_LIBRARY:= hardware/ti/omap4xxx/heaptracked-shared-library.mk
+ BUILD_HEAPTRACKED_EXECUTABLE:= hardware/ti/omap4xxx/heaptracked-executable.mk
+
+ LOCAL_PATH:= $(call my-dir)
+ include $(CLEAR_VARS)
+ LOCAL_SRC_FILES:= heaptracker.c stacktrace.c mapinfo.c
+ LOCAL_MODULE:= libheaptracker
+ LOCAL_MODULE_TAGS:= optional
+ include $(BUILD_STATIC_LIBRARY)
+
+ include $(CLEAR_VARS)
+ LOCAL_SRC_FILES:= tm.c
+ LOCAL_MODULE:= tm
+ LOCAL_MODULE_TAGS:= test
+ include $(BUILD_HEAPTRACKED_EXECUTABLE)
+
+ else
+ BUILD_HEAPTRACKED_SHARED_LIBRARY:=$(BUILD_SHARED_LIBRARY)
+ BUILD_HEAPTRACKED_EXECUTABLE:= $(BUILD_EXECUTABLE)
+ endif
+
+ include $(call first-makefiles-under,$(LOCAL_PATH))
+ endif # ifeq ($(TARGET_BOARD_PLATFORM),omap4)
+
+endif #ifeq ($(ENHANCED_DOMX),true)
+endif
diff --git a/domx/Makefile b/domx/Makefile
index cab0b80..f6fb3f0 100644
--- a/domx/Makefile
+++ b/domx/Makefile
@@ -1,27 +1,27 @@
-#
-# Copyright (C) Texas Instruments - http://www.ti.com/
-#
+#
+# Copyright 2001-2008 Texas Instruments - http://www.ti.com/
+#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
-#
+#
# ----------------------------------------------------------------------------
# Revision History
#
#
-# REF=ORG
+# SEP xx,2002 REF=ORG Swamy MC
# Original version.
# ----------------------------------------------------------------------------
-#PROJROOT = ..
+#PROJROOT = $(ROOTDIR)/src
include $(PROJROOT)/make/start.mk
@@ -30,11 +30,7 @@ include $(PROJROOT)/make/start.mk
# Arguments to tools, will move to make system once finalized.
CFLAGS =
-CDEFS =
-ifeq ($(BUILD),udeb)
-CDEFS += DEBUG
-endif
-CDEFS +=
+CDEFS = DEBUG
EXEC_ARGS =
ST_LIB_ARGS =
@@ -48,61 +44,43 @@ SH_LIB_ARGS =
# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
# executable (EXEC) : filename.out
-TARGETNAME = libdomx
+TARGETNAME =
# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+#TARGETTYPE = ST_LIB
+TARGETTYPE =
-TARGETTYPE = SH_LIB
-
-# install directory relative to the HOSTTARGET directory
-HOSTRELEASE = lib
-
-# install directory relative to the root filesystem
-ROOTFSRELEASE = lib
+# For shared object library, soname is filename.so.maj_ver
+SH_SONAME =
# Folders in which gmake will run before building current target
SUBMODULES = \
+mm_osal \
+omx_core \
+domx \
+omx_proxy_component \
+
+#video/omx_proxy_component/test
# Filename must not begin with '.', '/' or '\'
-SOURCES = \
-omx_rpc/src/omx_rpc.c \
-omx_rpc/src/omx_rpc_skel.c \
-omx_rpc/src/omx_rpc_stub.c \
-omx_proxy_common/src/omx_proxy_common.c \
-profiling/profile.c
-# The below files are currently empty, so removed them from building
-# omx_rpc/src/omx_rpc_config.c \
-# omx_rpc/src/omx_rpc_platform.c \
+SOURCES =
# Search path for include files
-INCLUDES = \
- $(PROJROOT)/omx_core/inc \
- $(PROJROOT)/mm_osal/inc \
- $(PROJROOT)/domx \
- $(PROJROOT)/domx/omx_rpc \
- $(PROJROOT)/domx/omx_rpc/inc \
- ../../memmgrheaders \
-
+INCLUDES =
# Libraries needed for linking.
-ST_LIBS =
-#mm_osal
-SH_LIBS = omx_core mm_osal
-#rcm ipc
-#pthread rt utils procmgr ipc rcm notify
-#SH_LIBS += sysmgr sysmemmgr
-
+ST_LIBS =
+SH_LIBS =
# Search path for library (and linker command) files.
# Current folder and target folder are included by default.
-LIBINCLUDES = $(PROJROOT)/mm_osal \
- $(PROJROOT)/omx_core
+LIBINCLUDES =
# Do not change below "include" line(s)
diff --git a/domx/domx/Android.mk b/domx/domx/Android.mk
new file mode 100644
index 0000000..66c90b9
--- /dev/null
+++ b/domx/domx/Android.mk
@@ -0,0 +1,41 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ omx_rpc/src/omx_rpc.c \
+ omx_rpc/src/omx_rpc_skel.c \
+ omx_rpc/src/omx_rpc_stub.c \
+ omx_rpc/src/omx_rpc_config.c \
+ omx_rpc/src/omx_rpc_platform.c \
+ omx_proxy_common/src/omx_proxy_common.c \
+ profiling/src/profile.c \
+ plugins/memplugin.c \
+ plugins/memplugin_table.c \
+ plugins/memplugin_ion.c
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/omx_rpc/inc \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/profiling/inc \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc/ \
+ $(HARDWARE_TI_OMAP4_BASE)/include/ \
+ system/core/include/cutils \
+ $(HARDWARE_TI_OMAP4_BASE)/../../libhardware/include \
+ $(LOCAL_PATH)/plugins/inc/
+
+LOCAL_CFLAGS += -D_Android -DENABLE_GRALLOC_BUFFERS -DUSE_ENHANCED_PORTRECONFIG -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ liblog \
+ libion_ti \
+ libcutils
+
+LOCAL_MODULE:= libdomx
+LOCAL_MODULE_TAGS:= optional
+
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
diff --git a/domx/domx/Makefile b/domx/domx/Makefile
new file mode 100644
index 0000000..cab0b80
--- /dev/null
+++ b/domx/domx/Makefile
@@ -0,0 +1,111 @@
+#
+# Copyright (C) Texas Instruments - http://www.ti.com/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+#PROJROOT = ..
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libdomx
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+omx_rpc/src/omx_rpc.c \
+omx_rpc/src/omx_rpc_skel.c \
+omx_rpc/src/omx_rpc_stub.c \
+omx_proxy_common/src/omx_proxy_common.c \
+profiling/profile.c
+# The below files are currently empty, so removed them from building
+# omx_rpc/src/omx_rpc_config.c \
+# omx_rpc/src/omx_rpc_platform.c \
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc \
+ $(PROJROOT)/domx/omx_rpc/inc \
+ ../../memmgrheaders \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal
+SH_LIBS = omx_core mm_osal
+#rcm ipc
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
+
diff --git a/domx/memmgr_rpc/src/Android.mk b/domx/domx/memmgr_rpc/src/Android.mk
index b71e9d5..b71e9d5 100755
--- a/domx/memmgr_rpc/src/Android.mk
+++ b/domx/domx/memmgr_rpc/src/Android.mk
diff --git a/domx/omx_proxy_common.h b/domx/domx/omx_proxy_common.h
index ba7874e..ba7874e 100755
--- a/domx/omx_proxy_common.h
+++ b/domx/domx/omx_proxy_common.h
diff --git a/domx/omx_proxy_common/src/omx_proxy_common.c b/domx/domx/omx_proxy_common/src/omx_proxy_common.c
index 1abf1eb..1abf1eb 100644
--- a/domx/omx_proxy_common/src/omx_proxy_common.c
+++ b/domx/domx/omx_proxy_common/src/omx_proxy_common.c
diff --git a/domx/omx_rpc.h b/domx/domx/omx_rpc.h
index 84c00d0..84c00d0 100755
--- a/domx/omx_rpc.h
+++ b/domx/domx/omx_rpc.h
diff --git a/domx/omx_rpc/inc/omx_rpc_internal.h b/domx/domx/omx_rpc/inc/omx_rpc_internal.h
index b33bf2d..b33bf2d 100755
--- a/domx/omx_rpc/inc/omx_rpc_internal.h
+++ b/domx/domx/omx_rpc/inc/omx_rpc_internal.h
diff --git a/domx/omx_rpc/inc/omx_rpc_skel.h b/domx/domx/omx_rpc/inc/omx_rpc_skel.h
index b36281c..b36281c 100755
--- a/domx/omx_rpc/inc/omx_rpc_skel.h
+++ b/domx/domx/omx_rpc/inc/omx_rpc_skel.h
diff --git a/domx/omx_rpc/inc/omx_rpc_stub.h b/domx/domx/omx_rpc/inc/omx_rpc_stub.h
index fd06506..fd06506 100755
--- a/domx/omx_rpc/inc/omx_rpc_stub.h
+++ b/domx/domx/omx_rpc/inc/omx_rpc_stub.h
diff --git a/domx/omx_rpc/inc/omx_rpc_utils.h b/domx/domx/omx_rpc/inc/omx_rpc_utils.h
index d8334c9..d8334c9 100755
--- a/domx/omx_rpc/inc/omx_rpc_utils.h
+++ b/domx/domx/omx_rpc/inc/omx_rpc_utils.h
diff --git a/domx/omx_rpc/src/omx_rpc.c b/domx/domx/omx_rpc/src/omx_rpc.c
index e78d92b..e78d92b 100755
--- a/domx/omx_rpc/src/omx_rpc.c
+++ b/domx/domx/omx_rpc/src/omx_rpc.c
diff --git a/domx/omx_rpc/src/omx_rpc_config.c b/domx/domx/omx_rpc/src/omx_rpc_config.c
index 8b13789..8b13789 100755
--- a/domx/omx_rpc/src/omx_rpc_config.c
+++ b/domx/domx/omx_rpc/src/omx_rpc_config.c
diff --git a/domx/omx_rpc/src/omx_rpc_platform.c b/domx/domx/omx_rpc/src/omx_rpc_platform.c
index 8b13789..8b13789 100755
--- a/domx/omx_rpc/src/omx_rpc_platform.c
+++ b/domx/domx/omx_rpc/src/omx_rpc_platform.c
diff --git a/domx/omx_rpc/src/omx_rpc_skel.c b/domx/domx/omx_rpc/src/omx_rpc_skel.c
index 5b8d423..5b8d423 100755
--- a/domx/omx_rpc/src/omx_rpc_skel.c
+++ b/domx/domx/omx_rpc/src/omx_rpc_skel.c
diff --git a/domx/omx_rpc/src/omx_rpc_stub.c b/domx/domx/omx_rpc/src/omx_rpc_stub.c
index 0c28ba1..0c28ba1 100755
--- a/domx/omx_rpc/src/omx_rpc_stub.c
+++ b/domx/domx/omx_rpc/src/omx_rpc_stub.c
diff --git a/domx/omx_rpc/src/omx_rpc_utils.c b/domx/domx/omx_rpc/src/omx_rpc_utils.c
index b1e47a8..b1e47a8 100755
--- a/domx/omx_rpc/src/omx_rpc_utils.c
+++ b/domx/domx/omx_rpc/src/omx_rpc_utils.c
diff --git a/domx/plugins/inc/memplugin.h b/domx/domx/plugins/inc/memplugin.h
index 6bd7d51..6bd7d51 100644
--- a/domx/plugins/inc/memplugin.h
+++ b/domx/domx/plugins/inc/memplugin.h
diff --git a/domx/plugins/inc/memplugin_ion.h b/domx/domx/plugins/inc/memplugin_ion.h
index 9e5b4a5..9e5b4a5 100755
--- a/domx/plugins/inc/memplugin_ion.h
+++ b/domx/domx/plugins/inc/memplugin_ion.h
diff --git a/domx/plugins/memplugin.c b/domx/domx/plugins/memplugin.c
index b6597b4..b6597b4 100644
--- a/domx/plugins/memplugin.c
+++ b/domx/domx/plugins/memplugin.c
diff --git a/domx/plugins/memplugin_ion.c b/domx/domx/plugins/memplugin_ion.c
index 07b81cc..07b81cc 100755
--- a/domx/plugins/memplugin_ion.c
+++ b/domx/domx/plugins/memplugin_ion.c
diff --git a/domx/plugins/memplugin_table.c b/domx/domx/plugins/memplugin_table.c
index a5b30c4..a5b30c4 100644
--- a/domx/plugins/memplugin_table.c
+++ b/domx/domx/plugins/memplugin_table.c
diff --git a/domx/profiling/inc/profile.h b/domx/domx/profiling/inc/profile.h
index 352a91c..352a91c 100644
--- a/domx/profiling/inc/profile.h
+++ b/domx/domx/profiling/inc/profile.h
diff --git a/domx/profiling/src/profile.c b/domx/domx/profiling/src/profile.c
index abb5817..abb5817 100644
--- a/domx/profiling/src/profile.c
+++ b/domx/domx/profiling/src/profile.c
diff --git a/domx/rpmsg_omx_defs.h b/domx/domx/rpmsg_omx_defs.h
index d3df1f5..d3df1f5 100644
--- a/domx/rpmsg_omx_defs.h
+++ b/domx/domx/rpmsg_omx_defs.h
diff --git a/domx/make/build.mk b/domx/make/build.mk
new file mode 100644
index 0000000..2faeffa
--- /dev/null
+++ b/domx/make/build.mk
@@ -0,0 +1,379 @@
+#
+# Copyright 2001-2009 Texas Instruments - http://www.ti.com/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# dspbridge/mpu_api/make/build.mk
+#
+# DSP-BIOS Bridge build rules.
+
+# ALL PATHS IN MAKEFILE MUST BE RELATIVE TO ITS DIRECTORY
+
+CDEFS += $(CMDDEFS) # Add command line definitions
+CDEFS += $(PROCFAMILY) # Processor Family e.g. 3430
+CDEFS += $(CMDDEFS_START) # Definitions from start.mk
+# ----------------------------------------------------------
+# REMOVE LEADING AND TRAILING SPACES FROM MAKEFILE MACROS
+# ----------------------------------------------------------
+
+TARGETNAME := $(strip $(TARGETNAME))
+TARGETTYPE := $(strip $(TARGETTYPE))
+SUBMODULES := $(strip $(SUBMODULES))
+SOURCES := $(strip $(SOURCES))
+INCLUDES := $(strip $(INCLUDES))
+LIBINCLUDES := $(strip $(LIBINCLUDES))
+
+SH_SONAME := $(strip $(SH_SONAME))
+ST_LIBS := $(strip $(ST_LIBS))
+SH_LIBS := $(strip $(SH_LIBS))
+
+CFLAGS := $(strip $(CFLAGS))
+CDEFS := $(strip $(CDEFS))
+EXEC_ARGS := $(strip $(EXEC_ARGS))
+ST_LIB_ARGS := $(strip $(ST_LIB_ARGS))
+SH_LIB_ARGS := $(strip $(SH_LIB_ARGS))
+
+# ----------------------------------------------------------
+# COMPILER OPTIONS
+# ----------------------------------------------------------
+
+# Preprocessor : dependency file generation
+ifndef NODEPENDS
+ifndef nodepends
+CFLAGS += -MD
+endif
+endif
+
+# Overall
+CFLAGS += -pipe
+# Preprocessor
+CFLAGS +=
+# Debugging
+ifeq ($(BUILD),deb)
+CFLAGS += -g
+else
+CFLAGS += -fomit-frame-pointer
+endif
+# Warnings
+CFLAGS += -Wall -Wno-trigraphs -Werror-implicit-function-declaration #-Wno-format
+# Optimizations
+#CFLAGS += -O2 -fno-strict-aliasing
+#CFLAGS += -Os -fno-strict-aliasing
+CFLAGS += -fno-strict-aliasing
+# Machine dependent
+
+ifeq ($(PROCFAMILY),OMAP_3430)
+CFLAGS += -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -march=armv7-a -msoft-float -Uarm -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR($(basename $(TARGETNAME)))" -D"KBUILD_MODNAME=KBUILD_STR($(basename $(TARGETNAME)))" -DMODULE -D__LINUX_ARM_ARCH__=7
+endif
+
+ifeq ($(PROCFAMILY),OMAP_4430)
+CFLAGS += -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -march=armv7-a -msoft-float -Uarm -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR($(basename $(TARGETNAME)))" -D"KBUILD_MODNAME=KBUILD_STR($(basename $(TARGETNAME)))" -DMODULE -D__LINUX_ARM_ARCH__=7
+endif
+
+# Code generation
+CFLAGS += -fno-common
+# Macros
+CFLAGS += -DLINUX $(addprefix -D, $(CDEFS))
+
+ifdef __KERNEL__
+CFLAGS += -D__KERNEL__ -fno-builtin
+endif
+
+# ----------------------------------------------------------
+# OBJECTS
+# ----------------------------------------------------------
+
+BUILDDIR = .obj/
+
+# setup the target - check the given type - make sure we have the
+# correct suffix on it
+# TARGETNAME should not have a suffix on it - give an error if it does
+#ifneq ($(suffix $(TARGETNAME)),)
+# $(error TARGETNAME can not have a suffix)
+#endif
+ifeq ($(TARGETTYPE),SH_LIB)
+ TARGET := $(basename $(TARGETNAME)).so
+else
+ifeq ($(TARGETTYPE),MODULE)
+ TARGET := $(basename $(TARGETNAME)).o
+ TARGETKO := $(addsuffix .ko,$(basename $(TARGET)))
+ TARGETMOD := $(addsuffix .mod,$(basename $(TARGET)))
+else
+ifeq ($(TARGETTYPE),ST_LIB)
+ TARGET := $(basename $(TARGETNAME)).a
+else
+ifeq ($(TARGETTYPE),EXEC)
+ TARGET := $(basename $(TARGETNAME)).out
+else
+ifneq ($(TARGETTYPE),)
+TARGET := $(error Invalid TARGETTYPE)
+endif
+endif
+endif
+endif
+endif
+
+#LIBINCLUDES += $(TARGETDIR) $(TGTROOT)/lib $(TGTROOT)/usr/lib
+LIBINCLUDES += $(TARGETDIR)/lib $(TARGETDIR)/usr/lib
+SRCDIRS := $(sort $(dir $(SOURCES)))
+OBJDIRS := $(addprefix $(BUILDDIR),$(SRCDIRS)) $(BUILDDIR)
+
+BASEOBJ := $(addsuffix .o,$(basename $(SOURCES)))
+OBJECTS := $(addprefix $(BUILDDIR), $(BASEOBJ))
+
+ST_LIBNAMES := $(addsuffix .a, $(addprefix lib, $(ST_LIBS)))
+DL_LIBNAMES := $(addsuffix .so, $(addprefix lib, $(SH_LIBS)))
+
+vpath %.a $(LIBINCLUDES) $(TGTROOT)/lib $(TGTROOT)/usr/lib
+vpath %.so $(LIBINCLUDES) $(TGTROOT)/lib $(TGTROOT)/usr/lib
+
+# ----------------------------------------------------------
+# BUILD ARGUMENTS
+# ----------------------------------------------------------
+
+MAPFILE := -Wl,-Map,$(TARGET).map
+INCPATH := $(addprefix -I, . $(INCLUDES)) $(LINUXINCLUDE)
+LIBPATH := $(addprefix -L, $(LIBINCLUDES))
+LIBFILE := $(addprefix -l, $(ST_LIBS) $(SH_LIBS)) $(LIB_OBJS)
+
+ifeq ($(TARGETTYPE),SH_LIB)
+CFLAGS += -fpic
+TARGETARGS := $(SH_LIB_ARGS) -nostartfiles -nodefaultlibs -nostdlib -shared -Wl
+ifneq ($(SH_SONAME),)
+TARGETARGS += -Wl,-soname,$(SH_SONAME)
+endif
+endif
+
+ifeq ($(TARGETTYPE),MODULE)
+TARGETARGS := $(SH_LIB_ARGS) -nostartfiles -nodefaultlibs -nostdlib -Wl,-r
+ifneq ($(SH_SONAME),)
+TARGETARGS += -Wl,-soname,$(SH_SONAME)
+endif
+endif
+
+ifeq ($(TARGETTYPE),ST_LIB)
+TARGETARGS := $(ST_LIB_ARGS) -nostartfiles -nodefaultlibs -nostdlib -Wl,-r
+endif
+
+ifeq ($(TARGETTYPE),EXEC)
+TARGETARGS := $(EXEC_ARGS)
+endif
+
+.PHONY : all $(SUBMODULES) clean cleantrg SHELLERR Debug
+
+# ==========================================================
+# all
+# ==========================================================
+all : $(CHECKSHELL) $(SUBMODULES)
+
+# ==========================================================
+# Make submodules
+# ==========================================================
+$(SUBMODULES):
+ifndef NORECURSE
+ifndef norecurse
+ $(MAKE) -C $@ $(filter-out $(SUBMODULES),$(MAKECMDGOALS))
+endif
+endif
+
+ifneq ($(TARGETTYPE),)
+
+# if this is driver module level , build KO file too
+ifneq ($(TOPLEVEL),)
+all : $(OBJDIRS) $(TARGETKO)
+else
+all : $(OBJDIRS) $(TARGET)
+endif
+
+# ==========================================================
+# Create directories
+# ==========================================================
+$(OBJDIRS) $(TARGETDIR) :
+ @$(call MKDIR, $@)
+
+# ==========================================================
+# Product 2.6.x kernel module based on target
+# ==========================================================
+
+# Link module .o with vermagic .o
+$(TARGETKO): $(TARGETMOD).o $(TARGET)
+ $(LD) -EL -r -o $@ $^
+
+# Compile vermagic
+$(TARGETMOD).o: $(TARGETMOD).c
+ $(CC) -c $(TARGETARGS) $(CFLAGS) $(INCPATH) -o $@ $<
+
+# Generate Module vermagic
+$(TARGETMOD).c: $(TARGET)
+ $(MODPOST) $(TARGET)
+# removed - need to be done as a pre-step to building
+# $(MAKE) -C $(KRNLSRC) modules
+
+# ==========================================================
+# Build target
+# ==========================================================
+$(TARGET):$(OBJECTS) $(ST_LIBNAMES) $(DL_LIBNAMES)
+# @$(SHELLCMD) echo Building $@
+# $(CC) $(TARGETARGS) $(CFLAGS) $(LIBPATH) $(MAPFILE) -o $@ $(BASEOBJ) $(LIBFILE)
+# $(CC) $(TARGETARGS) $(CFLAGS) $(LIBPATH) $(MAPFILE) -o $@ $(OBJECTS) $(LIBFILE)
+ifeq ($(TARGETTYPE),ST_LIB)
+ $(AR) r $@ $(OBJECTS)
+else
+ $(CC) $(TARGETARGS) $(CFLAGS) $(LIBPATH) $(MAPFILE) -o $@ $(OBJECTS) $(LIBFILE)
+endif
+
+# ==========================================================
+# Compile .c file
+# ==========================================================
+$(BUILDDIR)%.o:%.c
+# echo Compiling $(patsubst $(BUILDDIR)%.o,%.c, $@)
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $(patsubst $(BUILDDIR)%.o,%.c, $@)
+
+# ==========================================================
+# Compile .S file
+# ==========================================================
+$(BUILDDIR)%.o:%.S
+# echo Compiling $(patsubst $(BUILDDIR)%.o,%.S, $@)
+ $(CC) -c $(CFLAGS) $(INCPATH) -o $@ $(patsubst $(BUILDDIR)%.o,%.S, $@)
+
+endif # ifneq ($(TARGETTYPE),)
+
+# ----------------------------------------------------------
+# install - install the files
+# ----------------------------------------------------------
+install:: $(TARGETDIR) $(SUBMODULES) $(TARGET)
+ifdef HOSTRELEASE
+ifdef SH_SONAME
+ $(INSTALL) -D $(TARGET) $(TARGETDIR)/$(HOSTRELEASE)/$(SH_SONAME)
+ $(RM) -f $(TARGETDIR)/$(HOSTRELEASE)/$(TARGET)
+ ln -s $(SH_SONAME) $(TARGETDIR)/$(HOSTRELEASE)/$(TARGET)
+else
+ifneq ($(TOPLEVEL),)
+ $(INSTALL) -D $(TARGETKO) $(TARGETDIR)/$(HOSTRELEASE)/$(TARGETKO)
+else
+ $(INSTALL) -D $(TARGET) $(TARGETDIR)/$(HOSTRELEASE)/$(TARGET)
+endif
+endif
+endif
+ifdef 0 # removed - components shouldn't put things in the production fs
+ifdef ROOTFSRELEASE
+ $(call MKDIR, $(ROOTFSDIR)/$(ROOTFSRELEASE))
+ifdef SH_SONAME
+ $(STRIP) --strip-unneeded -xgo $(ROOTFSDIR)/$(ROOTFSRELEASE)/$(SH_SONAME) $(TARGET)
+ $(RM) -f $(ROOTFSDIR)/$(ROOTFSRELEASE)/$(TARGET)
+ ln -s $(SH_SONAME) $(ROOTFSDIR)/$(ROOTFSRELEASE)/$(TARGET)
+else
+ifneq ($(TOPLEVEL),)
+ $(STRIP) --strip-unneeded -xgo $(ROOTFSDIR)/$(ROOTFSRELEASE)/$(TARGETKO) $(TARGETKO)
+else
+ $(STRIP) --strip-unneeded -xgo $(ROOTFSDIR)/$(ROOTFSRELEASE)/$(TARGET) $(TARGET)
+endif
+endif
+endif
+endif
+
+# ----------------------------------------------------------
+# clean - Remove build directory and target files
+# Linux : Removes object and dependency files in build folder
+# DOS : Removes object dirs in build folder
+# ----------------------------------------------------------
+clean : $(SUBMODULES)
+ifneq ($(TARGETTYPE),)
+ifneq ($(OBJECTS),)
+ - $(call RM,-f $(OBJECTS))
+ - $(call RM,-f $(OBJECTS:.o=.d))
+ - $(call RMDIR,-f $(BUILDDIR))
+endif
+ - $(call RM,-f $(TARGET))
+ - $(call RM,-f $(TARGET).map)
+ - $(call RM,-f $(TARGETKO))
+ - $(call RM,-f $(TARGETMOD).c)
+ - $(call RM,-f $(TARGETMOD).o)
+ - $(call RM,-f $(TARGETMOD).d)
+ifneq ($(TOPLEVEL),)
+ - @$(call RM,-f $(TARGETKO))
+ - @$(call RM,-f $(TARGETMOD).c)
+ - @$(call RM,-f $(TARGETMOD).o)
+ - @$(call RM,-f $(TARGETMOD).d)
+endif
+endif
+
+cleantrg : $(SUBMODULES)
+ifneq ($(TARGETTYPE),)
+ - @$(call RM, $(TARGET))
+ - @$(call RM, $(TARGET).map)
+ifneq ($(TOPLEVEL),)
+ - @$(call RM, $(TARGETKO))
+ - @$(call RM, $(TARGETMOD).c)
+ - @$(call RM, $(TARGETMOD).o)
+ - @$(call RM, $(TARGETMOD).d)
+endif
+endif
+
+# ----------------------------------------------------------
+# Include dependency files generated by preprocessor.
+#
+# Dependency files are placed in main object directory because
+# dependent files' paths for same source file varies with the
+# directory from where gmake is run
+# ----------------------------------------------------------
+ifndef NODEPENDS
+ifndef nodepends
+ifneq ($(OBJECTS),)
+-include $(OBJECTS:.o=.d)
+endif
+endif
+endif
+
+# ----------------------------------------------------------
+# Generate fatal error if make variable SHELL is incorrect
+# ----------------------------------------------------------
+SHELLERR::
+ @$(SHELLCMD) echo Fatal error: SHELL set to $(SHELL) instead of $(MYSHELL)
+ @$(SHELLCMD) echo set $(MYSHELL) to correct path and CASE SENSITIVE FILE NAME and EXTENSTION
+ @$(SHELLCMD) echo of your command shell
+ $(ERR)
+
+
+# ----------------------------------------------------------
+# For debugging script
+# ----------------------------------------------------------
+Debug::$(SUBMODULES)
+ @$(SHELLCMD) echo SHELL: $(SHELL)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo CDEFS: $(CDEFS)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo CONFIG_SHELL: $(CONFIG_SHELL)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo CURDIR: $(CURDIR)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo SRCDIRS: $(SRCDIRS)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo OBJDIRS: $(OBJDIRS)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo OBJECTS: $(OBJECTS)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo BUILDDIR: $(BUILDDIR)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo TARGETDIR TARGETNAME: $(TARGET)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo MAKEDIR: $(MAKEDIR)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo INCLUDES: $(INCLUDES)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo DL_LIBNAMES: $(DL_LIBNAMES)
+ @$(SHELLCMD) echo
+ @$(SHELLCMD) echo LIBFILE: $(LIBFILE)
+ @$(SHELLCMD) echo
+
diff --git a/domx/make/start.mk b/domx/make/start.mk
new file mode 100644
index 0000000..57921ac
--- /dev/null
+++ b/domx/make/start.mk
@@ -0,0 +1,101 @@
+#
+# Copyright 2001-2009 Texas Instruments - http://www.ti.com/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# dspbridge/mpu_api/make/start.mk
+#
+# DSP-BIOS Bridge build rules.
+#
+
+# make sure we have a rootdir
+ifndef PROJROOT
+$(error Error: variable PROJROOT not defined)
+endif
+
+# make sure we have a bridgeroot
+#ifndef BRIDGEROOT
+#$(error Error: variable BRIDGEROOT not defined)
+#endif
+
+
+CMDDEFS =
+CMDDEFS_START =
+
+
+CROSS=arm-none-linux-gnueabi-
+PROCFAMILY=OMAP_4430
+
+
+ifndef PROCFAMILY
+$(error Error: PROCFAMILY can not be determined from Kernel .config)
+endif
+
+ifndef TARGETDIR
+TARGETDIR=$(PROJROOT)/target
+endif
+
+
+
+#default (first) target should be "all"
+#make sure the target directories are created
+#all: $(HOSTDIR) $(ROOTFSDIR) $(TARGETDIR)
+#all: $(TARGETDIR)
+
+CONFIG_SHELL := /bin/bash
+
+SHELL := $(CONFIG_SHELL)
+
+# Current version of gmake (3.79.1) cannot run windows shell's internal commands
+# We need to invoke command interpreter explicitly to do so.
+# for winnt it is cmd /c <command>
+SHELLCMD:=
+
+ifneq ($(SHELL),$(CONFIG_SHELL))
+CHECKSHELL:=SHELLERR
+else
+CHECKSHELL:=
+endif
+
+# Error string to generate fatal error and abort gmake
+ERR = $(error Makefile generated fatal error while building target "$@")
+
+CP := cp
+
+MAKEFLAGS = r
+
+QUIET := &> /dev/null
+
+# Should never be :=
+RM = rm $(1)
+MV = mv $(1) $(2)
+RMDIR = rm -r $(1)
+MKDIR = mkdir -p $(1)
+INSTALL = install
+
+# Current Makefile directory
+MAKEDIR := $(CURDIR)
+
+# Implicit rule search not needed for *.d, *.c, *.h
+%.d:
+%.c:
+%.h:
+
+# Tools
+CC := $(CROSS)gcc
+AR := $(CROSS)ar
+LD := $(CROSS)ld
+STRIP := $(CROSS)strip
+
+
diff --git a/domx/mm_osal/Android.mk b/domx/mm_osal/Android.mk
new file mode 100644
index 0000000..f41f131
--- /dev/null
+++ b/domx/mm_osal/Android.mk
@@ -0,0 +1,30 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ src/timm_osal.c \
+ src/timm_osal_events.c \
+ src/timm_osal_memory.c \
+ src/timm_osal_mutex.c \
+ src/timm_osal_pipes.c \
+ src/timm_osal_semaphores.c \
+ src/timm_osal_task.c \
+ src/timm_osal_trace.c
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libdl \
+ liblog \
+ libc \
+ libcutils
+
+LOCAL_CFLAGS += -DOMAP_2430 -DOMX_DEBUG -D_Android -D_POSIX_VERSION_1_
+LOCAL_CFLAGS += -DTIMM_OSAL_DEBUG_TRACE_DETAIL=1 # quiet
+
+LOCAL_MODULE:= libmm_osal
+LOCAL_MODULE_TAGS:= optional
+
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
diff --git a/domx/mm_osal/Makefile b/domx/mm_osal/Makefile
new file mode 100644
index 0000000..a83814f
--- /dev/null
+++ b/domx/mm_osal/Makefile
@@ -0,0 +1,61 @@
+
+include $(PROJROOT)/make/start.mk
+
+
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libmm_osal
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+ src/timm_osal.c \
+ src/timm_osal_events.c \
+ src/timm_osal_memory.c \
+ src/timm_osal_mutex.c \
+ src/timm_osal_pipes.c \
+ src/timm_osal_semaphores.c \
+ src/timm_osal_task.c \
+ src/timm_osal_trace.c
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ inc/ \
+
+
+
+ST_LIBS =
+SH_LIBS =
+#pthread
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES =
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
+
diff --git a/domx/mm_osal/inc/timm_osal_error.h b/domx/mm_osal/inc/timm_osal_error.h
new file mode 100755
index 0000000..37b20e7
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_error.h
@@ -0,0 +1,175 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_timm_osal_error.h
+* The osal header file defines the error codes
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_ERROR_H_
+#define _TIMM_OSAL_ERROR_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "timm_osal_types.h"
+
+/** A unique ID for each component*/
+ typedef TIMM_OSAL_U16 TIMM_OSAL_COMPID;
+
+/** TIMM_OSAL_ERROR is a 32 bits unsigned integer.
+ * Each error code can be broken up into three fields as given below:
+ * - Type of error (2 bits): NO_ERROR: 00, WARNING: 01, FATAL_ERROR: 10
+ * - Component ID (14 bits): A unique ID which indicates which of the component generated the error
+ * - Error ID (16 bits): The specific error generated by a component
+ */
+ typedef TIMM_OSAL_U32 TIMM_OSAL_ERRORTYPE;
+
+#define TIMM_OSAL_OK 0
+#define TIMM_OSAL_WAR 1
+#define TIMM_OSAL_ERR 2
+
+
+/* Macro to process TIMM_OSAL_ERROR */
+
+/** This macro tests if the provided M4OSA_ERR is a warning or not*/
+#define TIMM_OSAL_IS_WARNING(error) ((((error)>>30) == TIMM_OSAL_WAR) ? 1:0)
+
+/** This macro tests if the provided M4OSA_ERR is a fatal error or not*/
+#define TIMM_OSAL_IS_ERROR(error) ((((error)>>30) == TIMM_OSAL_ERR) ? 1:0)
+
+/** This macro returns an error code accroding to the 3 provided fields:
+ * @arg Type: (IN) [TIMM_OSAL_U32] Type of error to put in the error code
+ * @arg compID: (IN) [TIMM_OSAL_U32] CompID to put in the error code
+ * @arg errorID: (IN) [TIMM_OSAL_U32] ErrorID to put in the error code*/
+#define TIMM_OSAL_ERR_CREATE(type, compID, errorID)\
+ (((type)<<30)+(((compID)&0x003FFF)<<16)+((errorID)&0x00FFFF))
+
+/** This macro extracts the 3 fields from the error:
+ * @arg error: (IN) [TIMM_OSAL_ERRORTYPE] Error code
+ * @arg type: (OUT) [TIMM_OSAL_U32] Type of error in the error code
+ * @arg compID: (OUT) [TIMM_OSAL_U32] CompID to put in the error code
+ * @arg errorID: (OUT) [TIMM_OSAL_U32] ErrorID to put in the error code*/
+#define TIMM_OSAL_ERR_SPLIT(error, type, compID, errorID)\
+ { type=(TIMM_OSAL_U32)((error)>>30);\
+ compID=(TIMM_OSAL_U32)(((error)>>16)&0x003FFF);\
+ (TIMM_OSAL_U32)(errorID=(error)&0x00FFFF); }
+
+/* Component IDs */
+#define TIMM_OSAL_COMP_GENERAL 0x00
+#define TIMM_OSAL_COMP_MEMORY 0x01
+#define TIMM_OSAL_COMP_PIPES 0x02
+#define TIMM_OSAL_COMP_EVENTS 0x03
+#define TIMM_OSAL_COMP_SEMAPHORES 0x04
+#define TIMM_OSAL_COMP_TASK 0x05
+
+/* Definition of common error codes */
+/** there is no error*/
+#define TIMM_OSAL_ERR_NONE ((TIMM_OSAL_ERRORTYPE) 0x00000000)
+
+
+/** There is no more memory available*/
+#define TIMM_OSAL_ERR_ALLOC ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000001))
+#define TIMM_OSAL_ERR_OUT_OF_RESOURCE ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000002))
+
+/** Time out */
+#define TIMM_OSAL_WAR_TIMEOUT ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_WAR,TIMM_OSAL_COMP_GENERAL,0x000003))
+#define TIMM_OSAL_ERR_PARAMETER ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000004))
+#define TIMM_OSAL_ERR_NOT_READY ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000005))
+#define TIMM_OSAL_ERR_OMX ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000006))
+#define TIMM_OSAL_ERR_PIPE_FULL ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000007))
+#define TIMM_OSAL_ERR_PIPE_EMPTY ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000008))
+#define TIMM_OSAL_ERR_PIPE_DELETED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000009))
+#define TIMM_OSAL_ERR_PIPE_RESET ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000A))
+#define TIMM_OSAL_ERR_GROUP_DELETED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000B))
+#define TIMM_OSAL_ERR_UNKNOWN ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000C))
+
+
+#define TIMM_OSAL_ERR_SEM_CREATE_FAILED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_SEMAPHORE,0x000001))
+
+/*Added during Linux Porting*/
+#define TIMM_OSAL_ERR_NO_PERMISSIONS ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000D))
+#define TIMM_OSAL_ERR_RESOURCE_EXISTS ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000E))
+#define TIMM_OSAL_ERR_RESOURCE_REMOVED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x00000F))
+#define TIMM_OSAL_ERR_SYSTEM_LIMIT_EXCEEDED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000010))
+#define TIMM_OSAL_ERR_NOT_SUPPORTED ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000011))
+#define TIMM_OSAL_ERR_SIGNAL_CAUGHT ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000012))
+#define TIMM_OSAL_ERR_TIMEOUT ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_GENERAL,0x000013))
+
+
+
+#define TIMM_OSAL_COMP_MSG_Q 0x06
+#define TIMM_OSAL_ERR_MSG_SIZE_MISMATCH ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_MSG_Q,0x000001))
+#define TIMM_OSAL_ERR_MSG_TYPE_NOT_FOUND ((TIMM_OSAL_ERRORTYPE) TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR,TIMM_OSAL_COMP_MSG_Q,0x000002))
+
+
+/*
+#define GOTO_EXIT_IF(_Cond,_ErrorCode) { \
+ if ((_Cond)) { \
+ status = _ErrorCode; \
+ printf ("Error :: %s : %s : %d :: Exiting because : %s\n", \
+ __FILE__, __FUNCTION__, __LINE__, #_Cond); \
+ goto EXIT; \
+ } \
+}
+*/
+
+#define SWITCH_CASE(_Case, _ErrCode, _ErrMsg)\
+ case _Case:\
+ TIMM_OSAL_Error(_ErrMsg);\
+ bReturnStatus = _ErrCode;\
+ break;
+
+#define SWITCH_DEFAULT_CASE(_ErrCode, _ErrMsg )\
+ default:\
+ TIMM_OSAL_Error(_ErrMsg);\
+ bReturnStatus = _ErrCode;\
+ break;
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /*_TIMM_OSAL_ERROR_H_*/
diff --git a/domx/mm_osal/inc/timm_osal_events.h b/domx/mm_osal/inc/timm_osal_events.h
new file mode 100755
index 0000000..20a4d84
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_events.h
@@ -0,0 +1,81 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_defines.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_EVENTS_H_
+#define _TIMM_OSAL_EVENTS_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "timm_osal_types.h"
+
+ typedef enum TIMM_OSAL_EVENT_OPERATION
+ {
+ TIMM_OSAL_EVENT_AND,
+ TIMM_OSAL_EVENT_AND_CONSUME,
+ TIMM_OSAL_EVENT_OR,
+ TIMM_OSAL_EVENT_OR_CONSUME
+ } TIMM_OSAL_EVENT_OPERATION;
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventCreate(TIMM_OSAL_PTR * pEvents);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventDelete(TIMM_OSAL_PTR pEvents);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventSet(TIMM_OSAL_PTR pEvents,
+ TIMM_OSAL_U32 uEventFlag, TIMM_OSAL_EVENT_OPERATION eOperation);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventRetrieve(TIMM_OSAL_PTR pEvents,
+ TIMM_OSAL_U32 uRequestedEvents,
+ TIMM_OSAL_EVENT_OPERATION eOperation,
+ TIMM_OSAL_U32 * pRetrievedEvents, TIMM_OSAL_U32 uTimeOut);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_EVENTS_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_interfaces.h b/domx/mm_osal/inc/timm_osal_interfaces.h
new file mode 100755
index 0000000..dd3fd81
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_interfaces.h
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_memory.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_INTERFACES_H_
+#define _TIMM_OSAL_INTERFACES_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* External interface
+*******************************************************************************/
+#include "timm_osal_types.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+#include "timm_osal_pipes.h"
+#include "timm_osal_events.h"
+#include "timm_osal_semaphores.h"
+#include "timm_osal_mutex.h"
+#include "timm_osal_task.h"
+#include "timm_osal_osal.h"
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_INTERFACES_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_memory.h b/domx/mm_osal/inc/timm_osal_memory.h
new file mode 100755
index 0000000..ed21636
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_memory.h
@@ -0,0 +1,105 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_memory.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_MEMORY_H_
+#define _TIMM_OSAL_MEMORY_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* Includes
+*******************************************************************************/
+
+#include "timm_osal_types.h"
+#include "timm_osal_error.h"
+
+
+/* Enumeration Flag for Memory Segmenation Id */
+ typedef enum TIMMOSAL_MEM_SEGMENTID
+ {
+
+ TIMMOSAL_MEM_SEGMENT_EXT = 0,
+ TIMMOSAL_MEM_SEGMENT_INT,
+ TIMMOSAL_MEM_SEGMENT_UNCACHED
+ } TIMMOSAL_MEM_SEGMENTID;
+
+
+/*******************************************************************************
+* External interface
+*******************************************************************************/
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreateMemoryPool(void);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeleteMemoryPool(void);
+
+ TIMM_OSAL_PTR TIMM_OSAL_Malloc(TIMM_OSAL_U32 size,
+ TIMM_OSAL_BOOL bBlockContiguous, TIMM_OSAL_U32 unBlockAlignment,
+ TIMMOSAL_MEM_SEGMENTID tMemSegId);
+
+ void TIMM_OSAL_Free(TIMM_OSAL_PTR pData);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_Memset(TIMM_OSAL_PTR pBuffer,
+ TIMM_OSAL_U8 uValue, TIMM_OSAL_U32 uSize);
+
+ TIMM_OSAL_S32 TIMM_OSAL_Memcmp(TIMM_OSAL_PTR pBuffer1,
+ TIMM_OSAL_PTR pBuffer2, TIMM_OSAL_U32 uSize);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_Memcpy(TIMM_OSAL_PTR pBufDst,
+ TIMM_OSAL_PTR pBufSrc, TIMM_OSAL_U32 uSize);
+
+ TIMM_OSAL_U32 TIMM_OSAL_GetMemCounter(void);
+
+#define TIMM_OSAL_MallocExtn(size, bBlockContiguous, unBlockAlignment, tMemSegId, hHeap) \
+ TIMM_OSAL_Malloc(size, bBlockContiguous, unBlockAlignment, tMemSegId )
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_DEFINES_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_mutex.h b/domx/mm_osal/inc/timm_osal_mutex.h
new file mode 100755
index 0000000..1d12c91
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_mutex.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_defines.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_MUTEX_H_
+#define _TIMM_OSAL_MUTEX_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* Includes
+*******************************************************************************/
+
+#include "timm_osal_types.h"
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexCreate(TIMM_OSAL_PTR * pMutex);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexDelete(TIMM_OSAL_PTR pMutex);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexObtain(TIMM_OSAL_PTR pMutex,
+ TIMM_OSAL_U32 uTimeOut);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexRelease(TIMM_OSAL_PTR pMutex);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_MUTEX_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_osal.h b/domx/mm_osal/inc/timm_osal_osal.h
new file mode 100755
index 0000000..a4e0e9e
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_osal.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_osal.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_OSAL_H_
+#define _TIMM_OSAL_OSAL_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* Includes
+*******************************************************************************/
+
+#include "timm_osal_types.h"
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_Init(void);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_Deinit(void);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_OSAL_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_pipes.h b/domx/mm_osal/inc/timm_osal_pipes.h
new file mode 100755
index 0000000..79d7d61
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_pipes.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_defines.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_PIPES_H_
+#define _TIMM_OSAL_PIPES_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+#include "timm_osal_types.h"
+
+/*
+* Defined for Pipe timeout value
+*/
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreatePipe(TIMM_OSAL_PTR * pPipe,
+ TIMM_OSAL_U32 pipeSize,
+ TIMM_OSAL_U32 messageSize, TIMM_OSAL_U8 isFixedMessage);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeletePipe(TIMM_OSAL_PTR pPipe);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_WriteToPipe(TIMM_OSAL_PTR pPipe,
+ void *pMessage, TIMM_OSAL_U32 size, TIMM_OSAL_S32 timeout);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_WriteToFrontOfPipe(TIMM_OSAL_PTR pPipe,
+ void *pMessage, TIMM_OSAL_U32 size, TIMM_OSAL_S32 timeout);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_ReadFromPipe(TIMM_OSAL_PTR pPipe,
+ void *pMessage,
+ TIMM_OSAL_U32 size,
+ TIMM_OSAL_U32 * actualSize, TIMM_OSAL_S32 timeout);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_ClearPipe(TIMM_OSAL_PTR pPipe);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_IsPipeReady(TIMM_OSAL_PTR pPipe);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_GetPipeReadyMessageCount(TIMM_OSAL_PTR
+ pPipe, TIMM_OSAL_U32 * count);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_PIPES_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_semaphores.h b/domx/mm_osal/inc/timm_osal_semaphores.h
new file mode 100755
index 0000000..86037d7
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_semaphores.h
@@ -0,0 +1,79 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_defines.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_SEMAPHORE_H_
+#define _TIMM_OSAL_SEMAPHORE_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* Includes
+*******************************************************************************/
+
+#include "timm_osal_types.h"
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreCreate(TIMM_OSAL_PTR *
+ pSemaphore, TIMM_OSAL_U32 uInitCount);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreDelete(TIMM_OSAL_PTR
+ pSemaphore);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreObtain(TIMM_OSAL_PTR
+ pSemaphore, TIMM_OSAL_U32 uTimeOut);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreRelease(TIMM_OSAL_PTR
+ pSemaphore);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreReset(TIMM_OSAL_PTR pSemaphore,
+ TIMM_OSAL_U32 uInitCount);
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_GetSemaphoreCount(TIMM_OSAL_PTR
+ pSemaphore, TIMM_OSAL_U32 * count);
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_SEMAPHORE_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_task.h b/domx/mm_osal/inc/timm_osal_task.h
new file mode 100755
index 0000000..6f67a82
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_task.h
@@ -0,0 +1,89 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_task.h
+* The osal header file defines
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_TASK_H_
+#define _TIMM_OSAL_TASK_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* Includes
+*******************************************************************************/
+
+#include "timm_osal_types.h"
+
+/*******************************************************************************
+* Tasks
+*******************************************************************************/
+
+/**
+* prototype for the task function
+*/
+ /*typedef void (*TIMM_OSAL_TaskProc)(TIMM_OSAL_U32 argc, TIMM_OSAL_PTR argv);*//*Nucleus */
+
+ typedef void *(*TIMM_OSAL_TaskProc) (void *arg); /*Linux */
+
+
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreateTask(TIMM_OSAL_PTR * pTask,
+ TIMM_OSAL_TaskProc pFunc,
+ TIMM_OSAL_U32 uArgc,
+ TIMM_OSAL_PTR pArgv,
+ TIMM_OSAL_U32 uStackSize,
+ TIMM_OSAL_U32 uPriority, TIMM_OSAL_S8 * pName);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeleteTask(TIMM_OSAL_PTR pTask);
+
+ TIMM_OSAL_ERRORTYPE TIMM_OSAL_SleepTask(TIMM_OSAL_U32 mSec);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_TASK_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_trace.h b/domx/mm_osal/inc/timm_osal_trace.h
new file mode 100755
index 0000000..0f02f14
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_trace.h
@@ -0,0 +1,217 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_trace.h
+* The timm_osal_types header file defines the primative osal type definitions.
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_TRACES_H_
+#define _TIMM_OSAL_TRACES_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+/*******************************************************************************
+* Traces
+*******************************************************************************/
+
+
+/******************************************************************************
+* Debug Trace defines
+******************************************************************************/
+
+ typedef enum TIMM_OSAL_TRACEGRP_TYPE
+ {
+ TIMM_OSAL_TRACEGRP_SYSTEM = 1,
+ TIMM_OSAL_TRACEGRP_OMXBASE = (1 << 1),
+ TIMM_OSAL_TRACEGRP_DOMX = (1 << 2),
+ TIMM_OSAL_TRACEGRP_OMXVIDEOENC = (1 << 3),
+ TIMM_OSAL_TRACEGRP_OMXVIDEODEC = (1 << 4),
+ TIMM_OSAL_TRACEGRP_OMXCAM = (1 << 5),
+ TIMM_OSAL_TRACEGRP_OMXIMGDEC = (1 << 6),
+ TIMM_OSAL_TRACEGRP_DRIVERS = (1 << 7),
+ TIMM_OSAL_TRACEGRP_SIMCOPALGOS = (1 << 8)
+ } TIMM_OSAL_TRACEGRP;
+
+ typedef enum TIMM_OSAL_TRACE_LEVEL_TYPE
+ {
+ TIMM_OSAL_TRACE_LEVEL_ERROR = 1,
+ TIMM_OSAL_TRACE_LEVEL_WARNING = 2,
+ TIMM_OSAL_TRACE_LEVEL_PROFILING = 3,
+ TIMM_OSAL_TRACE_LEVEL_INFO = 4,
+ TIMM_OSAL_TRACE_LEVEL_DEBUG = 5,
+ TIMM_OSAL_TRACE_LEVEL_ENTERING = 6,
+ TIMM_OSAL_TRACE_LEVEL_EXITING = TIMM_OSAL_TRACE_LEVEL_ENTERING
+ } TIMM_OSAL_TRACE_LEVEL;
+
+
+/**
+* The OSAL debug trace level can be set at runtime by defining the environment
+* variable TIMM_OSAL_DEBUG_TRACE_LEVEL=<Level>. The default level is 1
+* The debug levels are:
+* Level 0 - No trace
+* Level 1 - Error [Errors]
+* Level 2 - Warning [Warnings that are useful to know about]
+* Level 3 - Profiling [performance analysis trace that must not impact use case perf]
+* Level 4 - Info [General information]
+* Level 5 - Debug [most-commonly used statement for us developers]
+* Level 6 - Trace ["ENTERING <function>" and "EXITING <function>" statements]
+*
+* Example: if TIMM_OSAL_DEBUG_TRACE_LEVEL=3, then level 1,2 and 3 traces messages
+* are enabled.
+*/
+
+/**
+ * Information about the trace location/type, passed as a single pointer to
+ * internal trace function. Not part of the public API
+ */
+ typedef struct
+ {
+ const char *file;
+ const char *function;
+ const int line;
+ const short level;
+ const short tracegrp; /* TIMM_OSAL_TRACEGRP */
+ } __TIMM_OSAL_TRACE_LOCATION;
+
+
+/**
+ * Trace level update function. Updates trace level if env variable
+ * or Android property is set. Env variable has precedence over it
+ */
+ void TIMM_OSAL_UpdateTraceLevel(void);
+
+/**
+ * Trace implementation function. Not part of public API. Default
+ * implementation uses printf(), but you can use LD_PRELOAD to plug in
+ * alternative trace system at runtime.
+ */
+ void __TIMM_OSAL_TraceFunction(const __TIMM_OSAL_TRACE_LOCATION * loc,
+ const char *fmt, ...);
+
+/**
+ * Internal trace macro. Not part of public API.
+ */
+#define __TIMM_OSAL_Trace(level, tracegrp, fmt, ...) \
+ do { \
+ static const __TIMM_OSAL_TRACE_LOCATION loc = { \
+ __FILE__, __FUNCTION__, __LINE__, (level), (tracegrp) \
+ }; \
+ __TIMM_OSAL_TraceFunction(&loc, fmt"\n", ##__VA_ARGS__); \
+ } while(0)
+
+/**
+* TIMM_OSAL_Error() -- Fatal errors
+*/
+#define TIMM_OSAL_Error(fmt,...) TIMM_OSAL_ErrorExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_Warning() -- Warnings that are useful to know about
+*/
+#define TIMM_OSAL_Warning(fmt,...) TIMM_OSAL_WarningExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_Profiling() -- performance analysis trace that must not impact use case perf]
+*/
+#define TIMM_OSAL_Profiling(fmt,...) TIMM_OSAL_ProfilingExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_Info() -- general information
+*/
+#define TIMM_OSAL_Info(fmt,...) TIMM_OSAL_InfoExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_Debug() -- debug traces, most-commonly useful for developers
+*/
+#define TIMM_OSAL_Debug(fmt,...) TIMM_OSAL_DebugExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_Entering() -- "ENTERING <function>" statements
+* TIMM_OSAL_Exiting() -- "EXITING <function>" statements
+*/
+#define TIMM_OSAL_Entering(fmt,...) TIMM_OSAL_EnteringExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+#define TIMM_OSAL_Exiting(fmt,...) TIMM_OSAL_ExitingExt(TIMM_OSAL_TRACEGRP_SYSTEM, fmt, ##__VA_ARGS__)
+
+/*******************************************************************************
+** New Trace to be used by Applications
+*******************************************************************************/
+
+/**
+* TIMM_OSAL_ErrorExt() -- Fatal errors
+*/
+#define TIMM_OSAL_ErrorExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_ERROR, tracegrp, "ERROR: "fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_WarningExt() -- Warnings that are useful to know about
+*/
+#define TIMM_OSAL_WarningExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_WARNING, tracegrp, "WARNING: "fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_ProfilingExt() -- performance analysis trace that must not impact use case perf]
+*/
+#define TIMM_OSAL_ProfilingExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_PROFILING, tracegrp, "PROFILING: "fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_InfoExt() -- general information
+*/
+#define TIMM_OSAL_InfoExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_INFO, tracegrp, "INFO: "fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_DebugExt() -- most-commonly used statement for us developers
+*/
+#define TIMM_OSAL_DebugExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_DEBUG, tracegrp, "TRACE: "fmt, ##__VA_ARGS__)
+
+/**
+* TIMM_OSAL_EnteringExt() -- "ENTERING <function>" statements
+* TIMM_OSAL_ExitingExt() -- "EXITING <function>" statements
+*/
+#define TIMM_OSAL_EnteringExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_ENTERING, tracegrp, "ENTER: "fmt, ##__VA_ARGS__)
+#define TIMM_OSAL_ExitingExt(tracegrp, fmt, ...) __TIMM_OSAL_Trace(TIMM_OSAL_TRACE_LEVEL_EXITING, tracegrp, "EXIT: "fmt, ##__VA_ARGS__)
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_TRACES_H_ */
diff --git a/domx/mm_osal/inc/timm_osal_types.h b/domx/mm_osal/inc/timm_osal_types.h
new file mode 100755
index 0000000..882148d
--- /dev/null
+++ b/domx/mm_osal/inc/timm_osal_types.h
@@ -0,0 +1,124 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_types.h
+* The timm_osal_types header file defines the primative osal type definitions.
+* @path
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+#ifndef _TIMM_OSAL_TYPES_H_
+#define _TIMM_OSAL_TYPES_H_
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif /* __cplusplus */
+
+
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
+ typedef int8_t TIMM_OSAL_S8; /*INT8 */
+ typedef int16_t TIMM_OSAL_S16; /*INT16 */
+ typedef int32_t TIMM_OSAL_S32; /*INT32 */
+
+#define TIMM_OSAL_INT8_MIN 0xFF
+#define TIMM_OSAL_INT8_MAX 0x7F
+
+#define TIMM_OSAL_INT16_MIN 0xFFFF
+#define TIMM_OSAL_INT16_MAX 0x7FFF
+
+#define TIMM_OSAL_INT32_MIN 0xFFFFFFFF
+#define TIMM_OSAL_INT32_MAX 0x7FFFFFFF
+
+ typedef uint8_t TIMM_OSAL_U8; /*UINT8 */
+ typedef uint16_t TIMM_OSAL_U16; /*UINT16 */
+ typedef uint32_t TIMM_OSAL_U32; /*UINT32 */
+
+#define TIMM_OSAL_UINT8_MIN 0
+#define TIMM_OSAL_UINT8_MAX 0xFF
+
+#define TIMM_OSAL_UINT16_MIN 0
+#define TIMM_OSAL_UINT16_MAX 0xFFFF
+
+#define TIMM_OSAL_UINT32_MIN 0
+#define TIMM_OSAL_UINT32_MAX 0xFFFFFFFF
+
+
+ typedef char TIMM_OSAL_CHAR;
+ /*CHAR*/ typedef void *TIMM_OSAL_HANDLE;
+ typedef void *TIMM_OSAL_PTR;
+
+ typedef enum TIMM_OSAL_BOOL
+ {
+ TIMM_OSAL_FALSE = 0,
+ TIMM_OSAL_TRUE = !TIMM_OSAL_FALSE,
+ TIMM_OSAL_BOOL_MAX = 0x7FFFFFFF
+ } TIMM_OSAL_BOOL;
+
+#define TIMM_OSAL_SUSPEND 0xFFFFFFFFUL
+#define TIMM_OSAL_NO_SUSPEND 0x0
+#define TIMM_OSAL_TIMED_OUT 0x7FFFFFFFUL
+
+
+#define SUCCESS 0
+#define NO_SUCCESS -1
+
+#define ERROR 1
+/*
+#define TRUE 0
+#define FALSE 1
+*/
+#define URGENT_MESSAGE 2
+#define NORMAL_MESSAGE 1
+
+
+#define TIMM_OSAL_NULL 0
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _TIMM_OSAL_TYPES_H_ */
diff --git a/domx/mm_osal/src/timm_osal.c b/domx/mm_osal/src/timm_osal.c
new file mode 100755
index 0000000..85fdb66
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal.c
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file tiimm_osal.c
+* This file contains methods that provides the functionality
+* initializing/deinitializing the osal.
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 20-Oct-2008 Maiya ShreeHarsha:Linux specific changes
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+#include "timm_osal_types.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+/*#include "timm_osal_trace.h"*/
+
+
+/******************************************************************************
+* Function Prototypes
+******************************************************************************/
+
+/****************************************************************
+* PRIVATE DECLARATIONS : only used in this file
+****************************************************************/
+/*--------data declarations -----------------------------------*/
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Init function initilize the osal with initial settings.
+*
+* @return TIMM_OSAL_ERR_NONE if successful
+* !TIMM_OSAL_ERR_NONE if an error occurs
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_Init(void)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ return bReturnStatus;
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Init function de-initilize the osal.
+*
+* @return TIMM_OSAL_ERR_NONE if successful
+* !TIMM_OSAL_ERR_NONE if an error occurs
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_Deinit(void)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ return bReturnStatus;
+}
diff --git a/domx/mm_osal/src/timm_osal_events.c b/domx/mm_osal/src/timm_osal_events.c
new file mode 100755
index 0000000..96f8e59
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_events.c
@@ -0,0 +1,420 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_events.c
+* This file contains methods that provides the functionality
+* for creating/using events.
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 06-Nov-2008 Maiya ShreeHarsha: Linux specific changes
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+#include <stdio.h>
+#include <pthread.h> /*for POSIX calls */
+#include <sys/time.h>
+#include <errno.h>
+
+#include "timm_osal_types.h"
+#include "timm_osal_trace.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+#include "timm_osal_events.h"
+
+
+typedef struct
+{
+ TIMM_OSAL_BOOL bSignaled;
+ TIMM_OSAL_U32 eFlags;
+ pthread_mutex_t mutex;
+ pthread_cond_t condition;
+} TIMM_OSAL_THREAD_EVENT;
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_EventCreate function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventCreate(TIMM_OSAL_PTR * pEvents)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_THREAD_EVENT *plEvent = NULL;
+
+ plEvent =
+ (TIMM_OSAL_THREAD_EVENT *)
+ TIMM_OSAL_Malloc(sizeof(TIMM_OSAL_THREAD_EVENT), 0, 0, 0);
+
+ if (TIMM_OSAL_NULL == plEvent)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_ALLOC;
+ goto EXIT;
+ }
+ plEvent->bSignaled = TIMM_OSAL_FALSE;
+ plEvent->eFlags = 0;
+
+ if (SUCCESS != pthread_mutex_init(&(plEvent->mutex), NULL))
+ {
+ TIMM_OSAL_Error("Event Create:Mutex Init failed !");
+ goto EXIT; /*bReturnStatus = TIMM_OSAL_ERR_UNKNOWN */
+ }
+
+ if (SUCCESS != pthread_cond_init(&(plEvent->condition), NULL))
+ {
+ TIMM_OSAL_Error
+ ("Event Create:Conditional Variable Init failed !");
+ pthread_mutex_destroy(&(plEvent->mutex));
+ /*TIMM_OSAL_Free(plEvent); */
+ } else
+ {
+ *pEvents = (TIMM_OSAL_PTR) plEvent;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+ EXIT:
+ if ((TIMM_OSAL_ERR_NONE != bReturnStatus) &&
+ (TIMM_OSAL_NULL != plEvent))
+ {
+ TIMM_OSAL_Free(plEvent);
+ }
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_EventDelete function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventDelete(TIMM_OSAL_PTR pEvents)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ TIMM_OSAL_THREAD_EVENT *plEvent = (TIMM_OSAL_THREAD_EVENT *) pEvents;
+
+ if (TIMM_OSAL_NULL == plEvent)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ if (SUCCESS != pthread_mutex_lock(&(plEvent->mutex)))
+ {
+ TIMM_OSAL_Error("Event Delete: Mutex Lock failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+ if (SUCCESS != pthread_cond_destroy(&(plEvent->condition)))
+ {
+ TIMM_OSAL_Error
+ ("Event Delete: Conditional Variable Destroy failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+
+ if (SUCCESS != pthread_mutex_unlock(&(plEvent->mutex)))
+ {
+ TIMM_OSAL_Error("Event Delete: Mutex Unlock failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+
+ if (SUCCESS != pthread_mutex_destroy(&(plEvent->mutex)))
+ {
+ TIMM_OSAL_Error("Event Delete: Mutex Destory failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+
+ TIMM_OSAL_Free(plEvent);
+ EXIT:
+ return bReturnStatus;
+}
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_EventSet function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventSet(TIMM_OSAL_PTR pEvents,
+ TIMM_OSAL_U32 uEventFlags, TIMM_OSAL_EVENT_OPERATION eOperation)
+{
+
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_THREAD_EVENT *plEvent = (TIMM_OSAL_THREAD_EVENT *) pEvents;
+
+ if (TIMM_OSAL_NULL == plEvent)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ if (SUCCESS != pthread_mutex_lock(&(plEvent->mutex)))
+ {
+ TIMM_OSAL_Error("Event Set: Mutex Lock failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ goto EXIT;
+ }
+
+ switch (eOperation)
+ {
+ case TIMM_OSAL_EVENT_AND:
+ plEvent->eFlags = plEvent->eFlags & uEventFlags;
+ break;
+ case TIMM_OSAL_EVENT_OR:
+ plEvent->eFlags = plEvent->eFlags | uEventFlags;
+ break;
+ default:
+ TIMM_OSAL_Error("Event Set: Bad eOperation !");
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ pthread_mutex_unlock(&plEvent->mutex);
+ goto EXIT;
+ }
+
+ plEvent->bSignaled = TIMM_OSAL_TRUE;
+
+ if (SUCCESS != pthread_cond_signal(&plEvent->condition))
+ {
+ TIMM_OSAL_Error
+ ("Event Set: Condition Variable Signal failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ pthread_mutex_unlock(&plEvent->mutex);
+ goto EXIT;
+ }
+
+ if (SUCCESS != pthread_mutex_unlock(&plEvent->mutex))
+ {
+ TIMM_OSAL_Error("Event Set: Mutex Unlock failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ } else
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ EXIT:
+ return bReturnStatus;
+
+
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_EventRetrieve function
+*
+*Spurious wakeups from the pthread_cond_timedwait() or pthread_cond_wait() functions may occur.
+*
+*A representative sequence for using condition variables is shown below
+*
+*Thread A (Retrieve Events) |Thread B (Set Events)
+*------------------------------------------------------------------------------------------------------------
+*1) Do work up to the point where a certain condition |1)Do work
+* must occur (such as "count" must reach a specified |2)Lock associated mutex
+* value) |3)Change the value of the global variable
+*2) Lock associated mutex and check value of a global | that Thread-A is waiting upon.
+* variable |4)Check value of the global Thread-A wait
+*3) Call pthread_cond_wait() to perform a blocking wait | variable. If it fulfills the desired
+* for signal from Thread-B. Note that a call to | condition, signal Thread-A.
+* pthread_cond_wait() automatically and atomically |5)Unlock mutex.
+* unlocks the associated mutex variable so that it can |6)Continue
+* be used by Thread-B. |
+*4) When signalled, wake up. Mutex is automatically and |
+* atomically locked. |
+*5) Explicitly unlock mutex |
+*6) Continue |
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_EventRetrieve(TIMM_OSAL_PTR pEvents,
+ TIMM_OSAL_U32 uRequestedEvents,
+ TIMM_OSAL_EVENT_OPERATION eOperation,
+ TIMM_OSAL_U32 * pRetrievedEvents, TIMM_OSAL_U32 uTimeOutMsec)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ struct timespec timeout;
+ struct timeval now;
+ TIMM_OSAL_U32 timeout_us;
+ TIMM_OSAL_U32 isolatedFlags;
+ int status = -1;
+ int and_operation;
+ TIMM_OSAL_THREAD_EVENT *plEvent = (TIMM_OSAL_THREAD_EVENT *) pEvents;
+
+ if (TIMM_OSAL_NULL == plEvent)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ /* Lock the mutex for access to the eFlags global variable */
+ if (SUCCESS != pthread_mutex_lock(&(plEvent->mutex)))
+ {
+ TIMM_OSAL_Error("Event Retrieve: Mutex Lock failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ goto EXIT;
+ }
+
+ /*Check the eOperation and put it in a variable */
+ and_operation = ((TIMM_OSAL_EVENT_AND == eOperation) ||
+ (TIMM_OSAL_EVENT_AND_CONSUME == eOperation));
+
+ /* Isolate the flags. The & operation is suffice for an TIMM_OSAL_EVENT_OR eOperation */
+ isolatedFlags = plEvent->eFlags & uRequestedEvents;
+
+ /*Check if it is the AND operation. If yes then, all the flags must match */
+ if (and_operation)
+ {
+ isolatedFlags = (isolatedFlags == uRequestedEvents);
+ }
+
+
+ if (isolatedFlags)
+ {
+
+ /*We have got required combination of the eFlags bits and will return it back */
+ *pRetrievedEvents = plEvent->eFlags;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ } else
+ {
+
+ /*Required combination of bits is not yet available */
+ if (TIMM_OSAL_NO_SUSPEND == uTimeOutMsec)
+ {
+ *pRetrievedEvents = 0;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+
+ else if (TIMM_OSAL_SUSPEND == uTimeOutMsec)
+ {
+
+ /*Wait till we get the required combination of bits. We we get the required
+ *bits then we go out of the while loop
+ */
+ while (!isolatedFlags)
+ {
+
+ /*Wait on the conditional variable for another thread to set the eFlags and signal */
+ pthread_cond_wait(&(plEvent->condition),
+ &(plEvent->mutex));
+
+ /* eFlags set by some thread. Now, isolate the flags.
+ * The & operation is suffice for an TIMM_OSAL_EVENT_OR eOperation
+ */
+ isolatedFlags =
+ plEvent->eFlags & uRequestedEvents;
+
+ /*Check if it is the AND operation. If yes then, all the flags must match */
+ if (and_operation)
+ {
+ isolatedFlags =
+ (isolatedFlags ==
+ uRequestedEvents);
+ }
+ }
+
+ /* Obtained the requested combination of bits on eFlags */
+ *pRetrievedEvents = plEvent->eFlags;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ } else
+ {
+
+ /* Calculate uTimeOutMsec in terms of the absolute time. uTimeOutMsec is in milliseconds */
+ gettimeofday(&now, NULL);
+ timeout_us = now.tv_usec + 1000 * uTimeOutMsec;
+ timeout.tv_sec = now.tv_sec + timeout_us / 1000000;
+ timeout.tv_nsec = (timeout_us % 1000000) * 1000;
+
+ while (!isolatedFlags)
+ {
+
+ /* Wait till uTimeOutMsec for a thread to signal on the conditional variable */
+ status =
+ pthread_cond_timedwait(&(plEvent->
+ condition), &(plEvent->mutex),
+ &timeout);
+
+ /*Timedout or error and returned without being signalled */
+ if (SUCCESS != status)
+ {
+ if (ETIMEDOUT == status)
+ bReturnStatus =
+ TIMM_OSAL_ERR_NONE;
+ *pRetrievedEvents = 0;
+ break;
+ }
+
+ /* eFlags set by some thread. Now, isolate the flags.
+ * The & operation is suffice for an TIMM_OSAL_EVENT_OR eOperation
+ */
+ isolatedFlags =
+ plEvent->eFlags & uRequestedEvents;
+
+ /*Check if it is the AND operation. If yes then, all the flags must match */
+ if (and_operation)
+ {
+ isolatedFlags =
+ (isolatedFlags ==
+ uRequestedEvents);
+ }
+
+ }
+ }
+ }
+
+ /*If we have got the required combination of bits, we will have to reset the eFlags if CONSUME is mentioned
+ *in the eOperations
+ */
+ if (isolatedFlags && ((eOperation == TIMM_OSAL_EVENT_AND_CONSUME) ||
+ (eOperation == TIMM_OSAL_EVENT_OR_CONSUME)))
+ {
+ plEvent->eFlags = 0;
+ }
+
+ /*Manually unlock the mutex */
+ if (SUCCESS != pthread_mutex_unlock(&(plEvent->mutex)))
+ {
+ TIMM_OSAL_Error("Event Retrieve: Mutex Unlock failed !");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+
+ EXIT:
+ return bReturnStatus;
+
+}
diff --git a/domx/mm_osal/src/timm_osal_memory.c b/domx/mm_osal/src/timm_osal_memory.c
new file mode 100755
index 0000000..22eb0a4
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_memory.c
@@ -0,0 +1,250 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_memory.c
+* This file contains methods that provides the functionality
+* for allocating/deallocating memory.
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *!23-Oct-2008 Maiya ShreeHarsha: Linux specific changes
+ *!0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+
+#include <string.h>
+#include <malloc.h>
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+#else
+#include <stdint.h>
+#endif
+
+
+#include "timm_osal_types.h"
+#include "timm_osal_trace.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+
+
+
+static TIMM_OSAL_U32 gMallocCounter = 0;
+
+/******************************************************************************
+* Function Prototypes
+******************************************************************************/
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_createMemoryPool function
+*
+* @see
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreateMemoryPool(void)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ return bReturnStatus;
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_DeleteMemoryPool function
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeleteMemoryPool(void)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ return bReturnStatus;
+
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Malloc function
+*
+* @see
+*/
+/* ========================================================================== */
+TIMM_OSAL_PTR TIMM_OSAL_Malloc(TIMM_OSAL_U32 size,
+ TIMM_OSAL_BOOL bBlockContiguous,
+ TIMM_OSAL_U32 unBlockAlignment, TIMMOSAL_MEM_SEGMENTID tMemSegId)
+{
+
+ TIMM_OSAL_PTR pData = TIMM_OSAL_NULL;
+
+#ifdef HAVE_MEMALIGN
+ if (0 == unBlockAlignment)
+ {
+ pData = malloc((size_t) size);
+ } else
+ {
+ pData = memalign((size_t) unBlockAlignment, (size_t) size);
+ }
+#else
+ if (0 != unBlockAlignment)
+ {
+ TIMM_OSAL_Warning
+ ("Memory Allocation:Not done for specified nBufferAlignment. Alignment of 0 will be used");
+
+ }
+ pData = malloc((size_t) size); /*size_t is long long */
+#endif
+ if (TIMM_OSAL_NULL == pData)
+ {
+ TIMM_OSAL_Error("Malloc failed!!!");
+ } else
+ {
+ /* Memory Allocation was successfull */
+ gMallocCounter++;
+ }
+
+
+ return pData;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Free function ....
+*
+* @see
+*/
+/* ========================================================================== */
+
+void TIMM_OSAL_Free(TIMM_OSAL_PTR pData)
+{
+ if (TIMM_OSAL_NULL == pData)
+ {
+ /*TIMM_OSAL_Warning("TIMM_OSAL_Free called on NULL pointer"); */
+ goto EXIT;
+ }
+
+ free(pData);
+ pData = NULL;
+ gMallocCounter--;
+ EXIT:
+ return;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Memset function ....
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_Memset(TIMM_OSAL_PTR pBuffer,
+ TIMM_OSAL_U8 uValue, TIMM_OSAL_U32 uSize)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+
+ memset((void *)pBuffer, (int)uValue, (size_t) uSize);
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Memcmp function ....
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_S32 TIMM_OSAL_Memcmp(TIMM_OSAL_PTR pBuffer1, TIMM_OSAL_PTR pBuffer2,
+ TIMM_OSAL_U32 uSize)
+{
+ TIMM_OSAL_S32 result = memcmp(pBuffer1, pBuffer2, uSize);
+
+ if (result > 0)
+ {
+ return 1;
+ } else if (result < 0)
+ {
+ return -1;
+ }
+
+ return 0;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_Memcpy function ....
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_Memcpy(TIMM_OSAL_PTR pBufDst,
+ TIMM_OSAL_PTR pBufSrc, TIMM_OSAL_U32 uSize)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+
+ memcpy(pBufDst, pBufSrc, uSize);
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_GetMemCounter function ....
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_U32 TIMM_OSAL_GetMemCounter(void)
+{
+
+ return gMallocCounter;
+}
diff --git a/domx/mm_osal/src/timm_osal_mutex.c b/domx/mm_osal/src/timm_osal_mutex.c
new file mode 100755
index 0000000..5cfecf8
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_mutex.c
@@ -0,0 +1,244 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_Mutexs.c
+* This file contains methods that provides the functionality
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 04-Nov-2008 Maiya ShreeHarsha: Linux specific changes
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+
+
+#include "timm_osal_types.h"
+#include "timm_osal_trace.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+#include "timm_osal_semaphores.h"
+
+#include <errno.h>
+
+#include <pthread.h>
+#include <sys/time.h>
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_MutexCreate function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexCreate(TIMM_OSAL_PTR * pMutex)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ pthread_mutex_t *plMutex = TIMM_OSAL_NULL;
+
+ plMutex =
+ (pthread_mutex_t *) TIMM_OSAL_Malloc(sizeof(pthread_mutex_t), 0,
+ 0, 0);
+ if (TIMM_OSAL_NULL == plMutex)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_ALLOC;
+ goto EXIT;
+ }
+
+ /*if (SUCCESS != pthread_mutex_init(plMutex, pAttr)) */
+ if (SUCCESS != pthread_mutex_init(plMutex, TIMM_OSAL_NULL))
+ {
+ /*TIMM_OSAL_Error ("Mutex Create failed !"); */
+ /*goto EXIT; */
+ } else
+ {
+ /**pMutex = (TIMM_OSAL_PTR *)plMutex;*/
+ *pMutex = (TIMM_OSAL_PTR) plMutex;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+ EXIT:
+ /*if((TIMM_OSAL_ERR_NONE != bReturnStatus)) {
+ TIMM_OSAL_Free(plMutex);
+ } */
+ if ((TIMM_OSAL_ERR_NONE != bReturnStatus) &&
+ (TIMM_OSAL_NULL != plMutex))
+ {
+ TIMM_OSAL_Free(plMutex);
+ }
+ return bReturnStatus;
+
+/**********************************************************/
+/*return TIMM_OSAL_SemaphoreCreate(pMutex, 1);*/
+/**********************************************************/
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_MutexDelete function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexDelete(TIMM_OSAL_PTR pMutex)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ pthread_mutex_t *plMutex = (pthread_mutex_t *) pMutex;
+
+ if (plMutex == TIMM_OSAL_NULL)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+ /*can we do away with if or with switch case */
+ if (SUCCESS != pthread_mutex_destroy(plMutex))
+ {
+ /*TIMM_OSAL_Error("Delete Mutex failed !"); */
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;;
+ }
+
+ TIMM_OSAL_Free(plMutex);
+ EXIT:
+ return bReturnStatus;
+/**********************************************************/
+/*return TIMM_OSAL_SemaphoreDelete(pMutex);*/
+/**********************************************************/
+
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_MutexObtain function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexObtain(TIMM_OSAL_PTR pMutex,
+ TIMM_OSAL_U32 uTimeOut)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ struct timespec abs_timeout;
+ struct timeval ltime_now;
+ TIMM_OSAL_U32 ltimenow_us;
+ pthread_mutex_t *plMutex = (pthread_mutex_t *) pMutex;
+
+ if (plMutex == TIMM_OSAL_NULL)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ if (TIMM_OSAL_SUSPEND == uTimeOut)
+ {
+ if (SUCCESS != pthread_mutex_lock(plMutex))
+ {
+ /*TIMM_OSAL_Error("Lock Mutex failed !"); */
+ goto EXIT;
+ }
+ } else if (TIMM_OSAL_NO_SUSPEND == uTimeOut)
+ {
+ if (SUCCESS != pthread_mutex_trylock(plMutex))
+ {
+ /*TIMM_OSAL_Error("Lock Mutex failed !"); */
+ goto EXIT;
+ }
+ } else
+ {
+ gettimeofday(&ltime_now, NULL);
+ /*uTimeOut is assumed to be in milliseconds */
+ ltimenow_us = ltime_now.tv_usec + 1000 * uTimeOut;
+ abs_timeout.tv_sec = ltime_now.tv_sec + uTimeOut / 1000;
+ abs_timeout.tv_nsec = (ltimenow_us % 1000000) * 1000;
+
+#ifdef _POSIX_VERSION_1_
+ if (SUCCESS != pthread_mutex_lock(plMutex))
+ { //Some Posix versions dont support timeout
+#else
+ if (SUCCESS != pthread_mutex_timedlock(plMutex, &abs_timeout))
+ {
+#endif
+ /*TIMM_OSAL_Error("Lock Mutex failed !"); */
+ goto EXIT;
+ }
+ }
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ EXIT:
+ return bReturnStatus;
+/**********************************************************/
+/*return TIMM_OSAL_SemaphoreObtain(pMutex, uTimeOut);*/
+/**********************************************************/
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_MutexRelease function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_MutexRelease(TIMM_OSAL_PTR pMutex)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ pthread_mutex_t *plMutex = (pthread_mutex_t *) pMutex;
+
+ if (TIMM_OSAL_NULL == plMutex)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ if (SUCCESS != pthread_mutex_unlock(plMutex))
+ {
+ /*TIMM_OSAL_Error("Unlock Mutex failed !"); */
+ } else
+ {
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+ EXIT:
+ return bReturnStatus;
+/**********************************************************/
+/*return TIMM_OSAL_SemaphoreRelease(pMutex);*/
+/**********************************************************/
+}
diff --git a/domx/mm_osal/src/timm_osal_pipes.c b/domx/mm_osal/src/timm_osal_pipes.c
new file mode 100755
index 0000000..1c38354
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_pipes.c
@@ -0,0 +1,415 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_pipes.c
+* This file contains methods that provides the functionality
+* for creating/using Nucleus pipes.
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 07-Nov-2008 Maiya ShreeHarsha: Linux specific changes
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+
+#include "timm_osal_types.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+#include "timm_osal_trace.h"
+
+#include <unistd.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <errno.h>
+
+/**
+* TIMM_OSAL_PIPE structure define the OSAL pipe
+*/
+typedef struct TIMM_OSAL_PIPE
+{
+ int pfd[2];
+ TIMM_OSAL_U32 pipeSize;
+ TIMM_OSAL_U32 messageSize;
+ TIMM_OSAL_U8 isFixedMessage;
+ int messageCount;
+ int totalBytesInPipe;
+} TIMM_OSAL_PIPE;
+
+
+/******************************************************************************
+* Function Prototypes
+******************************************************************************/
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_CreatePipe function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreatePipe(TIMM_OSAL_PTR * pPipe,
+ TIMM_OSAL_U32 pipeSize,
+ TIMM_OSAL_U32 messageSize, TIMM_OSAL_U8 isFixedMessage)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_PIPE *pHandle = TIMM_OSAL_NULL;
+
+ pHandle =
+ (TIMM_OSAL_PIPE *) TIMM_OSAL_Malloc(sizeof(TIMM_OSAL_PIPE), 0, 0,
+ 0);
+
+ if (TIMM_OSAL_NULL == pHandle)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_ALLOC;
+ goto EXIT;
+ }
+ TIMM_OSAL_Memset(pHandle, 0x0, sizeof(TIMM_OSAL_PIPE));
+
+ pHandle->pfd[0] = -1;
+ pHandle->pfd[1] = -1;
+ if (SUCCESS != pipe(pHandle->pfd))
+ {
+ TIMM_OSAL_Error("Pipe failed: %s!!!", strerror(errno));
+ goto EXIT;
+ }
+
+ pHandle->pipeSize = pipeSize;
+ pHandle->messageSize = messageSize;
+ pHandle->isFixedMessage = isFixedMessage;
+ pHandle->messageCount = 0;
+ pHandle->totalBytesInPipe = 0;
+
+ *pPipe = (TIMM_OSAL_PTR) pHandle;
+
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+
+ return bReturnStatus;
+EXIT:
+ TIMM_OSAL_Free(pHandle);
+ return bReturnStatus;
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_DeletePipe function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeletePipe(TIMM_OSAL_PTR pPipe)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ TIMM_OSAL_PIPE *pHandle = (TIMM_OSAL_PIPE *) pPipe;
+
+ if (TIMM_OSAL_NULL == pHandle)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ if (SUCCESS != close(pHandle->pfd[0]))
+ {
+ TIMM_OSAL_Error("Delete_Pipe Read fd failed!!!");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+ if (SUCCESS != close(pHandle->pfd[1]))
+ {
+ TIMM_OSAL_Error("Delete_Pipe Write fd failed!!!");
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+
+ TIMM_OSAL_Free(pHandle);
+EXIT:
+ return bReturnStatus;
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_WriteToPipe function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_WriteToPipe(TIMM_OSAL_PTR pPipe,
+ void *pMessage, TIMM_OSAL_U32 size, TIMM_OSAL_S32 timeout)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_U32 lSizeWritten = -1;
+
+ TIMM_OSAL_PIPE *pHandle = (TIMM_OSAL_PIPE *) pPipe;
+
+ if (size == 0)
+ {
+ TIMM_OSAL_Error("0 size!!!");
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+ lSizeWritten = write(pHandle->pfd[1], pMessage, size);
+
+ if (lSizeWritten != size)
+ {
+ TIMM_OSAL_Error("Write of pipe failed!!!");
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ /*Update message count and size */
+ pHandle->messageCount++;
+ pHandle->totalBytesInPipe += size;
+
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ EXIT:
+ return bReturnStatus;
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_WriteToFrontOfPipe function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_WriteToFrontOfPipe(TIMM_OSAL_PTR pPipe,
+ void *pMessage, TIMM_OSAL_U32 size, TIMM_OSAL_S32 timeout)
+{
+
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_U32 lSizeWritten = -1;
+ TIMM_OSAL_U32 lSizeRead = -1;
+ TIMM_OSAL_PIPE *pHandle = (TIMM_OSAL_PIPE *) pPipe;
+ TIMM_OSAL_U8 *tempPtr = NULL;
+
+
+ /*First write to this pipe */
+ if (size == 0)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ lSizeWritten = write(pHandle->pfd[1], pMessage, size);
+
+ if (lSizeWritten != size)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ /*Update number of messages */
+ pHandle->messageCount++;
+
+
+ if (pHandle->messageCount > 1)
+ {
+ /*First allocate memory */
+ tempPtr =
+ (TIMM_OSAL_U8 *) TIMM_OSAL_Malloc(pHandle->
+ totalBytesInPipe, 0, 0, 0);
+
+ if (tempPtr == NULL)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ /*Read out of pipe */
+ lSizeRead =
+ read(pHandle->pfd[0], tempPtr, pHandle->totalBytesInPipe);
+
+ /*Write back to pipe */
+ lSizeWritten =
+ write(pHandle->pfd[1], tempPtr,
+ pHandle->totalBytesInPipe);
+
+ if (lSizeWritten != size)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ /*Update Total bytes in pipe */
+ pHandle->totalBytesInPipe += size;
+ }
+
+
+ EXIT:
+ TIMM_OSAL_Free(tempPtr);
+
+ return bReturnStatus;
+
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_ReadFromPipe function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_ReadFromPipe(TIMM_OSAL_PTR pPipe,
+ void *pMessage,
+ TIMM_OSAL_U32 size, TIMM_OSAL_U32 * actualSize, TIMM_OSAL_S32 timeout)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_U32 lSizeRead = -1;
+ TIMM_OSAL_PIPE *pHandle = (TIMM_OSAL_PIPE *) pPipe;
+
+ if (size == 0)
+ {
+ TIMM_OSAL_Error("nRead size has error!!!");
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+ if ((pHandle->messageCount == 0) && (timeout == TIMM_OSAL_NO_SUSPEND))
+ {
+ /*If timeout is 0 and pipe is empty, return error */
+ TIMM_OSAL_Error("Pipe is empty!!!");
+ bReturnStatus = TIMM_OSAL_ERR_PIPE_EMPTY;
+ goto EXIT;
+ }
+ if ((timeout !=TIMM_OSAL_NO_SUSPEND) &&
+ (timeout != (TIMM_OSAL_S32)TIMM_OSAL_SUSPEND))
+ {
+ TIMM_OSAL_Warning("Only infinite or no timeouts \
+ supported. Going to read with infinite timeout now");
+ }
+ /*read blocks infinitely until message is available */
+ *actualSize = lSizeRead = read(pHandle->pfd[0], pMessage, size);
+ if (0 == lSizeRead)
+ {
+ TIMM_OSAL_Error("EOF reached or no data in pipe!!!");
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ pHandle->messageCount--;
+ pHandle->totalBytesInPipe -= size;
+
+ EXIT:
+ return bReturnStatus;
+
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_ClearPipe function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_ClearPipe(TIMM_OSAL_PTR pPipe)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR;
+
+ TIMM_OSAL_Warning("This function is currently not implemented");
+
+ return bReturnStatus;
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_IsPipeReady function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_IsPipeReady(TIMM_OSAL_PTR pPipe)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR;
+ TIMM_OSAL_PIPE *pHandle = (TIMM_OSAL_PIPE *) pPipe;
+
+ if (pHandle->messageCount <= 0)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_NOT_READY;
+ } else
+ {
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+
+ return bReturnStatus;
+
+}
+
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_GetPipeReadyMessageCount function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_GetPipeReadyMessageCount(TIMM_OSAL_PTR pPipe,
+ TIMM_OSAL_U32 * count)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ TIMM_OSAL_PIPE *pHandle = (TIMM_OSAL_PIPE *) pPipe;
+
+ *count = pHandle->messageCount;
+ return bReturnStatus;
+
+}
diff --git a/domx/mm_osal/src/timm_osal_semaphores.c b/domx/mm_osal/src/timm_osal_semaphores.c
new file mode 100755
index 0000000..b69ee3c
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_semaphores.c
@@ -0,0 +1,297 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_semaphores.c
+* This file contains methods that provides the functionality
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 30-Oct-2008 Maiya ShreeHarsha: Linux specific changes
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+
+#include <stdio.h>
+
+#include <semaphore.h>
+#include <sys/time.h>
+
+
+#include "timm_osal_types.h"
+#include "timm_osal_trace.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+
+
+#define SEMNAME_MAX 7
+
+/*
+typedef struct TIMM_OSAL_SEMAPHORE {
+ sem_t sem;
+ CHAR name[SEMNAME_MAX];
+} TIMM_OSAL_SEMAPHORE;
+*/
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_SemaphoreCreate function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreCreate(TIMM_OSAL_PTR * pSemaphore,
+ TIMM_OSAL_U32 uInitCount)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ *pSemaphore = TIMM_OSAL_NULL;
+
+ sem_t *psem = (sem_t *) TIMM_OSAL_Malloc(sizeof(sem_t), 0, 0, 0);
+
+ if (TIMM_OSAL_NULL == psem)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_ALLOC;
+ goto EXIT;
+ }
+
+ /*Unnamed semaphore */
+ if (SUCCESS != sem_init(psem, 0, uInitCount))
+ {
+ /*TIMM_OSAL_Error("Semaphore Create failed !"); */
+ /*goto EXIT; */
+ } else
+ {
+ *pSemaphore = (TIMM_OSAL_PTR) psem;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+ EXIT:
+ if ((TIMM_OSAL_ERR_NONE != bReturnStatus) && (TIMM_OSAL_NULL != psem))
+ {
+ TIMM_OSAL_Free(psem);
+ }
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_SemaphoreDelete function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreDelete(TIMM_OSAL_PTR pSemaphore)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_NONE;
+ sem_t *psem = (sem_t *) pSemaphore;
+
+ if (psem == TIMM_OSAL_NULL)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+ /* Release the semaphore. */
+ if (SUCCESS != sem_destroy(psem))
+ {
+ /*TIMM_OSAL_Error("Semaphore Delete failed !"); */
+ bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ }
+
+ TIMM_OSAL_Free(psem);
+ EXIT:
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_SemaphoreObtain function
+*
+*
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreObtain(TIMM_OSAL_PTR pSemaphore,
+ TIMM_OSAL_U32 uTimeOut)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ struct timeval ltime_now;
+ struct timespec abs_timeout;
+ sem_t *psem = (sem_t *) pSemaphore;
+
+ if (psem == TIMM_OSAL_NULL)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ if (TIMM_OSAL_SUSPEND == uTimeOut)
+ {
+ if (SUCCESS != sem_wait(psem))
+ {
+ /*TIMM_OSAL_Error("Semaphore Wait failed !"); */
+ goto EXIT;
+ }
+
+ } else if (TIMM_OSAL_NO_SUSPEND == uTimeOut)
+ {
+ if (SUCCESS != sem_trywait(psem))
+ {
+ /*TIMM_OSAL_Error("Semaphore blocked !"); */
+ goto EXIT;
+ }
+ } else
+ {
+ /*Some delay in calling gettimeofday and sem_timedwait - cant
+ be avoided. Possibility of thread switch after gettimeofday
+ in which case time out will be less than expected */
+ gettimeofday(&ltime_now, NULL);
+ /*uTimeOut is assumed to be in milliseconds */
+ abs_timeout.tv_sec = ltime_now.tv_sec + (uTimeOut / 1000);
+ abs_timeout.tv_nsec =
+ 1000 * (ltime_now.tv_usec + ((uTimeOut % 1000) * 1000));
+
+ if (SUCCESS != sem_timedwait(psem, &abs_timeout))
+ {
+ /*TIMM_OSAL_Error("Semaphore Timed Wait failed !"); */
+ goto EXIT;
+ }
+ }
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+
+ EXIT:
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_SemaphoreRelease function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreRelease(TIMM_OSAL_PTR pSemaphore)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ sem_t *psem = (sem_t *) pSemaphore;
+
+ if (TIMM_OSAL_NULL == psem)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+ /* Release the semaphore. */
+ if (SUCCESS != sem_post(psem))
+ {
+ /*TIMM_OSAL_Error("Release failed !"); */
+ } else
+ {
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+
+ EXIT:
+ return bReturnStatus;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_SemaphoreReset function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_SemaphoreReset(TIMM_OSAL_PTR pSemaphore,
+ TIMM_OSAL_U32 uInitCount)
+{
+ /* TIMM_OSAL_SEMAPHORE *pHandle = (TIMM_OSAL_SEMAPHORE *)pSemaphore;
+ STATUS status;
+ TIMM_OSAL_ERRORTYPE bReturnStatus; */
+
+
+ /* Release the semaphore. */
+ /*status = NU_Reset_Semaphore(&(pHandle->sem),
+ uInitCount);
+ */
+ /* switch(status)
+ {
+ case NU_SUCCESS:
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ break;
+ default:
+ bReturnStatus = TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR, TIMM_OSAL_COMP_SEMAPHORES, status);
+ break;
+ }
+ */
+ /* return bReturnStatus; */
+ return TIMM_OSAL_ERR_UNKNOWN;
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_GetSemaphoreCount function
+*
+*
+*/
+/* ========================================================================== */
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_GetSemaphoreCount(TIMM_OSAL_PTR pSemaphore,
+ TIMM_OSAL_U32 * count)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ int sval = -2; /*value that is not possible */
+ sem_t *psem = (sem_t *) pSemaphore;
+
+ if (TIMM_OSAL_NULL == psem)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+
+ /* Release the semaphore. */
+ if (SUCCESS != sem_getvalue(psem, &sval))
+ {
+ /*TIMM_OSAL_Error("Get Semaphore Count failed !"); */
+ } else
+ {
+ *count = sval;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ }
+
+ EXIT:
+ return bReturnStatus;
+}
diff --git a/domx/mm_osal/src/timm_osal_task.c b/domx/mm_osal/src/timm_osal_task.c
new file mode 100755
index 0000000..7a243a9
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_task.c
@@ -0,0 +1,262 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_task.c
+* This file contains methods that provides the functionality
+* for creating/destroying tasks.
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *! 21-Oct-2008 Maiya ShreeHarsha: Linux specific changes
+ *! 0.1: Created the first draft version, ksrini@ti.com
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+
+#include <stdio.h>
+#include <pthread.h> /*for POSIX calls */
+#include <sched.h> /*for sched structure */
+#include <unistd.h>
+
+
+
+#include "timm_osal_types.h"
+#include "timm_osal_trace.h"
+#include "timm_osal_error.h"
+#include "timm_osal_memory.h"
+#include "timm_osal_task.h"
+
+
+
+
+/**
+* TIMM_OSAL_TASK describe the different task information
+*/
+typedef struct TIMM_OSAL_TASK
+{
+ pthread_t threadID; /*SHM check */
+ /* To set the priority and stack size */
+ pthread_attr_t ThreadAttr; /*For setting the priority and stack size */
+ /** Name of the task */
+ /* TIMM_OSAL_S8 name[8];*//* eight character plus null char */
+ /** Pointer to the task stack memory */
+/* TIMM_OSAL_PTR stackPtr;*/
+ /** Size of the task stack */
+/* TIMM_OSAL_S32 stackSize;*/
+ /*parameters to the task */
+ TIMM_OSAL_U32 uArgc;
+ TIMM_OSAL_PTR pArgv;
+ /** task priority */
+/* TIMM_OSAL_S32 priority;*/
+ /** flag to check if task got created */
+ TIMM_OSAL_BOOL isCreated;
+} TIMM_OSAL_TASK;
+
+
+/******************************************************************************
+* Function Prototypes
+******************************************************************************/
+
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_CreateTask function
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_CreateTask(TIMM_OSAL_PTR * pTask,
+ TIMM_OSAL_TaskProc pFunc,
+ TIMM_OSAL_U32 uArgc,
+ TIMM_OSAL_PTR pArgv,
+ TIMM_OSAL_U32 uStackSize, TIMM_OSAL_U32 uPriority, TIMM_OSAL_S8 * pName)
+{
+
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+ TIMM_OSAL_TASK *pHandle = TIMM_OSAL_NULL;
+ struct sched_param sched;
+ size_t stackSize;
+ *pTask = TIMM_OSAL_NULL;
+
+
+ /*Task structure allocation */
+ pHandle =
+ (TIMM_OSAL_TASK *) TIMM_OSAL_Malloc(sizeof(TIMM_OSAL_TASK), 0, 0,
+ 0);
+ if (pHandle == TIMM_OSAL_NULL)
+ {
+ bReturnStatus = TIMM_OSAL_ERR_ALLOC;
+ goto EXIT;
+ }
+
+ /* Initial cleaning of the task structure */
+ TIMM_OSAL_Memset((TIMM_OSAL_PTR) pHandle, 0, sizeof(TIMM_OSAL_TASK));
+
+ /*Arguments for task */
+ pHandle->uArgc = uArgc;
+ pHandle->pArgv = pArgv;
+
+ pHandle->isCreated = TIMM_OSAL_FALSE;
+
+
+ if (SUCCESS != pthread_attr_init(&pHandle->ThreadAttr))
+ {
+ /*TIMM_OSAL_Error("Task Init Attr Init failed!"); */
+ goto EXIT;
+ }
+ /* Updation of the priority and the stack size */
+
+ if (SUCCESS != pthread_attr_getschedparam(&pHandle->ThreadAttr,
+ &sched))
+ {
+ /*TIMM_OSAL_Error("Task Init Get Sched Params failed!"); */
+ goto EXIT;
+ }
+
+ sched.sched_priority = uPriority; /* relative to the default priority */
+ if (SUCCESS != pthread_attr_setschedparam(&pHandle->ThreadAttr,
+ &sched))
+ {
+ /*TIMM_OSAL_Error("Task Init Set Sched Paramsfailed!"); */
+ goto EXIT;
+ }
+
+ /*First get the default stack size */
+ if (SUCCESS != pthread_attr_getstacksize(&pHandle->ThreadAttr,
+ &stackSize))
+ {
+ /*TIMM_OSAL_Error("Task Init Set Stack Size failed!"); */
+ goto EXIT;
+ }
+
+ /*Check if requested stack size is larger than the current default stack size */
+ if (uStackSize > stackSize)
+ {
+ stackSize = uStackSize;
+ if (SUCCESS != pthread_attr_setstacksize(&pHandle->ThreadAttr,
+ stackSize))
+ {
+ /*TIMM_OSAL_Error("Task Init Set Stack Size failed!"); */
+ goto EXIT;
+ }
+ }
+
+
+
+ if (SUCCESS != pthread_create(&pHandle->threadID,
+ &pHandle->ThreadAttr, pFunc, pArgv))
+ {
+ /*TIMM_OSAL_Error ("Create_Task failed !"); */
+ goto EXIT;
+ }
+
+
+ /* Task was successfully created */
+ pHandle->isCreated = TIMM_OSAL_TRUE;
+ *pTask = (TIMM_OSAL_PTR) pHandle;
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ /**pTask = (TIMM_OSAL_PTR *)pHandle;*/
+
+ EXIT:
+/* if((TIMM_OSAL_ERR_NONE != bReturnStatus) && (TIMM_OSAL_NULL != pHandle)) {
+ TIMM_OSAL_Free (pHandle->stackPtr);*/
+ if ((TIMM_OSAL_ERR_NONE != bReturnStatus))
+ {
+ TIMM_OSAL_Free(pHandle);
+ }
+ return bReturnStatus;
+
+}
+
+/* ========================================================================== */
+/**
+* @fn TIMM_OSAL_DeleteTask
+*
+* @see
+*/
+/* ========================================================================== */
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_DeleteTask(TIMM_OSAL_PTR pTask)
+{
+ TIMM_OSAL_ERRORTYPE bReturnStatus = TIMM_OSAL_ERR_UNKNOWN;
+
+ TIMM_OSAL_TASK *pHandle = (TIMM_OSAL_TASK *) pTask;
+ void *retVal;
+
+ if ((NULL == pHandle) || (TIMM_OSAL_TRUE != pHandle->isCreated))
+ {
+ /* this task was never created */
+ bReturnStatus = TIMM_OSAL_ERR_PARAMETER;
+ goto EXIT;
+ }
+ if (pthread_attr_destroy(&pHandle->ThreadAttr))
+ {
+ /*TIMM_OSAL_Error("Delete_Task failed !"); */
+ goto EXIT;
+ }
+ if (pthread_join(pHandle->threadID, &retVal))
+ {
+ /*TIMM_OSAL_Error("Delete_Task failed !"); */
+ goto EXIT;
+ /* bReturnStatus = TIMM_OSAL_ERR_CREATE(TIMM_OSAL_ERR, TIMM_OSAL_COMP_TASK, status);*//*shm to be done */
+ }
+ bReturnStatus = TIMM_OSAL_ERR_NONE;
+ TIMM_OSAL_Free(pHandle);
+ EXIT:
+ return bReturnStatus;
+}
+
+
+TIMM_OSAL_ERRORTYPE TIMM_OSAL_SleepTask(TIMM_OSAL_U32 mSec)
+{
+ TIMM_OSAL_S32 nReturn = 0;
+
+#ifdef _POSIX_VERSION_1_
+ usleep(1000 * mSec);
+#else
+ nReturn = usleep(1000 * mSec);
+#endif
+ if (nReturn == 0)
+ return TIMM_OSAL_ERR_NONE;
+ else
+ return TIMM_OSAL_ERR_UNKNOWN;
+}
diff --git a/domx/mm_osal/src/timm_osal_trace.c b/domx/mm_osal/src/timm_osal_trace.c
new file mode 100755
index 0000000..a192d7c
--- /dev/null
+++ b/domx/mm_osal/src/timm_osal_trace.c
@@ -0,0 +1,172 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+* @file timm_osal_trace.c
+* This file contains methods that provides the functionality
+* for logging errors/warings/information/etc.
+*
+* @path \
+*
+*/
+/* -------------------------------------------------------------------------- */
+/* =========================================================================
+ *!
+ *! Revision History
+ *! ===================================
+ *!
+ * ========================================================================= */
+
+/******************************************************************************
+* Includes
+******************************************************************************/
+
+/*#include "typedefs.h"*/
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include "timm_osal_trace.h"
+
+#ifdef _Android
+#define LOG_TAG "DOMX"
+#include <utils/Log.h>
+#include <cutils/properties.h>
+#endif
+
+/**
+* The OSAL debug trace detail can be set at compile time by defining the flag
+* TIMM_OSAL_DEBUG_TRACE_DETAIL=<Details>
+* detail - 0 - no detail
+* 1 - function name
+* 2 - function name, line number
+* Prefix is added to every debug trace message
+*/
+#ifndef TIMM_OSAL_DEBUG_TRACE_DETAIL
+#define TIMM_OSAL_DEBUG_TRACE_DETAIL 2
+#endif
+
+#define DEFAULT_TRACE_LEVEL TIMM_OSAL_TRACE_LEVEL_ERROR
+
+static int trace_level = -1;
+
+/* strip out leading ../ stuff that happens to __FILE__ for out-of-tree builds */
+static const char *simplify_path(const char *file)
+{
+ while (file)
+ {
+ char c = file[0];
+ if ((c != '.') && (c != '/') && (c != '\\'))
+ break;
+ file++;
+ }
+ return file;
+}
+
+void TIMM_OSAL_UpdateTraceLevel(void)
+{
+ char *val = getenv("TIMM_OSAL_DEBUG_TRACE_LEVEL");
+
+ if (val)
+ {
+ trace_level = strtol(val, NULL, 0);
+ }
+ else
+ {
+#ifdef _Android
+ char value[PROPERTY_VALUE_MAX];
+ int val;
+
+ property_get("debug.domx.trace_level", value, "0");
+ val = atoi(value);
+ if ( (!val) || (val < 0) )
+ {
+ trace_level = DEFAULT_TRACE_LEVEL;
+ }
+ else
+ trace_level = val;
+#else
+ trace_level = DEFAULT_TRACE_LEVEL;
+#endif
+ }
+}
+
+void __TIMM_OSAL_TraceFunction(const __TIMM_OSAL_TRACE_LOCATION * loc,
+ const char *fmt, ...)
+{
+ if (trace_level == -1)
+ {
+ char *val = getenv("TIMM_OSAL_DEBUG_TRACE_LEVEL");
+ trace_level =
+ val ? strtol(val, NULL, 0) : DEFAULT_TRACE_LEVEL;
+ }
+
+ if (trace_level >= loc->level)
+ {
+ va_list ap;
+
+ va_start(ap, fmt); /* make ap point to first arg after 'fmt' */
+
+#ifdef _Android
+
+#if 0 // Original for reference
+#if ( TIMM_OSAL_DEBUG_TRACE_DETAIL > 1 )
+ LOG_PRI(ANDROID_LOG_DEBUG, LOG_TAG, "%s:%d\t%s()\t", simplify_path(loc->file), loc->line,
+ loc->function);
+#endif
+#else // Prints function_name for ERROR, WARNING and ENTRY/EXIT
+ if ( (loc->level == TIMM_OSAL_TRACE_LEVEL_ERROR) || (loc->level == TIMM_OSAL_TRACE_LEVEL_WARNING) || (loc->level == TIMM_OSAL_TRACE_LEVEL_ENTERING) )
+ LOG_PRI(ANDROID_LOG_DEBUG, LOG_TAG, "%s:%d\t%s()\t", simplify_path(loc->file), loc->line,
+ loc->function);
+#endif
+
+ LOG_PRI_VA(ANDROID_LOG_DEBUG, LOG_TAG, fmt, ap);
+
+#else
+
+#if 0 // Original for reference
+#if ( TIMM_OSAL_DEBUG_TRACE_DETAIL > 1 )
+ printf("%s:%d\t%s()\t", simplify_path(loc->file), loc->line,
+ loc->function);
+#endif
+#else // Prints function_name for ERROR, WARNING and ENTRY/EXIT
+ if ( (loc->level == 1) || (loc->level == 2) || (loc->level == 5) )
+ printf("%s:%d\t%s()\t", simplify_path(loc->file), loc->line,
+ loc->function);
+#endif
+
+ vprintf(fmt, ap);
+
+#endif
+
+ va_end(ap);
+ }
+}
diff --git a/domx/omx_core/Android.mk b/domx/omx_core/Android.mk
new file mode 100644
index 0000000..843ace9
--- /dev/null
+++ b/domx/omx_core/Android.mk
@@ -0,0 +1,20 @@
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_SRC_FILES:= \
+ src/OMX_Core.c \
+ src/OMX_Core_Wrapper.c
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/inc \
+ $(LOCAL_PATH)/../mm_osal/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libdl \
+ libmm_osal
+
+LOCAL_CFLAGS += -DSTATIC_TABLE -D_Android -DCHECK_SECURE_STATE
+LOCAL_MODULE:= libOMX_Core
+LOCAL_MODULE_TAGS:= optional
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
diff --git a/domx/omx_core/Makefile b/domx/omx_core/Makefile
new file mode 100644
index 0000000..5c6c563
--- /dev/null
+++ b/domx/omx_core/Makefile
@@ -0,0 +1,99 @@
+#
+# Copyright (C) Texas Instruments - http://www.ti.com/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+#PROJROOT = ..
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS += -DSTATIC_TABLE
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libomx_core
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+ src/OMX_Core.c \
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal omx_proxy_component
+SH_LIBS = mm_osal dl
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal
+# $(PROJROOT)/video/omx_proxy_component/src
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
+
diff --git a/domx/omx_core/inc/OMX_Audio.h b/domx/omx_core/inc/OMX_Audio.h
new file mode 100644
index 0000000..4531df4
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Audio.h
@@ -0,0 +1,1345 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_Audio.h - OpenMax IL version 1.1.2
+ * The structures needed by Audio components to exchange
+ * parameters and configuration data with the componenmilts.
+ */
+
+#ifndef OMX_Audio_h
+#define OMX_Audio_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Core.h>
+
+/** @defgroup midi MIDI
+ * @ingroup audio
+ */
+
+/** @defgroup effects Audio effects
+ * @ingroup audio
+ */
+
+/** @defgroup audio OpenMAX IL Audio Domain
+ * Structures for OpenMAX IL Audio domain
+ * @{
+ */
+
+/** Enumeration used to define the possible audio codings.
+ * If "OMX_AUDIO_CodingUnused" is selected, the coding selection must
+ * be done in a vendor specific way. Since this is for an audio
+ * processing element this enum is relevant. However, for another
+ * type of component other enums would be in this area.
+ */
+typedef enum OMX_AUDIO_CODINGTYPE {
+ OMX_AUDIO_CodingUnused = 0, /**< Placeholder value when coding is N/A */
+ OMX_AUDIO_CodingAutoDetect, /**< auto detection of audio format */
+ OMX_AUDIO_CodingPCM, /**< Any variant of PCM coding */
+ OMX_AUDIO_CodingADPCM, /**< Any variant of ADPCM encoded data */
+ OMX_AUDIO_CodingAMR, /**< Any variant of AMR encoded data */
+ OMX_AUDIO_CodingGSMFR, /**< Any variant of GSM fullrate (i.e. GSM610) */
+ OMX_AUDIO_CodingGSMEFR, /**< Any variant of GSM Enhanced Fullrate encoded data*/
+ OMX_AUDIO_CodingGSMHR, /**< Any variant of GSM Halfrate encoded data */
+ OMX_AUDIO_CodingPDCFR, /**< Any variant of PDC Fullrate encoded data */
+ OMX_AUDIO_CodingPDCEFR, /**< Any variant of PDC Enhanced Fullrate encoded data */
+ OMX_AUDIO_CodingPDCHR, /**< Any variant of PDC Halfrate encoded data */
+ OMX_AUDIO_CodingTDMAFR, /**< Any variant of TDMA Fullrate encoded data (TIA/EIA-136-420) */
+ OMX_AUDIO_CodingTDMAEFR, /**< Any variant of TDMA Enhanced Fullrate encoded data (TIA/EIA-136-410) */
+ OMX_AUDIO_CodingQCELP8, /**< Any variant of QCELP 8kbps encoded data */
+ OMX_AUDIO_CodingQCELP13, /**< Any variant of QCELP 13kbps encoded data */
+ OMX_AUDIO_CodingEVRC, /**< Any variant of EVRC encoded data */
+ OMX_AUDIO_CodingSMV, /**< Any variant of SMV encoded data */
+ OMX_AUDIO_CodingG711, /**< Any variant of G.711 encoded data */
+ OMX_AUDIO_CodingG723, /**< Any variant of G.723 dot 1 encoded data */
+ OMX_AUDIO_CodingG726, /**< Any variant of G.726 encoded data */
+ OMX_AUDIO_CodingG729, /**< Any variant of G.729 encoded data */
+ OMX_AUDIO_CodingAAC, /**< Any variant of AAC encoded data */
+ OMX_AUDIO_CodingMP3, /**< Any variant of MP3 encoded data */
+ OMX_AUDIO_CodingSBC, /**< Any variant of SBC encoded data */
+ OMX_AUDIO_CodingVORBIS, /**< Any variant of VORBIS encoded data */
+ OMX_AUDIO_CodingWMA, /**< Any variant of WMA encoded data */
+ OMX_AUDIO_CodingRA, /**< Any variant of RA encoded data */
+ OMX_AUDIO_CodingMIDI, /**< Any variant of MIDI encoded data */
+ OMX_AUDIO_CodingFLAC, /**< Any variant of FLAC encoded data */
+#ifdef OMAP_ENHANCEMENT //DOLBY_DDPDEC51
+ OMX_AUDIO_CodingDDP, /**< Any variant of DDP encoded data */
+#endif
+ OMX_AUDIO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_CodingMax = 0x7FFFFFFF
+} OMX_AUDIO_CODINGTYPE;
+
+
+/** The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output audio
+ * path. If additional information is needed to define the parameters of the
+ * port (such as frequency), additional structures must be sent such as the
+ * OMX_AUDIO_PARAM_PCMMODETYPE structure to supply the extra parameters for the port.
+ */
+typedef struct OMX_AUDIO_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType; /**< MIME type of data for the port */
+ OMX_NATIVE_DEVICETYPE pNativeRender; /** < platform specific reference
+ for an output device,
+ otherwise this field is 0 */
+ OMX_BOOL bFlagErrorConcealment; /**< Turns on error concealment if it is
+ supported by the OMX component */
+ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this
+ port (e.g. PCM, AMR, MP3, etc) */
+} OMX_AUDIO_PORTDEFINITIONTYPE;
+
+
+/** Port format parameter. This structure is used to enumerate
+ * the various data input/output format supported by the port.
+ */
+typedef struct OMX_AUDIO_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Indicates which port to set */
+ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
+ OMX_AUDIO_CODINGTYPE eEncoding; /**< Type of data expected for this port (e.g. PCM, AMR, MP3, etc) */
+} OMX_AUDIO_PARAM_PORTFORMATTYPE;
+
+
+/** PCM mode type */
+typedef enum OMX_AUDIO_PCMMODETYPE {
+ OMX_AUDIO_PCMModeLinear = 0, /**< Linear PCM encoded data */
+ OMX_AUDIO_PCMModeALaw, /**< A law PCM encoded data (G.711) */
+ OMX_AUDIO_PCMModeMULaw, /**< Mu law PCM encoded data (G.711) */
+ OMX_AUDIO_PCMModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_PCMModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_PCMModeMax = 0x7FFFFFFF
+} OMX_AUDIO_PCMMODETYPE;
+
+
+typedef enum OMX_AUDIO_CHANNELTYPE {
+ OMX_AUDIO_ChannelNone = 0x0, /**< Unused or empty */
+ OMX_AUDIO_ChannelLF = 0x1, /**< Left front */
+ OMX_AUDIO_ChannelRF = 0x2, /**< Right front */
+ OMX_AUDIO_ChannelCF = 0x3, /**< Center front */
+ OMX_AUDIO_ChannelLS = 0x4, /**< Left surround */
+ OMX_AUDIO_ChannelRS = 0x5, /**< Right surround */
+ OMX_AUDIO_ChannelLFE = 0x6, /**< Low frequency effects */
+ OMX_AUDIO_ChannelCS = 0x7, /**< Back surround */
+ OMX_AUDIO_ChannelLR = 0x8, /**< Left rear. */
+ OMX_AUDIO_ChannelRR = 0x9, /**< Right rear. */
+ OMX_AUDIO_ChannelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_ChannelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_ChannelMax = 0x7FFFFFFF
+} OMX_AUDIO_CHANNELTYPE;
+
+#define OMX_AUDIO_MAXCHANNELS 16 /**< maximum number distinct audio channels that a buffer may contain */
+#define OMX_MIN_PCMPAYLOAD_MSEC 5 /**< Minimum audio buffer payload size for uncompressed (PCM) audio */
+
+/** PCM format description */
+typedef struct OMX_AUDIO_PARAM_PCMMODETYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels (e.g. 2 for stereo) */
+ OMX_NUMERICALDATATYPE eNumData; /**< indicates PCM data as signed or unsigned */
+ OMX_ENDIANTYPE eEndian; /**< indicates PCM data as little or big endian */
+ OMX_BOOL bInterleaved; /**< True for normal interleaved data; false for
+ non-interleaved data (e.g. block data) */
+ OMX_U32 nBitPerSample; /**< Bit per sample */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_AUDIO_PCMMODETYPE ePCMMode; /**< PCM mode enumeration */
+ OMX_AUDIO_CHANNELTYPE eChannelMapping[OMX_AUDIO_MAXCHANNELS]; /**< Slot i contains channel defined by eChannelMap[i] */
+
+} OMX_AUDIO_PARAM_PCMMODETYPE;
+
+
+/** Audio channel mode. This is used by both AAC and MP3, although the names are more appropriate
+ * for the MP3. For example, JointStereo for MP3 is CouplingChannels for AAC.
+ */
+typedef enum OMX_AUDIO_CHANNELMODETYPE {
+ OMX_AUDIO_ChannelModeStereo = 0, /**< 2 channels, the bitrate allocation between those
+ two channels changes accordingly to each channel information */
+ OMX_AUDIO_ChannelModeJointStereo, /**< mode that takes advantage of what is common between
+ 2 channels for higher compression gain */
+ OMX_AUDIO_ChannelModeDual, /**< 2 mono-channels, each channel is encoded with half
+ the bitrate of the overall bitrate */
+ OMX_AUDIO_ChannelModeMono, /**< Mono channel mode */
+ OMX_AUDIO_ChannelModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_ChannelModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_ChannelModeMax = 0x7FFFFFFF
+} OMX_AUDIO_CHANNELMODETYPE;
+
+
+typedef enum OMX_AUDIO_MP3STREAMFORMATTYPE {
+ OMX_AUDIO_MP3StreamFormatMP1Layer3 = 0, /**< MP3 Audio MPEG 1 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMP2Layer3, /**< MP3 Audio MPEG 2 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatMP2_5Layer3, /**< MP3 Audio MPEG2.5 Layer 3 Stream format */
+ OMX_AUDIO_MP3StreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MP3StreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MP3StreamFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_MP3STREAMFORMATTYPE;
+
+/** MP3 params */
+typedef struct OMX_AUDIO_PARAM_MP3TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+ OMX_AUDIO_MP3STREAMFORMATTYPE eFormat; /**< MP3 stream format */
+} OMX_AUDIO_PARAM_MP3TYPE;
+
+
+typedef enum OMX_AUDIO_AACSTREAMFORMATTYPE {
+ OMX_AUDIO_AACStreamFormatMP2ADTS = 0, /**< AAC Audio Data Transport Stream 2 format */
+ OMX_AUDIO_AACStreamFormatMP4ADTS, /**< AAC Audio Data Transport Stream 4 format */
+ OMX_AUDIO_AACStreamFormatMP4LOAS, /**< AAC Low Overhead Audio Stream format */
+ OMX_AUDIO_AACStreamFormatMP4LATM, /**< AAC Low overhead Audio Transport Multiplex */
+ OMX_AUDIO_AACStreamFormatADIF, /**< AAC Audio Data Interchange Format */
+ OMX_AUDIO_AACStreamFormatMP4FF, /**< AAC inside MPEG-4/ISO File Format */
+ OMX_AUDIO_AACStreamFormatRAW, /**< AAC Raw Format */
+ OMX_AUDIO_AACStreamFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AACStreamFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AACStreamFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_AACSTREAMFORMATTYPE;
+
+
+/** AAC mode type. Note that the term profile is used with the MPEG-2
+ * standard and the term object type and profile is used with MPEG-4 */
+typedef enum OMX_AUDIO_AACPROFILETYPE{
+ OMX_AUDIO_AACObjectNull = 0, /**< Null, not used */
+ OMX_AUDIO_AACObjectMain = 1, /**< AAC Main object */
+ OMX_AUDIO_AACObjectLC, /**< AAC Low Complexity object (AAC profile) */
+ OMX_AUDIO_AACObjectSSR, /**< AAC Scalable Sample Rate object */
+ OMX_AUDIO_AACObjectLTP, /**< AAC Long Term Prediction object */
+ OMX_AUDIO_AACObjectHE, /**< AAC High Efficiency (object type SBR, HE-AAC profile) */
+ OMX_AUDIO_AACObjectScalable, /**< AAC Scalable object */
+ OMX_AUDIO_AACObjectERLC = 17, /**< ER AAC Low Complexity object (Error Resilient AAC-LC) */
+ OMX_AUDIO_AACObjectLD = 23, /**< AAC Low Delay object (Error Resilient) */
+ OMX_AUDIO_AACObjectHE_PS = 29, /**< AAC High Efficiency with Parametric Stereo coding (HE-AAC v2, object type PS) */
+ OMX_AUDIO_AACObjectELD = 39, /** AAC Enhanced Low Delay. NOTE: Pending Khronos standardization **/
+ OMX_AUDIO_AACObjectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AACObjectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AACObjectMax = 0x7FFFFFFF
+} OMX_AUDIO_AACPROFILETYPE;
+
+
+/** AAC tool usage (for nAACtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
+ * Required for encoder configuration and optional as decoder info output.
+ * For MP3, OMX_AUDIO_CHANNELMODETYPE is sufficient. */
+#define OMX_AUDIO_AACToolNone 0x00000000 /**< no AAC tools allowed (encoder config) or active (decoder info output) */
+#define OMX_AUDIO_AACToolMS 0x00000001 /**< MS: Mid/side joint coding tool allowed or active */
+#define OMX_AUDIO_AACToolIS 0x00000002 /**< IS: Intensity stereo tool allowed or active */
+#define OMX_AUDIO_AACToolTNS 0x00000004 /**< TNS: Temporal Noise Shaping tool allowed or active */
+#define OMX_AUDIO_AACToolPNS 0x00000008 /**< PNS: MPEG-4 Perceptual Noise substitution tool allowed or active */
+#define OMX_AUDIO_AACToolLTP 0x00000010 /**< LTP: MPEG-4 Long Term Prediction tool allowed or active */
+#define OMX_AUDIO_AACToolAll 0x7FFFFFFF /**< all AAC tools allowed or active (*/
+
+/** MPEG-4 AAC error resilience (ER) tool usage (for nAACERtools in OMX_AUDIO_PARAM_AACPROFILETYPE).
+ * Required for ER encoder configuration and optional as decoder info output */
+#define OMX_AUDIO_AACERNone 0x00000000 /**< no AAC ER tools allowed/used */
+#define OMX_AUDIO_AACERVCB11 0x00000001 /**< VCB11: Virtual Code Books for AAC section data */
+#define OMX_AUDIO_AACERRVLC 0x00000002 /**< RVLC: Reversible Variable Length Coding */
+#define OMX_AUDIO_AACERHCR 0x00000004 /**< HCR: Huffman Codeword Reordering */
+#define OMX_AUDIO_AACERAll 0x7FFFFFFF /**< all AAC ER tools allowed/used */
+
+
+/** AAC params */
+typedef struct OMX_AUDIO_PARAM_AACPROFILETYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_U32 nFrameLength; /**< Frame length (in audio samples per channel) of the codec.
+ Can be 1024 or 960 (AAC-LC), 2048 (HE-AAC), 480 or 512 (AAC-LD).
+ Use 0 to let encoder decide */
+ OMX_U32 nAACtools; /**< AAC tool usage */
+ OMX_U32 nAACERtools; /**< MPEG-4 AAC error resilience tool usage */
+ OMX_AUDIO_AACPROFILETYPE eAACProfile; /**< AAC profile enumeration */
+ OMX_AUDIO_AACSTREAMFORMATTYPE eAACStreamFormat; /**< AAC stream format enumeration */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+} OMX_AUDIO_PARAM_AACPROFILETYPE;
+
+
+/** VORBIS params */
+typedef struct OMX_AUDIO_PARAM_VORBISTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the encoded data data. Use 0 for variable
+ rate or unknown bit rates. Encoding is set to the
+ bitrate closest to specified value (in bps) */
+ OMX_U32 nMinBitRate; /**< Sets minimum bitrate (in bps). */
+ OMX_U32 nMaxBitRate; /**< Sets maximum bitrate (in bps). */
+
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nAudioBandWidth; /**< Audio band width (in Hz) to which an encoder should
+ limit the audio signal. Use 0 to let encoder decide */
+ OMX_S32 nQuality; /**< Sets encoding quality to n, between -1 (low) and 10 (high).
+ In the default mode of operation, teh quality level is 3.
+ Normal quality range is 0 - 10. */
+ OMX_BOOL bManaged; /**< Set bitrate management mode. This turns off the
+ normal VBR encoding, but allows hard or soft bitrate
+ constraints to be enforced by the encoder. This mode can
+ be slower, and may also be lower quality. It is
+ primarily useful for streaming. */
+ OMX_BOOL bDownmix; /**< Downmix input from stereo to mono (has no effect on
+ non-stereo streams). Useful for lower-bitrate encoding. */
+} OMX_AUDIO_PARAM_VORBISTYPE;
+
+
+/** FLAC params */
+typedef struct OMX_AUDIO_PARAM_FLACTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ unknown sampling rate. */
+ OMX_U32 nCompressionLevel;/**< FLAC compression level, from 0 (fastest compression)
+ to 8 (highest compression */
+} OMX_AUDIO_PARAM_FLACTYPE;
+
+
+/** WMA Version */
+typedef enum OMX_AUDIO_WMAFORMATTYPE {
+ OMX_AUDIO_WMAFormatUnused = 0, /**< format unused or unknown */
+ OMX_AUDIO_WMAFormat7, /**< Windows Media Audio format 7 */
+ OMX_AUDIO_WMAFormat8, /**< Windows Media Audio format 8 */
+ OMX_AUDIO_WMAFormat9, /**< Windows Media Audio format 9 */
+ OMX_AUDIO_WMAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_WMAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_WMAFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_WMAFORMATTYPE;
+
+
+/** WMA Profile */
+typedef enum OMX_AUDIO_WMAPROFILETYPE {
+ OMX_AUDIO_WMAProfileUnused = 0, /**< profile unused or unknown */
+ OMX_AUDIO_WMAProfileL1, /**< Windows Media audio version 9 profile L1 */
+ OMX_AUDIO_WMAProfileL2, /**< Windows Media audio version 9 profile L2 */
+ OMX_AUDIO_WMAProfileL3, /**< Windows Media audio version 9 profile L3 */
+ OMX_AUDIO_WMAProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_WMAProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_WMAProfileMax = 0x7FFFFFFF
+} OMX_AUDIO_WMAPROFILETYPE;
+
+
+/** WMA params */
+typedef struct OMX_AUDIO_PARAM_WMATYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_AUDIO_WMAFORMATTYPE eFormat; /**< Version of WMA stream / data */
+ OMX_AUDIO_WMAPROFILETYPE eProfile; /**< Profile of WMA stream / data */
+ OMX_U32 nSamplingRate; /**< Sampling rate of the source data */
+ OMX_U16 nBlockAlign; /**< is the block alignment, or block size, in bytes of the audio codec */
+ OMX_U16 nEncodeOptions; /**< WMA Type-specific data */
+ OMX_U32 nSuperBlockAlign; /**< WMA Type-specific data */
+} OMX_AUDIO_PARAM_WMATYPE;
+
+/**
+ * RealAudio format
+ */
+typedef enum OMX_AUDIO_RAFORMATTYPE {
+ OMX_AUDIO_RAFormatUnused = 0, /**< Format unused or unknown */
+ OMX_AUDIO_RA8, /**< RealAudio 8 codec */
+ OMX_AUDIO_RA9, /**< RealAudio 9 codec */
+ OMX_AUDIO_RA10_AAC, /**< MPEG-4 AAC codec for bitrates of more than 128kbps */
+ OMX_AUDIO_RA10_CODEC, /**< RealAudio codec for bitrates less than 128 kbps */
+ OMX_AUDIO_RA10_LOSSLESS, /**< RealAudio Lossless */
+ OMX_AUDIO_RA10_MULTICHANNEL, /**< RealAudio Multichannel */
+ OMX_AUDIO_RA10_VOICE, /**< RealAudio Voice for bitrates below 15 kbps */
+ OMX_AUDIO_RAFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_RAFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_RAFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_RAFORMATTYPE;
+
+/** RA (Real Audio) params */
+typedef struct OMX_AUDIO_PARAM_RATYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nSamplingRate; /**< is the sampling rate of the source data */
+ OMX_U32 nBitsPerFrame; /**< is the value for bits per frame */
+ OMX_U32 nSamplePerFrame; /**< is the value for samples per frame */
+ OMX_U32 nCouplingQuantBits; /**< is the number of coupling quantization bits in the stream */
+ OMX_U32 nCouplingStartRegion; /**< is the coupling start region in the stream */
+ OMX_U32 nNumRegions; /**< is the number of regions value */
+ OMX_AUDIO_RAFORMATTYPE eFormat; /**< is the RealAudio audio format */
+} OMX_AUDIO_PARAM_RATYPE;
+
+
+/** SBC Allocation Method Type */
+typedef enum OMX_AUDIO_SBCALLOCMETHODTYPE {
+ OMX_AUDIO_SBCAllocMethodLoudness, /**< Loudness allocation method */
+ OMX_AUDIO_SBCAllocMethodSNR, /**< SNR allocation method */
+ OMX_AUDIO_SBCAllocMethodKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_SBCAllocMethodVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_SBCAllocMethodMax = 0x7FFFFFFF
+} OMX_AUDIO_SBCALLOCMETHODTYPE;
+
+
+/** SBC params */
+typedef struct OMX_AUDIO_PARAM_SBCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+ OMX_U32 nBlocks; /**< Number of blocks */
+ OMX_U32 nSubbands; /**< Number of subbands */
+ OMX_U32 nBitPool; /**< Bitpool value */
+ OMX_BOOL bEnableBitrate; /**< Use bitrate value instead of bitpool */
+ OMX_AUDIO_CHANNELMODETYPE eChannelMode; /**< Channel mode enumeration */
+ OMX_AUDIO_SBCALLOCMETHODTYPE eSBCAllocType; /**< SBC Allocation method type */
+} OMX_AUDIO_PARAM_SBCTYPE;
+
+
+/** ADPCM stream format parameters */
+typedef struct OMX_AUDIO_PARAM_ADPCMTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_U32 nBitsPerSample; /**< Number of bits in each sample */
+ OMX_U32 nSampleRate; /**< Sampling rate of the source data. Use 0 for
+ variable or unknown sampling rate. */
+} OMX_AUDIO_PARAM_ADPCMTYPE;
+
+
+/** G723 rate */
+typedef enum OMX_AUDIO_G723RATE {
+ OMX_AUDIO_G723ModeUnused = 0, /**< AMRNB Mode unused / unknown */
+ OMX_AUDIO_G723ModeLow, /**< 5300 bps */
+ OMX_AUDIO_G723ModeHigh, /**< 6300 bps */
+ OMX_AUDIO_G723ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_G723ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_G723ModeMax = 0x7FFFFFFF
+} OMX_AUDIO_G723RATE;
+
+
+/** G723 - Sample rate must be 8 KHz */
+typedef struct OMX_AUDIO_PARAM_G723TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_AUDIO_G723RATE eBitRate; /**< todo: Should this be moved to a config? */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+ OMX_BOOL bPostFilter; /**< Enable Post Filter */
+} OMX_AUDIO_PARAM_G723TYPE;
+
+
+/** ITU G726 (ADPCM) rate */
+typedef enum OMX_AUDIO_G726MODE {
+ OMX_AUDIO_G726ModeUnused = 0, /**< G726 Mode unused / unknown */
+ OMX_AUDIO_G726Mode16, /**< 16 kbps */
+ OMX_AUDIO_G726Mode24, /**< 24 kbps */
+ OMX_AUDIO_G726Mode32, /**< 32 kbps, most common rate, also G721 */
+ OMX_AUDIO_G726Mode40, /**< 40 kbps */
+ OMX_AUDIO_G726ModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_G726ModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_G726ModeMax = 0x7FFFFFFF
+} OMX_AUDIO_G726MODE;
+
+
+/** G.726 stream format parameters - must be at 8KHz */
+typedef struct OMX_AUDIO_PARAM_G726TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_G726MODE eG726Mode;
+} OMX_AUDIO_PARAM_G726TYPE;
+
+
+/** G729 coder type */
+typedef enum OMX_AUDIO_G729TYPE {
+ OMX_AUDIO_G729 = 0, /**< ITU G.729 encoded data */
+ OMX_AUDIO_G729A, /**< ITU G.729 annex A encoded data */
+ OMX_AUDIO_G729B, /**< ITU G.729 with annex B encoded data */
+ OMX_AUDIO_G729AB, /**< ITU G.729 annexes A and B encoded data */
+ OMX_AUDIO_G729KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_G729VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_G729Max = 0x7FFFFFFF
+} OMX_AUDIO_G729TYPE;
+
+
+/** G729 stream format parameters - fixed 6KHz sample rate */
+typedef struct OMX_AUDIO_PARAM_G729TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_AUDIO_G729TYPE eBitType;
+} OMX_AUDIO_PARAM_G729TYPE;
+
+
+/** AMR Frame format */
+typedef enum OMX_AUDIO_AMRFRAMEFORMATTYPE {
+ OMX_AUDIO_AMRFrameFormatConformance = 0, /**< Frame Format is AMR Conformance
+ (Standard) Format */
+ OMX_AUDIO_AMRFrameFormatIF1, /**< Frame Format is AMR Interface
+ Format 1 */
+ OMX_AUDIO_AMRFrameFormatIF2, /**< Frame Format is AMR Interface
+ Format 2*/
+ OMX_AUDIO_AMRFrameFormatFSF, /**< Frame Format is AMR File Storage
+ Format */
+ OMX_AUDIO_AMRFrameFormatRTPPayload, /**< Frame Format is AMR Real-Time
+ Transport Protocol Payload Format */
+ OMX_AUDIO_AMRFrameFormatITU, /**< Frame Format is ITU Format (added at Motorola request) */
+ OMX_AUDIO_AMRFrameFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AMRFrameFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AMRFrameFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRFRAMEFORMATTYPE;
+
+
+/** AMR band mode */
+typedef enum OMX_AUDIO_AMRBANDMODETYPE {
+ OMX_AUDIO_AMRBandModeUnused = 0, /**< AMRNB Mode unused / unknown */
+ OMX_AUDIO_AMRBandModeNB0, /**< AMRNB Mode 0 = 4750 bps */
+ OMX_AUDIO_AMRBandModeNB1, /**< AMRNB Mode 1 = 5150 bps */
+ OMX_AUDIO_AMRBandModeNB2, /**< AMRNB Mode 2 = 5900 bps */
+ OMX_AUDIO_AMRBandModeNB3, /**< AMRNB Mode 3 = 6700 bps */
+ OMX_AUDIO_AMRBandModeNB4, /**< AMRNB Mode 4 = 7400 bps */
+ OMX_AUDIO_AMRBandModeNB5, /**< AMRNB Mode 5 = 7950 bps */
+ OMX_AUDIO_AMRBandModeNB6, /**< AMRNB Mode 6 = 10200 bps */
+ OMX_AUDIO_AMRBandModeNB7, /**< AMRNB Mode 7 = 12200 bps */
+ OMX_AUDIO_AMRBandModeWB0, /**< AMRWB Mode 0 = 6600 bps */
+ OMX_AUDIO_AMRBandModeWB1, /**< AMRWB Mode 1 = 8850 bps */
+ OMX_AUDIO_AMRBandModeWB2, /**< AMRWB Mode 2 = 12650 bps */
+ OMX_AUDIO_AMRBandModeWB3, /**< AMRWB Mode 3 = 14250 bps */
+ OMX_AUDIO_AMRBandModeWB4, /**< AMRWB Mode 4 = 15850 bps */
+ OMX_AUDIO_AMRBandModeWB5, /**< AMRWB Mode 5 = 18250 bps */
+ OMX_AUDIO_AMRBandModeWB6, /**< AMRWB Mode 6 = 19850 bps */
+ OMX_AUDIO_AMRBandModeWB7, /**< AMRWB Mode 7 = 23050 bps */
+ OMX_AUDIO_AMRBandModeWB8, /**< AMRWB Mode 8 = 23850 bps */
+ OMX_AUDIO_AMRBandModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AMRBandModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AMRBandModeMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRBANDMODETYPE;
+
+
+/** AMR Discontinuous Transmission mode */
+typedef enum OMX_AUDIO_AMRDTXMODETYPE {
+ OMX_AUDIO_AMRDTXModeOff = 0, /**< AMR Discontinuous Transmission Mode is disabled */
+ OMX_AUDIO_AMRDTXModeOnVAD1, /**< AMR Discontinuous Transmission Mode using
+ Voice Activity Detector 1 (VAD1) is enabled */
+ OMX_AUDIO_AMRDTXModeOnVAD2, /**< AMR Discontinuous Transmission Mode using
+ Voice Activity Detector 2 (VAD2) is enabled */
+ OMX_AUDIO_AMRDTXModeOnAuto, /**< The codec will automatically select between
+ Off, VAD1 or VAD2 modes */
+
+ OMX_AUDIO_AMRDTXasEFR, /**< DTX as EFR instead of AMR standard (3GPP 26.101, frame type =8,9,10) */
+
+ OMX_AUDIO_AMRDTXModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_AMRDTXModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_AMRDTXModeMax = 0x7FFFFFFF
+} OMX_AUDIO_AMRDTXMODETYPE;
+
+
+/** AMR params */
+typedef struct OMX_AUDIO_PARAM_AMRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels */
+ OMX_U32 nBitRate; /**< Bit rate read only field */
+ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode; /**< AMR Band Mode enumeration */
+ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode; /**< AMR DTX Mode enumeration */
+ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat; /**< AMR frame format enumeration */
+} OMX_AUDIO_PARAM_AMRTYPE;
+
+
+/** GSM_FR (ETSI 06.10, 3GPP 46.010) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMFRTYPE;
+
+
+/** GSM-HR (ETSI 06.20, 3GPP 46.020) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMHRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMHRTYPE;
+
+
+/** GSM-EFR (ETSI 06.60, 3GPP 46.060) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_GSMEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_GSMEFRTYPE;
+
+
+/** TDMA FR (TIA/EIA-136-420, VSELP 7.95kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_TDMAFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_TDMAFRTYPE;
+
+
+/** TDMA EFR (TIA/EIA-136-410, ACELP 7.4kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_TDMAEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_TDMAEFRTYPE;
+
+
+/** PDC FR ( RCR-27, VSELP 6.7kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCFRTYPE;
+
+
+/** PDC EFR ( RCR-27, ACELP 6.7kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCEFRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCEFRTYPE;
+
+/** PDC HR ( RCR-27, PSI-CELP 3.45kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_PDCHRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_BOOL bDTX; /**< Enable Discontinuous Transmisssion */
+ OMX_BOOL bHiPassFilter; /**< Enable High Pass Filter */
+} OMX_AUDIO_PARAM_PDCHRTYPE;
+
+
+/** CDMA Rate types */
+typedef enum OMX_AUDIO_CDMARATETYPE {
+ OMX_AUDIO_CDMARateBlank = 0, /**< CDMA encoded frame is blank */
+ OMX_AUDIO_CDMARateFull, /**< CDMA encoded frame in full rate */
+ OMX_AUDIO_CDMARateHalf, /**< CDMA encoded frame in half rate */
+ OMX_AUDIO_CDMARateQuarter, /**< CDMA encoded frame in quarter rate */
+ OMX_AUDIO_CDMARateEighth, /**< CDMA encoded frame in eighth rate (DTX)*/
+ OMX_AUDIO_CDMARateErasure, /**< CDMA erasure frame */
+ OMX_AUDIO_CDMARateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_CDMARateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_CDMARateMax = 0x7FFFFFFF
+} OMX_AUDIO_CDMARATETYPE;
+
+
+/** QCELP8 (TIA/EIA-96, up to 8kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_QCELP8TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_U32 nBitRate; /**< Bit rate of the input data. Use 0 for variable
+ rate or unknown bit rates */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+} OMX_AUDIO_PARAM_QCELP8TYPE;
+
+
+/** QCELP13 ( CDMA, EIA/TIA-733, 13.3kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_QCELP13TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+} OMX_AUDIO_PARAM_QCELP13TYPE;
+
+
+/** EVRC ( CDMA, EIA/TIA-127, RCELP up to 8.55kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_EVRCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< actual Frame rate */
+ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 */
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 */
+ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter */
+ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
+ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter */
+} OMX_AUDIO_PARAM_EVRCTYPE;
+
+
+/** SMV ( up to 8.55kbps coder) stream format parameters */
+typedef struct OMX_AUDIO_PARAM_SMVTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannels; /**< Number of channels in the data stream (not
+ necessarily the same as the number of channels
+ to be rendered. */
+ OMX_AUDIO_CDMARATETYPE eCDMARate; /**< Frame rate */
+ OMX_BOOL bRATE_REDUCon; /**< RATE_REDUCtion is requested for this frame */
+ OMX_U32 nMinBitRate; /**< minmal rate for the encoder = 1,2,3,4, default = 1 ??*/
+ OMX_U32 nMaxBitRate; /**< maximal rate for the encoder = 1,2,3,4, default = 4 ??*/
+ OMX_BOOL bHiPassFilter; /**< Enable encoder's High Pass Filter ??*/
+ OMX_BOOL bNoiseSuppressor; /**< Enable encoder's noise suppressor pre-processing */
+ OMX_BOOL bPostFilter; /**< Enable decoder's post Filter ??*/
+} OMX_AUDIO_PARAM_SMVTYPE;
+
+
+/** MIDI Format
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDIFORMATTYPE
+{
+ OMX_AUDIO_MIDIFormatUnknown = 0, /**< MIDI Format unknown or don't care */
+ OMX_AUDIO_MIDIFormatSMF0, /**< Standard MIDI File Type 0 */
+ OMX_AUDIO_MIDIFormatSMF1, /**< Standard MIDI File Type 1 */
+ OMX_AUDIO_MIDIFormatSMF2, /**< Standard MIDI File Type 2 */
+ OMX_AUDIO_MIDIFormatSPMIDI, /**< SP-MIDI */
+ OMX_AUDIO_MIDIFormatXMF0, /**< eXtensible Music Format type 0 */
+ OMX_AUDIO_MIDIFormatXMF1, /**< eXtensible Music Format type 1 */
+ OMX_AUDIO_MIDIFormatMobileXMF, /**< Mobile XMF (eXtensible Music Format type 2) */
+ OMX_AUDIO_MIDIFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDIFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDIFormatMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDIFORMATTYPE;
+
+
+/** MIDI params
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_PARAM_MIDITYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nFileSize; /**< size of the MIDI file in bytes, where the entire
+ MIDI file passed in, otherwise if 0x0, the MIDI data
+ is merged and streamed (instead of passed as an
+ entire MIDI file) */
+ OMX_BU32 sMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
+ voices. A value of zero indicates that the default
+ polyphony of the device is used */
+ OMX_BOOL bLoadDefaultSound; /**< Whether to load default sound
+ bank at initialization */
+ OMX_AUDIO_MIDIFORMATTYPE eMidiFormat; /**< Version of the MIDI file */
+} OMX_AUDIO_PARAM_MIDITYPE;
+
+
+/** Type of the MIDI sound bank
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDISOUNDBANKTYPE {
+ OMX_AUDIO_MIDISoundBankUnused = 0, /**< unused/unknown soundbank type */
+ OMX_AUDIO_MIDISoundBankDLS1, /**< DLS version 1 */
+ OMX_AUDIO_MIDISoundBankDLS2, /**< DLS version 2 */
+ OMX_AUDIO_MIDISoundBankMobileDLSBase, /**< Mobile DLS, using the base functionality */
+ OMX_AUDIO_MIDISoundBankMobileDLSPlusOptions, /**< Mobile DLS, using the specification-defined optional feature set */
+ OMX_AUDIO_MIDISoundBankKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDISoundBankVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDISoundBankMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDISOUNDBANKTYPE;
+
+
+/** Bank Layout describes how bank MSB & LSB are used in the DLS instrument definitions sound bank
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE {
+ OMX_AUDIO_MIDISoundBankLayoutUnused = 0, /**< unused/unknown soundbank type */
+ OMX_AUDIO_MIDISoundBankLayoutGM, /**< GS layout (based on bank MSB 0x00) */
+ OMX_AUDIO_MIDISoundBankLayoutGM2, /**< General MIDI 2 layout (using MSB 0x78/0x79, LSB 0x00) */
+ OMX_AUDIO_MIDISoundBankLayoutUser, /**< Does not conform to any bank numbering standards */
+ OMX_AUDIO_MIDISoundBankLayoutKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDISoundBankLayoutVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDISoundBankLayoutMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE;
+
+
+/** MIDI params to load/unload user soundbank
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nDLSIndex; /**< DLS file index to be loaded */
+ OMX_U32 nDLSSize; /**< Size in bytes */
+ OMX_PTR pDLSData; /**< Pointer to DLS file data */
+ OMX_AUDIO_MIDISOUNDBANKTYPE eMidiSoundBank; /**< Midi sound bank type enumeration */
+ OMX_AUDIO_MIDISOUNDBANKLAYOUTTYPE eMidiSoundBankLayout; /**< Midi sound bank layout enumeration */
+} OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE;
+
+
+/** Structure for Live MIDI events and MIP messages.
+ * (MIP = Maximum Instantaneous Polyphony; part of the SP-MIDI standard.)
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nMidiEventSize; /**< Size of immediate MIDI events or MIP message in bytes */
+ OMX_U8 nMidiEvents[1]; /**< MIDI event array to be rendered immediately, or an
+ array for the MIP message buffer, where the size is
+ indicated by nMidiEventSize */
+} OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE;
+
+
+/** MIDI sound bank/ program pair in a given channel
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_U32 nChannel; /**< Valid channel values range from 1 to 16 */
+ OMX_U16 nIDProgram; /**< Valid program ID range is 1 to 128 */
+ OMX_U16 nIDSoundBank; /**< Sound bank ID */
+ OMX_U32 nUserSoundBankIndex;/**< User soundbank index, easier to access soundbanks
+ by index if multiple banks are present */
+} OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE;
+
+
+/** MIDI control
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDICONTROLTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BS32 sPitchTransposition; /**< Pitch transposition in semitones, stored as Q22.10
+ format based on JAVA MMAPI (JSR-135) requirement */
+ OMX_BU32 sPlayBackRate; /**< Relative playback rate, stored as Q14.17 fixed-point
+ number based on JSR-135 requirement */
+ OMX_BU32 sTempo ; /**< Tempo in beats per minute (BPM), stored as Q22.10
+ fixed-point number based on JSR-135 requirement */
+ OMX_U32 nMaxPolyphony; /**< Specifies the maximum simultaneous polyphonic
+ voices. A value of zero indicates that the default
+ polyphony of the device is used */
+ OMX_U32 nNumRepeat; /**< Number of times to repeat playback */
+ OMX_U32 nStopTime; /**< Time in milliseconds to indicate when playback
+ will stop automatically. Set to zero if not used */
+ OMX_U16 nChannelMuteMask; /**< 16 bit mask for channel mute status */
+ OMX_U16 nChannelSoloMask; /**< 16 bit mask for channel solo status */
+ OMX_U32 nTrack0031MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 0-31 */
+ OMX_U32 nTrack3263MuteMask; /**< 32 bit mask for track mute status. Note: This is for tracks 32-63 */
+ OMX_U32 nTrack0031SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 0-31 */
+ OMX_U32 nTrack3263SoloMask; /**< 32 bit mask for track solo status. Note: This is for tracks 32-63 */
+
+} OMX_AUDIO_CONFIG_MIDICONTROLTYPE;
+
+
+/** MIDI Playback States
+ * @ingroup midi
+ */
+typedef enum OMX_AUDIO_MIDIPLAYBACKSTATETYPE {
+ OMX_AUDIO_MIDIPlayBackStateUnknown = 0, /**< Unknown state or state does not map to
+ other defined states */
+ OMX_AUDIO_MIDIPlayBackStateClosedEngaged, /**< No MIDI resource is currently open.
+ The MIDI engine is currently processing
+ MIDI events. */
+ OMX_AUDIO_MIDIPlayBackStateParsing, /**< A MIDI resource is open and is being
+ primed. The MIDI engine is currently
+ processing MIDI events. */
+ OMX_AUDIO_MIDIPlayBackStateOpenEngaged, /**< A MIDI resource is open and primed but
+ not playing. The MIDI engine is currently
+ processing MIDI events. The transition to
+ this state is only possible from the
+ OMX_AUDIO_MIDIPlayBackStatePlaying state,
+ when the 'playback head' reaches the end
+ of media data or the playback stops due
+ to stop time set.*/
+ OMX_AUDIO_MIDIPlayBackStatePlaying, /**< A MIDI resource is open and currently
+ playing. The MIDI engine is currently
+ processing MIDI events.*/
+ OMX_AUDIO_MIDIPlayBackStatePlayingPartially, /**< Best-effort playback due to SP-MIDI/DLS
+ resource constraints */
+ OMX_AUDIO_MIDIPlayBackStatePlayingSilently, /**< Due to system resource constraints and
+ SP-MIDI content constraints, there is
+ no audible MIDI content during playback
+ currently. The situation may change if
+ resources are freed later.*/
+ OMX_AUDIO_MIDIPlayBackStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_MIDIPlayBackStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_MIDIPlayBackStateMax = 0x7FFFFFFF
+} OMX_AUDIO_MIDIPLAYBACKSTATETYPE;
+
+
+/** MIDI status
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDISTATUSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U16 nNumTracks; /**< Number of MIDI tracks in the file, read only field.
+ NOTE: May not return a meaningful value until the entire
+ file is parsed and buffered. */
+ OMX_U32 nDuration; /**< The length of the currently open MIDI resource
+ in milliseconds. NOTE: May not return a meaningful value
+ until the entire file is parsed and buffered. */
+ OMX_U32 nPosition; /**< Current Position of the MIDI resource being played
+ in milliseconds */
+ OMX_BOOL bVibra; /**< Does Vibra track exist? NOTE: May not return a meaningful
+ value until the entire file is parsed and buffered. */
+ OMX_U32 nNumMetaEvents; /**< Total number of MIDI Meta Events in the currently
+ open MIDI resource. NOTE: May not return a meaningful value
+ until the entire file is parsed and buffered. */
+ OMX_U32 nNumActiveVoices; /**< Number of active voices in the currently playing
+ MIDI resource. NOTE: May not return a meaningful value until
+ the entire file is parsed and buffered. */
+ OMX_AUDIO_MIDIPLAYBACKSTATETYPE eMIDIPlayBackState; /**< MIDI playback state enumeration, read only field */
+} OMX_AUDIO_CONFIG_MIDISTATUSTYPE;
+
+
+/** MIDI Meta Event structure one per Meta Event.
+ * MIDI Meta Events are like audio metadata, except that they are interspersed
+ * with the MIDI content throughout the file and are not localized in the header.
+ * As such, it is necessary to retrieve information about these Meta Events from
+ * the engine, as it encounters these Meta Events within the MIDI content.
+ * For example, SMF files can have up to 14 types of MIDI Meta Events (copyright,
+ * author, default tempo, etc.) scattered throughout the file.
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nIndex; /**< Index of Meta Event */
+ OMX_U8 nMetaEventType; /**< Meta Event Type, 7bits (i.e. 0 - 127) */
+ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
+ OMX_U32 nTrack; /**< track number for the meta event */
+ OMX_U32 nPosition; /**< Position of the meta-event in milliseconds */
+} OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE;
+
+
+/** MIDI Meta Event Data structure - one per Meta Event.
+ * @ingroup midi
+ */
+typedef struct OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nIndex; /**< Index of Meta Event */
+ OMX_U32 nMetaEventSize; /**< size of the Meta Event in bytes */
+ OMX_U8 nData[1]; /**< array of one or more bytes of meta data
+ as indicated by the nMetaEventSize field */
+} OMX_AUDIO_CONFIG__MIDIMETAEVENTDATATYPE;
+
+
+/** Audio Volume adjustment for a port */
+typedef struct OMX_AUDIO_CONFIG_VOLUMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's volume. Select the
+ output port to adjust the master
+ volume. */
+ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100)
+ or logarithmic scale (mB) */
+ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
+ Volume logarithmic setting for this port. The values
+ for volume are in mB (millibels = 1/100 dB) relative
+ to a gain of 1 (e.g. the output is the same as the
+ input level). Values are in mB from nMax
+ (maximum volume) to nMin mB (typically negative).
+ Since the volume is "voltage"
+ and not a "power", it takes a setting of
+ -600 mB to decrease the volume by 1/2. If
+ a component cannot accurately set the
+ volume to the requested value, it must
+ set the volume to the closest value BELOW
+ the requested value. When getting the
+ volume setting, the current actual volume
+ must be returned. */
+} OMX_AUDIO_CONFIG_VOLUMETYPE;
+
+
+/** Audio Volume adjustment for a channel */
+typedef struct OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's volume. Select the
+ output port to adjust the master
+ volume. */
+ OMX_U32 nChannel; /**< channel to select from 0 to N-1,
+ using OMX_ALL to apply volume settings
+ to all channels */
+ OMX_BOOL bLinear; /**< Is the volume to be set in linear (0.100) or
+ logarithmic scale (mB) */
+ OMX_BS32 sVolume; /**< Volume linear setting in the 0..100 range, OR
+ Volume logarithmic setting for this port.
+ The values for volume are in mB
+ (millibels = 1/100 dB) relative to a gain
+ of 1 (e.g. the output is the same as the
+ input level). Values are in mB from nMax
+ (maximum volume) to nMin mB (typically negative).
+ Since the volume is "voltage"
+ and not a "power", it takes a setting of
+ -600 mB to decrease the volume by 1/2. If
+ a component cannot accurately set the
+ volume to the requested value, it must
+ set the volume to the closest value BELOW
+ the requested value. When getting the
+ volume setting, the current actual volume
+ must be returned. */
+ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
+ FALSE otherwise */
+} OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE;
+
+
+/** Audio balance setting */
+typedef struct OMX_AUDIO_CONFIG_BALANCETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's balance. Select the
+ output port to adjust the master
+ balance. */
+ OMX_S32 nBalance; /**< balance setting for this port
+ (-100 to 100, where -100 indicates
+ all left, and no right */
+} OMX_AUDIO_CONFIG_BALANCETYPE;
+
+
+/** Audio Port mute */
+typedef struct OMX_AUDIO_CONFIG_MUTETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port index indicating which port to
+ set. Select the input port to set
+ just that port's mute. Select the
+ output port to adjust the master
+ mute. */
+ OMX_BOOL bMute; /**< Mute setting for this port */
+} OMX_AUDIO_CONFIG_MUTETYPE;
+
+
+/** Audio Channel mute */
+typedef struct OMX_AUDIO_CONFIG_CHANNELMUTETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nChannel; /**< channel to select from 0 to N-1,
+ using OMX_ALL to apply mute settings
+ to all channels */
+ OMX_BOOL bMute; /**< Mute setting for this channel */
+ OMX_BOOL bIsMIDI; /**< TRUE if nChannel refers to a MIDI channel,
+ FALSE otherwise */
+} OMX_AUDIO_CONFIG_CHANNELMUTETYPE;
+
+
+
+/** Enable / Disable for loudness control, which boosts bass and to a
+ * smaller extent high end frequencies to compensate for hearing
+ * ability at the extreme ends of the audio spectrum
+ */
+typedef struct OMX_AUDIO_CONFIG_LOUDNESSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bLoudness; /**< Enable/disable for loudness */
+} OMX_AUDIO_CONFIG_LOUDNESSTYPE;
+
+
+/** Enable / Disable for bass, which controls low frequencies
+ */
+typedef struct OMX_AUDIO_CONFIG_BASSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for bass control */
+ OMX_S32 nBass; /**< bass setting for the port, as a
+ continuous value from -100 to 100
+ (0 means no change in bass level)*/
+} OMX_AUDIO_CONFIG_BASSTYPE;
+
+
+/** Enable / Disable for treble, which controls high frequencies tones
+ */
+typedef struct OMX_AUDIO_CONFIG_TREBLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for treble control */
+ OMX_S32 nTreble; /**< treble setting for the port, as a
+ continuous value from -100 to 100
+ (0 means no change in treble level) */
+} OMX_AUDIO_CONFIG_TREBLETYPE;
+
+
+/** An equalizer is typically used for two reasons: to compensate for an
+ * sub-optimal frequency response of a system to make it sound more natural
+ * or to create intentionally some unnatural coloring to the sound to create
+ * an effect.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_EQUALIZERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for equalizer */
+ OMX_BU32 sBandIndex; /**< Band number to be set. Upper Limit is
+ N-1, where N is the number of bands, lower limit is 0 */
+ OMX_BU32 sCenterFreq; /**< Center frequecies in Hz. This is a
+ read only element and is used to determine
+ the lower, center and upper frequency of
+ this band. */
+ OMX_BS32 sBandLevel; /**< band level in millibels */
+} OMX_AUDIO_CONFIG_EQUALIZERTYPE;
+
+
+/** Stereo widening mode type
+ * @ingroup effects
+ */
+typedef enum OMX_AUDIO_STEREOWIDENINGTYPE {
+ OMX_AUDIO_StereoWideningHeadphones, /**< Stereo widening for loudspeakers */
+ OMX_AUDIO_StereoWideningLoudspeakers, /**< Stereo widening for closely spaced loudspeakers */
+ OMX_AUDIO_StereoWideningKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_StereoWideningVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_StereoWideningMax = 0x7FFFFFFF
+} OMX_AUDIO_STEREOWIDENINGTYPE;
+
+
+/** Control for stereo widening, which is a special 2-channel
+ * case of the audio virtualizer effect. For example, for 5.1-channel
+ * output, it translates to virtual surround sound.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for stereo widening control */
+ OMX_AUDIO_STEREOWIDENINGTYPE eWideningType; /**< Stereo widening algorithm type */
+ OMX_U32 nStereoWidening; /**< stereo widening setting for the port,
+ as a continuous value from 0 to 100 */
+} OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE;
+
+
+/** The chorus effect (or ``choralizer'') is any signal processor which makes
+ * one sound source (such as a voice) sound like many such sources singing
+ * (or playing) in unison. Since performance in unison is never exact, chorus
+ * effects simulate this by making independently modified copies of the input
+ * signal. Modifications may include (1) delay, (2) frequency shift, and
+ * (3) amplitude modulation.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_CHORUSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for chorus */
+ OMX_BU32 sDelay; /**< average delay in milliseconds */
+ OMX_BU32 sModulationRate; /**< rate of modulation in millihertz */
+ OMX_U32 nModulationDepth; /**< depth of modulation as a percentage of
+ delay (i.e. 0 to 100) */
+ OMX_BU32 nFeedback; /**< Feedback from chorus output to input in percentage */
+} OMX_AUDIO_CONFIG_CHORUSTYPE;
+
+
+/** Reverberation is part of the reflected sound that follows the early
+ * reflections. In a typical room, this consists of a dense succession of
+ * echoes whose energy decays exponentially. The reverberation effect structure
+ * as defined here includes both (early) reflections as well as (late) reverberations.
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_REVERBERATIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bEnable; /**< Enable/disable for reverberation control */
+ OMX_BS32 sRoomLevel; /**< Intensity level for the whole room effect
+ (i.e. both early reflections and late
+ reverberation) in millibels */
+ OMX_BS32 sRoomHighFreqLevel; /**< Attenuation at high frequencies
+ relative to the intensity at low
+ frequencies in millibels */
+ OMX_BS32 sReflectionsLevel; /**< Intensity level of early reflections
+ (relative to room value), in millibels */
+ OMX_BU32 sReflectionsDelay; /**< Delay time of the first reflection relative
+ to the direct path, in milliseconds */
+ OMX_BS32 sReverbLevel; /**< Intensity level of late reverberation
+ relative to room level, in millibels */
+ OMX_BU32 sReverbDelay; /**< Time delay from the first early reflection
+ to the beginning of the late reverberation
+ section, in milliseconds */
+ OMX_BU32 sDecayTime; /**< Late reverberation decay time at low
+ frequencies, in milliseconds */
+ OMX_BU32 nDecayHighFreqRatio; /**< Ratio of high frequency decay time relative
+ to low frequency decay time in percent */
+ OMX_U32 nDensity; /**< Modal density in the late reverberation decay,
+ in percent (i.e. 0 - 100) */
+ OMX_U32 nDiffusion; /**< Echo density in the late reverberation decay,
+ in percent (i.e. 0 - 100) */
+ OMX_BU32 sReferenceHighFreq; /**< Reference high frequency in Hertz. This is
+ the frequency used as the reference for all
+ the high-frequency settings above */
+
+} OMX_AUDIO_CONFIG_REVERBERATIONTYPE;
+
+
+/** Possible settings for the Echo Cancelation structure to use
+ * @ingroup effects
+ */
+typedef enum OMX_AUDIO_ECHOCANTYPE {
+ OMX_AUDIO_EchoCanOff = 0, /**< Echo Cancellation is disabled */
+ OMX_AUDIO_EchoCanNormal, /**< Echo Cancellation normal operation -
+ echo from plastics and face */
+ OMX_AUDIO_EchoCanHFree, /**< Echo Cancellation optimized for
+ Hands Free operation */
+ OMX_AUDIO_EchoCanCarKit, /**< Echo Cancellation optimized for
+ Car Kit (longer echo) */
+ OMX_AUDIO_EchoCanKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_AUDIO_EchoCanVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_AUDIO_EchoCanMax = 0x7FFFFFFF
+} OMX_AUDIO_ECHOCANTYPE;
+
+
+/** Enable / Disable for echo cancelation, which removes undesired echo's
+ * from the audio
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_AUDIO_ECHOCANTYPE eEchoCancelation; /**< Echo cancelation settings */
+} OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE;
+
+
+/** Enable / Disable for noise reduction, which undesired noise from
+ * the audio
+ * @ingroup effects
+ */
+typedef struct OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BOOL bNoiseReduction; /**< Enable/disable for noise reduction */
+} OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_Component.h b/domx/omx_core/inc/OMX_Component.h
new file mode 100644
index 0000000..c312aef
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Component.h
@@ -0,0 +1,596 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Component.h - OpenMax IL version 1.1.2
+ * The OMX_Component header file contains the definitions used to define
+ * the public interface of a component. This header file is intended to
+ * be used by both the application and the component.
+ */
+
+#ifndef OMX_Component_h
+#define OMX_Component_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Audio.h>
+#include <OMX_Video.h>
+#include <OMX_Image.h>
+#include <OMX_Other.h>
+
+/** @ingroup comp */
+typedef enum OMX_PORTDOMAINTYPE {
+ OMX_PortDomainAudio,
+ OMX_PortDomainVideo,
+ OMX_PortDomainImage,
+ OMX_PortDomainOther,
+ OMX_PortDomainKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_PortDomainVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_PortDomainMax = 0x7ffffff
+} OMX_PORTDOMAINTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_PORTDEFINITIONTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port number the structure applies to */
+ OMX_DIRTYPE eDir; /**< Direction (input or output) of this port */
+ OMX_U32 nBufferCountActual; /**< The actual number of buffers allocated on this port */
+ OMX_U32 nBufferCountMin; /**< The minimum number of buffers this port requires */
+ OMX_U32 nBufferSize; /**< Size, in bytes, for buffers to be used for this channel */
+ OMX_BOOL bEnabled; /**< Ports default to enabled and are enabled/disabled by
+ OMX_CommandPortEnable/OMX_CommandPortDisable.
+ When disabled a port is unpopulated. A disabled port
+ is not populated with buffers on a transition to IDLE. */
+ OMX_BOOL bPopulated; /**< Port is populated with all of its buffers as indicated by
+ nBufferCountActual. A disabled port is always unpopulated.
+ An enabled port is populated on a transition to OMX_StateIdle
+ and unpopulated on a transition to loaded. */
+ OMX_PORTDOMAINTYPE eDomain; /**< Domain of the port. Determines the contents of metadata below. */
+ union {
+ OMX_AUDIO_PORTDEFINITIONTYPE audio;
+ OMX_VIDEO_PORTDEFINITIONTYPE video;
+ OMX_IMAGE_PORTDEFINITIONTYPE image;
+ OMX_OTHER_PORTDEFINITIONTYPE other;
+ } format;
+ OMX_BOOL bBuffersContiguous;
+ OMX_U32 nBufferAlignment;
+} OMX_PARAM_PORTDEFINITIONTYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_U32TYPE {
+ OMX_U32 nSize; /**< Size of this structure, in Bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_U32 nU32; /**< U32 value */
+} OMX_PARAM_U32TYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONPOLICYTYPE {
+ OMX_SuspensionDisabled, /**< No suspension; v1.0 behavior */
+ OMX_SuspensionEnabled, /**< Suspension allowed */
+ OMX_SuspensionPolicyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_SuspensionPolicyStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_SuspensionPolicyMax = 0x7fffffff
+} OMX_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONPOLICYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_SUSPENSIONPOLICYTYPE ePolicy;
+} OMX_PARAM_SUSPENSIONPOLICYTYPE;
+
+/** @ingroup rpm */
+typedef enum OMX_SUSPENSIONTYPE {
+ OMX_NotSuspended, /**< component is not suspended */
+ OMX_Suspended, /**< component is suspended */
+ OMX_SuspensionKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_SuspensionVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_SuspendMax = 0x7FFFFFFF
+} OMX_SUSPENSIONTYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_PARAM_SUSPENSIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_SUSPENSIONTYPE eType;
+} OMX_PARAM_SUSPENSIONTYPE ;
+
+typedef struct OMX_CONFIG_BOOLEANTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bEnabled;
+} OMX_CONFIG_BOOLEANTYPE;
+
+/* Parameter specifying the content uri to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTURITYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes, including
+ actual URI name */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8 contentURI[1]; /**< The URI name */
+} OMX_PARAM_CONTENTURITYPE;
+
+/* Parameter specifying the pipe to use. */
+/** @ingroup cp */
+typedef struct OMX_PARAM_CONTENTPIPETYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_HANDLETYPE hPipe; /**< The pipe handle*/
+} OMX_PARAM_CONTENTPIPETYPE;
+
+/** @ingroup rpm */
+typedef struct OMX_RESOURCECONCEALMENTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bResourceConcealmentForbidden; /**< disallow the use of resource concealment
+ methods (like degrading algorithm quality to
+ lower resource consumption or functional bypass)
+ on a component as a resolution to resource conflicts. */
+} OMX_RESOURCECONCEALMENTTYPE;
+
+
+/** @ingroup metadata */
+typedef enum OMX_METADATACHARSETTYPE {
+ OMX_MetadataCharsetUnknown = 0,
+ OMX_MetadataCharsetASCII,
+ OMX_MetadataCharsetBinary,
+ OMX_MetadataCharsetCodePage1252,
+ OMX_MetadataCharsetUTF8,
+ OMX_MetadataCharsetJavaConformantUTF8,
+ OMX_MetadataCharsetUTF7,
+ OMX_MetadataCharsetImapUTF7,
+ OMX_MetadataCharsetUTF16LE,
+ OMX_MetadataCharsetUTF16BE,
+ OMX_MetadataCharsetGB12345,
+ OMX_MetadataCharsetHZGB2312,
+ OMX_MetadataCharsetGB2312,
+ OMX_MetadataCharsetGB18030,
+ OMX_MetadataCharsetGBK,
+ OMX_MetadataCharsetBig5,
+ OMX_MetadataCharsetISO88591,
+ OMX_MetadataCharsetISO88592,
+ OMX_MetadataCharsetISO88593,
+ OMX_MetadataCharsetISO88594,
+ OMX_MetadataCharsetISO88595,
+ OMX_MetadataCharsetISO88596,
+ OMX_MetadataCharsetISO88597,
+ OMX_MetadataCharsetISO88598,
+ OMX_MetadataCharsetISO88599,
+ OMX_MetadataCharsetISO885910,
+ OMX_MetadataCharsetISO885913,
+ OMX_MetadataCharsetISO885914,
+ OMX_MetadataCharsetISO885915,
+ OMX_MetadataCharsetShiftJIS,
+ OMX_MetadataCharsetISO2022JP,
+ OMX_MetadataCharsetISO2022JP1,
+ OMX_MetadataCharsetISOEUCJP,
+ OMX_MetadataCharsetSMS7Bit,
+ OMX_MetadataCharsetKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MetadataCharsetVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MetadataCharsetTypeMax= 0x7FFFFFFF
+} OMX_METADATACHARSETTYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASCOPETYPE
+{
+ OMX_MetadataScopeAllLevels,
+ OMX_MetadataScopeTopLevel,
+ OMX_MetadataScopePortLevel,
+ OMX_MetadataScopeNodeLevel,
+ OMX_MetadataScopeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MetadataScopeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MetadataScopeTypeMax = 0x7fffffff
+} OMX_METADATASCOPETYPE;
+
+/** @ingroup metadata */
+typedef enum OMX_METADATASEARCHMODETYPE
+{
+ OMX_MetadataSearchValueSizeByIndex,
+ OMX_MetadataSearchItemByIndex,
+ OMX_MetadataSearchNextItemByKey,
+ OMX_MetadataSearchKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MetadataSearchVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MetadataSearchTypeMax = 0x7fffffff
+} OMX_METADATASEARCHMODETYPE;
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMCOUNTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_METADATASCOPETYPE eScopeMode;
+ OMX_U32 nScopeSpecifier;
+ OMX_U32 nMetadataItemCount;
+} OMX_CONFIG_METADATAITEMCOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_METADATAITEMTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_METADATASCOPETYPE eScopeMode;
+ OMX_U32 nScopeSpecifier;
+ OMX_U32 nMetadataItemIndex;
+ OMX_METADATASEARCHMODETYPE eSearchMode;
+ OMX_METADATACHARSETTYPE eKeyCharset;
+ OMX_U8 nKeySizeUsed;
+ OMX_U8 nKey[128];
+ OMX_METADATACHARSETTYPE eValueCharset;
+ OMX_STRING sLanguageCountry;
+ OMX_U32 nValueMaxSize;
+ OMX_U32 nValueSizeUsed;
+ OMX_U8 nValue[1];
+} OMX_CONFIG_METADATAITEMTYPE;
+
+/* @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODECOUNTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys;
+ OMX_U32 nParentNodeID;
+ OMX_U32 nNumNodes;
+} OMX_CONFIG_CONTAINERNODECOUNTTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_CONFIG_CONTAINERNODEIDTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys;
+ OMX_U32 nParentNodeID;
+ OMX_U32 nNodeIndex;
+ OMX_U32 nNodeID;
+ OMX_STRING cNodeName;
+ OMX_BOOL bIsLeafType;
+} OMX_CONFIG_CONTAINERNODEIDTYPE;
+
+/** @ingroup metadata */
+typedef struct OMX_PARAM_METADATAFILTERTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAllKeys; /* if true then this structure refers to all keys and
+ * the three key fields below are ignored */
+ OMX_METADATACHARSETTYPE eKeyCharset;
+ OMX_U32 nKeySizeUsed;
+ OMX_U8 nKey [128];
+ OMX_U32 nLanguageCountrySizeUsed;
+ OMX_U8 nLanguageCountry[128];
+ OMX_BOOL bEnabled; /* if true then key is part of filter (e.g.
+ * retained for query later). If false then
+ * key is not part of filter */
+} OMX_PARAM_METADATAFILTERTYPE;
+
+/** The OMX_HANDLETYPE structure defines the component handle. The component
+ * handle is used to access all of the component's public methods and also
+ * contains pointers to the component's private data area. The component
+ * handle is initialized by the OMX core (with help from the component)
+ * during the process of loading the component. After the component is
+ * successfully loaded, the application can safely access any of the
+ * component's public functions (although some may return an error because
+ * the state is inappropriate for the access).
+ *
+ * @ingroup comp
+ */
+typedef struct OMX_COMPONENTTYPE
+{
+ /** The size of this structure, in bytes. It is the responsibility
+ of the allocator of this structure to fill in this value. Since
+ this structure is allocated by the GetHandle function, this
+ function will fill in this value. */
+ OMX_U32 nSize;
+
+ /** nVersion is the version of the OMX specification that the structure
+ is built against. It is the responsibility of the creator of this
+ structure to initialize this value and every user of this structure
+ should verify that it knows how to use the exact version of
+ this structure found herein. */
+ OMX_VERSIONTYPE nVersion;
+
+ /** pComponentPrivate is a pointer to the component private data area.
+ This member is allocated and initialized by the component when the
+ component is first loaded. The application should not access this
+ data area. */
+ OMX_PTR pComponentPrivate;
+
+ /** pApplicationPrivate is a pointer that is a parameter to the
+ OMX_GetHandle method, and contains an application private value
+ provided by the IL client. This application private data is
+ returned to the IL Client by OMX in all callbacks */
+ OMX_PTR pApplicationPrivate;
+
+ /** refer to OMX_GetComponentVersion in OMX_core.h or the OMX IL
+ specification for details on the GetComponentVersion method.
+ */
+ OMX_ERRORTYPE (*GetComponentVersion)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_STRING pComponentName,
+ OMX_OUT OMX_VERSIONTYPE* pComponentVersion,
+ OMX_OUT OMX_VERSIONTYPE* pSpecVersion,
+ OMX_OUT OMX_UUIDTYPE* pComponentUUID);
+
+ /** refer to OMX_SendCommand in OMX_core.h or the OMX IL
+ specification for details on the SendCommand method.
+ */
+ OMX_ERRORTYPE (*SendCommand)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_COMMANDTYPE Cmd,
+ OMX_IN OMX_U32 nParam1,
+ OMX_IN OMX_PTR pCmdData);
+
+ /** refer to OMX_GetParameter in OMX_core.h or the OMX IL
+ specification for details on the GetParameter method.
+ */
+ OMX_ERRORTYPE (*GetParameter)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure);
+
+
+ /** refer to OMX_SetParameter in OMX_core.h or the OMX IL
+ specification for details on the SetParameter method.
+ */
+ OMX_ERRORTYPE (*SetParameter)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_IN OMX_PTR pComponentParameterStructure);
+
+
+ /** refer to OMX_GetConfig in OMX_core.h or the OMX IL
+ specification for details on the GetConfig method.
+ */
+ OMX_ERRORTYPE (*GetConfig)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_INOUT OMX_PTR pComponentConfigStructure);
+
+
+ /** refer to OMX_SetConfig in OMX_core.h or the OMX IL
+ specification for details on the SetConfig method.
+ */
+ OMX_ERRORTYPE (*SetConfig)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nIndex,
+ OMX_IN OMX_PTR pComponentConfigStructure);
+
+
+ /** refer to OMX_GetExtensionIndex in OMX_core.h or the OMX IL
+ specification for details on the GetExtensionIndex method.
+ */
+ OMX_ERRORTYPE (*GetExtensionIndex)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName,
+ OMX_OUT OMX_INDEXTYPE* pIndexType);
+
+
+ /** refer to OMX_GetState in OMX_core.h or the OMX IL
+ specification for details on the GetState method.
+ */
+ OMX_ERRORTYPE (*GetState)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_STATETYPE* pState);
+
+
+ /** The ComponentTunnelRequest method will interact with another OMX
+ component to determine if tunneling is possible and to setup the
+ tunneling. The return codes for this method can be used to
+ determine if tunneling is not possible, or if tunneling is not
+ supported.
+
+ Base profile components (i.e. non-interop) do not support this
+ method and should return OMX_ErrorNotImplemented
+
+ The interop profile component MUST support tunneling to another
+ interop profile component with a compatible port parameters.
+ A component may also support proprietary communication.
+
+ If proprietary communication is supported the negotiation of
+ proprietary communication is done outside of OMX in a vendor
+ specific way. It is only required that the proper result be
+ returned and the details of how the setup is done is left
+ to the component implementation.
+
+ When this method is invoked when nPort in an output port, the
+ component will:
+ 1. Populate the pTunnelSetup structure with the output port's
+ requirements and constraints for the tunnel.
+
+ When this method is invoked when nPort in an input port, the
+ component will:
+ 1. Query the necessary parameters from the output port to
+ determine if the ports are compatible for tunneling
+ 2. If the ports are compatible, the component should store
+ the tunnel step provided by the output port
+ 3. Determine which port (either input or output) is the buffer
+ supplier, and call OMX_SetParameter on the output port to
+ indicate this selection.
+
+ The component will return from this call within 5 msec.
+
+ @param [in] hComp
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle method.
+ @param [in] nPort
+ nPort is used to select the port on the component to be used
+ for tunneling.
+ @param [in] hTunneledComp
+ Handle of the component to tunnel with. This is the component
+ handle returned by the call to the OMX_GetHandle method. When
+ this parameter is 0x0 the component should setup the port for
+ communication with the application / IL Client.
+ @param [in] nPortOutput
+ nPortOutput is used indicate the port the component should
+ tunnel with.
+ @param [in] pTunnelSetup
+ Pointer to the tunnel setup structure. When nPort is an output port
+ the component should populate the fields of this structure. When
+ When nPort is an input port the component should review the setup
+ provided by the component with the output port.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup tun
+ */
+
+ OMX_ERRORTYPE (*ComponentTunnelRequest)(
+ OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 nPort,
+ OMX_IN OMX_HANDLETYPE hTunneledComp,
+ OMX_IN OMX_U32 nTunneledPort,
+ OMX_INOUT OMX_TUNNELSETUPTYPE* pTunnelSetup);
+
+ /** refer to OMX_UseBuffer in OMX_core.h or the OMX IL
+ specification for details on the UseBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*UseBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN OMX_U32 nSizeBytes,
+ OMX_IN OMX_U8* pBuffer);
+
+ /** refer to OMX_AllocateBuffer in OMX_core.h or the OMX IL
+ specification for details on the AllocateBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*AllocateBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBuffer,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN OMX_U32 nSizeBytes);
+
+ /** refer to OMX_FreeBuffer in OMX_core.h or the OMX IL
+ specification for details on the FreeBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FreeBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** refer to OMX_EmptyThisBuffer in OMX_core.h or the OMX IL
+ specification for details on the EmptyThisBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*EmptyThisBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** refer to OMX_FillThisBuffer in OMX_core.h or the OMX IL
+ specification for details on the FillThisBuffer method.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FillThisBuffer)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** The SetCallbacks method is used by the core to specify the callback
+ structure from the application to the component. This is a blocking
+ call. The component will return from this call within 5 msec.
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @param [in] pCallbacks
+ pointer to an OMX_CALLBACKTYPE structure used to provide the
+ callback information to the component
+ @param [in] pAppData
+ pointer to an application defined value. It is anticipated that
+ the application will pass a pointer to a data structure or a "this
+ pointer" in this area to allow the callback (in the application)
+ to determine the context of the call
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*SetCallbacks)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_CALLBACKTYPE* pCallbacks,
+ OMX_IN OMX_PTR pAppData);
+
+ /** ComponentDeInit method is used to deinitialize the component
+ providing a means to free any resources allocated at component
+ initialization. NOTE: After this call the component handle is
+ not valid for further use.
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ */
+ OMX_ERRORTYPE (*ComponentDeInit)(
+ OMX_IN OMX_HANDLETYPE hComponent);
+
+ /** @ingroup buf */
+ OMX_ERRORTYPE (*UseEGLImage)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** ppBufferHdr,
+ OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate,
+ OMX_IN void* eglImage);
+
+ OMX_ERRORTYPE (*ComponentRoleEnum)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_U8 *cRole,
+ OMX_IN OMX_U32 nIndex);
+
+} OMX_COMPONENTTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_ComponentExt.h b/domx/omx_core/inc/OMX_ComponentExt.h
new file mode 100755
index 0000000..e32dcbe
--- /dev/null
+++ b/domx/omx_core/inc/OMX_ComponentExt.h
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2010 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_ComponentExt.h - OpenMax IL version 1.1.2
+ * The OMX_ComponentExt header file contains extensions to the definitions used
+ * by both the application and the component to access common items.
+ */
+
+#ifndef OMX_ComponentExt_h
+#define OMX_ComponentExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Types.h>
+
+
+/** Set/query the commit mode */
+typedef struct OMX_CONFIG_COMMITMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bDeferred;
+} OMX_CONFIG_COMMITMODETYPE;
+
+/** Explicit commit */
+typedef struct OMX_CONFIG_COMMITTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+} OMX_CONFIG_COMMITTYPE;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_ComponentExt_h */
diff --git a/domx/omx_core/inc/OMX_ComponentRegistry.h b/domx/omx_core/inc/OMX_ComponentRegistry.h
new file mode 100755
index 0000000..7bedcfc
--- /dev/null
+++ b/domx/omx_core/inc/OMX_ComponentRegistry.h
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dirent.h>
+
+#define MAX_ROLES 20
+#define MAX_TABLE_SIZE 50
+
+typedef struct _ComponentTable {
+ OMX_STRING name;
+ OMX_U16 nRoles;
+ OMX_STRING pRoleArray[MAX_ROLES];
+}ComponentTable;
+
+
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles);
+
+OMX_ERRORTYPE OMX_PrintComponentTable();
+OMX_ERRORTYPE OMX_BuildComponentTable();
+OMX_ERRORTYPE ComponentTable_EventHandler(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1,
+ OMX_IN OMX_U32 nData2,
+ OMX_IN OMX_PTR pEventData);
+
+OMX_ERRORTYPE ComponentTable_EmptyBufferDone(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
+
+OMX_ERRORTYPE ComponentTable_FillBufferDone(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
diff --git a/domx/omx_core/inc/OMX_ContentPipe.h b/domx/omx_core/inc/OMX_ContentPipe.h
new file mode 100644
index 0000000..6b1025e
--- /dev/null
+++ b/domx/omx_core/inc/OMX_ContentPipe.h
@@ -0,0 +1,212 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_ContentPipe.h - OpenMax IL version 1.1.2
+ * The OMX_ContentPipe header file contains the definitions used to define
+ * the public interface for content piples. This header file is intended to
+ * be used by the component.
+ */
+
+#ifndef OMX_CONTENTPIPE_H
+#define OMX_CONTENTPIPE_H
+
+#ifndef KD_EACCES
+/* OpenKODE error codes. CPResult values may be zero (indicating success
+ or one of the following values) */
+#define KD_EACCES (1)
+#define KD_EADDRINUSE (2)
+#define KD_EAGAIN (5)
+#define KD_EBADF (7)
+#define KD_EBUSY (8)
+#define KD_ECONNREFUSED (9)
+#define KD_ECONNRESET (10)
+#define KD_EDEADLK (11)
+#define KD_EDESTADDRREQ (12)
+#define KD_ERANGE (35)
+#define KD_EEXIST (13)
+#define KD_EFBIG (14)
+#define KD_EHOSTUNREACH (15)
+#define KD_EINVAL (17)
+#define KD_EIO (18)
+#define KD_EISCONN (20)
+#define KD_EISDIR (21)
+#define KD_EMFILE (22)
+#define KD_ENAMETOOLONG (23)
+#define KD_ENOENT (24)
+#define KD_ENOMEM (25)
+#define KD_ENOSPC (26)
+#define KD_ENOSYS (27)
+#define KD_ENOTCONN (28)
+#define KD_EPERM (33)
+#define KD_ETIMEDOUT (36)
+#define KD_EILSEQ (19)
+#endif
+
+/** Map types from OMX standard types only here so interface is as generic as possible. */
+typedef OMX_U32 CPresult;
+typedef char * CPstring;
+typedef void * CPhandle;
+typedef OMX_U32 CPuint;
+typedef OMX_S32 CPint;
+typedef char CPbyte;
+typedef OMX_BOOL CPbool;
+
+/** enumeration of origin types used in the CP_PIPETYPE's Seek function
+ * @ingroup cp
+ */
+typedef enum CP_ORIGINTYPE {
+ CP_OriginBegin,
+ CP_OriginCur,
+ CP_OriginEnd,
+ CP_OriginKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_OriginVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_OriginMax = 0X7FFFFFFF
+} CP_ORIGINTYPE;
+
+/** enumeration of contact access types used in the CP_PIPETYPE's Open function
+ * @ingroup cp
+ */
+typedef enum CP_ACCESSTYPE {
+ CP_AccessRead,
+ CP_AccessWrite,
+ CP_AccessReadWrite ,
+ CP_AccessKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_AccessVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_AccessMax = 0X7FFFFFFF
+} CP_ACCESSTYPE;
+
+/** enumeration of results returned by the CP_PIPETYPE's CheckAvailableBytes function
+ * @ingroup cp
+ */
+typedef enum CP_CHECKBYTESRESULTTYPE
+{
+ CP_CheckBytesOk, /**< There are at least the request number
+ of bytes available */
+ CP_CheckBytesNotReady, /**< The pipe is still retrieving bytes
+ and presently lacks sufficient bytes.
+ Client will be called when they are
+ sufficient bytes are available. */
+ CP_CheckBytesInsufficientBytes , /**< The pipe has retrieved all bytes
+ but those available are less than those
+ requested */
+ CP_CheckBytesAtEndOfStream, /**< The pipe has reached the end of stream
+ and no more bytes are available. */
+ CP_CheckBytesOutOfBuffers, /**< All read/write buffers are currently in use. */
+ CP_CheckBytesKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_CheckBytesVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_CheckBytesMax = 0X7FFFFFFF
+} CP_CHECKBYTESRESULTTYPE;
+
+/** enumeration of content pipe events sent to the client callback.
+ * @ingroup cp
+ */
+typedef enum CP_EVENTTYPE{
+ CP_BytesAvailable, /** bytes requested in a CheckAvailableBytes call are now available*/
+ CP_Overflow, /** enumeration of content pipe events sent to the client callback*/
+ CP_PipeDisconnected , /** enumeration of content pipe events sent to the client callback*/
+ CP_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ CP_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ CP_EventMax = 0X7FFFFFFF
+} CP_EVENTTYPE;
+
+/** content pipe definition
+ * @ingroup cp
+ */
+typedef struct CP_PIPETYPE
+{
+ /** Open a content stream for reading or writing. */
+ CPresult (*Open)( CPhandle* hContent, CPstring szURI, CP_ACCESSTYPE eAccess );
+
+ /** Close a content stream. */
+ CPresult (*Close)( CPhandle hContent );
+
+ /** Create a content source and open it for writing. */
+ CPresult (*Create)( CPhandle *hContent, CPstring szURI );
+
+ /** Check the that specified number of bytes are available for reading or writing (depending on access type).*/
+ CPresult (*CheckAvailableBytes)( CPhandle hContent, CPuint nBytesRequested, CP_CHECKBYTESRESULTTYPE *eResult );
+
+ /** Seek to certain position in the content relative to the specified origin. */
+ CPresult (*SetPosition)( CPhandle hContent, CPint nOffset, CP_ORIGINTYPE eOrigin);
+
+ /** Retrieve the current position relative to the start of the content. */
+ CPresult (*GetPosition)( CPhandle hContent, CPuint *pPosition);
+
+ /** Retrieve data of the specified size from the content stream (advance content pointer by size of data).
+ Note: pipe client provides pointer. This function is appropriate for small high frequency reads. */
+ CPresult (*Read)( CPhandle hContent, CPbyte *pData, CPuint nSize);
+
+ /** Retrieve a buffer allocated by the pipe that contains the requested number of bytes.
+ Buffer contains the next block of bytes, as specified by nSize, of the content. nSize also
+ returns the size of the block actually read. Content pointer advances the by the returned size.
+ Note: pipe provides pointer. This function is appropriate for large reads. The client must call
+ ReleaseReadBuffer when done with buffer.
+
+ In some cases the requested block may not reside in contiguous memory within the
+ pipe implementation. For instance if the pipe leverages a circular buffer then the requested
+ block may straddle the boundary of the circular buffer. By default a pipe implementation
+ performs a copy in this case to provide the block to the pipe client in one contiguous buffer.
+ If, however, the client sets bForbidCopy, then the pipe returns only those bytes preceding the memory
+ boundary. Here the client may retrieve the data in segments over successive calls. */
+ CPresult (*ReadBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint *nSize, CPbool bForbidCopy);
+
+ /** Release a buffer obtained by ReadBuffer back to the pipe. */
+ CPresult (*ReleaseReadBuffer)(CPhandle hContent, CPbyte *pBuffer);
+
+ /** Write data of the specified size to the content (advance content pointer by size of data).
+ Note: pipe client provides pointer. This function is appropriate for small high frequency writes. */
+ CPresult (*Write)( CPhandle hContent, CPbyte *data, CPuint nSize);
+
+ /** Retrieve a buffer allocated by the pipe used to write data to the content.
+ Client will fill buffer with output data. Note: pipe provides pointer. This function is appropriate
+ for large writes. The client must call WriteBuffer when done it has filled the buffer with data.*/
+ CPresult (*GetWriteBuffer)( CPhandle hContent, CPbyte **ppBuffer, CPuint nSize);
+
+ /** Deliver a buffer obtained via GetWriteBuffer to the pipe. Pipe will write the
+ the contents of the buffer to content and advance content pointer by the size of the buffer */
+ CPresult (*WriteBuffer)( CPhandle hContent, CPbyte *pBuffer, CPuint nFilledSize);
+
+ /** Register a per-handle client callback with the content pipe. */
+ CPresult (*RegisterCallback)( CPhandle hContent, CPresult (*ClientCallback)(CP_EVENTTYPE eEvent, CPuint iParam));
+
+} CP_PIPETYPE;
+
+#endif
+
diff --git a/domx/omx_core/inc/OMX_Core.h b/domx/omx_core/inc/OMX_Core.h
new file mode 100644
index 0000000..729dc36
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Core.h
@@ -0,0 +1,1448 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Core.h - OpenMax IL version 1.1.2
+ * The OMX_Core header file contains the definitions used by both the
+ * application and the component to access common items.
+ */
+
+#ifndef OMX_Core_h
+#define OMX_Core_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Index.h>
+
+
+/** The OMX_COMMANDTYPE enumeration is used to specify the action in the
+ * OMX_SendCommand macro.
+ * @ingroup core
+ */
+typedef enum OMX_COMMANDTYPE
+{
+ OMX_CommandStateSet, /**< Change the component state */
+ OMX_CommandFlush, /**< Flush the data queue(s) of a component */
+ OMX_CommandPortDisable, /**< Disable a port on a component. */
+ OMX_CommandPortEnable, /**< Enable a port on a component. */
+ OMX_CommandMarkBuffer, /**< Mark a component/buffer for observation */
+ OMX_CommandKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_CommandVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_CommandMax = 0X7FFFFFFF
+} OMX_COMMANDTYPE;
+
+
+
+/** The OMX_STATETYPE enumeration is used to indicate or change the component
+ * state. This enumeration reflects the current state of the component when
+ * used with the OMX_GetState macro or becomes the parameter in a state change
+ * command when used with the OMX_SendCommand macro.
+ *
+ * The component will be in the Loaded state after the component is initially
+ * loaded into memory. In the Loaded state, the component is not allowed to
+ * allocate or hold resources other than to build it's internal parameter
+ * and configuration tables. The application will send one or more
+ * SetParameters/GetParameters and SetConfig/GetConfig commands to the
+ * component and the component will record each of these parameter and
+ * configuration changes for use later. When the application sends the
+ * Idle command, the component will acquire the resources needed for the
+ * specified configuration and will transition to the idle state if the
+ * allocation is successful. If the component cannot successfully
+ * transition to the idle state for any reason, the state of the component
+ * shall be fully rolled back to the Loaded state (e.g. all allocated
+ * resources shall be released). When the component receives the command
+ * to go to the Executing state, it shall begin processing buffers by
+ * sending all input buffers it holds to the application. While
+ * the component is in the Idle state, the application may also send the
+ * Pause command. If the component receives the pause command while in the
+ * Idle state, the component shall send all input buffers it holds to the
+ * application, but shall not begin processing buffers. This will allow the
+ * application to prefill buffers.
+ *
+ * @ingroup comp
+ */
+
+typedef enum OMX_STATETYPE
+{
+ OMX_StateInvalid, /**< component has detected that it's internal data
+ structures are corrupted to the point that
+ it cannot determine it's state properly */
+ OMX_StateLoaded, /**< component has been loaded but has not completed
+ initialization. The OMX_SetParameter macro
+ and the OMX_GetParameter macro are the only
+ valid macros allowed to be sent to the
+ component in this state. */
+ OMX_StateIdle, /**< component initialization has been completed
+ successfully and the component is ready to
+ to start. */
+ OMX_StateExecuting, /**< component has accepted the start command and
+ is processing data (if data is available) */
+ OMX_StatePause, /**< component has received pause command */
+ OMX_StateWaitForResources, /**< component is waiting for resources, either after
+ preemption or before it gets the resources requested.
+ See specification for complete details. */
+ OMX_StateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_StateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_StateMax = 0X7FFFFFFF
+} OMX_STATETYPE;
+
+/** The OMX_ERRORTYPE enumeration defines the standard OMX Errors. These
+ * errors should cover most of the common failure cases. However,
+ * vendors are free to add additional error messages of their own as
+ * long as they follow these rules:
+ * 1. Vendor error messages shall be in the range of 0x90000000 to
+ * 0x9000FFFF.
+ * 2. Vendor error messages shall be defined in a header file provided
+ * with the component. No error messages are allowed that are
+ * not defined.
+ */
+typedef enum OMX_ERRORTYPE
+{
+ OMX_ErrorNone = 0,
+
+ /** There were insufficient resources to perform the requested operation */
+ OMX_ErrorInsufficientResources = (OMX_S32) 0x80001000,
+
+ /** There was an error, but the cause of the error could not be determined */
+ OMX_ErrorUndefined = (OMX_S32) 0x80001001,
+
+ /** The component name string was not valid */
+ OMX_ErrorInvalidComponentName = (OMX_S32) 0x80001002,
+
+ /** No component with the specified name string was found */
+ OMX_ErrorComponentNotFound = (OMX_S32) 0x80001003,
+
+ /** The component specified did not have a "OMX_ComponentInit" or
+ "OMX_ComponentDeInit entry point */
+ OMX_ErrorInvalidComponent = (OMX_S32) 0x80001004,
+
+ /** One or more parameters were not valid */
+ OMX_ErrorBadParameter = (OMX_S32) 0x80001005,
+
+ /** The requested function is not implemented */
+ OMX_ErrorNotImplemented = (OMX_S32) 0x80001006,
+
+ /** The buffer was emptied before the next buffer was ready */
+ OMX_ErrorUnderflow = (OMX_S32) 0x80001007,
+
+ /** The buffer was not available when it was needed */
+ OMX_ErrorOverflow = (OMX_S32) 0x80001008,
+
+ /** The hardware failed to respond as expected */
+ OMX_ErrorHardware = (OMX_S32) 0x80001009,
+
+ /** The component is in the state OMX_StateInvalid */
+ OMX_ErrorInvalidState = (OMX_S32) 0x8000100A,
+
+ /** Stream is found to be corrupt */
+ OMX_ErrorStreamCorrupt = (OMX_S32) 0x8000100B,
+
+ /** Ports being connected are not compatible */
+ OMX_ErrorPortsNotCompatible = (OMX_S32) 0x8000100C,
+
+ /** Resources allocated to an idle component have been
+ lost resulting in the component returning to the loaded state */
+ OMX_ErrorResourcesLost = (OMX_S32) 0x8000100D,
+
+ /** No more indicies can be enumerated */
+ OMX_ErrorNoMore = (OMX_S32) 0x8000100E,
+
+ /** The component detected a version mismatch */
+ OMX_ErrorVersionMismatch = (OMX_S32) 0x8000100F,
+
+ /** The component is not ready to return data at this time */
+ OMX_ErrorNotReady = (OMX_S32) 0x80001010,
+
+ /** There was a timeout that occurred */
+ OMX_ErrorTimeout = (OMX_S32) 0x80001011,
+
+ /** This error occurs when trying to transition into the state you are already in */
+ OMX_ErrorSameState = (OMX_S32) 0x80001012,
+
+ /** Resources allocated to an executing or paused component have been
+ preempted, causing the component to return to the idle state */
+ OMX_ErrorResourcesPreempted = (OMX_S32) 0x80001013,
+
+ /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
+ during the allocation of buffers (on a transition from the LOADED to the IDLE state or
+ on a port restart) when it deems that it has waited an unusually long time for the supplier
+ to send it an allocated buffer via a UseBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringAllocation = (OMX_S32) 0x80001014,
+
+ /** A non-supplier port sends this error to the IL client (via the EventHandler callback)
+ during the deallocation of buffers (on a transition from the IDLE to LOADED state or
+ on a port stop) when it deems that it has waited an unusually long time for the supplier
+ to request the deallocation of a buffer header via a FreeBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringDeallocation = (OMX_S32) 0x80001015,
+
+ /** A supplier port sends this error to the IL client (via the EventHandler callback)
+ during the stopping of a port (either on a transition from the IDLE to LOADED
+ state or a port stop) when it deems that it has waited an unusually long time for
+ the non-supplier to return a buffer via an EmptyThisBuffer or FillThisBuffer call. */
+ OMX_ErrorPortUnresponsiveDuringStop = (OMX_S32) 0x80001016,
+
+ /** Attempting a state transtion that is not allowed */
+ OMX_ErrorIncorrectStateTransition = (OMX_S32) 0x80001017,
+
+ /* Attempting a command that is not allowed during the present state. */
+ OMX_ErrorIncorrectStateOperation = (OMX_S32) 0x80001018,
+
+ /** The values encapsulated in the parameter or config structure are not supported. */
+ OMX_ErrorUnsupportedSetting = (OMX_S32) 0x80001019,
+
+ /** The parameter or config indicated by the given index is not supported. */
+ OMX_ErrorUnsupportedIndex = (OMX_S32) 0x8000101A,
+
+ /** The port index supplied is incorrect. */
+ OMX_ErrorBadPortIndex = (OMX_S32) 0x8000101B,
+
+ /** The port has lost one or more of its buffers and it thus unpopulated. */
+ OMX_ErrorPortUnpopulated = (OMX_S32) 0x8000101C,
+
+ /** Component suspended due to temporary loss of resources */
+ OMX_ErrorComponentSuspended = (OMX_S32) 0x8000101D,
+
+ /** Component suspended due to an inability to acquire dynamic resources */
+ OMX_ErrorDynamicResourcesUnavailable = (OMX_S32) 0x8000101E,
+
+ /** When the macroblock error reporting is enabled the component returns new error
+ for every frame that has errors */
+ OMX_ErrorMbErrorsInFrame = (OMX_S32) 0x8000101F,
+
+ /** A component reports this error when it cannot parse or determine the format of an input stream. */
+ OMX_ErrorFormatNotDetected = (OMX_S32) 0x80001020,
+
+ /** The content open operation failed. */
+ OMX_ErrorContentPipeOpenFailed = (OMX_S32) 0x80001021,
+
+ /** The content creation operation failed. */
+ OMX_ErrorContentPipeCreationFailed = (OMX_S32) 0x80001022,
+
+ /** Separate table information is being used */
+ OMX_ErrorSeperateTablesUsed = (OMX_S32) 0x80001023,
+
+ /** Tunneling is unsupported by the component*/
+ OMX_ErrorTunnelingUnsupported = (OMX_S32) 0x80001024,
+
+ OMX_ErrorKhronosExtensions = (OMX_S32)0x8F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ErrorVendorStartUnused = (OMX_S32)0x90000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ErrorMax = 0x7FFFFFFF
+} OMX_ERRORTYPE;
+
+/** @ingroup core */
+typedef OMX_ERRORTYPE (* OMX_COMPONENTINITTYPE)(OMX_IN OMX_HANDLETYPE hComponent);
+
+/** @ingroup core */
+typedef struct OMX_COMPONENTREGISTERTYPE
+{
+ const char * pName; /* Component name, 128 byte limit (including '\0') applies */
+ OMX_COMPONENTINITTYPE pInitialize; /* Component instance initialization function */
+} OMX_COMPONENTREGISTERTYPE;
+
+/** @ingroup core */
+extern OMX_COMPONENTREGISTERTYPE OMX_ComponentRegistered[];
+
+/** @ingroup rpm */
+typedef struct OMX_PRIORITYMGMTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nGroupPriority; /**< Priority of the component group */
+ OMX_U32 nGroupID; /**< ID of the component group */
+} OMX_PRIORITYMGMTTYPE;
+
+/* Component name and Role names are limited to 128 characters including the terminating '\0'. */
+#define OMX_MAX_STRINGNAME_SIZE 128
+
+/** @ingroup comp */
+typedef struct OMX_PARAM_COMPONENTROLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8 cRole[OMX_MAX_STRINGNAME_SIZE]; /**< name of standard component which defines component role */
+} OMX_PARAM_COMPONENTROLETYPE;
+
+/** End of Stream Buffer Flag:
+ *
+ * A component sets EOS when it has no more data to emit on a particular
+ * output port. Thus an output port shall set EOS on the last buffer it
+ * emits. A component's determination of when an output port should
+ * cease sending data is implemenation specific.
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_EOS 0x00000001
+
+/** Start Time Buffer Flag:
+ *
+ * The source of a stream (e.g. a demux component) sets the STARTTIME
+ * flag on the buffer that contains the starting timestamp for the
+ * stream. The starting timestamp corresponds to the first data that
+ * should be displayed at startup or after a seek.
+ * The first timestamp of the stream is not necessarily the start time.
+ * For instance, in the case of a seek to a particular video frame,
+ * the target frame may be an interframe. Thus the first buffer of
+ * the stream will be the intra-frame preceding the target frame and
+ * the starttime will occur with the target frame (with any other
+ * required frames required to reconstruct the target intervening).
+ *
+ * The STARTTIME flag is directly associated with the buffer's
+ * timestamp ' thus its association to buffer data and its
+ * propagation is identical to the timestamp's.
+ *
+ * When a Sync Component client receives a buffer with the
+ * STARTTIME flag it shall perform a SetConfig on its sync port
+ * using OMX_ConfigTimeClientStartTime and passing the buffer's
+ * timestamp.
+ *
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_STARTTIME 0x00000002
+
+
+
+/** Decode Only Buffer Flag:
+ *
+ * The source of a stream (e.g. a demux component) sets the DECODEONLY
+ * flag on any buffer that should shall be decoded but should not be
+ * displayed. This flag is used, for instance, when a source seeks to
+ * a target interframe that requires the decode of frames preceding the
+ * target to facilitate the target's reconstruction. In this case the
+ * source would emit the frames preceding the target downstream
+ * but mark them as decode only.
+ *
+ * The DECODEONLY is associated with buffer data and propagated in a
+ * manner identical to the buffer timestamp.
+ *
+ * A component that renders data should ignore all buffers with
+ * the DECODEONLY flag set.
+ *
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_DECODEONLY 0x00000004
+
+
+/* Data Corrupt Flag: This flag is set when the IL client believes the data in the associated buffer is corrupt
+ * @ingroup buf
+ */
+
+#define OMX_BUFFERFLAG_DATACORRUPT 0x00000008
+
+/* End of Frame: The buffer contains exactly one end of frame and no data
+ * occurs after the end of frame. This flag is an optional hint. The absence
+ * of this flag does not imply the absence of an end of frame within the buffer.
+ * @ingroup buf
+*/
+#define OMX_BUFFERFLAG_ENDOFFRAME 0x00000010
+
+/* Sync Frame Flag: This flag is set when the buffer content contains a coded sync frame '
+ * a frame that has no dependency on any other frame information
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_SYNCFRAME 0x00000020
+
+/* Extra data present flag: there is extra data appended to the data stream
+ * residing in the buffer
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_EXTRADATA 0x00000040
+
+/** Codec Config Buffer Flag:
+* OMX_BUFFERFLAG_CODECCONFIG is an optional flag that is set by an
+* output port when all bytes in the buffer form part or all of a set of
+* codec specific configuration data. Examples include SPS/PPS nal units
+* for OMX_VIDEO_CodingAVC or AudioSpecificConfig data for
+* OMX_AUDIO_CodingAAC. Any component that for a given stream sets
+* OMX_BUFFERFLAG_CODECCONFIG shall not mix codec configuration bytes
+* with frame data in the same buffer, and shall send all buffers
+* containing codec configuration bytes before any buffers containing
+* frame data that those configurations bytes describe.
+* If the stream format for a particular codec has a frame specific
+* header at the start of each frame, for example OMX_AUDIO_CodingMP3 or
+* OMX_AUDIO_CodingAAC in ADTS mode, then these shall be presented as
+* normal without setting OMX_BUFFERFLAG_CODECCONFIG.
+ * @ingroup buf
+ */
+#define OMX_BUFFERFLAG_CODECCONFIG 0x00000080
+
+
+
+/** @ingroup buf */
+typedef struct OMX_BUFFERHEADERTYPE
+{
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U8* pBuffer; /**< Pointer to actual block of memory
+ that is acting as the buffer */
+ OMX_U32 nAllocLen; /**< size of the buffer allocated, in bytes */
+ OMX_U32 nFilledLen; /**< number of bytes currently in the
+ buffer */
+ OMX_U32 nOffset; /**< start offset of valid data in bytes from
+ the start of the buffer */
+ OMX_PTR pAppPrivate; /**< pointer to any data the application
+ wants to associate with this buffer */
+ OMX_PTR pPlatformPrivate; /**< pointer to any data the platform
+ wants to associate with this buffer */
+ OMX_PTR pInputPortPrivate; /**< pointer to any data the input port
+ wants to associate with this buffer */
+ OMX_PTR pOutputPortPrivate; /**< pointer to any data the output port
+ wants to associate with this buffer */
+ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will generate a
+ mark event upon processing this buffer. */
+ OMX_PTR pMarkData; /**< Application specific data associated with
+ the mark sent on a mark event to disambiguate
+ this mark from others. */
+ OMX_U32 nTickCount; /**< Optional entry that the component and
+ application can update with a tick count
+ when they access the component. This
+ value should be in microseconds. Since
+ this is a value relative to an arbitrary
+ starting point, this value cannot be used
+ to determine absolute time. This is an
+ optional entry and not all components
+ will update it.*/
+ OMX_TICKS nTimeStamp; /**< Timestamp corresponding to the sample
+ starting at the first logical sample
+ boundary in the buffer. Timestamps of
+ successive samples within the buffer may
+ be inferred by adding the duration of the
+ of the preceding buffer to the timestamp
+ of the preceding buffer.*/
+ OMX_U32 nFlags; /**< buffer specific flags */
+ OMX_U32 nOutputPortIndex; /**< The index of the output port (if any) using
+ this buffer */
+ OMX_U32 nInputPortIndex; /**< The index of the input port (if any) using
+ this buffer */
+} OMX_BUFFERHEADERTYPE;
+
+/** The OMX_EXTRADATATYPE enumeration is used to define the
+ * possible extra data payload types.
+ * NB: this enum is binary backwards compatible with the previous
+ * OMX_EXTRADATA_QUANT define. This should be replaced with
+ * OMX_ExtraDataQuantization.
+ */
+typedef enum OMX_EXTRADATATYPE
+{
+ OMX_ExtraDataNone = 0, /**< Indicates that no more extra data sections follow */
+ OMX_ExtraDataQuantization, /**< The data payload contains quantization data */
+ OMX_ExtraDataKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ExtraDataVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ExtraDataMax = 0x7FFFFFFF
+} OMX_EXTRADATATYPE;
+
+
+typedef struct OMX_OTHER_EXTRADATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_EXTRADATATYPE eType; /* Extra Data type */
+ OMX_U32 nDataSize; /* Size of the supporting data to follow */
+ OMX_U8 data[1]; /* Supporting data hint */
+} OMX_OTHER_EXTRADATATYPE;
+
+/** @ingroup comp */
+typedef struct OMX_PORT_PARAM_TYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPorts; /**< The number of ports for this component */
+ OMX_U32 nStartPortNumber; /** first port number for this type of port */
+} OMX_PORT_PARAM_TYPE;
+
+/** @ingroup comp */
+typedef enum OMX_EVENTTYPE
+{
+ OMX_EventCmdComplete, /**< component has sucessfully completed a command */
+ OMX_EventError, /**< component has detected an error condition */
+ OMX_EventMark, /**< component has detected a buffer mark */
+ OMX_EventPortSettingsChanged, /**< component is reported a port settings change */
+ OMX_EventBufferFlag, /**< component has detected an EOS */
+ OMX_EventResourcesAcquired, /**< component has been granted resources and is
+ automatically starting the state change from
+ OMX_StateWaitForResources to OMX_StateIdle. */
+ OMX_EventComponentResumed, /**< Component resumed due to reacquisition of resources */
+ OMX_EventDynamicResourcesAvailable, /**< Component has acquired previously unavailable dynamic resources */
+ OMX_EventPortFormatDetected, /**< Component has detected a supported format. */
+ OMX_EventKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_EventVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_EventMax = 0x7FFFFFFF
+} OMX_EVENTTYPE;
+
+typedef struct OMX_CALLBACKTYPE
+{
+ /** The EventHandler method is used to notify the application when an
+ event of interest occurs. Events are defined in the OMX_EVENTTYPE
+ enumeration. Please see that enumeration for details of what will
+ be returned for each type of event. Callbacks should not return
+ an error to the component, so if an error occurs, the application
+ shall handle it internally. This is a blocking call.
+
+ The application should return from this call within 5 msec to avoid
+ blocking the component for an excessively long period of time.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param eEvent
+ Event that the component wants to notify the application about.
+ @param nData1
+ nData will be the OMX_ERRORTYPE for an error event and will be
+ an OMX_COMMANDTYPE for a command complete event and OMX_INDEXTYPE for a OMX_PortSettingsChanged event.
+ @param nData2
+ nData2 will hold further information related to the event. Can be OMX_STATETYPE for
+ a OMX_CommandStateSet command or port index for a OMX_PortSettingsChanged event.
+ Default value is 0 if not used. )
+ @param pEventData
+ Pointer to additional event-specific data (see spec for meaning).
+ */
+
+ OMX_ERRORTYPE (*EventHandler)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1,
+ OMX_IN OMX_U32 nData2,
+ OMX_IN OMX_PTR pEventData);
+
+ /** The EmptyBufferDone method is used to return emptied buffers from an
+ input port back to the application for reuse. This is a blocking call
+ so the application should not attempt to refill the buffers during this
+ call, but should queue them and refill them in another thread. There
+ is no error return, so the application shall handle any errors generated
+ internally.
+
+ The application should return from this call within 5 msec.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer indicating the buffer that was emptied.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*EmptyBufferDone)(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_BUFFERHEADERTYPE* pBuffer);
+
+ /** The FillBufferDone method is used to return filled buffers from an
+ output port back to the application for emptying and then reuse.
+ This is a blocking call so the application should not attempt to
+ empty the buffers during this call, but should queue the buffers
+ and empty them in another thread. There is no error return, so
+ the application shall handle any errors generated internally. The
+ application shall also update the buffer header to indicate the
+ number of bytes placed into the buffer.
+
+ The application should return from this call within 5 msec.
+
+ @param hComponent
+ handle of the component to access. This is the component
+ handle returned by the call to the GetHandle function.
+ @param pAppData
+ pointer to an application defined value that was provided in the
+ pAppData parameter to the OMX_GetHandle method for the component.
+ This application defined value is provided so that the application
+ can have a component specific context when receiving the callback.
+ @param pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer indicating the buffer that was filled.
+ @ingroup buf
+ */
+ OMX_ERRORTYPE (*FillBufferDone)(
+ OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE* pBuffer);
+
+} OMX_CALLBACKTYPE;
+
+/** The OMX_BUFFERSUPPLIERTYPE enumeration is used to dictate port supplier
+ preference when tunneling between two ports.
+ @ingroup tun buf
+*/
+typedef enum OMX_BUFFERSUPPLIERTYPE
+{
+ OMX_BufferSupplyUnspecified = 0x0, /**< port supplying the buffers is unspecified,
+ or don't care */
+ OMX_BufferSupplyInput, /**< input port supplies the buffers */
+ OMX_BufferSupplyOutput, /**< output port supplies the buffers */
+ OMX_BufferSupplyKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_BufferSupplyVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_BufferSupplyMax = 0x7FFFFFFF
+} OMX_BUFFERSUPPLIERTYPE;
+
+
+/** buffer supplier parameter
+ * @ingroup tun
+ */
+typedef struct OMX_PARAM_BUFFERSUPPLIERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_BUFFERSUPPLIERTYPE eBufferSupplier; /**< buffer supplier */
+} OMX_PARAM_BUFFERSUPPLIERTYPE;
+
+
+/**< indicates that buffers received by an input port of a tunnel
+ may not modify the data in the buffers
+ @ingroup tun
+ */
+#define OMX_PORTTUNNELFLAG_READONLY 0x00000001
+
+
+/** The OMX_TUNNELSETUPTYPE structure is used to pass data from an output
+ port to an input port as part the two ComponentTunnelRequest calls
+ resulting from a OMX_SetupTunnel call from the IL Client.
+ @ingroup tun
+ */
+typedef struct OMX_TUNNELSETUPTYPE
+{
+ OMX_U32 nTunnelFlags; /**< bit flags for tunneling */
+ OMX_BUFFERSUPPLIERTYPE eSupplier; /**< supplier preference */
+} OMX_TUNNELSETUPTYPE;
+
+/* OMX Component headers is included to enable the core to use
+ macros for functions into the component for OMX release 1.0.
+ Developers should not access any structures or data from within
+ the component header directly */
+/* TO BE REMOVED - #include <OMX_Component.h> */
+
+/** GetComponentVersion will return information about the component.
+ This is a blocking call. This macro will go directly from the
+ application to the component (via a core macro). The
+ component will return from this call within 5 msec.
+ @param [in] hComponent
+ handle of component to execute the command
+ @param [out] pComponentName
+ pointer to an empty string of length 128 bytes. The component
+ will write its name into this string. The name will be
+ terminated by a single zero byte. The name of a component will
+ be 127 bytes or less to leave room for the trailing zero byte.
+ An example of a valid component name is "OMX.ABC.ChannelMixer\0".
+ @param [out] pComponentVersion
+ pointer to an OMX Version structure that the component will fill
+ in. The component will fill in a value that indicates the
+ component version. NOTE: the component version is NOT the same
+ as the OMX Specification version (found in all structures). The
+ component version is defined by the vendor of the component and
+ its value is entirely up to the component vendor.
+ @param [out] pSpecVersion
+ pointer to an OMX Version structure that the component will fill
+ in. The SpecVersion is the version of the specification that the
+ component was built against. Please note that this value may or
+ may not match the structure's version. For example, if the
+ component was built against the 2.0 specification, but the
+ application (which creates the structure is built against the
+ 1.0 specification the versions would be different.
+ @param [out] pComponentUUID
+ pointer to the UUID of the component which will be filled in by
+ the component. The UUID is a unique identifier that is set at
+ RUN time for the component and is unique to each instantion of
+ the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetComponentVersion( \
+ hComponent, \
+ pComponentName, \
+ pComponentVersion, \
+ pSpecVersion, \
+ pComponentUUID) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetComponentVersion( \
+ hComponent, \
+ pComponentName, \
+ pComponentVersion, \
+ pSpecVersion, \
+ pComponentUUID) /* Macro End */
+
+
+/** Send a command to the component. This call is a non-blocking call.
+ The component should check the parameters and then queue the command
+ to the component thread to be executed. The component thread shall
+ send the EventHandler() callback at the conclusion of the command.
+ This macro will go directly from the application to the component (via
+ a core macro). The component will return from this call within 5 msec.
+
+ When the command is "OMX_CommandStateSet" the component will queue a
+ state transition to the new state idenfied in nParam.
+
+ When the command is "OMX_CommandFlush", to flush a port's buffer queues,
+ the command will force the component to return all buffers NOT CURRENTLY
+ BEING PROCESSED to the application, in the order in which the buffers
+ were received.
+
+ When the command is "OMX_CommandPortDisable" or
+ "OMX_CommandPortEnable", the component's port (given by the value of
+ nParam) will be stopped or restarted.
+
+ When the command "OMX_CommandMarkBuffer" is used to mark a buffer, the
+ pCmdData will point to a OMX_MARKTYPE structure containing the component
+ handle of the component to examine the buffer chain for the mark. nParam1
+ contains the index of the port on which the buffer mark is applied.
+
+ Specification text for more details.
+
+ @param [in] hComponent
+ handle of component to execute the command
+ @param [in] Cmd
+ Command for the component to execute
+ @param [in] nParam
+ Parameter for the command to be executed. When Cmd has the value
+ OMX_CommandStateSet, value is a member of OMX_STATETYPE. When Cmd has
+ the value OMX_CommandFlush, value of nParam indicates which port(s)
+ to flush. -1 is used to flush all ports a single port index will
+ only flush that port. When Cmd has the value "OMX_CommandPortDisable"
+ or "OMX_CommandPortEnable", the component's port is given by
+ the value of nParam. When Cmd has the value "OMX_CommandMarkBuffer"
+ the components pot is given by the value of nParam.
+ @param [in] pCmdData
+ Parameter pointing to the OMX_MARKTYPE structure when Cmd has the value
+ "OMX_CommandMarkBuffer".
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SendCommand( \
+ hComponent, \
+ Cmd, \
+ nParam, \
+ pCmdData) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SendCommand( \
+ hComponent, \
+ Cmd, \
+ nParam, \
+ pCmdData) /* Macro End */
+
+
+/** The OMX_GetParameter macro will get one of the current parameter
+ settings from the component. This macro cannot only be invoked when
+ the component is in the OMX_StateInvalid state. The nParamIndex
+ parameter is used to indicate which structure is being requested from
+ the component. The application shall allocate the correct structure
+ and shall fill in the structure size and version information before
+ invoking this macro. When the parameter applies to a port, the
+ caller shall fill in the appropriate nPortIndex value indicating the
+ port on which the parameter applies. If the component has not had
+ any settings changed, then the component should return a set of
+ valid DEFAULT parameters for the component. This is a blocking
+ call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nParamIndex
+ Index of the structure to be filled. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in,out] pComponentParameterStructure
+ Pointer to application allocated structure to be filled by the
+ component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) /* Macro End */
+
+
+/** The OMX_SetParameter macro will send an initialization parameter
+ structure to a component. Each structure shall be sent one at a time,
+ in a separate invocation of the macro. This macro can only be
+ invoked when the component is in the OMX_StateLoaded state, or the
+ port is disabled (when the parameter applies to a port). The
+ nParamIndex parameter is used to indicate which structure is being
+ passed to the component. The application shall allocate the
+ correct structure and shall fill in the structure size and version
+ information (as well as the actual data) before invoking this macro.
+ The application is free to dispose of this structure after the call
+ as the component is required to copy any data it shall retain. This
+ is a blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nIndex
+ Index of the structure to be sent. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in] pComponentParameterStructure
+ pointer to application allocated structure to be used for
+ initialization by the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SetParameter( \
+ hComponent, \
+ nParamIndex, \
+ pComponentParameterStructure) /* Macro End */
+
+
+/** The OMX_GetConfig macro will get one of the configuration structures
+ from a component. This macro can be invoked anytime after the
+ component has been loaded. The nParamIndex call parameter is used to
+ indicate which structure is being requested from the component. The
+ application shall allocate the correct structure and shall fill in the
+ structure size and version information before invoking this macro.
+ If the component has not had this configuration parameter sent before,
+ then the component should return a set of valid DEFAULT values for the
+ component. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nIndex
+ Index of the structure to be filled. This value is from the
+ OMX_INDEXTYPE enumeration.
+ @param [in,out] pComponentConfigStructure
+ pointer to application allocated structure to be filled by the
+ component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+*/
+#define OMX_GetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) /* Macro End */
+
+
+/** The OMX_SetConfig macro will send one of the configuration
+ structures to a component. Each structure shall be sent one at a time,
+ each in a separate invocation of the macro. This macro can be invoked
+ anytime after the component has been loaded. The application shall
+ allocate the correct structure and shall fill in the structure size
+ and version information (as well as the actual data) before invoking
+ this macro. The application is free to dispose of this structure after
+ the call as the component is required to copy any data it shall retain.
+ This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nConfigIndex
+ Index of the structure to be sent. This value is from the
+ OMX_INDEXTYPE enumeration above.
+ @param [in] pComponentConfigStructure
+ pointer to application allocated structure to be used for
+ initialization by the component.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_SetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) \
+ ((OMX_COMPONENTTYPE*)hComponent)->SetConfig( \
+ hComponent, \
+ nConfigIndex, \
+ pComponentConfigStructure) /* Macro End */
+
+
+/** The OMX_GetExtensionIndex macro will invoke a component to translate
+ a vendor specific configuration or parameter string into an OMX
+ structure index. There is no requirement for the vendor to support
+ this command for the indexes already found in the OMX_INDEXTYPE
+ enumeration (this is done to save space in small components). The
+ component shall support all vendor supplied extension indexes not found
+ in the master OMX_INDEXTYPE enumeration. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @param [in] cParameterName
+ OMX_STRING that shall be less than 128 characters long including
+ the trailing null byte. This is the string that will get
+ translated by the component into a configuration index.
+ @param [out] pIndexType
+ a pointer to a OMX_INDEXTYPE to receive the index value.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetExtensionIndex( \
+ hComponent, \
+ cParameterName, \
+ pIndexType) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetExtensionIndex( \
+ hComponent, \
+ cParameterName, \
+ pIndexType) /* Macro End */
+
+
+/** The OMX_GetState macro will invoke the component to get the current
+ state of the component and place the state value into the location
+ pointed to by pState.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] pState
+ pointer to the location to receive the state. The value returned
+ is one of the OMX_STATETYPE members
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp
+ */
+#define OMX_GetState( \
+ hComponent, \
+ pState) \
+ ((OMX_COMPONENTTYPE*)hComponent)->GetState( \
+ hComponent, \
+ pState) /* Macro End */
+
+
+/** The OMX_UseBuffer macro will request that the component use
+ a buffer (and allocate its own buffer header) already allocated
+ by another component, or by the IL Client. This is a blocking
+ call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
+ pointer to the buffer header
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+
+#define OMX_UseBuffer( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->UseBuffer( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes, \
+ pBuffer)
+
+
+/** The OMX_AllocateBuffer macro will request that the component allocate
+ a new buffer and buffer header. The component will allocate the
+ buffer and the buffer header and return a pointer to the buffer
+ header. This is a blocking call.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive
+ the pointer to the buffer header
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with. The port can be found by using the nPortIndex
+ value as an index into the Port Definition array of the component.
+ @param [in] pAppPrivate
+ pAppPrivate is used to initialize the pAppPrivate member of the
+ buffer header structure.
+ @param [in] nSizeBytes
+ size of the buffer to allocate. Used when bAllocateNew is true.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_AllocateBuffer( \
+ hComponent, \
+ ppBuffer, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes) \
+ ((OMX_COMPONENTTYPE*)hComponent)->AllocateBuffer( \
+ hComponent, \
+ ppBuffer, \
+ nPortIndex, \
+ pAppPrivate, \
+ nSizeBytes) /* Macro End */
+
+
+/** The OMX_FreeBuffer macro will release a buffer header from the component
+ which was allocated using either OMX_AllocateBuffer or OMX_UseBuffer. If
+ the component allocated the buffer (see the OMX_UseBuffer macro) then
+ the component shall free the buffer and buffer header. This is a
+ blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_FreeBuffer( \
+ hComponent, \
+ nPortIndex, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->FreeBuffer( \
+ hComponent, \
+ nPortIndex, \
+ pBuffer) /* Macro End */
+
+
+/** The OMX_EmptyThisBuffer macro will send a buffer full of data to an
+ input port of a component. The buffer will be emptied by the component
+ and returned to the application via the EmptyBufferDone call back.
+ This is a non-blocking call in that the component will record the buffer
+ and return immediately and then empty the buffer, later, at the proper
+ time. As expected, this macro may be invoked only while the component
+ is in the OMX_StateExecuting. If nPortIndex does not specify an input
+ port, the component shall return an error.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_EmptyThisBuffer( \
+ hComponent, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->EmptyThisBuffer( \
+ hComponent, \
+ pBuffer) /* Macro End */
+
+
+/** The OMX_FillThisBuffer macro will send an empty buffer to an
+ output port of a component. The buffer will be filled by the component
+ and returned to the application via the FillBufferDone call back.
+ This is a non-blocking call in that the component will record the buffer
+ and return immediately and then fill the buffer, later, at the proper
+ time. As expected, this macro may be invoked only while the component
+ is in the OMX_ExecutingState. If nPortIndex does not specify an output
+ port, the component shall return an error.
+
+ The component should return from this call within 5 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [in] pBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure allocated with UseBuffer
+ or AllocateBuffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_FillThisBuffer( \
+ hComponent, \
+ pBuffer) \
+ ((OMX_COMPONENTTYPE*)hComponent)->FillThisBuffer( \
+ hComponent, \
+ pBuffer) /* Macro End */
+
+
+
+/** The OMX_UseEGLImage macro will request that the component use
+ a EGLImage provided by EGL (and allocate its own buffer header)
+ This is a blocking call.
+
+ The component should return from this call within 20 msec.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the OMX_GetHandle function.
+ @param [out] ppBuffer
+ pointer to an OMX_BUFFERHEADERTYPE structure used to receive the
+ pointer to the buffer header. Note that the memory location used
+ for this buffer is NOT visible to the IL Client.
+ @param [in] nPortIndex
+ nPortIndex is used to select the port on the component the buffer will
+ be used with. The port can be found by using the nPortIndex
+ value as an index into the Port Definition array of the component.
+ @param [in] pAppPrivate
+ pAppPrivate is used to initialize the pAppPrivate member of the
+ buffer header structure.
+ @param [in] eglImage
+ eglImage contains the handle of the EGLImage to use as a buffer on the
+ specified port. The component is expected to validate properties of
+ the EGLImage against the configuration of the port to ensure the component
+ can use the EGLImage as a buffer.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup comp buf
+ */
+#define OMX_UseEGLImage( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ eglImage) \
+ ((OMX_COMPONENTTYPE*)hComponent)->UseEGLImage( \
+ hComponent, \
+ ppBufferHdr, \
+ nPortIndex, \
+ pAppPrivate, \
+ eglImage)
+
+/** The OMX_Init method is used to initialize the OMX core. It shall be the
+ first call made into OMX and it should only be executed one time without
+ an interviening OMX_Deinit call.
+
+ The core should return from this call within 20 msec.
+
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Init(void);
+
+
+/** The OMX_Deinit method is used to deinitialize the OMX core. It shall be
+ the last call made into OMX. In the event that the core determines that
+ thare are components loaded when this call is made, the core may return
+ with an error rather than try to unload the components.
+
+ The core should return from this call within 20 msec.
+
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_Deinit(void);
+
+
+/** The OMX_ComponentNameEnum method will enumerate through all the names of
+ recognised valid components in the system. This function is provided
+ as a means to detect all the components in the system run-time. There is
+ no strict ordering to the enumeration order of component names, although
+ each name will only be enumerated once. If the OMX core supports run-time
+ installation of new components, it is only requried to detect newly
+ installed components when the first call to enumerate component names
+ is made (i.e. when nIndex is 0x0).
+
+ The core should return from this call in 20 msec.
+
+ @param [out] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] nNameLength
+ number of characters in the cComponentName string. With all
+ component name strings restricted to less than 128 characters
+ (including the trailing null) it is recomended that the caller
+ provide a input string for the cComponentName of 128 characters.
+ @param [in] nIndex
+ number containing the enumeration index for the component.
+ Multiple calls to OMX_ComponentNameEnum with increasing values
+ of nIndex will enumerate through the component names in the
+ system until OMX_ErrorNoMore is returned. The value of nIndex
+ is 0 to (N-1), where N is the number of valid installed components
+ in the system.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. When the value of nIndex exceeds the number of
+ components in the system minus 1, OMX_ErrorNoMore will be
+ returned. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex);
+
+
+/** The OMX_GetHandle method will locate the component specified by the
+ component name given, load that component into memory and then invoke
+ the component's methods to create an instance of the component.
+
+ The core should return from this call within 20 msec.
+
+ @param [out] pHandle
+ pointer to an OMX_HANDLETYPE pointer to be filled in by this method.
+ @param [in] cComponentName
+ pointer to a null terminated string with the component name. The
+ names of the components are strings less than 127 bytes in length
+ plus the trailing null for a maximum size of 128 bytes. An example
+ of a valid component name is "OMX.TI.AUDIO.DSP.MIXER\0". Names are
+ assigned by the vendor, but shall start with "OMX." and then have
+ the Vendor designation next.
+ @param [in] pAppData
+ pointer to an application defined value that will be returned
+ during callbacks so that the application can identify the source
+ of the callback.
+ @param [in] pCallBacks
+ pointer to a OMX_CALLBACKTYPE structure that will be passed to the
+ component to initialize it with.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+
+
+/** The OMX_FreeHandle method will free a handle allocated by the OMX_GetHandle
+ method. If the component reference count goes to zero, the component will
+ be unloaded from memory.
+
+ The core should return from this call within 20 msec when the component is
+ in the OMX_StateLoaded state.
+
+ @param [in] hComponent
+ Handle of the component to be accessed. This is the component
+ handle returned by the call to the GetHandle function.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_FreeHandle(
+ OMX_IN OMX_HANDLETYPE hComponent);
+
+
+
+/** The OMX_SetupTunnel method will handle the necessary calls to the components
+ to setup the specified tunnel the two components. NOTE: This is
+ an actual method (not a #define macro). This method will make calls into
+ the component ComponentTunnelRequest method to do the actual tunnel
+ connection.
+
+ The ComponentTunnelRequest method on both components will be called.
+ This method shall not be called unless the component is in the
+ OMX_StateLoaded state except when the ports used for the tunnel are
+ disabled. In this case, the component may be in the OMX_StateExecuting,
+ OMX_StatePause, or OMX_StateIdle states.
+
+ The core should return from this call within 20 msec.
+
+ @param [in] hOutput
+ Handle of the component to be accessed. Also this is the handle
+ of the component whose port, specified in the nPortOutput parameter
+ will be used the source for the tunnel. This is the component handle
+ returned by the call to the OMX_GetHandle function. There is a
+ requirement that hOutput be the source for the data when
+ tunelling (i.e. nPortOutput is an output port). If 0x0, the component
+ specified in hInput will have it's port specified in nPortInput
+ setup for communication with the application / IL client.
+ @param [in] nPortOutput
+ nPortOutput is used to select the source port on component to be
+ used in the tunnel.
+ @param [in] hInput
+ This is the component to setup the tunnel with. This is the handle
+ of the component whose port, specified in the nPortInput parameter
+ will be used the destination for the tunnel. This is the component handle
+ returned by the call to the OMX_GetHandle function. There is a
+ requirement that hInput be the destination for the data when
+ tunelling (i.e. nPortInut is an input port). If 0x0, the component
+ specified in hOutput will have it's port specified in nPortPOutput
+ setup for communication with the application / IL client.
+ @param [in] nPortInput
+ nPortInput is used to select the destination port on component to be
+ used in the tunnel.
+ @return OMX_ERRORTYPE
+ If the command successfully executes, the return code will be
+ OMX_ErrorNone. Otherwise the appropriate OMX error will be returned.
+ When OMX_ErrorNotImplemented is returned, one or both components is
+ a non-interop component and does not support tunneling.
+
+ On failure, the ports of both components are setup for communication
+ with the application / IL Client.
+ @ingroup core tun
+ */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(
+ OMX_IN OMX_HANDLETYPE hOutput,
+ OMX_IN OMX_U32 nPortOutput,
+ OMX_IN OMX_HANDLETYPE hInput,
+ OMX_IN OMX_U32 nPortInput);
+
+/** @ingroup cp */
+OMX_API OMX_ERRORTYPE OMX_GetContentPipe(
+ OMX_OUT OMX_HANDLETYPE *hPipe,
+ OMX_IN OMX_STRING szURI);
+
+/** The OMX_GetComponentsOfRole method will return the number of components that support the given
+ role and (if the compNames field is non-NULL) the names of those components. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the compNames field NULL to determine the number of component names
+ * second call this function with the compNames field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ The core should return from this call within 5 msec.
+
+ @param [in] role
+ This is generic standard component name consisting only of component class
+ name and the type within that class (e.g. 'audio_decoder.aac').
+ @param [inout] pNumComps
+ This is used both as input and output.
+
+ If compNames is NULL, the input is ignored and the output specifies how many components support
+ the given role.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of components string names listed within the compNames parameter.
+ @param [inout] compNames
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings which accepts
+ a list of the names of all physical components that implement the specified standard component name.
+ Each name is NULL terminated. numComps indicates the number of names.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole (
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames);
+
+/** The OMX_GetRolesOfComponent method will return the number of roles supported by the given
+ component and (if the roles field is non-NULL) the names of those roles. The call will fail if
+ an insufficiently sized array of names is supplied. To ensure the array is sufficiently sized the
+ client should:
+ * first call this function with the roles field NULL to determine the number of role names
+ * second call this function with the roles field pointing to an array of names allocated
+ according to the number returned by the first call.
+
+ The core should return from this call within 5 msec.
+
+ @param [in] compName
+ This is the name of the component being queried about.
+ @param [inout] pNumRoles
+ This is used both as input and output.
+
+ If roles is NULL, the input is ignored and the output specifies how many roles the component supports.
+
+ If compNames is not NULL, on input it bounds the size of the input structure and
+ on output, it specifies the number of roles string names listed within the roles parameter.
+ @param [out] roles
+ If NULL this field is ignored. If non-NULL this points to an array of 128-byte strings
+ which accepts a list of the names of all standard components roles implemented on the
+ specified component name. numComps indicates the number of names.
+ @ingroup core
+ */
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent (
+ OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 *pNumRoles,
+ OMX_OUT OMX_U8 **roles);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
diff --git a/domx/omx_core/inc/OMX_CoreExt.h b/domx/omx_core/inc/OMX_CoreExt.h
new file mode 100755
index 0000000..5974d02
--- /dev/null
+++ b/domx/omx_core/inc/OMX_CoreExt.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2010 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_CoreExt.h - OpenMax IL version 1.1.2
+ * The OMX_CoreExt header file contains extensions to the definitions used
+ * by both the application and the component to access common items.
+ */
+
+#ifndef OMX_CoreExt_h
+#define OMX_CoreExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Core.h>
+
+/** Extensions to the standard IL errors. */
+typedef enum OMX_ERROREXTTYPE
+{
+ OMX_ErrorInvalidMode = (OMX_S32) (OMX_ErrorKhronosExtensions + 0x00000001),
+ OMX_ErrorExtMax = 0x7FFFFFFF
+} OMX_ERROREXTTYPE;
+
+
+/** Event type extensions. */
+typedef enum OMX_EVENTEXTTYPE
+{
+ OMX_EventIndexSettingChanged = OMX_EventKhronosExtensions, /**< component signals the IL client of a change
+ in a param, config, or extension */
+ OMX_EventExtMax = 0x7FFFFFFF
+} OMX_EVENTEXTTYPE;
+
+
+/** Enable or disable a callback event. */
+typedef struct OMX_CONFIG_CALLBACKREQUESTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_INDEXTYPE nIndex; /**< the index the callback is requested for */
+ OMX_BOOL bEnable; /**< enable (OMX_TRUE) or disable (OMX_FALSE) the callback */
+} OMX_CONFIG_CALLBACKREQUESTTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_CoreExt_h */
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_Core_Wrapper.h b/domx/omx_core/inc/OMX_Core_Wrapper.h
new file mode 100755
index 0000000..567a357
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Core_Wrapper.h
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** OMX_Core.h
+ * The OMX_Core header file contains the definitions used for PV core
+ */
+
+#ifndef OMX_TI_Core_h
+#define OMX_TI_Core_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Core.h>
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_Init(void);
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_Deinit(void);
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_ComponentNameEnum(
+ OMX_OUT OMX_STRING cComponentName,
+ OMX_IN OMX_U32 nNameLength,
+ OMX_IN OMX_U32 nIndex);
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_GetHandle(
+ OMX_OUT OMX_HANDLETYPE* pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_CALLBACKTYPE* pCallBacks);
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_FreeHandle(
+ OMX_IN OMX_HANDLETYPE hComponent);
+OMX_API OMX_ERRORTYPE TIOMX_GetComponentsOfRole (
+ OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps,
+ OMX_INOUT OMX_U8 **compNames);
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_SetupTunnel(
+ OMX_IN OMX_HANDLETYPE hOutput,
+ OMX_IN OMX_U32 nPortOutput,
+ OMX_IN OMX_HANDLETYPE hInput,
+ OMX_IN OMX_U32 nPortInput);
+OMX_API OMX_ERRORTYPE OMX_APIENTRY TIOMX_GetContentPipe(
+ OMX_OUT OMX_HANDLETYPE *hPipe,
+ OMX_IN OMX_STRING szURI);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
diff --git a/domx/omx_core/inc/OMX_Debug.h b/domx/omx_core/inc/OMX_Debug.h
new file mode 100755
index 0000000..0ccc351
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Debug.h
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OMX_DEBUG_H
+#define OMX_DEBUG_H
+
+#include "OMX_DebugMem.h"
+
+#define OMX_NO_MESSAGES 0x00000000
+#define OMX_ALL_MESSAGES 0xffff0000
+
+#define OMX_MASK_FATAL 0x80000000
+#define OMX_MASK_ERROR 0x40000000
+#define OMX_MASK_WARN 0x20000000
+#define OMX_MASK_INFO 0x10000000
+#define OMX_MASK_DEBUG 0x08000000
+#define OMX_MASK_TRACE 0x04000000
+#define OMX_MASK_RESERVE1 0x02000000
+#define OMX_MASK_RESERVE2 0x01000000
+
+#define OMX_MASK_USERMASK 0x00FF0000
+
+#define OMX_OPTION_FILE 0x00000001
+#define OMX_OPTION_FUNC 0x00000002
+#define OMX_OPTION_LINE 0x00000004
+
+#define OMX_MASK_HANDLES 0x0000FFFF
+
+
+
+/*
+ * ANSI escape sequences for outputing text in various colors
+ */
+#define DBG_TEXT_WHITE "\x1b[1;37;40m"
+#define DBG_TEXT_YELLOW "\x1b[1;33;40m"
+#define DBG_TEXT_MAGENTA "\x1b[1;35;40m"
+#define DBG_TEXT_GREEN "\x1b[1;32;40m"
+#define DBG_TEXT_CYAN "\x1b[1;36;40m"
+#define DBG_TEXT_RED "\x1b[1;31;40m"
+
+
+/* Setup log format (adds newline if no newline provided) */
+// do not use this one directly....
+#define OMX_LOG_PRINT(HANDLE, STR, ARG...) \
+ (OMX_Log(HANDLE, __FILE__, __LINE__, __FUNCTION__, STR, ##ARG))
+
+#ifdef OMX_DEBUG
+ #define OMX_DPRINT(HANDLE, STR, ARG...) OMX_LOG_PRINT(OMX_MASK_DEBUG | HANDLE, STR, ##ARG)
+ #define OMX_TPRINT(HANDLE, STR, ARG...) OMX_LOG_PRINT(OMX_MASK_TRACE | HANDLE, STR, ##ARG)
+#else
+ #define OMX_DPRINT(HANDLE, STR, ARG...)
+ #define OMX_TPRINT(HANDLE, STR, ARG...)
+#endif
+
+/* Later this will be able to be turned on/off separately as a trace */
+#define OMX_DENTER(handle) OMX_TPRINT((handle), "+++ENTERING")
+#define OMX_DEXIT(handle,retVal) OMX_TPRINT((handle), "---EXITING(0x%x)", (retVal))
+
+#define OMX_DBG_INT(handle, intVar) OMX_DPRINT(OMX_MASK_DEBUG | (handle), #intVar ": %d", (intVar))
+#define OMX_DBG_PTR(handle, ptrVar) OMX_DPRINT(OMX_MASK_DEBUG | (handle), #ptrVar ": 0x%08x", (ptrVar))
+#define OMX_DBG_STR(handle, strVar) OMX_DPRINT(OMX_MASK_DEBUG | (handle), #strVar ": %s", (strVar))
+
+
+/* Error/warning printing defines to be used by all sub-components */
+#define OMX_INFOPRINT(handle, str,arg...) (OMX_LOG_PRINT(OMX_MASK_INFO | (handle), "(INFO) "str, ##arg))
+#define OMX_WARNPRINT(handle, str,arg...) (OMX_LOG_PRINT(OMX_MASK_WARN | (handle), "(WARN) "str, ##arg))
+#define OMX_ERRPRINT(handle, str,arg...) (OMX_LOG_PRINT(OMX_MASK_ERROR | (handle), "(ERROR) "str, ##arg))
+#define OMX_FATALPRINT(handle, str,arg...) (OMX_LOG_PRINT(OMX_MASK_FATAL | (handle), "(FATAL) "str, ##arg))
+
+/* assert macros */
+#ifdef OMX_DEBUG
+ #define OMX_ASSERT(COND) ((!(COND))?OMX_FATALPRINT(0,"OMX_ASSERT("#COND")"),abort():0)
+#else
+ #define OMX_ASSERT(COND)
+#endif
+
+#define OMX_LOG_ADD_MASK(HANDLE,NEW_BITS) (OMX_Log_SetMask((HANDLE), OMX_Log_GetMask(HANDLE) | (NEW_BITS)))
+#define OMX_LOG_CLEAR_MASK(HANDLE,NEW_BITS) (OMX_Log_SetMask((HANDLE), OMX_Log_GetMask(HANDLE) & ~(NEW_BITS)))
+
+#define OMX_LOG_ADD_OPTIONS(HANDLE,NEW_BITS) (OMX_Log_SetOptions((HANDLE), OMX_Log_GetOptions(HANDLE) | (NEW_BITS)))
+#define OMX_LOG_CLEAR_OPTIONS(HANDLE,NEW_BITS) (OMX_Log_SetOptions((HANDLE), OMX_Log_GetOptions(HANDLE) & ~(NEW_BITS)))
+
+typedef unsigned int OMX_DBG_HANDLE;
+
+OMX_DBG_HANDLE OMX_Log_GetDebugHandle(const char *description);
+void OMX_Log_ReleaseDebugHandle(OMX_DBG_HANDLE hDebug);
+unsigned int OMX_Log_GetMask(OMX_DBG_HANDLE hDebug);
+unsigned int OMX_Log_SetMask(OMX_DBG_HANDLE hDebug, unsigned int uiNewMask);
+
+unsigned int OMX_Log_GetOptions(OMX_DBG_HANDLE hDebug);
+unsigned int OMX_Log_SetOptions(OMX_DBG_HANDLE hDebug, unsigned int uiNewOptions);
+
+void OMX_Log(unsigned int mask, const char *szFileName, int iLineNum,
+ const char *szFunctionName, const char *strFormat, ...);
+
+const char *OMX_GetErrorString(OMX_ERRORTYPE error);
+
+OMX_ERRORTYPE OMX_Log_LoadConfigFile(char* szConfigFile);
+
+
+/*
+ * The following macros are intended to make accessing a debug handle easier.
+ *
+ * For example, for the Util library, you would create a header file called
+ * OMX_Util_Private.h. This file will be included in all source files
+ * compiled into the Util library. The header file uses the 'define' macro
+ * to generate a prototype for the getDebugHandle() function:
+ *
+ * DEFINE_DEBUG_HANDLE_FN(UTIL);
+ *
+ * Now, in your private header file, define easier macros for printing:
+ *
+ * #define UTIL_DPRINT(str,args...) OMX_DPRINT(ACCESS_DEBUG_HANDLE(UTIL),str,##args)
+ * #define UTIL_WARNPRINT(str,args...) OMX_WARNPRINT(ACCESS_DEBUG_HANDLE(UTIL),str,##args)
+ * #define UTIL_ERRPRINT(str,args...) OMX_ERRPRINT(ACCESS_DEBUG_HANDLE(UTIL),str,##args)
+ *
+ * Finally, in a source file which will be compiled into the lib, for example
+ * OMX_Util_Private.c, you implement the function with the 'implement' macro:
+ *
+ * IMPLEMENT_DEBUG_HANDLE_FN(UTIL)
+ *
+ */
+#define DEFINE_DEBUG_HANDLE_FN(MOD) OMX_DBG_HANDLE getDebugHandle_##MOD(void);
+
+#define ACCESS_DEBUG_HANDLE(MOD) getDebugHandle_##MOD()
+
+#define IMPLMENT_DEBUG_HANDLE_FN(MOD) \
+OMX_DBG_HANDLE getDebugHandle_##MOD(void) \
+{ \
+ static OMX_DBG_HANDLE hDebug = 0; \
+ if(!hDebug) { \
+ hDebug = OMX_Log_GetDebugHandle(#MOD); \
+ OMX_DPRINT(0,"Component "#MOD": hDebug %d",hDebug); \
+ } \
+ return hDebug; \
+}
+
+
+
+#endif
+
diff --git a/domx/omx_core/inc/OMX_DebugMem.h b/domx/omx_core/inc/OMX_DebugMem.h
new file mode 100755
index 0000000..f45cfe0
--- /dev/null
+++ b/domx/omx_core/inc/OMX_DebugMem.h
@@ -0,0 +1,71 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef OMX_DEBUGMEM_H
+#define OMX_DEBUGMEM_H
+
+#include <stdlib.h> // for size_t
+
+#if OMX_DEBUG
+void* OMX_DebugMem_calloc(size_t num, size_t size,
+ const char* file, const char* func, int line);
+void* OMX_DebugMem_malloc(size_t size,
+ const char* file, const char* func, int line);
+void* OMX_DebugMem_realloc(void *ptr, size_t size,
+ const char* file, const char* func, int line);
+void OMX_DebugMem_free(void* ptr,
+ const char* file, const char* func, int line);
+int OMX_DebugMem_validate(void *ptr,
+ const char* file, const char* func, int line);
+
+void OMX_DebugMem_dump(const char *file, const char *func, int line);
+#endif
+
+#define OMX_MASK_MEMORY 0x00010000 /** One of the reserved bits from OMX_MASK_USERMASK */
+
+#define MEM_DEBUG_HANDLE_DESCR "DebugMemory"
+
+#if OMX_DEBUG
+ #define malloc(x) OMX_DebugMem_malloc(x,__FILE__,__FUNCTION__,__LINE__)
+ #define calloc(n,s) OMX_DebugMem_calloc(n,s,__FILE__,__FUNCTION__,__LINE__)
+ #define realloc(x,s) OMX_DebugMem_realloc(x,s,__FILE__,__FUNCTION__,__LINE__)
+ #define free(x) OMX_DebugMem_free(x,__FILE__,__FUNCTION__ ,__LINE__)
+ #define validate(x) OMX_DebugMem_validate(x, __FILE__,__FUNCTION__ ,__LINE__)
+ #define dump() OMX_DebugMem_dump( __FILE__,__FUNCTION__ ,__LINE__)
+#else
+ #define validate(x)
+ #define dump()
+#endif
+
+
+#endif
+
diff --git a/domx/omx_core/inc/OMX_IVCommon.h b/domx/omx_core/inc/OMX_IVCommon.h
new file mode 100644
index 0000000..c3968ca
--- /dev/null
+++ b/domx/omx_core/inc/OMX_IVCommon.h
@@ -0,0 +1,947 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/**
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * @file OMX_IVCommon.h - OpenMax IL version 1.1.2
+ * The structures needed by Video and Image components to exchange
+ * parameters and configuration data with the components.
+ */
+#ifndef OMX_IVCommon_h
+#define OMX_IVCommon_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/**
+ * Each OMX header must include all required header files to allow the header
+ * to compile without errors. The includes below are required for this header
+ * file to compile successfully
+ */
+
+#include <OMX_Core.h>
+
+/** @defgroup iv OpenMAX IL Imaging and Video Domain
+ * Common structures for OpenMAX IL Imaging and Video domains
+ * @{
+ */
+
+
+/**
+ * Enumeration defining possible uncompressed image/video formats.
+ *
+ * ENUMS:
+ * Unused : Placeholder value when format is N/A
+ * Monochrome : black and white
+ * 8bitRGB332 : Red 7:5, Green 4:2, Blue 1:0
+ * 12bitRGB444 : Red 11:8, Green 7:4, Blue 3:0
+ * 16bitARGB4444 : Alpha 15:12, Red 11:8, Green 7:4, Blue 3:0
+ * 16bitARGB1555 : Alpha 15, Red 14:10, Green 9:5, Blue 4:0
+ * 16bitRGB565 : Red 15:11, Green 10:5, Blue 4:0
+ * 16bitBGR565 : Blue 15:11, Green 10:5, Red 4:0
+ * 18bitRGB666 : Red 17:12, Green 11:6, Blue 5:0
+ * 18bitARGB1665 : Alpha 17, Red 16:11, Green 10:5, Blue 4:0
+ * 19bitARGB1666 : Alpha 18, Red 17:12, Green 11:6, Blue 5:0
+ * 24bitRGB888 : Red 24:16, Green 15:8, Blue 7:0
+ * 24bitBGR888 : Blue 24:16, Green 15:8, Red 7:0
+ * 24bitARGB1887 : Alpha 23, Red 22:15, Green 14:7, Blue 6:0
+ * 25bitARGB1888 : Alpha 24, Red 23:16, Green 15:8, Blue 7:0
+ * 32bitBGRA8888 : Blue 31:24, Green 23:16, Red 15:8, Alpha 7:0
+ * 32bitARGB8888 : Alpha 31:24, Red 23:16, Green 15:8, Blue 7:0
+ * YUV411Planar : U,Y are subsampled by a factor of 4 horizontally
+ * YUV411PackedPlanar : packed per payload in planar slices
+ * YUV420Planar : Three arrays Y,U,V.
+ * YUV420PackedPlanar : packed per payload in planar slices
+ * YUV420SemiPlanar : Two arrays, one is all Y, the other is U and V
+ * YUV422Planar : Three arrays Y,U,V.
+ * YUV422PackedPlanar : packed per payload in planar slices
+ * YUV422SemiPlanar : Two arrays, one is all Y, the other is U and V
+ * YCbYCr : Organized as 16bit YUYV (i.e. YCbYCr)
+ * YCrYCb : Organized as 16bit YVYU (i.e. YCrYCb)
+ * CbYCrY : Organized as 16bit UYVY (i.e. CbYCrY)
+ * CrYCbY : Organized as 16bit VYUY (i.e. CrYCbY)
+ * YUV444Interleaved : Each pixel contains equal parts YUV
+ * RawBayer8bit : SMIA camera output format
+ * RawBayer10bit : SMIA camera output format
+ * RawBayer8bitcompressed : SMIA camera output format
+ */
+typedef enum OMX_COLOR_FORMATTYPE {
+ OMX_COLOR_FormatUnused,
+ OMX_COLOR_FormatMonochrome,
+ OMX_COLOR_Format8bitRGB332,
+ OMX_COLOR_Format12bitRGB444,
+ OMX_COLOR_Format16bitARGB4444,
+ OMX_COLOR_Format16bitARGB1555,
+ OMX_COLOR_Format16bitRGB565,
+ OMX_COLOR_Format16bitBGR565,
+ OMX_COLOR_Format18bitRGB666,
+ OMX_COLOR_Format18bitARGB1665,
+ OMX_COLOR_Format19bitARGB1666,
+ OMX_COLOR_Format24bitRGB888,
+ OMX_COLOR_Format24bitBGR888,
+ OMX_COLOR_Format24bitARGB1887,
+ OMX_COLOR_Format25bitARGB1888,
+ OMX_COLOR_Format32bitBGRA8888,
+ OMX_COLOR_Format32bitARGB8888,
+ OMX_COLOR_FormatYUV411Planar,
+ OMX_COLOR_FormatYUV411PackedPlanar,
+ OMX_COLOR_FormatYUV420Planar,
+ OMX_COLOR_FormatYUV420PackedPlanar,
+ OMX_COLOR_FormatYUV420SemiPlanar,
+ OMX_COLOR_FormatYUV422Planar,
+ OMX_COLOR_FormatYUV422PackedPlanar,
+ OMX_COLOR_FormatYUV422SemiPlanar,
+ OMX_COLOR_FormatYCbYCr,
+ OMX_COLOR_FormatYCrYCb,
+ OMX_COLOR_FormatCbYCrY,
+ OMX_COLOR_FormatCrYCbY,
+ OMX_COLOR_FormatYUV444Interleaved,
+ OMX_COLOR_FormatRawBayer8bit,
+ OMX_COLOR_FormatRawBayer10bit,
+ OMX_COLOR_FormatRawBayer8bitcompressed,
+ OMX_COLOR_FormatL2,
+ OMX_COLOR_FormatL4,
+ OMX_COLOR_FormatL8,
+ OMX_COLOR_FormatL16,
+ OMX_COLOR_FormatL24,
+ OMX_COLOR_FormatL32,
+ OMX_COLOR_FormatYUV420PackedSemiPlanar,
+ OMX_COLOR_FormatYUV422PackedSemiPlanar,
+ OMX_COLOR_Format18BitBGR666,
+ OMX_COLOR_Format24BitARGB6666,
+ OMX_COLOR_Format24BitABGR6666,
+ OMX_COLOR_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_COLOR_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ /**<Reserved android opaque colorformat. Tells the encoder that
+ * the actual colorformat will be relayed by the
+ * Gralloc Buffers.
+ * FIXME: In the process of reserving some enum values for
+ * Android-specific OMX IL colorformats. Change this enum to
+ * an acceptable range once that is done.
+ * */
+ OMX_COLOR_FormatAndroidOpaque = 0x7F000789,
+ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
+ OMX_QCOM_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka = 0x7FA30C03,
+ OMX_COLOR_FormatMax = 0x7FFFFFFF
+} OMX_COLOR_FORMATTYPE;
+
+
+/**
+ * Defines the matrix for conversion from RGB to YUV or vice versa.
+ * iColorMatrix should be initialized with the fixed point values
+ * used in converting between formats.
+ */
+typedef struct OMX_CONFIG_COLORCONVERSIONTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+ OMX_U32 nPortIndex; /**< Port that this struct applies to */
+ OMX_S32 xColorMatrix[3][3]; /**< Stored in signed Q16 format */
+ OMX_S32 xColorOffset[4]; /**< Stored in signed Q16 format */
+}OMX_CONFIG_COLORCONVERSIONTYPE;
+
+
+/**
+ * Structure defining percent to scale each frame dimension. For example:
+ * To make the width 50% larger, use fWidth = 1.5 and to make the width
+ * 1/2 the original size, use fWidth = 0.5
+ */
+typedef struct OMX_CONFIG_SCALEFACTORTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+ OMX_U32 nPortIndex; /**< Port that this struct applies to */
+ OMX_S32 xWidth; /**< Fixed point value stored as Q16 */
+ OMX_S32 xHeight; /**< Fixed point value stored as Q16 */
+}OMX_CONFIG_SCALEFACTORTYPE;
+
+
+/**
+ * Enumeration of possible image filter types
+ */
+typedef enum OMX_IMAGEFILTERTYPE {
+ OMX_ImageFilterNone,
+ OMX_ImageFilterNoise,
+ OMX_ImageFilterEmboss,
+ OMX_ImageFilterNegative,
+ OMX_ImageFilterSketch,
+ OMX_ImageFilterOilPaint,
+ OMX_ImageFilterHatch,
+ OMX_ImageFilterGpen,
+ OMX_ImageFilterAntialias,
+ OMX_ImageFilterDeRing,
+ OMX_ImageFilterSolarize,
+ OMX_ImageFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ImageFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ImageFilterMax = 0x7FFFFFFF
+} OMX_IMAGEFILTERTYPE;
+
+
+/**
+ * Image filter configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eImageFilter : Image filter type enumeration
+ */
+typedef struct OMX_CONFIG_IMAGEFILTERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGEFILTERTYPE eImageFilter;
+} OMX_CONFIG_IMAGEFILTERTYPE;
+
+
+/**
+ * Customized U and V for color enhancement
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bColorEnhancement : Enable/disable color enhancement
+ * nCustomizedU : Practical values: 16-240, range: 0-255, value set for
+ * U component
+ * nCustomizedV : Practical values: 16-240, range: 0-255, value set for
+ * V component
+ */
+typedef struct OMX_CONFIG_COLORENHANCEMENTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bColorEnhancement;
+ OMX_U8 nCustomizedU;
+ OMX_U8 nCustomizedV;
+} OMX_CONFIG_COLORENHANCEMENTTYPE;
+
+
+/**
+ * Define color key and color key mask
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nARGBColor : 32bit Alpha, Red, Green, Blue Color
+ * nARGBMask : 32bit Mask for Alpha, Red, Green, Blue channels
+ */
+typedef struct OMX_CONFIG_COLORKEYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nARGBColor;
+ OMX_U32 nARGBMask;
+} OMX_CONFIG_COLORKEYTYPE;
+
+
+/**
+ * List of color blend types for pre/post processing
+ *
+ * ENUMS:
+ * None : No color blending present
+ * AlphaConstant : Function is (alpha_constant * src) +
+ * (1 - alpha_constant) * dst)
+ * AlphaPerPixel : Function is (alpha * src) + (1 - alpha) * dst)
+ * Alternate : Function is alternating pixels from src and dst
+ * And : Function is (src & dst)
+ * Or : Function is (src | dst)
+ * Invert : Function is ~src
+ */
+typedef enum OMX_COLORBLENDTYPE {
+ OMX_ColorBlendNone,
+ OMX_ColorBlendAlphaConstant,
+ OMX_ColorBlendAlphaPerPixel,
+ OMX_ColorBlendAlternate,
+ OMX_ColorBlendAnd,
+ OMX_ColorBlendOr,
+ OMX_ColorBlendInvert,
+ OMX_ColorBlendKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ColorBlendVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ColorBlendMax = 0x7FFFFFFF
+} OMX_COLORBLENDTYPE;
+
+
+/**
+ * Color blend configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRGBAlphaConstant : Constant global alpha values when global alpha is used
+ * eColorBlend : Color blend type enumeration
+ */
+typedef struct OMX_CONFIG_COLORBLENDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nRGBAlphaConstant;
+ OMX_COLORBLENDTYPE eColorBlend;
+} OMX_CONFIG_COLORBLENDTYPE;
+
+
+/**
+ * Hold frame dimension
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nWidth : Frame width in pixels
+ * nHeight : Frame height in pixels
+ */
+typedef struct OMX_FRAMESIZETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_FRAMESIZETYPE;
+
+
+/**
+ * Rotation configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nRotation : +/- integer rotation value
+ */
+typedef struct OMX_CONFIG_ROTATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nRotation;
+} OMX_CONFIG_ROTATIONTYPE;
+
+
+/**
+ * Possible mirroring directions for pre/post processing
+ *
+ * ENUMS:
+ * None : No mirroring
+ * Vertical : Vertical mirroring, flip on X axis
+ * Horizontal : Horizontal mirroring, flip on Y axis
+ * Both : Both vertical and horizontal mirroring
+ */
+typedef enum OMX_MIRRORTYPE {
+ OMX_MirrorNone = 0,
+ OMX_MirrorVertical,
+ OMX_MirrorHorizontal,
+ OMX_MirrorBoth,
+ OMX_MirrorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MirrorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_MirrorMax = 0x7FFFFFFF
+} OMX_MIRRORTYPE;
+
+
+/**
+ * Mirroring configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eMirror : Mirror type enumeration
+ */
+typedef struct OMX_CONFIG_MIRRORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_MIRRORTYPE eMirror;
+} OMX_CONFIG_MIRRORTYPE;
+
+
+/**
+ * Position information only
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nX : X coordinate for the point
+ * nY : Y coordinate for the point
+ */
+typedef struct OMX_CONFIG_POINTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nX;
+ OMX_S32 nY;
+} OMX_CONFIG_POINTTYPE;
+
+
+/**
+ * Frame size plus position
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLeft : X Coordinate of the top left corner of the rectangle
+ * nTop : Y Coordinate of the top left corner of the rectangle
+ * nWidth : Width of the rectangle
+ * nHeight : Height of the rectangle
+ */
+typedef struct OMX_CONFIG_RECTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_CONFIG_RECTTYPE;
+
+
+/**
+ * Deblocking state; it is required to be set up before starting the codec
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bDeblocking : Enable/disable deblocking mode
+ */
+typedef struct OMX_PARAM_DEBLOCKINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bDeblocking;
+} OMX_PARAM_DEBLOCKINGTYPE;
+
+
+/**
+ * Stabilization state
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bStab : Enable/disable frame stabilization state
+ */
+typedef struct OMX_CONFIG_FRAMESTABTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bStab;
+} OMX_CONFIG_FRAMESTABTYPE;
+
+
+/**
+ * White Balance control type
+ *
+ * STRUCT MEMBERS:
+ * SunLight : Referenced in JSR-234
+ * Flash : Optimal for device's integrated flash
+ */
+typedef enum OMX_WHITEBALCONTROLTYPE {
+ OMX_WhiteBalControlOff = 0,
+ OMX_WhiteBalControlAuto,
+ OMX_WhiteBalControlSunLight,
+ OMX_WhiteBalControlCloudy,
+ OMX_WhiteBalControlShade,
+ OMX_WhiteBalControlTungsten,
+ OMX_WhiteBalControlFluorescent,
+ OMX_WhiteBalControlIncandescent,
+ OMX_WhiteBalControlFlash,
+ OMX_WhiteBalControlHorizon,
+ OMX_WhiteBalControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_WhiteBalControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_WhiteBalControlMax = 0x7FFFFFFF
+} OMX_WHITEBALCONTROLTYPE;
+
+
+/**
+ * White Balance control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eWhiteBalControl : White balance enumeration
+ */
+typedef struct OMX_CONFIG_WHITEBALCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_WHITEBALCONTROLTYPE eWhiteBalControl;
+} OMX_CONFIG_WHITEBALCONTROLTYPE;
+
+
+/**
+ * Exposure control type
+ */
+typedef enum OMX_EXPOSURECONTROLTYPE {
+ OMX_ExposureControlOff = 0,
+ OMX_ExposureControlAuto,
+ OMX_ExposureControlNight,
+ OMX_ExposureControlBackLight,
+ OMX_ExposureControlSpotLight,
+ OMX_ExposureControlSports,
+ OMX_ExposureControlSnow,
+ OMX_ExposureControlBeach,
+ OMX_ExposureControlLargeAperture,
+ OMX_ExposureControlSmallApperture,
+ OMX_ExposureControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_ExposureControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_ExposureControlMax = 0x7FFFFFFF
+} OMX_EXPOSURECONTROLTYPE;
+
+
+/**
+ * White Balance control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eExposureControl : Exposure control enumeration
+ */
+typedef struct OMX_CONFIG_EXPOSURECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_EXPOSURECONTROLTYPE eExposureControl;
+} OMX_CONFIG_EXPOSURECONTROLTYPE;
+
+
+/**
+ * Defines sensor supported mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nFrameRate : Single shot mode is indicated by a 0
+ * bOneShot : Enable for single shot, disable for streaming
+ * sFrameSize : Framesize
+ */
+typedef struct OMX_PARAM_SENSORMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameRate;
+ OMX_BOOL bOneShot;
+ OMX_FRAMESIZETYPE sFrameSize;
+} OMX_PARAM_SENSORMODETYPE;
+
+
+/**
+ * Defines contrast level
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nContrast : Values allowed for contrast -100 to 100, zero means no change
+ */
+typedef struct OMX_CONFIG_CONTRASTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nContrast;
+} OMX_CONFIG_CONTRASTTYPE;
+
+
+/**
+ * Defines brightness level
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBrightness : 0-100%
+ */
+typedef struct OMX_CONFIG_BRIGHTNESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBrightness;
+} OMX_CONFIG_BRIGHTNESSTYPE;
+
+
+/**
+ * Defines backlight level configuration for a video sink, e.g. LCD panel
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBacklight : Values allowed for backlight 0-100%
+ * nTimeout : Number of milliseconds before backlight automatically turns
+ * off. A value of 0x0 disables backight timeout
+ */
+typedef struct OMX_CONFIG_BACKLIGHTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBacklight;
+ OMX_U32 nTimeout;
+} OMX_CONFIG_BACKLIGHTTYPE;
+
+
+/**
+ * Defines setting for Gamma
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nGamma : Values allowed for gamma -100 to 100, zero means no change
+ */
+typedef struct OMX_CONFIG_GAMMATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nGamma;
+} OMX_CONFIG_GAMMATYPE;
+
+
+/**
+ * Define for setting saturation
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSaturation : Values allowed for saturation -100 to 100, zero means
+ * no change
+ */
+typedef struct OMX_CONFIG_SATURATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nSaturation;
+} OMX_CONFIG_SATURATIONTYPE;
+
+
+/**
+ * Define for setting Lightness
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLightness : Values allowed for lightness -100 to 100, zero means no
+ * change
+ */
+typedef struct OMX_CONFIG_LIGHTNESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLightness;
+} OMX_CONFIG_LIGHTNESSTYPE;
+
+
+/**
+ * Plane blend configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Index of input port associated with the plane.
+ * nDepth : Depth of the plane in relation to the screen. Higher
+ * numbered depths are "behind" lower number depths.
+ * This number defaults to the Port Index number.
+ * nAlpha : Transparency blending component for the entire plane.
+ * See blending modes for more detail.
+ */
+typedef struct OMX_CONFIG_PLANEBLENDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDepth;
+ OMX_U32 nAlpha;
+} OMX_CONFIG_PLANEBLENDTYPE;
+
+
+/**
+ * Define interlace type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnable : Enable control variable for this functionality
+ * (see below)
+ * nInterleavePortIndex : Index of input or output port associated with
+ * the interleaved plane.
+ * pPlanarPortIndexes[4] : Index of input or output planar ports.
+ */
+typedef struct OMX_PARAM_INTERLEAVETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_U32 nInterleavePortIndex;
+} OMX_PARAM_INTERLEAVETYPE;
+
+
+/**
+ * Defines the picture effect used for an input picture
+ */
+typedef enum OMX_TRANSITIONEFFECTTYPE {
+ OMX_EffectNone,
+ OMX_EffectFadeFromBlack,
+ OMX_EffectFadeToBlack,
+ OMX_EffectUnspecifiedThroughConstantColor,
+ OMX_EffectDissolve,
+ OMX_EffectWipe,
+ OMX_EffectUnspecifiedMixOfTwoScenes,
+ OMX_EffectKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_EffectVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_EffectMax = 0x7FFFFFFF
+} OMX_TRANSITIONEFFECTTYPE;
+
+
+/**
+ * Structure used to configure current transition effect
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eEffect : Effect to enable
+ */
+typedef struct OMX_CONFIG_TRANSITIONEFFECTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TRANSITIONEFFECTTYPE eEffect;
+} OMX_CONFIG_TRANSITIONEFFECTTYPE;
+
+
+/**
+ * Defines possible data unit types for encoded video data. The data unit
+ * types are used both for encoded video input for playback as well as
+ * encoded video output from recording.
+ */
+typedef enum OMX_DATAUNITTYPE {
+ OMX_DataUnitCodedPicture,
+ OMX_DataUnitVideoSegment,
+ OMX_DataUnitSeveralSegments,
+ OMX_DataUnitArbitraryStreamSection,
+ OMX_DataUnitKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_DataUnitVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_DataUnitMax = 0x7FFFFFFF
+} OMX_DATAUNITTYPE;
+
+
+/**
+ * Defines possible encapsulation types for coded video data unit. The
+ * encapsulation information is used both for encoded video input for
+ * playback as well as encoded video output from recording.
+ */
+typedef enum OMX_DATAUNITENCAPSULATIONTYPE {
+ OMX_DataEncapsulationElementaryStream,
+ OMX_DataEncapsulationGenericPayload,
+ OMX_DataEncapsulationRtpPayload,
+ OMX_DataEncapsulationKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_DataEncapsulationVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_DataEncapsulationMax = 0x7FFFFFFF
+} OMX_DATAUNITENCAPSULATIONTYPE;
+
+
+/**
+ * Structure used to configure the type of being decoded/encoded
+ */
+typedef struct OMX_PARAM_DATAUNITTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_DATAUNITTYPE eUnitType;
+ OMX_DATAUNITENCAPSULATIONTYPE eEncapsulationType;
+} OMX_PARAM_DATAUNITTYPE;
+
+
+/**
+ * Defines dither types
+ */
+typedef enum OMX_DITHERTYPE {
+ OMX_DitherNone,
+ OMX_DitherOrdered,
+ OMX_DitherErrorDiffusion,
+ OMX_DitherOther,
+ OMX_DitherKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_DitherVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_DitherMax = 0x7FFFFFFF
+} OMX_DITHERTYPE;
+
+
+/**
+ * Structure used to configure current type of dithering
+ */
+typedef struct OMX_CONFIG_DITHERTYPE {
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_DITHERTYPE eDither; /**< Type of dithering to use */
+} OMX_CONFIG_DITHERTYPE;
+
+typedef struct OMX_CONFIG_CAPTUREMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< Port that this structure applies to */
+ OMX_BOOL bContinuous; /**< If true then ignore frame rate and emit capture
+ * data as fast as possible (otherwise obey port's frame rate). */
+ OMX_BOOL bFrameLimited; /**< If true then terminate capture after the port emits the
+ * specified number of frames (otherwise the port does not
+ * terminate the capture until instructed to do so by the client).
+ * Even if set, the client may manually terminate the capture prior
+ * to reaching the limit. */
+ OMX_U32 nFrameLimit; /**< Limit on number of frames emitted during a capture (only
+ * valid if bFrameLimited is set). */
+} OMX_CONFIG_CAPTUREMODETYPE;
+
+typedef enum OMX_METERINGTYPE {
+
+ OMX_MeteringModeAverage, /**< Center-weighted average metering. */
+ OMX_MeteringModeSpot, /**< Spot (partial) metering. */
+ OMX_MeteringModeMatrix, /**< Matrix or evaluative metering. */
+
+ OMX_MeteringKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_MeteringVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_EVModeMax = 0x7fffffff
+} OMX_METERINGTYPE;
+
+typedef struct OMX_CONFIG_EXPOSUREVALUETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_METERINGTYPE eMetering;
+ OMX_S32 xEVCompensation; /**< Fixed point value stored as Q16 */
+ OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
+ OMX_BOOL bAutoAperture; /**< Whether aperture number is defined automatically */
+ OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
+ OMX_BOOL bAutoShutterSpeed; /**< Whether shutter speed is defined automatically */
+ OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
+ OMX_BOOL bAutoSensitivity; /**< Whether sensitivity is defined automatically */
+} OMX_CONFIG_EXPOSUREVALUETYPE;
+
+/**
+ * Focus region configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bCenter : Use center region as focus region of interest
+ * bLeft : Use left region as focus region of interest
+ * bRight : Use right region as focus region of interest
+ * bTop : Use top region as focus region of interest
+ * bBottom : Use bottom region as focus region of interest
+ * bTopLeft : Use top left region as focus region of interest
+ * bTopRight : Use top right region as focus region of interest
+ * bBottomLeft : Use bottom left region as focus region of interest
+ * bBottomRight : Use bottom right region as focus region of interest
+ */
+typedef struct OMX_CONFIG_FOCUSREGIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bCenter;
+ OMX_BOOL bLeft;
+ OMX_BOOL bRight;
+ OMX_BOOL bTop;
+ OMX_BOOL bBottom;
+ OMX_BOOL bTopLeft;
+ OMX_BOOL bTopRight;
+ OMX_BOOL bBottomLeft;
+ OMX_BOOL bBottomRight;
+} OMX_CONFIG_FOCUSREGIONTYPE;
+
+/**
+ * Focus Status type
+ */
+typedef enum OMX_FOCUSSTATUSTYPE {
+ OMX_FocusStatusOff = 0,
+ OMX_FocusStatusRequest,
+ OMX_FocusStatusReached,
+ OMX_FocusStatusUnableToReach,
+ OMX_FocusStatusLost,
+ OMX_FocusStatusKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_FocusStatusVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_FocusStatusMax = 0x7FFFFFFF
+} OMX_FOCUSSTATUSTYPE;
+
+/**
+ * Focus status configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFocusStatus : Specifies the focus status
+ * bCenterStatus : Use center region as focus region of interest
+ * bLeftStatus : Use left region as focus region of interest
+ * bRightStatus : Use right region as focus region of interest
+ * bTopStatus : Use top region as focus region of interest
+ * bBottomStatus : Use bottom region as focus region of interest
+ * bTopLeftStatus : Use top left region as focus region of interest
+ * bTopRightStatus : Use top right region as focus region of interest
+ * bBottomLeftStatus : Use bottom left region as focus region of interest
+ * bBottomRightStatus : Use bottom right region as focus region of interest
+ */
+typedef struct OMX_PARAM_FOCUSSTATUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_FOCUSSTATUSTYPE eFocusStatus;
+ OMX_BOOL bCenterStatus;
+ OMX_BOOL bLeftStatus;
+ OMX_BOOL bRightStatus;
+ OMX_BOOL bTopStatus;
+ OMX_BOOL bBottomStatus;
+ OMX_BOOL bTopLeftStatus;
+ OMX_BOOL bTopRightStatus;
+ OMX_BOOL bBottomLeftStatus;
+ OMX_BOOL bBottomRightStatus;
+} OMX_PARAM_FOCUSSTATUSTYPE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_Image.h b/domx/omx_core/inc/OMX_Image.h
new file mode 100644
index 0000000..23a0209
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Image.h
@@ -0,0 +1,345 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/**
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/**
+ * @file OMX_Image.h - OpenMax IL version 1.1.2
+ * The structures needed by Image components to exchange parameters and
+ * configuration data with the components.
+ */
+#ifndef OMX_Image_h
+#define OMX_Image_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/**
+ * Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_IVCommon.h>
+
+/** @defgroup imaging OpenMAX IL Imaging Domain
+ * @ingroup iv
+ * Structures for OpenMAX IL Imaging domain
+ * @{
+ */
+
+/**
+ * Enumeration used to define the possible image compression coding.
+ */
+typedef enum OMX_IMAGE_CODINGTYPE {
+ OMX_IMAGE_CodingUnused, /**< Value when format is N/A */
+ OMX_IMAGE_CodingAutoDetect, /**< Auto detection of image format */
+ OMX_IMAGE_CodingJPEG, /**< JPEG/JFIF image format */
+ OMX_IMAGE_CodingJPEG2K, /**< JPEG 2000 image format */
+ OMX_IMAGE_CodingEXIF, /**< EXIF image format */
+ OMX_IMAGE_CodingTIFF, /**< TIFF image format */
+ OMX_IMAGE_CodingGIF, /**< Graphics image format */
+ OMX_IMAGE_CodingPNG, /**< PNG image format */
+ OMX_IMAGE_CodingLZW, /**< LZW image format */
+ OMX_IMAGE_CodingBMP, /**< Windows Bitmap format */
+ OMX_IMAGE_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_CodingMax = 0x7FFFFFFF
+} OMX_IMAGE_CODINGTYPE;
+
+
+/**
+ * Data structure used to define an image path. The number of image paths
+ * for input and output will vary by type of the image component.
+ *
+ * Input (aka Source) : Zero Inputs, one Output,
+ * Splitter : One Input, 2 or more Outputs,
+ * Processing Element : One Input, one output,
+ * Mixer : 2 or more inputs, one output,
+ * Output (aka Sink) : One Input, zero outputs.
+ *
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output
+ * image path. If additional vendor specific data is required, it should
+ * be transmitted to the component using the CustomCommand function.
+ * Compliant components will prepopulate this structure with optimal
+ * values during the OMX_GetParameter() command.
+ *
+ * STRUCT MEMBERS:
+ * cMIMEType : MIME type of data for the port
+ * pNativeRender : Platform specific reference for a display if a
+ * sync, otherwise this field is 0
+ * nFrameWidth : Width of frame to be used on port if
+ * uncompressed format is used. Use 0 for
+ * unknown, don't care or variable
+ * nFrameHeight : Height of frame to be used on port if
+ * uncompressed format is used. Use 0 for
+ * unknown, don't care or variable
+ * nStride : Number of bytes per span of an image (i.e.
+ * indicates the number of bytes to get from
+ * span N to span N+1, where negative stride
+ * indicates the image is bottom up
+ * nSliceHeight : Height used when encoding in slices
+ * bFlagErrorConcealment : Turns on error concealment if it is supported by
+ * the OMX component
+ * eCompressionFormat : Compression format used in this instance of
+ * the component. When OMX_IMAGE_CodingUnused is
+ * specified, eColorFormat is valid
+ * eColorFormat : Decompressed format used by this component
+ * pNativeWindow : Platform specific reference for a window object if a
+ * display sink , otherwise this field is 0x0.
+ */
+typedef struct OMX_IMAGE_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType;
+ OMX_NATIVE_DEVICETYPE pNativeRender;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+ OMX_S32 nStride;
+ OMX_U32 nSliceHeight;
+ OMX_BOOL bFlagErrorConcealment;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_NATIVE_WINDOWTYPE pNativeWindow;
+} OMX_IMAGE_PORTDEFINITIONTYPE;
+
+
+/**
+ * Port format parameter. This structure is used to enumerate the various
+ * data input/output format supported by the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Indicates which port to set
+ * nIndex : Indicates the enumeration index for the format from
+ * 0x0 to N-1
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_IMAGE_CodingUnused is specified,
+ * eColorFormat is valid
+ * eColorFormat : Decompressed format used by this component
+ */
+typedef struct OMX_IMAGE_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+} OMX_IMAGE_PARAM_PORTFORMATTYPE;
+
+
+/**
+ * Flash control type
+ *
+ * ENUMS
+ * Torch : Flash forced constantly on
+ */
+typedef enum OMX_IMAGE_FLASHCONTROLTYPE {
+ OMX_IMAGE_FlashControlOn = 0,
+ OMX_IMAGE_FlashControlOff,
+ OMX_IMAGE_FlashControlAuto,
+ OMX_IMAGE_FlashControlRedEyeReduction,
+ OMX_IMAGE_FlashControlFillin,
+ OMX_IMAGE_FlashControlTorch,
+ OMX_IMAGE_FlashControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_FlashControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_FlashControlMax = 0x7FFFFFFF
+} OMX_IMAGE_FLASHCONTROLTYPE;
+
+
+/**
+ * Flash control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFlashControl : Flash control type
+ */
+typedef struct OMX_IMAGE_PARAM_FLASHCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_FLASHCONTROLTYPE eFlashControl;
+} OMX_IMAGE_PARAM_FLASHCONTROLTYPE;
+
+
+/**
+ * Focus control type
+ */
+typedef enum OMX_IMAGE_FOCUSCONTROLTYPE {
+ OMX_IMAGE_FocusControlOn = 0,
+ OMX_IMAGE_FocusControlOff,
+ OMX_IMAGE_FocusControlAuto,
+ OMX_IMAGE_FocusControlAutoLock,
+ OMX_IMAGE_FocusControlKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_FocusControlVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_FocusControlMax = 0x7FFFFFFF
+} OMX_IMAGE_FOCUSCONTROLTYPE;
+
+
+/**
+ * Focus control configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFocusControl : Focus control
+ * nFocusSteps : Focus can take on values from 0 mm to infinity.
+ * Interest is only in number of steps over this range.
+ * nFocusStepIndex : Current focus step index
+ */
+typedef struct OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_FOCUSCONTROLTYPE eFocusControl;
+ OMX_U32 nFocusSteps;
+ OMX_U32 nFocusStepIndex;
+} OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE;
+
+
+/**
+ * Q Factor for JPEG compression, which controls the tradeoff between image
+ * quality and size. Q Factor provides a more simple means of controlling
+ * JPEG compression quality, without directly programming Quantization
+ * tables for chroma and luma
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nQFactor : JPEG Q factor value in the range of 1-100. A factor of 1
+ * produces the smallest, worst quality images, and a factor
+ * of 100 produces the largest, best quality images. A
+ * typical default is 75 for small good quality images
+ */
+typedef struct OMX_IMAGE_PARAM_QFACTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQFactor;
+} OMX_IMAGE_PARAM_QFACTORTYPE;
+
+/**
+ * Quantization table type
+ */
+
+typedef enum OMX_IMAGE_QUANTIZATIONTABLETYPE {
+ OMX_IMAGE_QuantizationTableLuma = 0,
+ OMX_IMAGE_QuantizationTableChroma,
+ OMX_IMAGE_QuantizationTableChromaCb,
+ OMX_IMAGE_QuantizationTableChromaCr,
+ OMX_IMAGE_QuantizationTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_QuantizationTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_QuantizationTableMax = 0x7FFFFFFF
+} OMX_IMAGE_QUANTIZATIONTABLETYPE;
+
+/**
+ * JPEG quantization tables are used to determine DCT compression for
+ * YUV data, as an alternative to specifying Q factor, providing exact
+ * control of compression
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eQuantizationTable : Quantization table type
+ * nQuantizationMatrix[64] : JPEG quantization table of coefficients stored
+ * in increasing columns then by rows of data (i.e.
+ * row 1, ... row 8). Quantization values are in
+ * the range 0-255 and stored in linear order
+ * (i.e. the component will zig-zag the
+ * quantization table data if required internally)
+ */
+typedef struct OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_QUANTIZATIONTABLETYPE eQuantizationTable;
+ OMX_U8 nQuantizationMatrix[64];
+} OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE;
+
+
+/**
+ * Huffman table type, the same Huffman table is applied for chroma and
+ * luma component
+ */
+typedef enum OMX_IMAGE_HUFFMANTABLETYPE {
+ OMX_IMAGE_HuffmanTableAC = 0,
+ OMX_IMAGE_HuffmanTableDC,
+ OMX_IMAGE_HuffmanTableACLuma,
+ OMX_IMAGE_HuffmanTableACChroma,
+ OMX_IMAGE_HuffmanTableDCLuma,
+ OMX_IMAGE_HuffmanTableDCChroma,
+ OMX_IMAGE_HuffmanTableKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_IMAGE_HuffmanTableVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_HuffmanTableMax = 0x7FFFFFFF
+} OMX_IMAGE_HUFFMANTABLETYPE;
+
+/**
+ * JPEG Huffman table
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eHuffmanTable : Huffman table type
+ * nNumberOfHuffmanCodeOfLength[16] : 0-16, number of Huffman codes of each
+ * possible length
+ * nHuffmanTable[256] : 0-255, the size used for AC and DC
+ * HuffmanTable are 16 and 162
+ */
+typedef struct OMX_IMAGE_PARAM_HUFFMANTTABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGE_HUFFMANTABLETYPE eHuffmanTable;
+ OMX_U8 nNumberOfHuffmanCodeOfLength[16];
+ OMX_U8 nHuffmanTable[256];
+}OMX_IMAGE_PARAM_HUFFMANTTABLETYPE;
+
+/** @} */
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_Index.h b/domx/omx_core/inc/OMX_Index.h
new file mode 100644
index 0000000..bfb8739
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Index.h
@@ -0,0 +1,276 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_Index.h - OpenMax IL version 1.1.2
+ * The OMX_Index header file contains the definitions for both applications
+ * and components .
+ */
+
+
+#ifndef OMX_Index_h
+#define OMX_Index_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Types.h>
+
+
+/** The OMX_INDEXTYPE enumeration is used to select a structure when either
+ * getting or setting parameters and/or configuration data. Each entry in
+ * this enumeration maps to an OMX specified structure. When the
+ * OMX_GetParameter, OMX_SetParameter, OMX_GetConfig or OMX_SetConfig methods
+ * are used, the second parameter will always be an entry from this enumeration
+ * and the third entry will be the structure shown in the comments for the entry.
+ * For example, if the application is initializing a cropping function, the
+ * OMX_SetConfig command would have OMX_IndexConfigCommonInputCrop as the second parameter
+ * and would send a pointer to an initialized OMX_RECTTYPE structure as the
+ * third parameter.
+ *
+ * The enumeration entries named with the OMX_Config prefix are sent using
+ * the OMX_SetConfig command and the enumeration entries named with the
+ * OMX_PARAM_ prefix are sent using the OMX_SetParameter command.
+ */
+typedef enum OMX_INDEXTYPE {
+
+ OMX_IndexComponentStartUnused = 0x01000000,
+ OMX_IndexParamPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
+ OMX_IndexParamAudioInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamImageInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamVideoInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamOtherInit, /**< reference: OMX_PORT_PARAM_TYPE */
+ OMX_IndexParamNumAvailableStreams, /**< reference: OMX_PARAM_U32TYPE */
+ OMX_IndexParamActiveStream, /**< reference: OMX_PARAM_U32TYPE */
+ OMX_IndexParamSuspensionPolicy, /**< reference: OMX_PARAM_SUSPENSIONPOLICYTYPE */
+ OMX_IndexParamComponentSuspended, /**< reference: OMX_PARAM_SUSPENSIONTYPE */
+ OMX_IndexConfigCapturing, /**< reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigCaptureMode, /**< reference: OMX_CONFIG_CAPTUREMODETYPE */
+ OMX_IndexAutoPauseAfterCapture, /**< reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexParamContentURI, /**< reference: OMX_PARAM_CONTENTURITYPE */
+ OMX_IndexParamCustomContentPipe, /**< reference: OMX_PARAM_CONTENTPIPETYPE */
+ OMX_IndexParamDisableResourceConcealment, /**< reference: OMX_RESOURCECONCEALMENTTYPE */
+ OMX_IndexConfigMetadataItemCount, /**< reference: OMX_CONFIG_METADATAITEMCOUNTTYPE */
+ OMX_IndexConfigContainerNodeCount, /**< reference: OMX_CONFIG_CONTAINERNODECOUNTTYPE */
+ OMX_IndexConfigMetadataItem, /**< reference: OMX_CONFIG_METADATAITEMTYPE */
+ OMX_IndexConfigCounterNodeID, /**< reference: OMX_CONFIG_CONTAINERNODEIDTYPE */
+ OMX_IndexParamMetadataFilterType, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
+ OMX_IndexParamMetadataKeyFilter, /**< reference: OMX_PARAM_METADATAFILTERTYPE */
+ OMX_IndexConfigPriorityMgmt, /**< reference: OMX_PRIORITYMGMTTYPE */
+ OMX_IndexParamStandardComponentRole, /**< reference: OMX_PARAM_COMPONENTROLETYPE */
+
+ OMX_IndexPortStartUnused = 0x02000000,
+ OMX_IndexParamPortDefinition, /**< reference: OMX_PARAM_PORTDEFINITIONTYPE */
+ OMX_IndexParamCompBufferSupplier, /**< reference: OMX_PARAM_BUFFERSUPPLIERTYPE */
+ OMX_IndexReservedStartUnused = 0x03000000,
+
+ /* Audio parameters and configurations */
+ OMX_IndexAudioStartUnused = 0x04000000,
+ OMX_IndexParamAudioPortFormat, /**< reference: OMX_AUDIO_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamAudioPcm, /**< reference: OMX_AUDIO_PARAM_PCMMODETYPE */
+ OMX_IndexParamAudioAac, /**< reference: OMX_AUDIO_PARAM_AACPROFILETYPE */
+ OMX_IndexParamAudioRa, /**< reference: OMX_AUDIO_PARAM_RATYPE */
+ OMX_IndexParamAudioMp3, /**< reference: OMX_AUDIO_PARAM_MP3TYPE */
+ OMX_IndexParamAudioAdpcm, /**< reference: OMX_AUDIO_PARAM_ADPCMTYPE */
+ OMX_IndexParamAudioG723, /**< reference: OMX_AUDIO_PARAM_G723TYPE */
+ OMX_IndexParamAudioG729, /**< reference: OMX_AUDIO_PARAM_G729TYPE */
+ OMX_IndexParamAudioAmr, /**< reference: OMX_AUDIO_PARAM_AMRTYPE */
+ OMX_IndexParamAudioWma, /**< reference: OMX_AUDIO_PARAM_WMATYPE */
+ OMX_IndexParamAudioSbc, /**< reference: OMX_AUDIO_PARAM_SBCTYPE */
+ OMX_IndexParamAudioMidi, /**< reference: OMX_AUDIO_PARAM_MIDITYPE */
+ OMX_IndexParamAudioGsm_FR, /**< reference: OMX_AUDIO_PARAM_GSMFRTYPE */
+ OMX_IndexParamAudioMidiLoadUserSound, /**< reference: OMX_AUDIO_PARAM_MIDILOADUSERSOUNDTYPE */
+ OMX_IndexParamAudioG726, /**< reference: OMX_AUDIO_PARAM_G726TYPE */
+ OMX_IndexParamAudioGsm_EFR, /**< reference: OMX_AUDIO_PARAM_GSMEFRTYPE */
+ OMX_IndexParamAudioGsm_HR, /**< reference: OMX_AUDIO_PARAM_GSMHRTYPE */
+ OMX_IndexParamAudioPdc_FR, /**< reference: OMX_AUDIO_PARAM_PDCFRTYPE */
+ OMX_IndexParamAudioPdc_EFR, /**< reference: OMX_AUDIO_PARAM_PDCEFRTYPE */
+ OMX_IndexParamAudioPdc_HR, /**< reference: OMX_AUDIO_PARAM_PDCHRTYPE */
+ OMX_IndexParamAudioTdma_FR, /**< reference: OMX_AUDIO_PARAM_TDMAFRTYPE */
+ OMX_IndexParamAudioTdma_EFR, /**< reference: OMX_AUDIO_PARAM_TDMAEFRTYPE */
+ OMX_IndexParamAudioQcelp8, /**< reference: OMX_AUDIO_PARAM_QCELP8TYPE */
+ OMX_IndexParamAudioQcelp13, /**< reference: OMX_AUDIO_PARAM_QCELP13TYPE */
+ OMX_IndexParamAudioEvrc, /**< reference: OMX_AUDIO_PARAM_EVRCTYPE */
+ OMX_IndexParamAudioSmv, /**< reference: OMX_AUDIO_PARAM_SMVTYPE */
+ OMX_IndexParamAudioVorbis, /**< reference: OMX_AUDIO_PARAM_VORBISTYPE */
+ OMX_IndexParamAudioFlac, /**< reference: OMX_AUDIO_PARAM_FLACTYPE */
+
+ OMX_IndexConfigAudioMidiImmediateEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIIMMEDIATEEVENTTYPE */
+ OMX_IndexConfigAudioMidiControl, /**< reference: OMX_AUDIO_CONFIG_MIDICONTROLTYPE */
+ OMX_IndexConfigAudioMidiSoundBankProgram, /**< reference: OMX_AUDIO_CONFIG_MIDISOUNDBANKPROGRAMTYPE */
+ OMX_IndexConfigAudioMidiStatus, /**< reference: OMX_AUDIO_CONFIG_MIDISTATUSTYPE */
+ OMX_IndexConfigAudioMidiMetaEvent, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTTYPE */
+ OMX_IndexConfigAudioMidiMetaEventData, /**< reference: OMX_AUDIO_CONFIG_MIDIMETAEVENTDATATYPE */
+ OMX_IndexConfigAudioVolume, /**< reference: OMX_AUDIO_CONFIG_VOLUMETYPE */
+ OMX_IndexConfigAudioBalance, /**< reference: OMX_AUDIO_CONFIG_BALANCETYPE */
+ OMX_IndexConfigAudioChannelMute, /**< reference: OMX_AUDIO_CONFIG_CHANNELMUTETYPE */
+ OMX_IndexConfigAudioMute, /**< reference: OMX_AUDIO_CONFIG_MUTETYPE */
+ OMX_IndexConfigAudioLoudness, /**< reference: OMX_AUDIO_CONFIG_LOUDNESSTYPE */
+ OMX_IndexConfigAudioEchoCancelation, /**< reference: OMX_AUDIO_CONFIG_ECHOCANCELATIONTYPE */
+ OMX_IndexConfigAudioNoiseReduction, /**< reference: OMX_AUDIO_CONFIG_NOISEREDUCTIONTYPE */
+ OMX_IndexConfigAudioBass, /**< reference: OMX_AUDIO_CONFIG_BASSTYPE */
+ OMX_IndexConfigAudioTreble, /**< reference: OMX_AUDIO_CONFIG_TREBLETYPE */
+ OMX_IndexConfigAudioStereoWidening, /**< reference: OMX_AUDIO_CONFIG_STEREOWIDENINGTYPE */
+ OMX_IndexConfigAudioChorus, /**< reference: OMX_AUDIO_CONFIG_CHORUSTYPE */
+ OMX_IndexConfigAudioEqualizer, /**< reference: OMX_AUDIO_CONFIG_EQUALIZERTYPE */
+ OMX_IndexConfigAudioReverberation, /**< reference: OMX_AUDIO_CONFIG_REVERBERATIONTYPE */
+ OMX_IndexConfigAudioChannelVolume, /**< reference: OMX_AUDIO_CONFIG_CHANNELVOLUMETYPE */
+
+ /* Image specific parameters and configurations */
+ OMX_IndexImageStartUnused = 0x05000000,
+ OMX_IndexParamImagePortFormat, /**< reference: OMX_IMAGE_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
+ OMX_IndexConfigFocusControl, /**< reference: OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE */
+ OMX_IndexParamQFactor, /**< reference: OMX_IMAGE_PARAM_QFACTORTYPE */
+ OMX_IndexParamQuantizationTable, /**< reference: OMX_IMAGE_PARAM_QUANTIZATIONTABLETYPE */
+ OMX_IndexParamHuffmanTable, /**< reference: OMX_IMAGE_PARAM_HUFFMANTTABLETYPE */
+ OMX_IndexConfigFlashControl, /**< reference: OMX_IMAGE_PARAM_FLASHCONTROLTYPE */
+
+ /* Video specific parameters and configurations */
+ OMX_IndexVideoStartUnused = 0x06000000,
+ OMX_IndexParamVideoPortFormat, /**< reference: OMX_VIDEO_PARAM_PORTFORMATTYPE */
+ OMX_IndexParamVideoQuantization, /**< reference: OMX_VIDEO_PARAM_QUANTIZATIONTYPE */
+ OMX_IndexParamVideoFastUpdate, /**< reference: OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE */
+ OMX_IndexParamVideoBitrate, /**< reference: OMX_VIDEO_PARAM_BITRATETYPE */
+ OMX_IndexParamVideoMotionVector, /**< reference: OMX_VIDEO_PARAM_MOTIONVECTORTYPE */
+ OMX_IndexParamVideoIntraRefresh, /**< reference: OMX_VIDEO_PARAM_INTRAREFRESHTYPE */
+ OMX_IndexParamVideoErrorCorrection, /**< reference: OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE */
+ OMX_IndexParamVideoVBSMC, /**< reference: OMX_VIDEO_PARAM_VBSMCTYPE */
+ OMX_IndexParamVideoMpeg2, /**< reference: OMX_VIDEO_PARAM_MPEG2TYPE */
+ OMX_IndexParamVideoMpeg4, /**< reference: OMX_VIDEO_PARAM_MPEG4TYPE */
+ OMX_IndexParamVideoWmv, /**< reference: OMX_VIDEO_PARAM_WMVTYPE */
+ OMX_IndexParamVideoRv, /**< reference: OMX_VIDEO_PARAM_RVTYPE */
+ OMX_IndexParamVideoAvc, /**< reference: OMX_VIDEO_PARAM_AVCTYPE */
+ OMX_IndexParamVideoH263, /**< reference: OMX_VIDEO_PARAM_H263TYPE */
+ OMX_IndexParamVideoProfileLevelQuerySupported, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
+ OMX_IndexParamVideoProfileLevelCurrent, /**< reference: OMX_VIDEO_PARAM_PROFILELEVELTYPE */
+ OMX_IndexConfigVideoBitrate, /**< reference: OMX_VIDEO_CONFIG_BITRATETYPE */
+ OMX_IndexConfigVideoFramerate, /**< reference: OMX_CONFIG_FRAMERATETYPE */
+ OMX_IndexConfigVideoIntraVOPRefresh, /**< reference: OMX_CONFIG_INTRAREFRESHVOPTYPE */
+ OMX_IndexConfigVideoIntraMBRefresh, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
+ OMX_IndexConfigVideoMBErrorReporting, /**< reference: OMX_CONFIG_MBERRORREPORTINGTYPE */
+ OMX_IndexParamVideoMacroblocksPerFrame, /**< reference: OMX_PARAM_MACROBLOCKSTYPE */
+ OMX_IndexConfigVideoMacroBlockErrorMap, /**< reference: OMX_CONFIG_MACROBLOCKERRORMAPTYPE */
+ OMX_IndexParamVideoSliceFMO, /**< reference: OMX_VIDEO_PARAM_AVCSLICEFMO */
+ OMX_IndexConfigVideoAVCIntraPeriod, /**< reference: OMX_VIDEO_CONFIG_AVCINTRAPERIOD */
+ OMX_IndexConfigVideoNalSize, /**< reference: OMX_VIDEO_CONFIG_NALSIZE */
+
+ /* Image & Video common Configurations */
+ OMX_IndexCommonStartUnused = 0x07000000,
+ OMX_IndexParamCommonDeblocking, /**< reference: OMX_PARAM_DEBLOCKINGTYPE */
+ OMX_IndexParamCommonSensorMode, /**< reference: OMX_PARAM_SENSORMODETYPE */
+ OMX_IndexParamCommonInterleave, /**< reference: OMX_PARAM_INTERLEAVETYPE */
+ OMX_IndexConfigCommonColorFormatConversion, /**< reference: OMX_CONFIG_COLORCONVERSIONTYPE */
+ OMX_IndexConfigCommonScale, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
+ OMX_IndexConfigCommonImageFilter, /**< reference: OMX_CONFIG_IMAGEFILTERTYPE */
+ OMX_IndexConfigCommonColorEnhancement, /**< reference: OMX_CONFIG_COLORENHANCEMENTTYPE */
+ OMX_IndexConfigCommonColorKey, /**< reference: OMX_CONFIG_COLORKEYTYPE */
+ OMX_IndexConfigCommonColorBlend, /**< reference: OMX_CONFIG_COLORBLENDTYPE */
+ OMX_IndexConfigCommonFrameStabilisation,/**< reference: OMX_CONFIG_FRAMESTABTYPE */
+ OMX_IndexConfigCommonRotate, /**< reference: OMX_CONFIG_ROTATIONTYPE */
+ OMX_IndexConfigCommonMirror, /**< reference: OMX_CONFIG_MIRRORTYPE */
+ OMX_IndexConfigCommonOutputPosition, /**< reference: OMX_CONFIG_POINTTYPE */
+ OMX_IndexConfigCommonInputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonOutputCrop, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonDigitalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE */
+ OMX_IndexConfigCommonOpticalZoom, /**< reference: OMX_CONFIG_SCALEFACTORTYPE*/
+ OMX_IndexConfigCommonWhiteBalance, /**< reference: OMX_CONFIG_WHITEBALCONTROLTYPE */
+ OMX_IndexConfigCommonExposure, /**< reference: OMX_CONFIG_EXPOSURECONTROLTYPE */
+ OMX_IndexConfigCommonContrast, /**< reference: OMX_CONFIG_CONTRASTTYPE */
+ OMX_IndexConfigCommonBrightness, /**< reference: OMX_CONFIG_BRIGHTNESSTYPE */
+ OMX_IndexConfigCommonBacklight, /**< reference: OMX_CONFIG_BACKLIGHTTYPE */
+ OMX_IndexConfigCommonGamma, /**< reference: OMX_CONFIG_GAMMATYPE */
+ OMX_IndexConfigCommonSaturation, /**< reference: OMX_CONFIG_SATURATIONTYPE */
+ OMX_IndexConfigCommonLightness, /**< reference: OMX_CONFIG_LIGHTNESSTYPE */
+ OMX_IndexConfigCommonExclusionRect, /**< reference: OMX_CONFIG_RECTTYPE */
+ OMX_IndexConfigCommonDithering, /**< reference: OMX_CONFIG_DITHERTYPE */
+ OMX_IndexConfigCommonPlaneBlend, /**< reference: OMX_CONFIG_PLANEBLENDTYPE */
+ OMX_IndexConfigCommonExposureValue, /**< reference: OMX_CONFIG_EXPOSUREVALUETYPE */
+ OMX_IndexConfigCommonOutputSize, /**< reference: OMX_FRAMESIZETYPE */
+ OMX_IndexParamCommonExtraQuantData, /**< reference: OMX_OTHER_EXTRADATATYPE */
+ OMX_IndexConfigCommonFocusRegion, /**< reference: OMX_CONFIG_FOCUSREGIONTYPE */
+ OMX_IndexConfigCommonFocusStatus, /**< reference: OMX_PARAM_FOCUSSTATUSTYPE */
+ OMX_IndexConfigCommonTransitionEffect, /**< reference: OMX_CONFIG_TRANSITIONEFFECTTYPE */
+
+ /* Reserved Configuration range */
+ OMX_IndexOtherStartUnused = 0x08000000,
+ OMX_IndexParamOtherPortFormat, /**< reference: OMX_OTHER_PARAM_PORTFORMATTYPE */
+ OMX_IndexConfigOtherPower, /**< reference: OMX_OTHER_CONFIG_POWERTYPE */
+ OMX_IndexConfigOtherStats, /**< reference: OMX_OTHER_CONFIG_STATSTYPE */
+
+
+ /* Reserved Time range */
+ OMX_IndexTimeStartUnused = 0x09000000,
+ OMX_IndexConfigTimeScale, /**< reference: OMX_TIME_CONFIG_SCALETYPE */
+ OMX_IndexConfigTimeClockState, /**< reference: OMX_TIME_CONFIG_CLOCKSTATETYPE */
+ OMX_IndexConfigTimeActiveRefClock, /**< reference: OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE */
+ OMX_IndexConfigTimeCurrentMediaTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
+ OMX_IndexConfigTimeCurrentWallTime, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (read only) */
+ OMX_IndexConfigTimeCurrentAudioReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimeCurrentVideoReference, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimeMediaTimeRequest, /**< reference: OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE (write only) */
+ OMX_IndexConfigTimeClientStartTime, /**<reference: OMX_TIME_CONFIG_TIMESTAMPTYPE (write only) */
+ OMX_IndexConfigTimePosition, /**< reference: OMX_TIME_CONFIG_TIMESTAMPTYPE */
+ OMX_IndexConfigTimeSeekMode, /**< reference: OMX_TIME_CONFIG_SEEKMODETYPE */
+
+
+ OMX_IndexKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ /* Vendor specific area */
+ OMX_IndexVendorStartUnused = 0x7F000000,
+ /* Vendor specific structures should be in the range of 0x7F000000
+ to 0x7FFFFFFE. This range is not broken out by vendor, so
+ private indexes are not guaranteed unique and therefore should
+ only be sent to the appropriate component. */
+
+ OMX_IndexMax = 0x7FFFFFFF
+
+} OMX_INDEXTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_IndexExt.h b/domx/omx_core/inc/OMX_IndexExt.h
new file mode 100755
index 0000000..733c3eb
--- /dev/null
+++ b/domx/omx_core/inc/OMX_IndexExt.h
@@ -0,0 +1,87 @@
+/*
+ * Copyright (c) 2010 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_IndexExt.h - OpenMax IL version 1.1.2
+ * The OMX_IndexExt header file contains extensions to the definitions
+ * for both applications and components .
+ */
+
+#ifndef OMX_IndexExt_h
+#define OMX_IndexExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Index.h>
+
+
+/** Khronos standard extension indices.
+
+This enum lists the current Khronos extension indices to OpenMAX IL.
+*/
+typedef enum OMX_INDEXEXTTYPE {
+
+ /* Component parameters and configurations */
+ OMX_IndexExtComponentStartUnused = OMX_IndexKhronosExtensions + 0x00100000,
+ OMX_IndexConfigCallbackRequest, /**< reference: OMX_CONFIG_CALLBACKREQUESTTYPE */
+ OMX_IndexConfigCommitMode, /**< reference: OMX_CONFIG_COMMITMODETYPE */
+ OMX_IndexConfigCommit, /**< reference: OMX_CONFIG_COMMITTYPE */
+
+ /* Port parameters and configurations */
+ OMX_IndexExtPortStartUnused = OMX_IndexKhronosExtensions + 0x00200000,
+
+ /* Audio parameters and configurations */
+ OMX_IndexExtAudioStartUnused = OMX_IndexKhronosExtensions + 0x00400000,
+
+ /* Image parameters and configurations */
+ OMX_IndexExtImageStartUnused = OMX_IndexKhronosExtensions + 0x00500000,
+
+ /* Video parameters and configurations */
+ OMX_IndexExtVideoStartUnused = OMX_IndexKhronosExtensions + 0x00600000,
+ OMX_IndexParamNalStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexParamNalStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexParamNalStreamFormatSelect, /**< reference: OMX_NALSTREAMFORMATTYPE */
+
+ /* Image & Video common configurations */
+ OMX_IndexExtCommonStartUnused = OMX_IndexKhronosExtensions + 0x00700000,
+
+ /* Other configurations */
+ OMX_IndexExtOtherStartUnused = OMX_IndexKhronosExtensions + 0x00800000,
+
+ /* Time configurations */
+ OMX_IndexExtTimeStartUnused = OMX_IndexKhronosExtensions + 0x00900000,
+
+ OMX_IndexExtMax = 0x7FFFFFFF
+} OMX_INDEXEXTTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_IndexExt_h */
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_Other.h b/domx/omx_core/inc/OMX_Other.h
new file mode 100644
index 0000000..a9b0c4e
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Other.h
@@ -0,0 +1,354 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** @file OMX_Other.h - OpenMax IL version 1.1.2
+ * The structures needed by Other components to exchange
+ * parameters and configuration data with the components.
+ */
+
+#ifndef OMX_Other_h
+#define OMX_Other_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/* Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_Core.h>
+
+
+/**
+ * Enumeration of possible data types which match to multiple domains or no
+ * domain at all. For types which are vendor specific, a value above
+ * OMX_OTHER_VENDORTSTART should be used.
+ */
+typedef enum OMX_OTHER_FORMATTYPE {
+ OMX_OTHER_FormatTime = 0, /**< Transmission of various timestamps, elapsed time,
+ time deltas, etc */
+ OMX_OTHER_FormatPower, /**< Perhaps used for enabling/disabling power
+ management, setting clocks? */
+ OMX_OTHER_FormatStats, /**< Could be things such as frame rate, frames
+ dropped, etc */
+ OMX_OTHER_FormatBinary, /**< Arbitrary binary data */
+ OMX_OTHER_FormatVendorReserved = 1000, /**< Starting value for vendor specific
+ formats */
+
+ OMX_OTHER_FormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_OTHER_FormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_OTHER_FormatMax = 0x7FFFFFFF
+} OMX_OTHER_FORMATTYPE;
+
+/**
+ * Enumeration of seek modes.
+ */
+typedef enum OMX_TIME_SEEKMODETYPE {
+ OMX_TIME_SeekModeFast = 0, /**< Prefer seeking to an approximation
+ * of the requested seek position over
+ * the actual seek position if it
+ * results in a faster seek. */
+ OMX_TIME_SeekModeAccurate, /**< Prefer seeking to the actual seek
+ * position over an approximation
+ * of the requested seek position even
+ * if it results in a slower seek. */
+ OMX_TIME_SeekModeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_SeekModeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_SeekModeMax = 0x7FFFFFFF
+} OMX_TIME_SEEKMODETYPE;
+
+/* Structure representing the seekmode of the component */
+typedef struct OMX_TIME_CONFIG_SEEKMODETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_TIME_SEEKMODETYPE eType; /**< The seek mode */
+} OMX_TIME_CONFIG_SEEKMODETYPE;
+
+/** Structure representing a time stamp used with the following configs
+ * on the Clock Component (CC):
+ *
+ * OMX_IndexConfigTimeCurrentWallTime: query of the CC's current wall
+ * time
+ * OMX_IndexConfigTimeCurrentMediaTime: query of the CC's current media
+ * time
+ * OMX_IndexConfigTimeCurrentAudioReference and
+ * OMX_IndexConfigTimeCurrentVideoReference: audio/video reference
+ * clock sending SC its reference time
+ * OMX_IndexConfigTimeClientStartTime: a Clock Component client sends
+ * this structure to the Clock Component via a SetConfig on its
+ * client port when it receives a buffer with
+ * OMX_BUFFERFLAG_STARTTIME set. It must use the timestamp
+ * specified by that buffer for nStartTimestamp.
+ *
+ * It's also used with the following config on components in general:
+ *
+ * OMX_IndexConfigTimePosition: IL client querying component position
+ * (GetConfig) or commanding a component to seek to the given location
+ * (SetConfig)
+ */
+typedef struct OMX_TIME_CONFIG_TIMESTAMPTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version
+ * information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_TICKS nTimestamp; /**< timestamp .*/
+} OMX_TIME_CONFIG_TIMESTAMPTYPE;
+
+/** Enumeration of possible reference clocks to the media time. */
+typedef enum OMX_TIME_UPDATETYPE {
+ OMX_TIME_UpdateRequestFulfillment, /**< Update is the fulfillment of a media time request. */
+ OMX_TIME_UpdateScaleChanged, /**< Update was generated because the scale chagned. */
+ OMX_TIME_UpdateClockStateChanged, /**< Update was generated because the clock state changed. */
+ OMX_TIME_UpdateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_UpdateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_UpdateMax = 0x7FFFFFFF
+} OMX_TIME_UPDATETYPE;
+
+/** Enumeration of possible reference clocks to the media time. */
+typedef enum OMX_TIME_REFCLOCKTYPE {
+ OMX_TIME_RefClockNone, /**< Use no references. */
+ OMX_TIME_RefClockAudio, /**< Use references sent through OMX_IndexConfigTimeCurrentAudioReference */
+ OMX_TIME_RefClockVideo, /**< Use references sent through OMX_IndexConfigTimeCurrentVideoReference */
+ OMX_TIME_RefClockKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_RefClockVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_RefClockMax = 0x7FFFFFFF
+} OMX_TIME_REFCLOCKTYPE;
+
+/** Enumeration of clock states. */
+typedef enum OMX_TIME_CLOCKSTATE {
+ OMX_TIME_ClockStateRunning, /**< Clock running. */
+ OMX_TIME_ClockStateWaitingForStartTime, /**< Clock waiting until the
+ * prescribed clients emit their
+ * start time. */
+ OMX_TIME_ClockStateStopped, /**< Clock stopped. */
+ OMX_TIME_ClockStateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_TIME_ClockStateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_TIME_ClockStateMax = 0x7FFFFFFF
+} OMX_TIME_CLOCKSTATE;
+
+/** Structure representing a media time request to the clock component.
+ *
+ * A client component sends this structure to the Clock Component via a SetConfig
+ * on its client port to specify a media timestamp the Clock Component
+ * should emit. The Clock Component should fulfill the request by sending a
+ * OMX_TIME_MEDIATIMETYPE when its media clock matches the requested
+ * timestamp.
+ *
+ * The client may require a media time request be fulfilled slightly
+ * earlier than the media time specified. In this case the client specifies
+ * an offset which is equal to the difference between wall time corresponding
+ * to the requested media time and the wall time when it will be
+ * fulfilled.
+ *
+ * A client component may uses these requests and the OMX_TIME_MEDIATIMETYPE to
+ * time events according to timestamps. If a client must perform an operation O at
+ * a time T (e.g. deliver a video frame at its corresponding timestamp), it makes a
+ * media time request at T (perhaps specifying an offset to ensure the request fulfillment
+ * is a little early). When the clock component passes the resulting OMX_TIME_MEDIATIMETYPE
+ * structure back to the client component, the client may perform operation O (perhaps having
+ * to wait a slight amount more time itself as specified by the return values).
+ */
+
+typedef struct OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< port that this structure applies to */
+ OMX_PTR pClientPrivate; /**< Client private data to disabiguate this media time
+ * from others (e.g. the number of the frame to deliver).
+ * Duplicated in the media time structure that fulfills
+ * this request. A value of zero is reserved for time scale
+ * updates. */
+ OMX_TICKS nMediaTimestamp; /**< Media timestamp requested.*/
+ OMX_TICKS nOffset; /**< Amount of wall clock time by which this
+ * request should be fulfilled early */
+} OMX_TIME_CONFIG_MEDIATIMEREQUESTTYPE;
+
+/**< Structure sent from the clock component client either when fulfilling
+ * a media time request or when the time scale has changed.
+ *
+ * In the former case the Clock Component fills this structure and times its emission
+ * to a client component (via the client port) according to the corresponding media
+ * time request sent by the client. The Clock Component should time the emission to occur
+ * when the requested timestamp matches the Clock Component's media time but also the
+ * prescribed offset early.
+ *
+ * Upon scale changes the clock component clears the nClientPrivate data, sends the current
+ * media time and sets the nScale to the new scale via the client port. It emits a
+ * OMX_TIME_MEDIATIMETYPE to all clients independent of any requests. This allows clients to
+ * alter processing to accomodate scaling. For instance a video component might skip inter-frames
+ * in the case of extreme fastforward. Likewise an audio component might add or remove samples
+ * from an audio frame to scale audio data.
+ *
+ * It is expected that some clock components may not be able to fulfill requests
+ * at exactly the prescribed time. This is acceptable so long as the request is
+ * fulfilled at least as early as described and not later. This structure provides
+ * fields the client may use to wait for the remaining time.
+ *
+ * The client may use either the nOffset or nWallTimeAtMedia fields to determine the
+ * wall time until the nMediaTimestamp actually occurs. In the latter case the
+ * client can get a more accurate value for offset by getting the current wall
+ * from the cloc component and subtracting it from nWallTimeAtMedia.
+ */
+
+typedef struct OMX_TIME_MEDIATIMETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nClientPrivate; /**< Client private data to disabiguate this media time
+ * from others. Copied from the media time request.
+ * A value of zero is reserved for time scale updates. */
+ OMX_TIME_UPDATETYPE eUpdateType; /**< Reason for the update */
+ OMX_TICKS nMediaTimestamp; /**< Media time requested. If no media time was
+ * requested then this is the current media time. */
+ OMX_TICKS nOffset; /**< Amount of wall clock time by which this
+ * request was actually fulfilled early */
+
+ OMX_TICKS nWallTimeAtMediaTime; /**< Wall time corresponding to nMediaTimeStamp.
+ * A client may compare this value to current
+ * media time obtained from the Clock Component to determine
+ * the wall time until the media timestamp is really
+ * current. */
+ OMX_S32 xScale; /**< Current media time scale in Q16 format. */
+ OMX_TIME_CLOCKSTATE eState; /* Seeking Change. Added 7/12.*/
+ /**< State of the media time. */
+} OMX_TIME_MEDIATIMETYPE;
+
+/** Structure representing the current media time scale factor. Applicable only to clock
+ * component, other components see scale changes via OMX_TIME_MEDIATIMETYPE buffers sent via
+ * the clock component client ports. Upon recieving this config the clock component changes
+ * the rate by which the media time increases or decreases effectively implementing trick modes.
+ */
+typedef struct OMX_TIME_CONFIG_SCALETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_S32 xScale; /**< This is a value in Q16 format which is used for
+ * scaling the media time */
+} OMX_TIME_CONFIG_SCALETYPE;
+
+/** Bits used to identify a clock port. Used in OMX_TIME_CONFIG_CLOCKSTATETYPE's nWaitMask field */
+#define OMX_CLOCKPORT0 0x00000001
+#define OMX_CLOCKPORT1 0x00000002
+#define OMX_CLOCKPORT2 0x00000004
+#define OMX_CLOCKPORT3 0x00000008
+#define OMX_CLOCKPORT4 0x00000010
+#define OMX_CLOCKPORT5 0x00000020
+#define OMX_CLOCKPORT6 0x00000040
+#define OMX_CLOCKPORT7 0x00000080
+
+/** Structure representing the current mode of the media clock.
+ * IL Client uses this config to change or query the mode of the
+ * media clock of the clock component. Applicable only to clock
+ * component.
+ *
+ * On a SetConfig if eState is OMX_TIME_ClockStateRunning media time
+ * starts immediately at the prescribed start time. If
+ * OMX_TIME_ClockStateWaitingForStartTime the Clock Component ignores
+ * the given nStartTime and waits for all clients specified in the
+ * nWaitMask to send starttimes (via
+ * OMX_IndexConfigTimeClientStartTime). The Clock Component then starts
+ * the media clock using the earliest start time supplied. */
+typedef struct OMX_TIME_CONFIG_CLOCKSTATETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version
+ * information */
+ OMX_TIME_CLOCKSTATE eState; /**< State of the media time. */
+ OMX_TICKS nStartTime; /**< Start time of the media time. */
+ OMX_TICKS nOffset; /**< Time to offset the media time by
+ * (e.g. preroll). Media time will be
+ * reported to be nOffset ticks earlier.
+ */
+ OMX_U32 nWaitMask; /**< Mask of OMX_CLOCKPORT values. */
+} OMX_TIME_CONFIG_CLOCKSTATETYPE;
+
+/** Structure representing the reference clock currently being used to
+ * compute media time. IL client uses this config to change or query the
+ * clock component's active reference clock */
+typedef struct OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_TIME_REFCLOCKTYPE eClock; /**< Reference clock used to compute media time */
+} OMX_TIME_CONFIG_ACTIVEREFCLOCKTYPE;
+
+/** Descriptor for setting specifics of power type.
+ * Note: this structure is listed for backwards compatibility. */
+typedef struct OMX_OTHER_CONFIG_POWERTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnablePM; /**< Flag to enable Power Management */
+} OMX_OTHER_CONFIG_POWERTYPE;
+
+
+/** Descriptor for setting specifics of stats type.
+ * Note: this structure is listed for backwards compatibility. */
+typedef struct OMX_OTHER_CONFIG_STATSTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ /* what goes here */
+} OMX_OTHER_CONFIG_STATSTYPE;
+
+
+/**
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output other
+ * path.
+ */
+typedef struct OMX_OTHER_PORTDEFINITIONTYPE {
+ OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
+} OMX_OTHER_PORTDEFINITIONTYPE;
+
+/** Port format parameter. This structure is used to enumerate
+ * the various data input/output format supported by the port.
+ */
+typedef struct OMX_OTHER_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Indicates which port to set */
+ OMX_U32 nIndex; /**< Indicates the enumeration index for the format from 0x0 to N-1 */
+ OMX_OTHER_FORMATTYPE eFormat; /**< Type of data expected for this channel */
+} OMX_OTHER_PARAM_PORTFORMATTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_TI_Common.h b/domx/omx_core/inc/OMX_TI_Common.h
new file mode 100755
index 0000000..b39163f
--- /dev/null
+++ b/domx/omx_core/inc/OMX_TI_Common.h
@@ -0,0 +1,343 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_ti_common.h
+ *
+ *
+ * @path \OMAPSW_SysDev\multimedia\omx\khronos1_1\omx_core\inc
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 20-Dec-2008 x0052661@ti.com, initial version
+ *================================================================*/
+
+#ifndef _OMX_TI_COMMON_H_
+#define _OMX_TI_COMMON_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <OMX_Core.h>
+
+/*******************************************************************
+ * EXTERNAL REFERENCE NOTE: only use if not found in header file
+ *******************************************************************/
+/*---------- function prototypes ------------------- */
+/*---------- data declarations ------------------- */
+/*******************************************************************
+ * PUBLIC DECLARATIONS: defined here, used elsewhere
+ *******************************************************************/
+/*---------- function prototypes ------------------- */
+/*---------- data declarations ------------------- */
+#define OMX_BUFFERHEADERFLAG_MODIFIED 0x00000100
+
+#define OMX_TI_BUFFERFLAG_READONLY 0x00000200
+
+/* TI extra data will be passed in the platform private structure rather than
+ * appended at the end of the buffer. Adding a new custom flag to indicate
+ * this.*/
+#define OMX_TI_BUFFERFLAG_DETACHEDEXTRADATA 0x00000400
+
+typedef struct OMX_CONFIG_CHANNELNAME {
+
+ OMX_U32 nSize; /**< Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nPortIndex; /**< Index of the port */
+ OMX_STRING cChannelName; /**< Channel name */
+
+} OMX_CONFIG_CHANNELNAME;
+
+typedef struct OMX_TI_PLATFORMPRIVATE
+{
+ OMX_U32 nSize;
+ OMX_PTR pExtendedPlatformPrivate;
+ OMX_BOOL bReadViaCPU;
+ OMX_BOOL bWriteViaCPU;
+ OMX_PTR pMetaDataBuffer;
+ OMX_U32 nMetaDataSize;
+ OMX_PTR pAuxBuf1;
+ OMX_U32 pAuxBufSize1;
+}OMX_TI_PLATFORMPRIVATE;
+
+/*===============================================================*/
+/** OMX_TI_PARAM_BUFFERPREANNOUNCE : This parameter is used to enable/disable
+ * buffer pre announcement. Buffer pre
+ * announcement is enabled by default i.e.
+ * if buffer is being allocated by client
+ * then the buffer ptrs will be made known
+ * to the component at the time of
+ * UseBuffer and these will not change in
+ * lifetime of the component. If pre
+ * announcement is disabled then new
+ * buffers can be allocated by the client
+ * at runtime and passed in ETB/FTB. This
+ * parameter is valid only in cases where
+ * client allocates the buffer
+ * (i.e. UseBuffer cases).
+ *
+ * @ param nSize : Size of the structure.
+ * @ param nVersion : Version.
+ * @ param nPortIndex : Port index on which the parameter will
+ * be applied.
+ * @ param bEnabled : Whether buffer pre announcement is
+ * enabled or not. Set to TRUE (enabled)
+ * by default.
+ */
+/*===============================================================*/
+typedef struct OMX_TI_PARAM_BUFFERPREANNOUNCE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+}OMX_TI_PARAM_BUFFERPREANNOUNCE;
+
+
+
+/*===============================================================*/
+/** OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE : This config is used to
+ * enable/disable notification when
+ * reference count of a buffer changes
+ * This happens usually when buffers
+ * are locked/unlocked by codecs. By
+ * DEFAULT all notifications are
+ * DISABLED.
+ *
+ * @ param nSize : Size of the structure.
+ * @ param nVersion : Version.
+ * @ param nPortIndex : Port index on which the config will
+ * be applied.
+ * @param bNotifyOnIncrease : Enable notification when reference
+ * count is increased.
+ * @ param bNotifyOnDecrease : Enable notification when reference
+ * count is decreased.
+ * @ param nCountForNotification : Count at which to trigger
+ * notification. Count indicates no.
+ * of copies of the buffer in
+ * circulation e.g.
+ * 1 - Only the original buffer is in
+ * circulation i.e. no buffers are
+ * currently locked.
+ * 2 - There are two copies of the
+ * buffer i.e. one original and
+ * one copy which has been locked
+ * by the codec.
+ * And so on
+ * SPECIAL CASE
+ * 0 - Indicates notify always
+ * irrespective of count value.
+ */
+/*===============================================================*/
+typedef struct OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bNotifyOnIncrease;
+ OMX_BOOL bNotifyOnDecrease;
+ OMX_U32 nCountForNotification;
+}OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE;
+
+
+
+
+
+/* OMX_TI_SEVERITYTYPE enumeration is used to indicate severity level of errors returned by TI OpenMax components.
+ Critcal Requires reboot/reset DSP
+ Severe Have to unload components and free memory and try again
+ Major Can be handled without unloading the component
+ Minor Essentially informational
+*/
+typedef enum OMX_TI_SEVERITYTYPE {
+ OMX_TI_ErrorCritical=1,
+ OMX_TI_ErrorSevere,
+ OMX_TI_ErrorMajor,
+ OMX_TI_ErrorMinor
+} OMX_TI_SEVERITYTYPE;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_PARAM_METADATABUFFERINFO : Structure to access metadata buffer info needed
+ by proxy to allocate metadat buffers.
+
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_PARAM_METADATABUFFERINFO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bIsMetaDataEnabledOnPort;
+ OMX_U32 nMetaDataSize;
+} OMX_TI_PARAM_METADATABUFFERINFO;
+
+/*===============================================================*/
+/** OMX_TI_BUFFERTYPE : This enumberation defines the type of
+ * buffer that is exchanged with the OMX
+ * component port
+ *
+ * OMX_TI_BufferTypeDefault : Default buffer type accessed via a
+ * single virtual address
+ * OMX_TI_BufferTypeVirtual2D : Multiple virtual buffers describing a
+ * 2D buffer
+ * OMX_TI_BufferTypePlatform1D : Platform specific 1D buffer handle
+ * OMX_TI_BufferTypePlatform2D : Platform specific buffer handles
+ * describing a 2D buffer
+ * OMX_TI_BufferTypePhysicalPageList : List of a given number of physical pages
+ * OMX_TI_BufferTypeHardwareReserved1D:Harware reserve space only that can
+ * accomodate a 1D buffer by mapping memory
+ * to it
+ */
+/*===============================================================*/
+typedef enum OMX_TI_BUFFERTYPE {
+ OMX_TI_BufferTypeDefault = 0,
+ OMX_TI_BufferTypeVirtual2D,
+ OMX_TI_BufferTypePlatform1D,
+ OMX_TI_BufferTypePlatform2D,
+ OMX_TI_BufferTypePhysicalPageList,
+ OMX_TI_BufferTypeHardwareReserved1D,
+ OMX_TI_BufferTypeMax = 0x7FFFFFFF
+} OMX_TI_BUFFERTYPE;
+
+/*===============================================================*/
+/** OMX_TI_BUFFERDESCRIPTOR_TYPE : This buffer descriptor structure is used
+ * to convey additional buffer information
+ * when OMX_TI_IndexUseBufferDescriptor is
+ * enabled and it is passed via pBuffer
+ * in OMX_BUFFERHEADERTYPE
+ *
+ * @ param nSize : Size of the structure.
+ * @ param eBufType : Specifies type of buffer
+ * @ param nNumOfBuf : Number of component buffers of eBufType
+ * @ param pBuf : Array of buffers of type eBufType
+ */
+/*===============================================================*/
+typedef struct OMX_TI_BUFFERDESCRIPTOR_TYPE {
+ OMX_U32 nSize;
+ OMX_TI_BUFFERTYPE eBufType;
+ OMX_U32 nNumOfBuf;
+ OMX_PTR pBuf[3];
+} OMX_TI_BUFFERDESCRIPTOR_TYPE;
+
+/*===============================================================*/
+/** OMX_TI_PARAM_USEBUFFERDESCRIPTOR : This parameter is used to enable/disable
+ * buffer descriptor mode. When enabled,
+ * the pBuffer in OMX buffer header points
+ * to a buffer descriptor structure
+ * OMX_TI_BUFFERDESCRIPTOR_TYPE instead of
+ * the buffer directly.
+ *
+ * @ param nSize : Size of the structure.
+ * @ param nVersion : Version.
+ * @ param nPortIndex : Port index on which the parameter will
+ * be applied.
+ * @ param bEnabled : Whether buffer descriptor mode is
+ * enabled or not. Set to FALSE (disabled)
+ * by default.
+ */
+/*===============================================================*/
+typedef struct OMX_TI_PARAM_USEBUFFERDESCRIPTOR {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+ OMX_TI_BUFFERTYPE eBufferType;
+} OMX_TI_PARAM_USEBUFFERDESCRIPTOR;
+
+
+/*===============================================================*/
+/** OMX_TI_PARAM_COMPONENTBUFALLOCTYPE :This parameter is used to query/set
+ * internal buffers used by OMX component
+ * after allocation by the user of OMX
+ * component during regular OMX buffer
+ * allocation/free life cycle
+ *
+ * @ param nSize : Size of the structure.
+ * @ param nVersion : Version.
+ * @ param nPortIndex : Port index on which the parameter will
+ * be applied.
+ * @ param nIndex : Present buffer number whose requirement
+ * is queried and then set
+ * @ param eBufType : Present nIndex'ed buffer type
+ * @ param pBuf : Buffer communication
+ * @ param nAllocWidth : Size of buffer (Width in case of 2D)
+ * @ param nAllocLines : Size of buffer (1 in case of 1D)
+ * @ param nOffset : Offset from which buffer communicated is
+ * valid
+ */
+/*===============================================================*/
+typedef struct OMX_TI_PARAM_COMPONENTBUFALLOCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_TI_BUFFERTYPE eBufType;
+ OMX_PTR pBuf[3];
+ OMX_U32 nAllocWidth;
+ OMX_U32 nAllocLines;
+ OMX_U32 nOffset;
+} OMX_TI_PARAM_COMPONENTBUFALLOCTYPE;
+
+/*===============================================================*/
+/** OMX_TI_COMPONENT_HANDLE : This parameter is used to retrieve
+ * the component handle by the client.
+ *
+ * @ param nSize : Size of the structure.
+ * @ param nVersion : Version.
+ * @ param pHandle : Component Handle
+ */
+/*===============================================================*/
+typedef struct OMX_TI_COMPONENT_HANDLE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_HANDLETYPE pHandle;
+} OMX_TI_COMPONENT_HANDLE;
+
+/*******************************************************************
+ * PRIVATE DECLARATIONS: defined here, used only here
+ *******************************************************************/
+/*---------- data declarations ------------------- */
+/*---------- function prototypes ------------------- */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _OMX_TI_COMMON_H_ */
diff --git a/domx/omx_core/inc/OMX_TI_Core.h b/domx/omx_core/inc/OMX_TI_Core.h
new file mode 100755
index 0000000..eb4993e
--- /dev/null
+++ b/domx/omx_core/inc/OMX_TI_Core.h
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * @file omx_ti_core.h
+ * This file contains the vendor(TI) specific core extensions
+ *
+ * @path domx/system/omx_core/inc
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 19-Jul-2010 admonga@ti.com : Initial version
+ *================================================================*/
+
+#ifndef _OMX_TI_CORE_H_
+#define _OMX_TI_CORE_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/******************************************************************
+ INCLUDE FILES
+ ******************************************************************/
+#include <OMX_Types.h>
+#include <OMX_Core.h>
+
+/*******************************************************************
+ * EXTERNAL REFERENCE NOTE: only use if not found in header file
+ *******************************************************************/
+/*---------- function prototypes ------------------- */
+/*---------- data declarations ------------------- */
+/*******************************************************************
+ * PUBLIC DECLARATIONS: defined here, used elsewhere
+ *******************************************************************/
+/*---------- function prototypes ------------------- */
+/*---------- data declarations ------------------- */
+
+
+
+typedef enum OMX_TI_ERRORTYPE
+{
+ /* Vendor specific area for storing TI custom extended events */
+
+ /*Control attribute is pending - Dio_Dequeue will not work until attribute
+ is retreived*/
+ OMX_TI_WarningAttributePending = (OMX_S32)((OMX_ERRORTYPE)OMX_ErrorVendorStartUnused + 1),
+ /*Attribute buffer size is insufficient - reallocate the attribute buffer*/
+ OMX_TI_WarningInsufficientAttributeSize,
+ /*EOS buffer has been received*/
+ OMX_TI_WarningEosReceived,
+ /*Port enable is called on an already enabled port*/
+ OMX_TI_ErrorPortIsAlreadyEnabled,
+ /*Port disable is called on an already disabled port*/
+ OMX_TI_ErrorPortIsAlreadyDisabled
+} OMX_TI_ERRORTYPE;
+
+
+
+typedef enum OMX_TI_EVENTTYPE
+{
+ /* Vendor specific area for storing indices */
+ /*Reference count for the buffer has changed. In the callback, nData1 will
+ pBufferHeader, nData2 will be present count*/
+ OMX_TI_EventBufferRefCount = (OMX_S32)((OMX_EVENTTYPE)OMX_EventVendorStartUnused + 1)
+}OMX_TI_EVENTTYPE;
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _OMX_TI_INDEX_H_ */
+
diff --git a/domx/omx_core/inc/OMX_TI_IVCommon.h b/domx/omx_core/inc/OMX_TI_IVCommon.h
new file mode 100755
index 0000000..f1d19c4
--- /dev/null
+++ b/domx/omx_core/inc/OMX_TI_IVCommon.h
@@ -0,0 +1,4906 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* -------------------------------------------------------------------------- *
+ *
+ * @file:OMX_TI_IVCommon.h
+ * This header defines the structures specific to the config indices of msp_VPPM.
+ *
+ * @path ..\OMAPSW_SysDev\multimedia\omx\khronos1_1\omx_core\inc
+ *
+ * -------------------------------------------------------------------------- */
+
+/* ======================================================================== *!
+ *! Revision History
+ *! ==================================================================== */
+
+#ifndef OMX_TI_IVCommon_H
+#define OMX_TI_IVCommon_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <OMX_IVCommon.h>
+#include <OMX_Image.h>
+
+#define DCC_PATH "/data/misc/camera/"
+
+#define MAX_URI_LENGTH (OMX_MAX_STRINGNAME_SIZE)
+#define MAX_ALGOAREAS (35)
+
+/*======================================================================= */
+/* Enumerated values for operation mode for compressed image
+ *
+ * ENUMS:
+ * Chunk : Chunk based operation
+ * NonChunk : Non-chunk based operation
+ */
+ /* ======================================================================= */
+typedef enum OMX_JPEG_COMPRESSEDMODETYPE {
+ OMX_JPEG_ModeChunk = 0,
+ OMX_JPEG_ModeNonChunk,
+ OMX_JPEG_CompressedmodeMax = 0x7fffffff
+}OMX_JPEG_COMPRESSEDMODETYPE ;
+
+
+/*======================================================================= */
+/* Enumerated values for operation mode for uncompressed image
+ *
+ * ENUMS:
+ * Frame : Frame based operation
+ * Slice : Slice based operation
+ * Stitch : For stitching between image frames
+ * Burst : For stitching between image frames
+ */
+ /* ======================================================================= */
+typedef enum OMX_JPEG_UNCOMPRESSEDMODETYPE {
+ OMX_JPEG_UncompressedModeFrame = 0,
+ OMX_JPEG_UncompressedModeSlice,
+ OMX_JPEG_UncompressedModeStitch,
+ OMX_JPEG_UncompressedModeBurst,
+ OMX_JPEG_UncompressedModeMax = 0x7fffffff
+}OMX_JPEG_UNCOMPRESSEDMODETYPE;
+
+
+
+/*======================================================================= */
+/* Configuration structure for compressed image
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eCompressedImageMode : Operating mode enumeration for compressed image
+ */
+ /*======================================================================= */
+typedef struct OMX_JPEG_PARAM_COMPRESSEDMODETYPE{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_JPEG_COMPRESSEDMODETYPE eCompressedImageMode;
+}OMX_JPEG_PARAM_COMPRESSEDMODETYPE;
+
+
+
+/*======================================================================= */
+/* Uncompressed image Operating mode configuration structure
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBurstLength : No of frames to be dumped in burst mode
+ * eUncompressedImageMode : uncompressed image mode information
+ * eSourceType : Image encode souce info
+ * tRotationInfo : Rotation related information
+ */
+ /*======================================================================= */
+typedef struct OMX_JPEG_PARAM_UNCOMPRESSEDMODETYPE{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBurstLength;
+ OMX_JPEG_UNCOMPRESSEDMODETYPE eUncompressedImageMode;
+}OMX_JPEG_PARAM_UNCOMPRESSEDMODETYPE;
+
+
+/*======================================================================= */
+/* Subregion Decode Parameter configuration structure
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nXOrg : Sectional decoding X origin
+ * nYOrg : Sectional decoding Y origin
+ * nXLength : Sectional decoding X length
+ * nYLength : Sectional decoding Y length
+ */
+ /*======================================================================= */
+typedef struct OMX_IMAGE_PARAM_DECODE_SUBREGION{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nXOrg;
+ OMX_U32 nYOrg;
+ OMX_U32 nXLength;
+ OMX_U32 nYLength;
+}OMX_IMAGE_PARAM_DECODE_SUBREGION;
+
+
+/**
+ * sensor select types
+ */
+typedef enum OMX_SENSORSELECT{
+ OMX_PrimarySensor = 0,
+ OMX_SecondarySensor,
+ OMX_TI_StereoSensor,
+ OMX_SensorTypeMax = 0x7fffffff
+}OMX_SENSORSELECT;
+
+/**
+ *
+ * Sensor Select
+ */
+typedef struct OMX_CONFIG_SENSORSELECTTYPE {
+OMX_U32 nSize; /**< Size of the structure in bytes */
+OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+OMX_U32 nPortIndex; /**< Port that this struct applies to */
+OMX_SENSORSELECT eSensor; /**< sensor select */
+} OMX_CONFIG_SENSORSELECTTYPE;
+
+/**
+ * Flicker cancellation types
+ */
+typedef enum OMX_COMMONFLICKERCANCELTYPE{
+ OMX_FlickerCancelOff = 0,
+ OMX_FlickerCancelAuto,
+ OMX_FlickerCancel50,
+ OMX_FlickerCancel60,
+ OMX_FlickerCancel100,
+ OMX_FlickerCancel120,
+ OMX_FlickerCancelMax = 0x7fffffff
+}OMX_COMMONFLICKERCANCELTYPE;
+
+typedef struct OMX_CONFIG_FLICKERCANCELTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_COMMONFLICKERCANCELTYPE eFlickerCancel;
+} OMX_CONFIG_FLICKERCANCELTYPE;
+
+
+/**
+ * Sensor caleberation types
+ */
+typedef enum OMX_SENSORCALTYPE{
+ OMX_SensorCalFull = 0,
+ OMX_SensorCalQuick,
+ OMX_SensorCalMax = 0x7fffffff
+}OMX_SENSORCALTYPE;
+
+typedef struct OMX_CONFIG_SENSORCALTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SENSORCALTYPE eSensorCal;
+} OMX_CONFIG_SENSORCALTYPE;
+
+/**
+ * Scene mode types
+ */
+typedef enum OMX_SCENEMODETYPE{
+
+ OMX_Manual = 0,
+ OMX_Closeup,
+ OMX_Portrait,
+ OMX_Landscape,
+ OMX_Underwater,
+ OMX_Sport,
+ OMX_SnowBeach,
+ OMX_Mood,
+ OMX_NightPortrait,
+ OMX_NightIndoor,
+ OMX_Fireworks,
+ OMX_Document, /**< for still image */
+ OMX_Barcode, /**< for still image */
+ OMX_SuperNight, /**< for video */
+ OMX_Cine, /**< for video */
+ OMX_OldFilm, /**< for video */
+ OMX_TI_Action,
+ OMX_TI_Beach,
+ OMX_TI_Candlelight,
+ OMX_TI_Night,
+ OMX_TI_Party,
+ OMX_TI_Portrait,
+ OMX_TI_Snow,
+ OMX_TI_Steadyphoto,
+ OMX_TI_Sunset,
+ OMX_TI_Theatre,
+ OMX_SceneModeMax = 0x7fffffff
+}OMX_SCENEMODETYPE;
+
+typedef struct OMX_CONFIG_SCENEMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SCENEMODETYPE eSceneMode;
+} OMX_CONFIG_SCENEMODETYPE;
+
+ /**
+ * Port specific capture trigger
+ * useful for the usecases with multiple capture ports.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bExtCapturing : Start Captre at the specified port. Can be queried to know the status of a specific port.
+ */
+typedef struct OMX_CONFIG_EXTCAPTURING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bExtCapturing;
+} OMX_CONFIG_EXTCAPTURING;
+
+
+ /**
+ * Digital Zoom Speed
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nDigitalZoomSpeed : Optical zoom speed level. Special values:
+ * 0 - stop current movement
+ * values from 1 to 254 are mapped proportionally to supported zoom speeds inside optical zoom driver.
+ * So 1 is slowest available optical zoom speed and 254 is fastest available optical zoom speed
+ * 255 - default optical zoom speed value
+ */
+typedef struct OMX_CONFIG_DIGITALZOOMSPEEDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nDigitalZoomSpeed;
+} OMX_CONFIG_DIGITALZOOMSPEEDTYPE;
+
+
+ /**
+ * Digital Zoom Target
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nDigitalZoomTarget : Default and minimum is 0. Maximum is determined by the current supported range
+ */
+
+typedef struct OMX_CONFIG_DIGITALZOOMTARGETTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDigitalZoomTarget;
+} OMX_CONFIG_DIGITALZOOMTARGETTYPE;
+
+
+/**
+* Scale quality enums
+*/
+typedef enum OMX_SCALEQUALITY{
+ OMX_DefaultScaling = 0, /** <default scaling if nothing is specified > */
+ OMX_BetterScaling, /** <better scaling> */
+ OMX_BestScaling, /** <best scaling> */
+ OMX_AutoScalingQuality, /** <auto scaling quality> */
+ OMX_FastScaling, /** <fast scaling, prioritizes speed> */
+ OMX_ScaleQualityMax = 0x7fffffff
+}OMX_SCALEQUALITY;
+
+/**
+* Scaling Quality Mode
+*/
+typedef enum OMX_SCALEQUALITYMODE{
+ OMX_SingleFrameScalingMode = 0, /** <default > */
+ OMX_MultiFrameScalingMode, /** <better scaling> */
+ OMX_AutoScalingMode, /** <best scaling> */
+ OMX_ScaleModeMax = 0x7fffffff
+}OMX_SCALEQUALITYMODE;
+
+ /**
+ * Rescale quality control type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * eScaleQuality : controls the quality level.
+ * eScaleQualityMode : controls the scaling algo types
+ */
+typedef struct OMX_CONFIG_SCALEQUALITYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SCALEQUALITY eScaleQuality;
+ OMX_SCALEQUALITYMODE eScaleQualityMode;
+} OMX_CONFIG_SCALEQUALITYTYPE;
+
+/**
+* Smooth Zoom mode enum
+* Starts or stops the Smooth Zoom. Selecting INCREASE will cause an increasing digital zoom factor (increased cropping),
+* with a shrinking viewable area and crop height percentage. Selecting DECREASE will cause a decreasing digital zoom (decreased cropping),
+* with a growing viewable area and crop height percentage. The CaptureCropHeight will continue to update based on the SmoothZoomRate until
+* the SmoothZoomMin or SmoothZoomMax zoom step is reached, the framework minimum zoom step is reached, the SmoothZoomRate becomes 0,
+* or the SmoothZoomMode is set to OFF.
+* NOTE: The message payload includes all parts of the message that is NOT part of the message header as listed for the CAM_SEND_DATA message.
+*/
+typedef enum OMX_SMOOTHZOOMMODE{
+ OMX_Off=0, /**< default OFF */
+ OMX_Increase,
+ OMX_Decrease,
+ OMX_SmoothZoomModeMax = 0x7fffffff
+}OMX_SMOOTHZOOMMODE;
+
+
+ /**
+ * Rescale quality control type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * eSmoothZoomMode : controls the smooth zoom feature.
+ * nSmoothZoomRate : Values from 0 to 65535 which represents percentage to increase per second, where 65535 = 100%, and 0 = 0%.
+ * nSmoothZoomQuantize:
+ * nSmoothZoomThresh
+ * nSmoothZoomMin
+ * nSmoothZoomMax
+ */
+typedef struct OMX_CONFIG_SMOOTHZOOMTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_SMOOTHZOOMMODE eSmoothZoomMode;
+ OMX_U32 nSmoothZoomRate;
+ OMX_U32 nSmoothZoomQuantize;
+ OMX_U32 nSmoothZoomThresh;
+ OMX_U32 nSmoothZoomMin;
+ OMX_U32 nSmoothZoomMax;
+} OMX_CONFIG_SMOOTHZOOMTYPE;
+
+/**
+ * Enumeration of possible Extended image filter types for OMX_CONFIG_IMAGEFILTERTYPE
+ */
+typedef enum OMX_EXTIMAGEFILTERTYPE {
+ OMX_ImageFilterSepia = 0x7F000001,
+ OMX_ImageFilterGrayScale,
+ OMX_ImageFilterNatural,
+ OMX_ImageFilterVivid,
+ OMX_ImageFilterColourSwap,
+ OMX_ImageFilterOutOfFocus,
+ OMX_ImageFilterWaterColour,
+ OMX_ImageFilterPastel,
+ OMX_ImageFilterFilm,
+ OMX_TI_ImageFilterBlackWhite,
+ OMX_TI_ImageFilterWhiteBoard,
+ OMX_TI_ImageFilterBlackBoard,
+ OMX_TI_ImageFilterAqua,
+ OMX_TI_ImageFilterPosterize,
+ OMX_ImageFilterTypeMax = 0x7fffffff
+} OMX_EXTIMAGEFILTERTYPE;
+
+
+/**
+ * Image filter configuration extended
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bBlemish : Enable/Disable Blemish correction
+ */
+typedef struct OMX_CONFIG_BLEMISHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bBlemish;
+} OMX_CONFIG_BLEMISHTYPE;
+
+/**
+ * Enumeration of Bracket types
+ * OMX_BracketExposureRelativeInEV:
+ * Exposure value is changed relative to the value set by automatic exposure.
+ * nBracketStartValue and nBracketStep are in Q16. Increment is additive.
+ * OMX_BracketExposureAbsoluteMs:
+ * Exposure value is changed in absolute value in ms.
+ * nBracketStartValue and nBracketStep are in Q16. Increment is multiplicative.
+ * OMX_BracketFocusRelative:
+ * Focus is adjusted relative to the focus set by auto focus.
+ * The value is S32 integer, and is the same as adjusting nFocusSteps of OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE relatively.
+ * Increment is additive.
+ * OMX_BracketFocusAbsolute:
+ * Focus position is adjusted absolutely. It is the same as setting nFocusSteps of
+ * OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE relatively for each captures.
+ * The value should be interpreted as U32 value. Increment is additive.
+ * OMX_BracketFlashPower:
+ * Power of flash is adjusted relative to the automatic level. Increment is multiplicative.
+ * OMX_BracketAperture:
+ * Aperture number relative to the automatic setting. Data in Q16 format. Increment is multiplicative.
+ * OMX_BracketTemporal:
+ * To suppport temporal bracketing.
+ */
+typedef enum OMX_BRACKETMODETYPE {
+ OMX_BracketExposureRelativeInEV = 0,
+ OMX_BracketExposureAbsoluteMs,
+ OMX_BracketFocusRelative,
+ OMX_BracketFocusAbsolute,
+ OMX_BracketFlashPower,
+ OMX_BracketAperture,
+ OMX_BracketTemporal,
+ OMX_BracketExposureGainAbsolute,
+ OMX_BracketVectorShot,
+ OMX_BrackerTypeKhronosExtensions = 0x6f000000,
+ OMX_BrackerTypeVendorStartUnused = 0x7f000000,
+ OMX_BracketTypeMax = 0x7FFFFFFF
+} OMX_BRACKETMODETYPE;
+
+typedef struct OMX_CONFIG_BRACKETINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BRACKETMODETYPE eBracketMode;
+ OMX_U32 nNbrBracketingValues;
+ OMX_S32 nBracketValues[10]; /**< 10 can be assumed */
+ OMX_S32 nBracketValues2[10]; /**< 10 can be assumed */
+} OMX_CONFIG_BRACKETINGTYPE;
+
+
+/**
+ * Capture mode types
+ * Note: this list could get extended modified based on the type of interenal use-case pipelines implemented within the camera component.
+ *
+ * OMX_CaptureImageHighSpeedBurst = 0,
+ * OMX_CaptureImageHighSpeedTemporalBracketing,
+ * OMX_CaptureImageProfileBase(Base):
+ * Base one almost same as Highspeed one.
+ * OMX_CaptureImageProfileLowLight1(LL1):
+ * Includes NSF2 in addition to Base processing
+ * OMX_CaptureImageProfileLowLight2(LL2):
+ * Includes NSF2 and LBCE in addition to Base processing.
+ * OMX_CaptureImageProfileOpticalCorr1(OC1):
+ * Includes LDC in addition to Base processing.
+ * OMX_CaptureImageProfileOpticalCorr2(OC2):
+ * Includes LDC and CAC in addition to Base processing.
+ * OMX_CaptureImageProfileExtended1(Ext1):
+ * Includes NSF2, LBCE, LDC, and CAC in addition to Base
+ * OMX_CaptureStereoImageCapture:
+ * Stereo image capture use-case.
+ * OMX_CaptureImageMemoryInput:
+ * need to take sensor input from INPUT port.
+ * OMX_CaptureVideo:
+ * OMX_CaptureHighSpeedVideo:
+ * OMX_CaptureVideoMemoryInput:
+ *
+ */
+typedef enum OMX_CAMOPERATINGMODETYPE {
+ OMX_CaptureImageHighSpeedBurst = 0,
+ OMX_CaptureImageHighSpeedTemporalBracketing,
+ OMX_CaptureImageProfileBase,
+ OMX_CaptureImageProfileLowLight1,
+ OMX_CaptureImageProfileLowLight2,
+ OMX_CaptureImageProfileOpticalCorr1,
+ OMX_CaptureImageProfileOpticalCorr2,
+ OMX_CaptureImageProfileExtended1,
+ OMX_CaptureStereoImageCapture,
+ OMX_CaptureImageMemoryInput,
+ OMX_CaptureVideo,
+ OMX_CaptureHighSpeedVideo,
+ OMX_CaptureVideoMemoryInput,
+ OMX_TI_CaptureDummy,
+ OMX_TI_CaptureGestureRecognition,
+ OMX_TI_CaptureImageProfileZeroShutterLag,
+ OMX_TI_SinglePreview,
+ OMX_TI_StereoGestureRecognition,
+ OMX_TI_CPCam,
+ OMX_TI_StereoVideo,
+ OMX_CaptureHighQualityVideo,
+ OMX_TI_SimultaneousSensorsGesture,
+ OMX_TI_CaptureVideoLowLatency,
+ OMX_TI_HQBurst,
+ OMX_TI_Reprocessing,
+ // Put new entries here so OMX_CamOperatingModeMax always points to
+ // the last one
+ OMX_TI_CamOperatingModeCount,
+ OMX_CamOperatingModeMax = OMX_TI_CamOperatingModeCount - 1,
+ OMX_CamOperatingMode = 0x7fffffff
+} OMX_CAMOPERATINGMODETYPE;
+
+/**
+ * Capture mode setting: applicable to multi shot capture also including bracketing.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eCamOperatingMode : specifies the camera operating mode.
+ */
+typedef struct OMX_CONFIG_CAMOPERATINGMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_CAMOPERATINGMODETYPE eCamOperatingMode;
+} OMX_CONFIG_CAMOPERATINGMODETYPE;
+
+
+/**
+ * Capture mode setting: applicable to multi shot capture also including bracketing.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nFrameRate : when bContinuous is FALSE, need to define the frame rate of the muti-shot scenario. Since this would be applicable to IMAGE domain port, there is no port specific frame rate.
+ * nFrameBefore :
+ * is specifying how many frames before the capture trigger shall be used.
+ * It is implementation dependent how many is supported. This shall only be supported for images and not for video frames.
+ * bPrepareCapture :
+ * should be set to true when nFrameBefore is greater than zero and before capturing of before-frames should start.
+ * The component is not allowed to deliver buffers until capturing starts. This shall only be supported for images and not for video frames.
+ * bEnableBracketing :
+ * should be enabled when bracketing is used. In bracketing mode, one parameter can be changed per each capture.
+ * tBracketConfigType :
+ * specifies bracket mode to use. Valid only when bEnableBracketing is set.
+ */
+typedef struct OMX_CONFIG_EXTCAPTUREMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameRate;
+ OMX_U32 nFrameBefore;
+ OMX_BOOL bPrepareCapture;
+ OMX_BOOL bEnableBracketing;
+ OMX_CONFIG_BRACKETINGTYPE tBracketConfigType;
+} OMX_CONFIG_EXTCAPTUREMODETYPE;
+
+/**
+ * For Extended Focus region Type -
+ */
+typedef struct OMX_CONFIG_EXTFOCUSREGIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nRefPortIndex;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_CONFIG_EXTFOCUSREGIONTYPE;
+
+/**
+ * Digital Flash Control
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bDigitalFlash : Digital flash type Enable/Disable -
+ * Specifies whether the digital flash algorithm is enabled or disabled. This overrides the contrast and brightness settings.
+ */
+typedef struct OMX_CONFIG_DIGITALFLASHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bDigitalFlash;
+} OMX_CONFIG_DIGITALFLASHTYPE;
+
+
+
+/**
+ * Privacy Indicator Enable/Disable
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bPrivacyIndicator :
+ * Specifies whether the flash should be used to indicate image or video capture. When flash is not used for exposure,
+ * flash will be activated after exposure to indicate image capture.
+ * If video light is not used, the flash can be blinking or constant at low intensity to indicate capture but not affect exposure.
+ * Specifies whether the digital flash algorithm is enabled or disabled. This overrides the contrast and brightness settings.
+ */
+typedef struct OMX_CONFIG_PRIVACYINDICATOR {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bPrivacyIndicator;
+} OMX_CONFIG_PRIVACYINDICATOR;
+
+
+/**
+ * Privacy Indicator Enable/Disable
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bTorchMode :
+ * Enable/Disable
+ * nIntensityLevel : relative intensity from 0 - 100
+ * nDuration : duration in msec
+ */
+typedef struct OMX_CONFIG_TORCHMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bTorchMode;
+ OMX_U32 nIntensityLevel;
+ OMX_U32 nDuration;
+} OMX_CONFIG_TORCHMODETYPE;
+
+
+
+/**
+ * Privacy Indicator Enable/Disable
+ * DISABLE - Fire the xenon flash in the usual manner
+ * ENABLE - Reduce the light intensity of the main flash (ex 1EV)
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bSlowSync :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ */
+typedef struct OMX_CONFIG_SLOWSYNCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bSlowSync;
+} OMX_CONFIG_SLOWSYNCTYPE;
+
+
+/**
+ * Focus control extended enums. use this along with OMX_IMAGE_CONFIG_FOCUSCONTROLTYPE
+ */
+typedef enum OMX_IMAGE_EXTFOCUSCONTROLTYPE {
+ OMX_IMAGE_FocusControlAutoMacro = 0x7F000001, /**< Reserved region for introducing Vendor Extensions */
+ OMX_IMAGE_FocusControlAutoInfinity,
+ OMX_IMAGE_FocusControlHyperfocal,
+ OMX_IMAGE_FocusControlPortrait, /**< from Xena */
+ OMX_IMAGE_FocusControlExtended, /**< from Xena */
+ OMX_IMAGE_FocusControlContinousNormal, /**< from Xena */
+ OMX_IMAGE_FocusControlContinousExtended, /**< from Xena */
+ OMX_IMAGE_FocusControlContinousFacePriority,
+ OMX_IMAGE_FocusControlContinousRegionPriority,
+ OMX_IMAGE_FocusControlContinousPicture,
+ OMX_IMAGE_FocusControlTypeMax = 0x7fffffff
+} OMX_IMAGE_EXTFOCUSCONTROLTYPE;
+
+
+
+/**
+ * Specifies whether the LED can be used to assist in autofocus, due to low lighting conditions.
+ * ENABLE means use as determined by the auto exposure algorithm.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bFocusAssist :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ */
+typedef struct OMX_CONFIG_FOCUSASSISTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bFocusAssist;
+} OMX_CONFIG_FOCUSASSISTTYPE;
+
+
+
+/**
+ *for locking the focus
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bFocusLock :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ */
+typedef struct OMX_CONFIG_FOCUSLOCKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bFocusLock;
+} OMX_CONFIG_FOCUSLOCKTYPE;
+
+
+/**
+ *for locking the White balance
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bWhiteBalanceLock :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ */
+typedef struct OMX_CONFIG_WHITEBALANCELOCKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bWhiteBalanceLock;
+} OMX_CONFIG_WHITEBALANCELOCKTYPE;
+
+/**
+ *for locking the Exposure
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bExposureLock :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ */
+typedef struct OMX_CONFIG_EXPOSURELOCKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bExposureLock;
+} OMX_CONFIG_EXPOSURELOCKTYPE;
+
+/**
+ *for locking the Exposure
+ * Simultaneously lock focus, white balance and exposure (and relevant other settings).
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bAllLock :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ */
+typedef struct OMX_CONFIG_ALLLOCKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bAllLock;
+} OMX_CONFIG_ALLLOCKTYPE;
+
+/**
+ *for locking
+ * Simultaneously lock focus, white balance and exposure (and relevant other settings).
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bLock :
+ * Enable - OMX_TRUE/Disable - OMX_FALSE
+ * bAtCapture:
+ *
+ */
+typedef struct OMX_IMAGE_CONFIG_LOCKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bLock;
+ OMX_BOOL bAtCapture;
+} OMX_IMAGE_CONFIG_LOCKTYPE;
+
+/**
+ * processig level types enum
+ */
+typedef enum OMX_PROCESSINGLEVEL{
+ OMX_Min = 0,
+ OMX_Low,
+ OMX_Medium,
+ OMX_High,
+ OMX_Max,
+ OMX_ProcessingLevelMax = 0x7fffffff
+}OMX_PROCESSINGLEVEL;
+
+/**
+ *processing level type
+ * Simultaneously lock focus, white balance and exposure (and relevant other settings).
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLevel :
+ * nLevel hinting processing amount. Range of values is -100 to 100.
+ * 0 causes no change to the image. Increased values cause increased processing to occur, with 100 applying maximum processing.
+ * Negative values have the opposite effect of positive values.
+ * bAuto:
+ * sets if the processing should be applied according to input data.
+ It is allowed to combine the hint level with the auto setting,
+ * i.e. to give a bias to the automatic setting. When set to false, the processing should not take input data into account.
+ */
+
+typedef struct OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE {
+OMX_U32 nSize;
+OMX_VERSIONTYPE nVersion;
+OMX_U32 nPortIndex;
+OMX_S32 nLevel;
+OMX_BOOL bAuto;
+} OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE;
+
+
+/**
+ * White Balance control type extended enums - to be used along with the structure @OMX_CONFIG_WHITEBALCONTROLTYPE
+ *
+ *
+ *
+ */
+typedef enum OMX_EXTWHITEBALCONTROLTYPE {
+ OMX_WhiteBalControlFacePriorityMode = OMX_WhiteBalControlVendorStartUnused + 1, /**< */
+ OMX_TI_WhiteBalControlSunset,
+ OMX_TI_WhiteBalControlShade,
+ OMX_TI_WhiteBalControlTwilight,
+ OMX_TI_WhiteBalControlWarmFluorescent,
+ OMX_TI_WhiteBalControlMax = 0x7fffffff
+} OMX_EXTWHITEBALCONTROLTYPE;
+
+/**
+ *white balance gain type
+ * xWhiteBalanceGain and xWhiteBalanceOffset represents gain and offset for R, Gr, Gb, B channels respectively in Q16 format. \
+ * For example, new red pixel value = xWhiteBalanceGain[1]* the current pixel value + xWhiteBalanceOffset[1].
+ * All values assume that maximum value is 255. If internal implementation uses higher dynamic range, this value should be adjusted internally.
+ * nWhiteThreshhold represents thresholds for "white" area measurments in Q16 format.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ *
+ */
+typedef struct OMX_CONFIG_WHITEBALGAINTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 xWhiteBalanceGain[4];
+ OMX_S32 xWhiteBalanceOffset[4];
+ OMX_S32 nWhiteThreshhold[4];
+} OMX_CONFIG_WHITEBALGAINTYPE;
+
+/**
+ * This structure represents linear color conversion from one space to another. For example, to conversion from one RGB color into another RGB color space can be represented as
+ * R' = xColorMatrix[1][1]*R + xColorMatrix[1][2]*G + xColorMatrix[1][3]*B + xColorOffset[1]
+ * G' = xColorMatrix[2][1]*R + xColorMatrix[2][2]*G + xColorMatrix[2][3]*B + xColorOffset[2]
+ * B' = xColorMatrix[3][1]*R + xColorMatrix[3][2]*G + xColorMatrix[3][3]*B + xColorOffset[3]
+ * Both xColorMatrix and xColorOffset are represented as Q16 value.
+ * bFullColorRange represents represents whether valid range of color is 0 to 255 (when set to TRUE) or 16 to 235 (for FALSE).
+ * Again all values assume that maximum value is 255. If internal implementation uses higher dynamic range, this value should be adjusted internally.
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ *
+ */
+typedef struct OMX_CONFIG_EXT_COLORCONVERSIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 xColorMatrix[3][3];
+ OMX_S32 xColorOffset[3];
+ OMX_BOOL bFullColorRange;
+}OMX_CONFIG_EXT_COLORCONVERSIONTYPE;
+
+
+/**
+ * xGamma represents lool-up table for gamma correction in Q16 format.
+ * All values assume that maximum value is 255. If internal implementation uses higher dynamic range, this value should be adjusted internally.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ *
+ */
+typedef struct OMX_CONFIG_GAMMATABLETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 xGamma[3][256];
+}OMX_CONFIG_GAMMATABLETYPE;
+
+
+
+/**
+ * processig types
+ */
+typedef enum OMX_PROCESSINGTYPE{
+ OMX_BloomingReduction = 0,
+ OMX_Denoise,
+ OMX_Sharpening,
+ OMX_Deblurring,
+ OMX_Demosaicing,
+ OMX_ContrastEnhancement,
+ OMX_ProcessingTypeMax = 0x7fffffff
+}OMX_PROCESSINGTYPE;
+
+
+typedef struct OMX_CONFIGPROCESSINGORDERTYPE {
+OMX_U32 nSize; /**< Size of the structure in bytes */
+OMX_VERSIONTYPE nVersion; /**< OMX specification version info */
+OMX_U32 nPortIndex; /**< Port that this struct applies to */
+OMX_U32 nIndex;
+OMX_PROCESSINGTYPE eProc;
+} OMX_CONFIGPROCESSINGORDERTYPE;
+
+/**
+ * HIST TYPE
+ */
+typedef enum OMX_HISTTYPE{
+ OMX_HistControlLuminance = 0, /**< Luminance histogram is calculated (Y)*/
+ OMX_HistControlColorComponents, /**< A histogram per color component (R, G, B) is calculated*/
+ OMX_HistControlChrominanceComponents, /**< A histogram per chrominance component (Cb, Cr) is calculated.*/
+ OMX_HistControl_32BIT_PATCH = 0x7FFFFFFF
+}OMX_HISTTYPE;
+
+/**
+ * Histogram Setting
+ * nPortIndex is an output port. The port index decides on which port the extra data structur is sent on.
+ * bFrameLimited is a Boolean used to indicate if measurement shall be terminated after the specified number of
+ * frames if true frame limited measurement is enabled; otherwise the port does not terminate measurement until
+ * instructed to do so by the client.
+ * nFrameLimit is the limit on number of frames measured, this parameter is only valid if bFrameLimited is enabled.
+ * bMeasure is a Boolean that should be set to true when measurement shall begin, otherwise set to false. Query will give status information on if measurement is ongoing or not.
+ * nBins specifies the number of histogram bins. When queried with set to zero, the respons gives the maximum number of bins allowed.
+ * nLeft is the leftmost coordinate of the measurement area rectangle.
+ * nTop is the topmost coordinate of the measurement area rectangle.
+ * nWidth is the width of the measurement area rectangle in pixels.
+ * nHeight is the height of the measurement area rectangle in pixels.
+ * eHistType is an enumeration specifying the histogram type
+ *
+ *
+ */
+
+typedef struct OMX_CONFIG_HISTOGRAMTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bFrameLimited;
+ OMX_U32 nFrameLimit;
+ OMX_BOOL bMeasure;
+ OMX_U32 nBins;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+ OMX_HISTTYPE eHistType;
+} OMX_CONFIG_HISTOGRAMTYPE;
+
+/**
+ * OMX_HISTCOMPONENTTYPE Enumerated Value
+ */
+typedef enum OMX_HISTCOMPONENTTYPE{
+ OMX_HISTCOMP_Y = 0, /**< Luminance histogram (Y) */
+ OMX_HISTCOMP_YLOG, /**< Logarithmic luminance histogram (Y)*/
+ OMX_HISTCOMP_R, /**< Red histogram component (R)*/
+ OMX_HISTCOMP_G, /**< Green histogram component (G)*/
+ OMX_HISTCOMP_B, /**< Blue histogram component (B)*/
+ OMX_HISTCOMP_Cb, /**< Chroma blue histogram component (Cb)*/
+ OMX_HISTCOMP_Cr, /**< Chroma red histogram component (Cr) */
+ OMX_HISTCOMP_32BIT_PATCH = 0x7FFFFFFF
+}OMX_HISTCOMPONENTTYPE;
+
+/**
+ * The OMX_TI_CAMERAVIEWTYPE enumeration is used to identify the
+ * particular camera view and frame type that the rest of
+ * the data in the structure is associated with.
+ */
+typedef enum OMX_TI_CAMERAVIEWTYPE {
+ OMX_2D_Prv, /**< Camera view in 2D for preview */
+ OMX_2D_Snap, /**< Camera view in 2D for snapshot */
+ OMX_2D_Cap, /**< Camera view in 2D for capture */
+ OMX_3D_Left_Prv, /**< Left camera view in 3D for preview */
+ OMX_3D_Left_Snap, /**< Left camera view in 3D for snapshot */
+ OMX_3D_Left_Cap, /**< Left camera view in 3D for capture */
+ OMX_3D_Right_Prv, /**< Right camera view in 3D for preview */
+ OMX_3D_Right_Snap, /**< Right camera view in 3D for snapshot */
+ OMX_3D_Right_Cap, /**< Right camera view in 3D for capture */
+ OMX_TI_CAMERAVIEWTYPE_32BIT_PATCH = 0x7FFFFFFF
+} OMX_TI_CAMERAVIEWTYPE;
+
+/**
+ * nSize is the size of the structure including the length of data field containing
+ * the Histogram Matched for Stereo Gamma data.
+ * nItems is the number of items in the Gamma table.
+ * data[1] first byte of the Gamma data
+ */
+typedef struct OMX_HMSGAMMATYPE {
+ OMX_U32 nSize; /**< The size of the structure
+ including the length of data field containing the gamma data */
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nItems; /**< The number of items in Gamma */
+ OMX_U8 data[1];
+} OMX_HMSGAMMATYPE;
+
+/**
+ * Structure describes properties of pyramid level
+ * nOffset : nOffset from start of buffer in bytes
+ * nWidth : nWidth in pixels
+ * nHeight : nHeight in pixels
+ * nStride : nStride in bytes
+ */
+typedef struct OMX_TI_IMAGEPYRAMIDDESCTYPE {
+ OMX_U32 nOffset;
+ OMX_U16 nWidth;
+ OMX_U16 nHeight;
+ OMX_U32 nStride;
+} OMX_TI_IMAGEPYRAMIDDESCTYPE;
+
+/**
+ * The extra data having pyramid data,
+ * It is described with the following structure.
+ * nLevelsCount - Number of levels of pyramid
+ * PyramidData - first element of array with description
+ * of levels of pyramid. Size of array will describe
+ * by nLevelsCount.
+ */
+typedef struct OMX_TI_IMAGEPYRAMIDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nLevelsCount;
+ OMX_TI_IMAGEPYRAMIDDESCTYPE PyramidData[1];
+} OMX_TI_IMAGEPYRAMIDTYPE;
+
+
+#define OMX_OTHER_EXTRADATATYPE_SIZE ((OMX_U32)(((OMX_OTHER_EXTRADATATYPE *)0x0)->data)) /**< Size of OMX_OTHER_EXTRADATATYPE
+ without Data[1] and without padding */
+
+/**
+ * The extra data having DCC data is described with the following structure.
+ * This data contains single flags and values
+ * (not arrays) that have general usage for camera applications.
+ */
+typedef struct OMX_TI_DCCDATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nCameraModuleId;
+ OMX_U32 nDccDescriptorId;
+ OMX_U32 nAlgorithmVendorId;
+ OMX_U32 nUseCaseId;
+ OMX_U32 nOffset;
+ OMX_PTR pData;
+} OMX_TI_DCCDATATYPE;
+/**
+ * The extra data type to feed the camera re-processing function
+ */
+typedef struct OMX_TI_CAMREPROCMETATYPE {
+ OMX_U32 nExpTime;
+ OMX_U32 nGain;
+} OMX_TI_CAMREPROCMETATYPE;
+
+/**
+ * The extra data vector shot feedback info
+ * nConfigId : Same id that cames with
+ * OMX_TI_CONFIG_ENQUEUESHOTCONFIGS::nShotConfig[x].nConfigId
+ * for particular shot config.
+ * nFrameNum : Frame number in vect shot repeat sequence.
+ * Starts from 1 for every shot config.
+ *
+ * nExpMin : The exposure time lower limit,[us]
+ * nExpMax : The exposure time upper limit,[us]
+ * nGainMin : The analog gain lower limit,[0,01EV]
+ * nGainMax : The analog gain upper limit,[0,01EV]
+ *
+ * nReqEC : Requested total exposure compensation
+ * nReqExpTime : Requested exposure time
+ * nReqGain : Requested gain
+ *
+ * nExpTime : Exposure time of this frame.
+ * nAGain : Analog gain of this frame.
+ *
+ * nSenExpTimeErr : Exposure time error in us.
+ * If the requested exposure time is ExpReq
+ * and the one produced by the sensor is nExpTime then:
+ * nExpTimeErr = nExpTime - ExpReq.
+ * nSenAGainErr: Analog gain error as multiplier (in Q8 format).
+ *
+ * nDevEV : The total exposure deviation,[us]
+ * nDevExpTime : The exposure time deviation after flicker reduction,[us]
+ * nDevAGain : The analog gain deviation after flicker reduction,[0,01EV]
+ */
+typedef struct OMX_TI_VECTSHOTINFOTYPE {
+ OMX_U32 nConfigId;
+ OMX_U32 nFrameNum;
+ OMX_U32 nExpMin;
+ OMX_U32 nExpMax;
+ OMX_U32 nGainMin;
+ OMX_U32 nGainMax;
+ OMX_S32 nReqEC;
+ OMX_S32 nReqExpTime;
+ OMX_S32 nReqGain;
+ OMX_U32 nExpTime;
+ OMX_U32 nAGain;
+ OMX_S32 nSenExpTimeErr;
+ OMX_U32 nSenAGainErr;
+ OMX_S32 nDevEV;
+ OMX_S32 nDevExpTime;
+ OMX_S32 nDevAGain;
+} OMX_TI_VECTSHOTINFOTYPE;
+
+/*
+ * LSC gain table size
+ */
+#define OMX_TI_LSC_GAIN_TABLE_SIZE (80 * 1024)
+
+/**
+ * Possible LSC table gain formats
+ */
+typedef enum OMX_TI_LSC_GAIN_FORMAT_TYPE {
+ OMX_TI_LSC_GAIN_FORMAT_0Q8,
+ OMX_TI_LSC_GAIN_FORMAT_0Q8_PLUS_1,
+ OMX_TI_LSC_GAIN_FORMAT_1Q7,
+ OMX_TI_LSC_GAIN_FORMAT_1Q7_PLUS_1,
+ OMX_TI_LSC_GAIN_FORMAT_2Q6,
+ OMX_TI_LSC_GAIN_FORMAT_2Q6_PLUS_1,
+ OMX_TI_LSC_GAIN_FORMAT_3Q5,
+ OMX_TI_LSC_GAIN_FORMAT_3Q5_PLUS_1,
+ OMX_TI_LSC_GAIN_FORMAT = 0x7FFFFFFF
+} OMX_TI_LSC_GAIN_FORMAT_TYPE;
+
+/**
+ * The extra data for LSC table
+ * bApplied : If true the table is applied to the frame.
+ * eGainFormat : Paxel format
+ * nWidth : LSC table width in paxels
+ * nHeight : LSC table height in paxels
+ * pGainTable : LSC gain table
+ */
+typedef struct OMX_TI_LSCTABLETYPE {
+ OMX_BOOL bApplied;
+ OMX_TI_LSC_GAIN_FORMAT_TYPE eGainFormat;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+ OMX_U8 pGainTable[OMX_TI_LSC_GAIN_TABLE_SIZE];
+} OMX_TI_LSCTABLETYPE;
+
+/**
+ * The extra data having ancillary data is described with the following structure.
+ * This data contains single flags and values
+ * (not arrays) that have general usage for camera applications.
+ */
+typedef struct OMX_TI_ANCILLARYDATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nAncillaryDataVersion;
+ OMX_U32 nFrameNumber;
+ OMX_U32 nShotNumber;
+ OMX_U16 nInputImageHeight;
+ OMX_U16 nInputImageWidth;
+ OMX_U16 nOutputImageHeight;
+ OMX_U16 nOutputImageWidth;
+ OMX_U16 nDigitalZoomFactor;
+ OMX_S16 nCropCenterColumn;
+ OMX_S16 nCropCenterRow;
+ OMX_U16 nOpticalZoomValue;
+ OMX_U8 nFlashConfiguration;
+ OMX_U8 nFlashUsage;
+ OMX_U32 nFlashStatus;
+ OMX_U8 nAFStatus;
+ OMX_U8 nAWBStatus;
+ OMX_U8 nAEStatus;
+ OMX_U32 nExposureTime;
+ OMX_U16 nEVCompensation;
+ OMX_U8 nDigitalGainValue;
+ OMX_U8 nAnalogGainValue;
+ OMX_U16 nCurrentISO;
+ OMX_U16 nReferenceISO;
+ OMX_U8 nApertureValue;
+ OMX_U8 nPixelRange;
+ OMX_U16 nPixelAspectRatio;
+ OMX_U8 nCameraShake;
+ OMX_U16 nFocalDistance;
+ OMX_U64 nParameterChangeFlags;
+ OMX_U8 nNumFacesDetected;
+ OMX_U8 nConvergenceMode;
+ OMX_U8 nConvergenceStatus;
+ OMX_U8 nDCCStatus;
+} OMX_TI_ANCILLARYDATATYPE;
+
+/**
+ * White Balance Results data
+ * The extra data having white balance results data is
+ * described with the following structure..
+ */
+typedef struct OMX_TI_WHITEBALANCERESULTTYPE {
+ OMX_U32 nSize; /**< Size */
+ OMX_VERSIONTYPE nVersion; /**< Version */
+ OMX_U32 nPortIndex; /**< Port Index */
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U16 nColorTemperature; /**< White Balance Color Temperature in Kelvins */
+ OMX_U16 nGainR; /**< Bayer applied R color channel gain in (U13Q9) */
+ OMX_U16 nGainGR; /**< Bayer applied Gr color channel gain in (U13Q9) */
+ OMX_U16 nGainGB; /**< Bayer applied Gb color channel gain in (U13Q9) */
+ OMX_U16 nGainB; /**< Bayer applied B color channel gain in (U13Q9) */
+ OMX_S16 nOffsetR; /**< Bayer applied R color channel offset */
+ OMX_S16 nOffsetGR; /**< Bayer applied Gr color channel offset */
+ OMX_S16 nOffsetGB; /**< Bayer applied Gb color channel offset */
+ OMX_S16 nOffsetB; /**< Bayer applied B color channel offset */
+} OMX_TI_WHITEBALANCERESULTTYPE;
+
+/**
+ * Unsaturated Regions data
+ * The extra data having unsaturated regions data is
+ * described with the following structure..
+ */
+typedef struct OMX_TI_UNSATURATEDREGIONSTYPE {
+ OMX_U32 nSize; /**< Size */
+ OMX_VERSIONTYPE nVersion; /**< Version */
+ OMX_U32 nPortIndex; /**< Port Index */
+ OMX_U16 nPaxelsX; /**< The number of paxels in the horizontal direction */
+ OMX_U16 nPaxelsY; /**< The number of paxels in the vertical direction */
+ OMX_U16 data[1]; /**< the first value of an array of values that represent
+ the percentage of unsaturated pixels within the associated paxel */
+} OMX_TI_UNSATURATEDREGIONSTYPE;
+
+/**
+ * OMX_BARCODETYPE
+ */
+typedef enum OMX_BARCODETYPE {
+ OMX_BARCODE1D = 0, /**< 1D barcode */
+ OMX_BARCODE2D, /**< 2D barcode */
+ OMX_BarcodeMax = 0x7fffffff
+}OMX_BARCODETYPE;
+/**
+ * Brcode detection data
+ * nLeft is the leftmost coordinate of the detected area rectangle.
+ * nTop is the topmost coordinate of the detected area rectangle.
+ * nWidth is the width of the detected area rectangle in pixels.
+ * nHeight is the height of the detected area rectangle in pixels.
+ * nOrientation is the orientation of the axis of the detected object. This refers to the angle between the vertical axis of barcode and the horizontal axis.
+ * eBarcodetype is an enumeration specifying the barcode type, as listed in the given table.
+ */
+typedef struct OMX_BARCODEDETECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_S32 nLeft; /**< The leftmost coordinate of the detected area rectangle */
+ OMX_S32 nTop; /**< Topmost coordinate of the detected area rectangle */
+ OMX_U32 nWidth; /**< The width of the detected area rectangle in pixels */
+ OMX_U32 nHeight; /**< The height of the detected area rectangle in pixels */
+ OMX_S32 nOrientation; /**< The orientation of the axis of the detected object.
+ This refers to the angle between the vertical axis of barcode and the horizontal axis */
+ OMX_BARCODETYPE eBarcodetype; /**< An enumeration specifying the barcode type, as listed in the given table */
+ } OMX_BARCODEDETECTIONTYPE;
+
+/**
+ * Front object detection data
+ * nLeft is the leftmost coordinate of the detected area rectangle.
+ * nTop is the topmost coordinate of the detected area rectangle.
+ * nWidth is the width of the detected area rectangle in pixels.
+ * nHeight is the height of the detected area rectangle in pixels.
+ */
+typedef struct OMX_FRONTOBJDETECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_S32 nLeft; /**< The leftmost coordinate of the detected area rectangle */
+ OMX_S32 nTop; /**< The topmost coordinate of the detected area rectangle */
+ OMX_U32 nWidth; /**< The width of the detected area rectangle in pixels */
+ OMX_U32 nHeight; /**< The height of the detected area rectangle in pixels */
+} OMX_FRONTOBJDETECTIONTYPE;
+
+/**
+ * Distance estimation data
+ * nDistance is the estimated distance to the object in millimeters.
+ * nLargestDiscrepancy is the estimated largest discrepancy of the distance to the object in millimeters. When equal to MAX_INT the discrepancy is unknown.
+ */
+typedef struct OMX_DISTANCEESTIMATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nDistance; /**< Estimated distance to the object in millimeters */
+ OMX_U32 nLargestDiscrepancy; /**< the estimated largest discrepancy of the distance to the object in millimeters.
+ When equal to MAX_INT the discrepancy is unknown */
+} OMX_DISTANCEESTIMATIONTYPE;
+
+/**
+ * Distance estimation data
+ * nDistance is the estimated distance to the object in millimeters.
+ * nLargestDiscrepancy is the estimated largest discrepancy of the distance to the object in millimeters. When equal to MAX_INT the discrepancy is unknown.
+ */
+
+typedef struct OMX_MOTIONESTIMATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_S32 nPanX; /**< The detected translation in horizontal direction.
+ The value is represented as pixels in Q16-format */
+ OMX_S32 nPanY; /**< The detected translation in vertical direction.
+ The value is represented as pixels in Q16-format */
+} OMX_MOTIONESTIMATIONTYPE;
+
+
+/**
+ * Focus region data
+ * nRefPortIndex is the port the image frame size is defined on. This image frame size is used as reference for the focus region rectangle.
+ * nLeft is the leftmost coordinate of the focus region rectangle.
+ * nTop is the topmost coordinate of the focus region rectangle.
+ * nWidth is the width of the focus region rectangle in pixels.
+ * nHeight is the height of the focus region rectangle in pixels.
+ *
+ */
+typedef struct OMX_FOCUSREGIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nRefPortIndex; /**< The port the image frame size is defined on.
+ This image frame size is used as reference for the focus region rectangle */
+ OMX_S32 nLeft; /**< The leftmost coordinate of the focus region rectangle */
+ OMX_S32 nTop; /**< The topmost coordinate of the focus region rectangle */
+ OMX_U32 nWidth; /**< The width of the focus region rectangle in pixels */
+ OMX_U32 nHeight; /**< The height of the focus region rectangle in pixels */
+} OMX_FOCUSREGIONTYPE;
+
+/**
+ * OMX_ISOSETTINGTYPE: specifies its auto or manual setting
+ *
+ */
+typedef enum OMX_ISOSETTINGTYPE{
+ OMX_Auto = 0, /**< */
+ OMX_IsoManual, /**< */
+ OMX_IsoSettingMax = 0x7fffffff
+}OMX_ISOSETTINGTYPE;
+
+/**
+ * nSize is the size of the structure including the length of data field containing
+ * the histogram data.
+ * eISOMode:
+ * specifies the ISO seetting mode - auto/manual
+ * nISOSetting:
+ * for manual mode client can specify the ISO setting.
+ */
+
+typedef struct OMX_CONFIG_ISOSETTINGTYPE{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_ISOSETTINGTYPE eISOMode;
+ OMX_U32 nISOSetting;
+}OMX_CONFIG_ISOSETTINGTYPE;
+
+/**
+ * custom RAW format
+ */
+typedef struct OMX_CONFIG_RAWFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VERSIONTYPE nFormatVersion;
+ OMX_STRING cVendorName;
+} OMX_CONFIG_RAWFORMATTYPE;
+
+/**
+ * Sensor type
+ */
+typedef struct OMX_CONFIG_SENSORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VERSIONTYPE nSensorVersion;
+ OMX_STRING cModelName;
+} OMX_CONFIG_SENSORTYPE;
+
+/**
+* Sensor Detect
+*/
+typedef struct OMX_TI_PARAM_SENSORDETECT {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bSensorDetect;
+} OMX_TI_PARAM_SENSORDETECT;
+
+/**
+ * OMX_BAYERCOMPRESSION
+ *
+ */
+typedef enum OMX_BAYERCOMPRESSION {
+ OMX_BAYER_UNPACKED,
+ OMX_BAYER_PACKED10,
+ OMX_BAYER_ALAW,
+ OMX_BAYER_DPCM,
+ OMX_BAYER_MAX = 0x7FFFFFFF
+} OMX_BAYERCOMPRESSION;
+
+/**
+* Sensor Detect
+*/
+typedef struct OMX_TI_PARAM_BAYERCOMPRESSION {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BAYERCOMPRESSION eBayerCompression;
+} OMX_TI_PARAM_BAYERCOMPRESSION;
+
+/**
+ * Sensor custom data type
+ */
+typedef struct OMX_CONFIG_SENSORCUSTOMDATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDataLength;
+ OMX_U8 xSensorData[1];
+} OMX_CONFIG_SENSORCUSTOMDATATYPE;
+
+/**
+ * OMX_OBJDETECTQUALITY
+ *
+ */
+typedef enum OMX_OBJDETECTQUALITY{
+ OMX_FastDetection = 0, /**< A detection that prioritizes speed*/
+ OMX_Default, /**< The default detection, should be used when no control of the detection quality is given.*/
+ OMX_BetterDetection, /**< A detection that levels correct detection with speed*/
+ OMX_BestDtection, /**< A detection that prioritizes correct detection*/
+ OMX_AUTODETECTION, /**< Automatically decide which object detection quality is best.*/
+ OMX_ObjDetectQualityMax = 0x7fffffff
+}OMX_OBJDETECTQUALITY;
+
+/**
+ * OBJECT DETECTION Type
+ * nPortIndex: is an output port. The port index decides on which port the extra data structur of detected object is sent on.
+ * bEnable : this controls ON/OFF for this object detection algirithm.
+ * bFrameLimited: is a Boolean used to indicate if detection shall be terminated after the specified number of frames if
+ * true frame limited detection is enabled; otherwise the port does not terminate detection until instructed to do so by the client.
+ * nFrameLimit: is the limit on number of frames detection is executed for, this parameter is only valid if bFrameLimited is enabled.
+ * nMaxNbrObjects: specifies the maximum number of objects that should be found in each frame. It is implementation dependent which objects are found.
+ * nLeft: is the leftmost coordinate of the detection area rectangle.
+ * nTop: is the topmost coordinate of the detection area rectangle.
+ * nWidth: is the width of the detection area rectangle in pixels.
+ * nHeight: is the height of the detection area rectangle in pixels.
+ * eObjDetectQuality: is an enumeration specifying the quality desired by the detection.
+ * nPriority: represents priority of each object when there are multiple objects detected.
+ */
+
+typedef struct OMX_CONFIG_OBJDETECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+ OMX_BOOL bFrameLimited;
+ OMX_U32 nFrameLimit;
+ OMX_U32 nMaxNbrObjects;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+ OMX_OBJDETECTQUALITY eObjDetectQuality;
+ OMX_U32 nPriority;
+ OMX_U32 nDeviceOrientation;
+ } OMX_CONFIG_OBJDETECTIONTYPE;
+
+
+/**
+ * OMX_OBJDETECTQUALITY
+ *
+ */
+typedef enum OMX_DISTTYPE{
+ OMX_DistanceControlFocus = 0, /**< focus objects distance type*/
+ OMX_DISTANCECONTROL_RECT, /**< Evaluated distance to the object found in the rectangelar area indicated as input region. */
+ OMX_DistTypeMax = 0x7fffffff
+}OMX_DISTTYPE;
+
+
+/**
+ * Distance mesurement
+ * bStarted is a Boolean. The IL client sets it to true to start the measurement .
+ * the IL client sets to false to stop the measurement. The IL client can query it to check if the measurement is ongoing.
+ * nLeft : is the leftmost coordinate of the rectangle.
+ * nTop : is the topmost coordinate of the rectangle.
+ * nWidth: is the width of the rectangle in pixels.
+ * nHeight: is the height of the rectangle in pixels.
+ * eDistType: is an enumeration specifying the distance measurement type, as shown in
+ */
+typedef struct OMX_CONFIG_DISTANCETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bStarted;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+ OMX_DISTTYPE eDistType;
+} OMX_CONFIG_DISTANCETYPE;
+
+
+/**
+ * face detect data - face attribute
+ * nARGBEyeColor: is the indicates a 32-bit eye color of the person, where bits 0-7 are blue,
+ * bits 15-8 are green, bits 24-16 are red, and bits 31-24 are for alpha.
+ * nARGBSkinColor: is the indicates a 32-bit skin color of the person, where bits 0-7 are blue,
+ * bits 15-8 are green, bits 24-16 are red, and bits 31-24 are for alpha.
+ * nARGBHairColor: is the indicates a 32-bit hair color of the person, where bits 0-7 are blue,
+ * bits 15-8 are green, bits 24-16 are red, and bits 31-24 are for alpha.
+ * nSmileScore: a smile detection score between 0 and 100, where 0 means not detecting,
+ * 1 means least certain and 100 means most certain a smile is detected.
+ * nBlinkScore: a eye-blink detection score between 0 and 100, where 0 means not detecting,
+ * 1 means least certain and 100 means most certain an eye-blink is detected.
+ * xIdentity: represents the identity of the face. With identity equal to zero this is not supported.
+ * This can be used by a face recognition application. The component shall not reuse an identity value unless the same face.
+ * Can be used to track detected faces when it moves between frames. Specific usage of this field is implementation dependent.
+ * It can be some kind of ID.
+ *
+ */
+typedef struct OMX_FACEATTRIBUTE {
+ OMX_U32 nARGBEyeColor; /**< The indicates a 32-bit eye color of the person,
+ where bits 0-7 are blue, bits 15-8 are green, bits 24-16 are red,
+ and bits 31-24 are for alpha. */
+ OMX_U32 nARGBSkinColor; /**< The indicates a 32-bit skin color of the person,
+ where bits 0-7 are blue, bits 15-8 are green, bits 24-16 are red,
+ and bits 31-24 are for alpha */
+ OMX_U32 nARGBHairColor; /**< the indicates a 32-bit hair color of the person,
+ where bits 0-7 are blue, bits 15-8 are green, bits 24-16 are red,
+ and bits 31-24 are for alpha */
+ OMX_U32 nSmileScore; /**< Smile detection score between 0 and 100, where 0 means not detecting,
+ 1 means least certain and 100 means most certain a smile is detected */
+ OMX_U32 nBlinkScore; /**< Eye-blink detection score between 0 and 100, where 0 means not detecting,
+ 1 means least certain and 100 means most certain an eye-blink is detected */
+ OMX_U32 xIdentity[4]; /**< represents the identity of the face. With identity equal to zero this is not supported.
+ This can be used by a face recognition application.
+ The component shall not reuse an identity value unless the same face.
+ Can be used to track detected faces when it moves between frames.
+ Specific usage of this field is implementation dependent.
+ It can be some kind of ID */
+} OMX_FACEATTRIBUTE;
+
+/**
+ * xGamma represents lool-up table for gamma correction in Q16 format.
+ * All values assume that maximum value is 255. If internal implementation uses higher dynamic range, this value should be adjusted internally.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nScore: is a detection score between 0 and 100, where 0 means unknown score, 1 means least certain and 100 means most certain the detection is correct.
+ * nLeft: is the leftmost coordinate of the detected area rectangle.
+ * nTop: is the topmost coordinate of the detected area rectangle.
+ * nWidth: is the width of the detected area rectangle in pixels.
+ * nHeight: is the height of the detected area rectangle in pixels.
+ * nOrientationRoll/Yaw/Pitch is the orientation of the axis of the detected object. Here roll angle is defined as the angle between the vertical axis of face and the horizontal axis. All angles can have the value of -180 to 180 degree in Q16 format. Some face detection algorithm may not be able to fill in the angles, this is denoted by the use of MAX_INT value.
+ * nPriority represents priority of each object when there are multiple objects detected.
+ * nFaceAttr describe the attributes of the detected face object with the following structure:
+ *
+ *
+ */
+typedef struct OMX_TI_FACERESULT {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nScore; /**< Detection score between 0 and 100, where 0 means unknown score,
+ 1 means least certain and 100 means most certain the detection is correct */
+ OMX_S32 nLeft; /**< The leftmost coordinate of the detected area rectangle */
+ OMX_S32 nTop; /**< The topmost coordinate of the detected area rectangle */
+ OMX_U32 nWidth; /**< The width of the detected area rectangle in pixels */
+ OMX_U32 nHeight; /**< The height of the detected area rectangle in pixels */
+ // The orientation of the axis of the detected object.
+ // Here roll angle is defined as the angle between the vertical axis of face and the horizontal axis.
+ // All angles can have the value of -180 to 180 degree in Q16 format.
+ // Some face detection algorithm may not be able to fill in the angles, this is denoted by the use of MAX_INT value.
+OMX_S32 nOrientationRoll;
+OMX_S32 nOrientationYaw;
+OMX_S32 nOrientationPitch;
+ //
+ OMX_U32 nPriority; /**< Represents priority of each object when there are multiple objects detected */
+ OMX_FACEATTRIBUTE nFaceAttr; /**< Describe the attributes of the detected face object with the following structure */
+} OMX_TI_FACERESULT;
+
+
+/**
+ * Face detection data
+ * The extra data having face detection data is described with the following structure.
+ * The parser should only assume that the first tFacePosition[ulFaceCount] of the 35 elements
+ * of the array should contain valid data.
+ */
+typedef struct OMX_FACEDETECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U16 ulFaceCount; // faces detected
+ OMX_TI_FACERESULT tFacePosition[35];// 35 is max faces supported by FDIF
+} OMX_FACEDETECTIONTYPE;
+
+/**
+ * MTIS Vendor Specific Motion estimation
+ * The extra data having MTIS motion estimation data is
+ * described with the following structure.
+ */
+typedef struct OMX_TI_MTISTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_S32 nMaxMVh; /**< The maximum MV for horizontal direction */
+ OMX_S32 nMaxMVv; /**< The maximum MV for vertical direction */
+ OMX_U16 nMVRelY[9]; /**< The mask for MV reliability */
+ OMX_U16 nMVRelX[9]; /**< The mask for MV reliability */
+ OMX_S32 nMVh[9]; /**< The MVs for horizontal direction */
+ OMX_S32 nMVv[9]; /**< The MVs for vertical direction */
+} OMX_TI_MTISTYPE;
+
+/**
+ * The OMX_EXTRADATATYPE enumeration is used to define the
+ * possible extra data payload types.
+ */
+typedef enum OMX_EXT_EXTRADATATYPE {
+ OMX_ExifAttributes = 0x7F000001, /**< 0x7F000001 Reserved region for introducing Vendor Extensions */
+ OMX_AncillaryData, /**< 0x7F000002 ancillary data */
+ OMX_WhiteBalance, /**< 0x7F000003 white balance resultant data */
+ OMX_UnsaturatedRegions, /**< 0x7F000004 unsaturated regions data */
+ OMX_FaceDetection, /**< 0x7F000005 face detect data */
+ OMX_BarcodeDetection, /**< 0x7F000006 bar-code detct data */
+ OMX_FrontObjectDetection, /**< 0x7F000007 Front object detection data */
+ OMX_MotionEstimation, /**< 0x7F000008 motion Estimation data */
+ OMX_MTISType, /**< 0x7F000009 MTIS motion Estimation data */
+ OMX_DistanceEstimation, /**< 0x7F00000A disctancedistance estimation */
+ OMX_Histogram, /**< 0x7F00000B histogram */
+ OMX_FocusRegion, /**< 0x7F00000C focus region data */
+ OMX_ExtraDataPanAndScan, /**< 0x7F00000D pan and scan data */
+ OMX_RawFormat, /**< 0x7F00000E custom RAW data format */
+ OMX_SensorType, /**< 0x7F00000F vendor & model of the sensor being used */
+ OMX_SensorCustomDataLength, /**< 0x7F000010 vendor specific custom data length */
+ OMX_SensorCustomData, /**< 0x7F000011 vendor specific data */
+ OMX_TI_FrameLayout, /**< 0x7F000012 vendor specific data */
+ OMX_TI_SEIinfo2004Frame1, /**< 0x7F000013 Used for 2004 SEI message to be provided by video decoders */
+ OMX_TI_SEIinfo2004Frame2, /**< 0x7F000014 Used for 2004 SEI message to be provided by video decoders */
+ OMX_TI_SEIinfo2010Frame1, /**< 0x7F000015 Used for 2010 SEI message to be provided by video decoders */
+ OMX_TI_SEIinfo2010Frame2, /**< 0x7F000016 Used for 2010 SEI message to be provided by video decoders */
+ OMX_TI_RangeMappingInfo, /**< 0x7F000017 Used for Range mapping info provided by Video Decoders */
+ OMX_TI_RescalingInfo, /**< 0x7F000018 Used for width/height rescaling info provided by Video Decoders */
+ OMX_TI_WhiteBalanceOverWrite, /**< 0x7F000019 Used for manual AWB settings */
+ OMX_TI_CPCamData, /**< 0x7F00001A Used for cp cam data */
+ OMX_TI_H264ESliceDataInfo, /**< 0x7F00001B */
+ OMX_TI_DccData, /**< 0x7F00001C Used for dcc data overwrite in the file system */
+ OMX_TI_ProfilerData, /**< 0x7F00001D Used for profiling data */
+ OMX_TI_VectShotInfo, /**< 0x7F00001E Used for vector shot feedback notification */
+ OMX_TI_CamReProcMeta, /**< 0x7F00001F Used for meta data input to camera re-proc function */
+ OMX_TI_LSCTable, /**< 0x7F000020 Lens shading table for corresponding frame */
+ OMX_TI_CodecExtenderErrorFrame1, /**< 0x7F000021 Used for Codec Extended Error to be provided byvideo decoders */
+ OMX_TI_CodecExtenderErrorFrame2, /**< 0x7F000022 Used for Codec Extended Error to be provided byvideo decoders */
+ OMX_TI_MBInfoFrame1, /**< 0x7F000023 Used for MBError message to be provided by videodecoders */
+ OMX_TI_MBInfoFrame2, /**< 0x7F000024 Used for MBError message to be provided by videodecoders */
+ OMX_TI_SEIInfoFrame1, /**< 0x7F000025 Used for SEI message to be provided by video decoders*/
+ OMX_TI_SEIInfoFrame2, /**< 0x7F000026 Used for SEI message to be provided by video decoders*/
+ OMX_TI_VUIInfoFrame1, /**< 0x7F000027 Used for VUI message to be provided by video decoders */
+ OMX_TI_VUIInfoFrame2, /**< 0x7F000028 Used for VUI message to be provided by video decoders */
+ OMX_TI_FaceDetectionRaw, /**< 0x7F000029 Face detect data without face tracking calculations */
+ OMX_TI_HMSGamma, /**< 0x7F00002A Histogram Matched for Stereo Gamma table */
+ OMX_TI_ImagePyramid, /**< 0x7F00002B Describe image piramid sizes for each level of pyramid */
+ OMX_TI_ExtraData_AFStatistics, /**< 0x7F00002C Auto Focus buffer and settings for corresponding frame */
+ OMX_TI_ExtraData_AEWBStatistics, /**< 0x7F00002D Auto Exppsure, white balance buffer and settings for corresponding frame */
+ OMX_TI_ExtraData_BSCStatistics, /**< 0x7F00002E Boundary signal calculator statistics for corresponding frame */
+ OMX_TI_ExtraData_AuxiliaryImage, /**< 0x7F00002F Auxiliary image contains rescaled image at QVGA resolution */
+ OMX_TI_ExtraData_Count,
+ OMX_TI_ExtraData_Max = OMX_TI_ExtraData_Count - 1,
+ OMX_TI_ExtraData_32Bit_Patch = 0x7fffffff
+} OMX_EXT_EXTRADATATYPE;
+
+/**
+ * Enable Extra-data on a specific port.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port on which this extra data to be assosiated
+ * eExtraDataType : Extra data type
+ * bEnable : Eneble/Disable this extra-data through port.
+ *
+ */
+typedef struct OMX_CONFIG_EXTRADATATYPE {
+ OMX_U32 nSize; /**< The size of the structure including data bytes
+ and any padding necessary to ensure 32bit alignment
+ of the next OMX_OTHER_EXTRADATATYPE structure */
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< The read-only value containing the index of the port */
+ OMX_EXT_EXTRADATATYPE eExtraDataType; /**< Identifies the extra data payload type */
+ OMX_BOOL bEnable;
+} OMX_CONFIG_EXTRADATATYPE;
+
+/**
+ * JPEG header type
+ * */
+
+typedef enum OMX_JPEGHEADERTYPE{
+ OMX_NoHeader = 0,
+ OMX_JFIF,
+ OMX_EXIF,
+ OMX_JpegHeaderTypeMax = 0x7fffffff
+}OMX_JPEGHEADERTYPE;
+/**
+ * Re-start marker configuration
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port on which this extra data to be assosiated
+ * eJpegHeaderType : JPEG header type EXIF, JFIF, or No heeader.
+ */
+
+typedef struct OMX_CONFIG_JPEGHEEADERTYPE{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_JPEGHEADERTYPE eJpegHeaderType;
+}OMX_CONFIG_JPEGHEEADERTYPE;
+
+/**
+ * Re-start marker configuration
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port on which this extra data to be assosiated
+ * nRstInterval : interval at which RST markers are to be inserted.
+ * bEnable : Eneble/Disable this RST marker insertion feature.
+ *
+ */
+
+typedef struct OMX_CONFIG_RSTMARKER{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nRstInterval;
+ OMX_BOOL nEnable;
+}OMX_CONFIG_RSTMARKER;
+
+/**
+ * Enable Extra-data on a specific port.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nMaxSize : max size
+ *
+ *
+ */
+typedef struct OMX_IMAGE_JPEGMAXSIZE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nMaxSize;
+} OMX_IMAGE_JPEGMAXSIZE;
+
+
+typedef enum OMX_IMAGESTAMPOPERATION{
+ OMX_NewImageStamp = 0,
+ OMX_Continuation,
+ OMX_ImageStapOperationMax = 0x7fffffff
+}OMX_IMAGESTAMPOPERATION;
+
+
+/**
+ * Enable Extra-data on a specific port.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nMaxSize : max size
+ *
+ *
+ */
+typedef struct OMX_PARAM_IMAGESTAMPOVERLAYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_IMAGESTAMPOPERATION nOp;
+ OMX_U32 nLeft;
+ OMX_U32 nTop;
+ OMX_U32 nHeight;
+ OMX_U32 nWidth;
+ OMX_COLOR_FORMATTYPE eFormat;
+ OMX_U8 * pBitMap;
+} OMX_PARAM_IMAGESTAMPOVERLAYTYPE;
+
+
+/**
+ * Enable Extra-data on a specific port.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nMaxSize : max size
+ *
+ *
+ */
+typedef struct OMX_PARAM_THUMBNAILTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nHeight;
+ OMX_U32 nWidth;
+ OMX_IMAGE_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_U32 nQuality;
+ OMX_U32 nMaxSize;
+} OMX_PARAM_THUMBNAILTYPE;
+
+/**
+ * Red-Eye Removal Enum
+ */
+typedef enum OMX_REDEYEREMOVALTYPE{
+ OMX_RedEyeRemovalOff = 0, /** No red eye removal*/
+ OMX_RedEyeRemovalOn, /** Red eye removal on*/
+ OMX_RedEyeRemovalAuto, /** Red eye removal will be done automatically when detected*/
+ OMX_RedEyeRemovalKhronosExtensions = 0x6F000000, /** Reserved region for introducing Khronos Standard Extensions*/
+ OMX_RedEyeRemovalVendorStartUnused = 0x7F000000, /** Reserved region for introducing Vendor Extensions*/
+ OMX_RedEyeRemovalMax = 0x7FFFFFFF
+}OMX_REDEYEREMOVALTYPE;
+
+/**
+ * Enable Extra-data on a specific port.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLeft: is the leftmost coordinate of the detection area rectangle (such as face region).
+ * nTop: is the topmost coordinate of the detection area rectangle (such as face region).
+ * nWidth: is the width of the detection area rectangle in pixels.
+ * nHeight: is the height of the detection area rectangle in pixels.
+ * nARGBEyeColor indicates a 32-bit eye color to replace the red-eye, where bits 0-7 are blue, bits 15-8 are green, bits 24-16 are red, and bits 31-24 are for alpha. When all zero indicates automatic choice.
+
+ *
+ */
+typedef struct OMX_CONFIG_REDEYEREMOVALTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_S32 nLeft;
+ OMX_S32 nTop;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+ OMX_U32 nARGBEyeColor;
+ OMX_REDEYEREMOVALTYPE eMode;
+} OMX_CONFIG_REDEYEREMOVALTYPE;
+
+
+
+
+
+
+/**
+ * Video capture YUV Range Enum
+ */
+typedef enum OMX_VIDEOYUVRANGETYPE{
+ OMX_ITURBT601 = 0,
+ OMX_Full8Bit,
+ OMX_VideoYUVRangeKhronosExtensions = 0x6F000000, /** Reserved region for introducing Khronos Standard Extensions*/
+ OMX_VideoYUVRangeVendorStartUnused = 0x7F000000, /** Reserved region for introducing Vendor Extensions*/
+ OMX_VideoYUVRangeMax = 0x7FFFFFFF
+}OMX_VIDEOYUVRANGETYPE;
+
+/**
+ * Enable Extra-data on a specific port.
+ *
+ *
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ *
+ */
+typedef struct OMX_PARAM_VIDEOYUVRANGETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEOYUVRANGETYPE eYUVRange;
+} OMX_PARAM_VIDEOYUVRANGETYPE;
+
+/**
+ * Video noise filter mode range enum
+ */
+typedef enum OMX_VIDEONOISEFILTERMODETYPE{
+ OMX_VideoNoiseFilterModeOff = 0,
+ OMX_VideoNoiseFilterModeOn,
+ OMX_VideoNoiseFilterModeAuto,
+ OMX_VideoNoiseFilterModeExtensions = 0x6F000000, /** Reserved region for introducing Khronos Standard Extensions */
+ OMX_VideoNoiseFilterModeStartUnused = 0x7F000000, /** Reserved region for introducing Vendor Extensions */
+ OMX_VideoNoiseFilterModeMax = 0x7FFFFFFF
+} OMX_VIDEONOISEFILTERMODETYPE;
+
+/**
+ * Enable video noise filter.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eMode : Video noise filter mode (on/off/auto)
+ */
+typedef struct OMX_PARAM_VIDEONOISEFILTERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEONOISEFILTERMODETYPE eMode;
+} OMX_PARAM_VIDEONOISEFILTERTYPE;
+
+
+/**
+ * High ISO Noise filter mode range enum
+ */
+typedef enum OMX_ISONOISEFILTERMODETYPE{
+ OMX_ISONoiseFilterModeOff = 0,
+ OMX_ISONoiseFilterModeOn,
+ OMX_ISONoiseFilterModeAuto,
+ OMX_ISONoiseFilterModeExtensions = 0x6F000000, /** Reserved region for introducing Khronos Standard Extensions */
+ OMX_ISONoiseFilterModeStartUnused = 0x7F000000, /** Reserved region for introducing Vendor Extensions */
+ OMX_ISONoiseFilterModeMax = 0x7FFFFFFF
+} OMX_ISONOISEFILTERMODETYPE;
+
+/**
+ * Enable ISO noise filter.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eMode : ISO noise filter (NSF2 is used) mode (on/off/auto)
+ */
+typedef struct OMX_PARAM_ISONOISEFILTERTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_ISONOISEFILTERMODETYPE eMode;
+} OMX_PARAM_ISONOISEFILTERTYPE;
+
+/**
+ * Structure used to to call OMX_GetParams() for each
+ * increment of "Index" starting with "0"
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nIndex : Index of the sDCCURI 0..MAX_URI_LENGTH
+ * sDCCURI : Look-up table containing strings. Ends with '\0'
+ */
+typedef struct OMX_TI_PARAM_DCCURIINFO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nIndex;
+ OMX_S8 sDCCURI[MAX_URI_LENGTH];
+} OMX_TI_PARAM_DCCURIINFO;
+
+/**
+ * Manual White Balance color temperature
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nColorTemperature : Color Temperature in K
+ */
+typedef struct OMX_TI_CONFIG_WHITEBALANCECOLORTEMPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nColorTemperature;
+} OMX_TI_CONFIG_WHITEBALANCECOLORTEMPTYPE;
+
+/**
+ * Focus spot weighting range enum
+ */
+typedef enum OMX_TI_CONFIG_FOCUSSPOTMODETYPE {
+ OMX_FocusSpotDefault = 0, /** Makes CommonFocusRegion to be used. */
+ OMX_FocusSpotSinglecenter, /** Only central part of the image is used for focus. */
+ OMX_FocusSpotMultiNormal, /** Middle part of the image is used with 100% weight, upper and lower parts are with 50%. */
+ OMX_FocusSpotMultiAverage, /** All the image is used with 100% weight. */
+ OMX_FocusSpotMultiCenter, /** Central part of the image is used with 100% weight, the rest is used with 50%. */
+ OMX_FocusSpotExtensions = 0x6F000000, /** Reserved region for introducing Khronos Standard Extensions */
+ OMX_FocusSpotModeStartUnused = 0x7F000000, /** Reserved region for introducing Vendor Extensions */
+ OMX_FocusSpotModeMax = 0x7FFFFFFF
+} OMX_TI_CONFIG_FOCUSSPOTMODETYPE;
+
+/**
+ * Focus Spot Weighting configuration.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eMode : Spot Weighting mode
+ */
+typedef struct OMX_TI_CONFIG_FOCUSSPOTWEIGHTINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CONFIG_FOCUSSPOTMODETYPE eMode;
+} OMX_TI_CONFIG_FOCUSSPOTWEIGHTINGTYPE;
+
+/**
+ * Enumeration of possible Exposure control types for OMX_EXPOSURECONTROLTYPE
+ */
+typedef enum OMX_TI_EXTEXPOSURECONTROLTYPE {
+ OMX_TI_ExposureControlVeryLong = OMX_ExposureControlVendorStartUnused + 1,
+ OMX_TI_ExposureControlFacePriority,
+ OMX_TI_ExposureControlMax = 0x7fffffff
+} OMX_TI_EXTEXPOSURECONTROLTYPE;
+
+/**
+ * Variable frame rate configuration.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * xMinFramerate : Minimum variable frame rate value
+ */
+typedef struct OMX_TI_PARAM_VARFRAMERATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 xMinFramerate;
+} OMX_TI_PARAM_VARFRAMERATETYPE;
+
+/**
+ * Exposure config for right frame
+ */
+typedef struct OMX_TI_CONFIG_EXPOSUREVALUERIGHTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nApertureFNumber; /**< e.g. nApertureFNumber = 2 implies "f/2" - Q16 format */
+ OMX_U32 nShutterSpeedMsec; /**< Shutterspeed in milliseconds */
+ OMX_U32 nSensitivity; /**< e.g. nSensitivity = 100 implies "ISO 100" */
+} OMX_TI_CONFIG_EXPOSUREVALUERIGHTTYPE;
+
+/**
+ * Auto Convergence mode enum
+ */
+typedef enum OMX_TI_AUTOCONVERGENCEMODETYPE {
+ OMX_TI_AutoConvergenceModeDisable,
+ OMX_TI_AutoConvergenceModeFrame,
+ OMX_TI_AutoConvergenceModeCenter,
+ OMX_TI_AutoConvergenceModeFocusFaceTouch,
+ OMX_TI_AutoConvergenceModeManual,
+ OMX_TI_AutoConvergenceExtensions = 0x6F000000, /** Reserved region for introducing Khronos Standard Extensions */
+ OMX_TI_AutoConvergenceStartUnused = 0x7F000000, /** Reserved region for introducing Vendor Extensions */
+ OMX_TI_AutoConvergenceModeMax = 0x7FFFFFFF
+} OMX_TI_AUTOCONVERGENCEMODETYPE;
+
+/**
+ * Variable farame rate configuration.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eACMode : Auto convergence mode
+ * nManualConverence : Manual Converence value
+ * nACProcWinStartX : Start X AC Window
+ * nACProcWinStartY : Start Y AC Window
+ * nACProcWinWidth : Width of AC Window
+ * nACProcWinHeight : Height of AC Window
+ * bACStatus : output status from AL alg
+ */
+typedef struct OMX_TI_CONFIG_CONVERGENCETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_AUTOCONVERGENCEMODETYPE eACMode;
+ OMX_S32 nManualConverence;
+ OMX_U32 nACProcWinStartX;
+ OMX_U32 nACProcWinStartY;
+ OMX_U32 nACProcWinWidth;
+ OMX_U32 nACProcWinHeight;
+ OMX_BOOL bACStatus;
+} OMX_TI_CONFIG_CONVERGENCETYPE;
+
+/**
+ * Camera specific version.
+ *
+ * STRUCT MEMBERS:
+ * nBranch : Branch
+ * nCommitID : Commit ID
+ * nBuildDateTime : Build date and time
+ * nExtraInfo : rederved for future use
+ */
+typedef struct OMX_TI_CAMERASPECVERSIONTYPE {
+ OMX_U8 nBranch[64];
+ OMX_U8 nCommitID[64];
+ OMX_U8 nBuildDateTime[64];
+ OMX_U8 nExtraInfo[64];
+} OMX_TI_CAMERASPECVERSIONTYPE;
+
+/**
+ * Stereo frame layout enum
+ */
+typedef enum OMX_TI_STEREOFRAMELAYOUTTYPE {
+ OMX_TI_StereoFrameLayout2D,
+ OMX_TI_StereoFrameLayoutTopBottom,
+ OMX_TI_StereoFrameLayoutLeftRight,
+ OMX_TI_StereoFrameLayoutTopBottomSubsample,
+ OMX_TI_StereoFrameLayoutLeftRightSubsample,
+ OMX_TI_StereoFrameLayoutMax = 0x7FFFFFFF
+} OMX_TI_STEREOFRAMELAYOUTTYPE;
+
+/**
+ * Camera frame layout type.
+ *
+ * STRUCT MEMBERS:
+ * eFrameLayout : frame layout
+ * nSubsampleRatio : subsample ratio
+ */
+typedef struct OMX_TI_FRAMELAYOUTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_STEREOFRAMELAYOUTTYPE eFrameLayout;
+ OMX_U32 nSubsampleRatio; /** Subsampling ratio, Q15.7 */
+} OMX_TI_FRAMELAYOUTTYPE;
+
+/**
+ * The OMX_TI_COLOR_FORMATTYPE enumeration is used to define the
+ * extended color format types.
+ */
+typedef enum OMX_TI_COLOR_FORMATTYPE {
+ OMX_TI_COLOR_FormatRawBayer10bitStereo =
+ OMX_COLOR_FormatVendorStartUnused + 2, /**< 10 bit raw for stereo */
+ OMX_TI_COLOR_FormatYUV420PackedSemiPlanar =
+ (OMX_COLOR_FORMATTYPE) OMX_COLOR_FormatVendorStartUnused + 0x100, /* 0x100 is used since it is the corresponding HAL pixel fromat */
+ OMX_TI_ColorFormatTypeMax = 0x7fffffff
+} OMX_TI_COLOR_FORMATTYPE;
+
+/**
+ * The OMX_TI_EXIFTAGSTATUS enumeration is used to define the
+ * tag status types.
+ */
+typedef enum OMX_TI_EXIFTAGSTATUS {
+ OMX_TI_TagReadOnly, /**< implies this tag is generated within omx-camera >*/
+ OMX_TI_TagReadWrite, /**< implies this tag can be overwritten by client >*/
+ OMX_TI_TagUpdated, /**< client has to use this to indicate the specific tag is overwritten >*/
+ OMX_TI_ExifStatus_Max = 0x7fffffff
+} OMX_TI_EXIFTAGSTATUS;
+
+typedef struct OMX_TI_CONFIG_EXIF_TAGS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_EXIFTAGSTATUS eStatusImageWidth;
+ OMX_U32 ulImageWidth;
+ OMX_TI_EXIFTAGSTATUS eStatusImageHeight;
+ OMX_U32 ulImageHeight;
+ OMX_TI_EXIFTAGSTATUS eStatusBitsPerSample;
+ OMX_U16 usBitsPerSample[3];
+ OMX_TI_EXIFTAGSTATUS eStatusCompression;
+ OMX_U16 usCompression;
+ OMX_TI_EXIFTAGSTATUS eStatusPhotometricInterpretation;
+ OMX_U16 usPhotometricInterpretation;
+ OMX_TI_EXIFTAGSTATUS eStatusOrientation;
+ OMX_U16 usOrientation;
+ OMX_TI_EXIFTAGSTATUS eStatusSamplesPerPixel;
+ OMX_U16 usSamplesPerPixel;
+ OMX_TI_EXIFTAGSTATUS eStatusPlanarConfiguration;
+ OMX_U16 usPlanarConfiguration;
+ OMX_TI_EXIFTAGSTATUS eStatusYCbCrSubSampling;
+ OMX_U16 usYCbCrSubSampling[2];
+ OMX_TI_EXIFTAGSTATUS eStatusYCbCrPositioning;
+ OMX_U16 usYCbCrPositioning;
+ OMX_TI_EXIFTAGSTATUS eStatusXResolution;
+ OMX_U32 ulXResolution[2];
+ OMX_TI_EXIFTAGSTATUS eStatusYResolution;
+ OMX_U32 ulYResolution[2];
+ OMX_TI_EXIFTAGSTATUS eStatusResolutionUnit;
+ OMX_U16 usResolutionUnit;
+
+ OMX_TI_EXIFTAGSTATUS eStatusRowsPerStrip;
+ OMX_U32 ulRowsPerStrip;
+ OMX_TI_EXIFTAGSTATUS eStatusDataSize;
+ OMX_U32 ulDataSize;
+
+ OMX_TI_EXIFTAGSTATUS eStatusTransferFunction;
+ OMX_U16 usTransferFunction[3*256];
+ OMX_TI_EXIFTAGSTATUS eStatusWhitePoint;
+ OMX_U32 ulWhitePoint[4]; //2x2
+ OMX_TI_EXIFTAGSTATUS eStatusPrimaryChromaticities;
+ OMX_U32 ulPrimaryChromaticities[12]; //2x6
+ OMX_TI_EXIFTAGSTATUS eStatusYCbCrCoefficients;
+ OMX_U32 ulYCbCrCoefficients[6]; //2x3
+ OMX_TI_EXIFTAGSTATUS eStatusReferenceBlackWhite;
+ OMX_U32 ulReferenceBlackWhite[12]; //2x6
+ OMX_TI_EXIFTAGSTATUS eStatusDateTime;
+ OMX_S8* pDateTimeBuff;
+ OMX_U32 ulDateTimeBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusImageDescription;
+ OMX_S8* pImageDescriptionBuff;
+ OMX_U32 ulImageDescriptionBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusMake;
+ OMX_S8* pMakeBuff;
+ OMX_U32 ulMakeBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusModel;
+ OMX_S8* pModelBuff;
+ OMX_U32 ulModelBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusSoftware;
+ OMX_S8* pSoftwareBuff;
+ OMX_U32 ulSoftwareBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusArtist;
+ OMX_S8* pArtistBuff;
+ OMX_U32 ulArtistBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusCopyright;
+ OMX_S8* pCopyrightBuff;
+ OMX_U32 ulCopyrightBuffSizeBytes;
+
+ OMX_TI_EXIFTAGSTATUS eStatusExifVersion;
+ OMX_S8 cExifVersion[4];
+ OMX_TI_EXIFTAGSTATUS eStatusFlashpixVersion;
+ OMX_S8 cFlashpixVersion[4];
+ OMX_TI_EXIFTAGSTATUS eStatusColorSpace;
+ OMX_U16 usColorSpace;
+ OMX_TI_EXIFTAGSTATUS eStatusComponentsConfiguration;
+ OMX_S8 cComponentsConfiguration[4];
+ OMX_TI_EXIFTAGSTATUS eStatusCompressedBitsPerPixel;
+ OMX_U32 ulCompressedBitsPerPixel[2];
+ OMX_TI_EXIFTAGSTATUS eStatusPixelXDimension;
+ OMX_U32 ulPixelXDimension;
+ OMX_TI_EXIFTAGSTATUS eStatusPixelYDimension;
+ OMX_U32 ulPixelYDimension;
+ OMX_TI_EXIFTAGSTATUS eStatusMakerNote;
+ OMX_S8* pMakerNoteBuff;
+ OMX_U32 ulMakerNoteBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusUserComment;
+ OMX_S8* pUserCommentBuff;
+ OMX_U32 ulUserCommentBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusRelatedSoundFile;
+ OMX_S8 cRelatedSoundFile[13];
+ OMX_TI_EXIFTAGSTATUS eStatusDateTimeOriginal;
+ OMX_S8* pDateTimeOriginalBuff;
+ OMX_U32 ulDateTimeOriginalBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusDateTimeDigitized;
+ OMX_S8* pDateTimeDigitizedBuff;
+ OMX_U32 ulDateTimeDigitizedBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusSubSecTime;
+ OMX_S8* pSubSecTimeBuff;
+ OMX_U32 ulSubSecTimeBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusSubSecTimeOriginal;
+ OMX_S8* pSubSecTimeOriginalBuff;
+ OMX_U32 ulSubSecTimeOriginalBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusSubSecTimeDigitized;
+ OMX_S8* pSubSecTimeDigitizedBuff;
+ OMX_U32 ulSubSecTimeDigitizedBuffSizeBytes;
+
+ OMX_TI_EXIFTAGSTATUS eStatusExposureTime;
+ OMX_U32 ulExposureTime[2];
+ OMX_TI_EXIFTAGSTATUS eStatusFNumber;
+ OMX_U32 ulFNumber[2];
+ OMX_TI_EXIFTAGSTATUS eStatusExposureProgram;
+ OMX_U16 usExposureProgram;
+ OMX_TI_EXIFTAGSTATUS eStatusSpectralSensitivity;
+ OMX_S8* pSpectralSensitivityBuff;
+ OMX_U32 ulSpectralSensitivityBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusISOCount;
+ OMX_U16 usISOCount;
+ OMX_TI_EXIFTAGSTATUS eStatusISOSpeedRatings;
+ OMX_U16* pISOSpeedRatings;
+ OMX_TI_EXIFTAGSTATUS eStatusOECF;
+ OMX_S8* pOECFBuff;
+ OMX_U32 ulOECFBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusShutterSpeedValue;
+ OMX_S32 slShutterSpeedValue[2];
+ OMX_TI_EXIFTAGSTATUS eStatusApertureValue;
+ OMX_U32 ulApertureValue[2];
+ OMX_TI_EXIFTAGSTATUS eStatusBrightnessValue;
+ OMX_S32 slBrightnessValue[2];
+ OMX_TI_EXIFTAGSTATUS eStatusExposureBiasValue;
+ OMX_S32 slExposureBiasValue[2];
+ OMX_TI_EXIFTAGSTATUS eStatusMaxApertureValue;
+ OMX_U32 ulMaxApertureValue[2];
+ OMX_TI_EXIFTAGSTATUS eStatusSubjectDistance;
+ OMX_U32 ulSubjectDistance[2];
+ OMX_TI_EXIFTAGSTATUS eStatusMeteringMode;
+ OMX_U16 usMeteringMode;
+ OMX_TI_EXIFTAGSTATUS eStatusLightSource;
+ OMX_U16 usLightSource;
+ OMX_TI_EXIFTAGSTATUS eStatusFlash;
+ OMX_U16 usFlash;
+ OMX_TI_EXIFTAGSTATUS eStatusFocalLength;
+ OMX_U32 ulFocalLength[2];
+ OMX_TI_EXIFTAGSTATUS eStatusSubjectArea;
+ OMX_U16 usSubjectArea[4];
+ OMX_TI_EXIFTAGSTATUS eStatusFlashEnergy;
+ OMX_U32 ulFlashEnergy[2];
+ OMX_TI_EXIFTAGSTATUS eStatusSpatialFrequencyResponse;
+ OMX_S8* pSpatialFrequencyResponseBuff;
+ OMX_U32 ulSpatialFrequencyResponseBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusFocalPlaneXResolution;
+ OMX_U32 ulFocalPlaneXResolution[2];
+ OMX_TI_EXIFTAGSTATUS eStatusFocalPlaneYResolution;
+ OMX_U32 ulFocalPlaneYResolution[2];
+ OMX_TI_EXIFTAGSTATUS eStatusFocalPlaneResolutionUnit;
+ OMX_U16 usFocalPlaneResolutionUnit;
+ OMX_TI_EXIFTAGSTATUS eStatusSubjectLocation;
+ OMX_U16 usSubjectLocation[2];
+ OMX_TI_EXIFTAGSTATUS eStatusExposureIndex;
+ OMX_U32 ulExposureIndex[2];
+ OMX_TI_EXIFTAGSTATUS eStatusSensingMethod;
+ OMX_U16 usSensingMethod;
+ OMX_TI_EXIFTAGSTATUS eStatusFileSource;
+ OMX_S8 cFileSource;
+ OMX_TI_EXIFTAGSTATUS eStatusSceneType;
+ OMX_S8 cSceneType;
+ OMX_TI_EXIFTAGSTATUS eStatusCFAPattern;
+ OMX_S8* pCFAPatternBuff;
+ OMX_U32 ulCFAPatternBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusCustomRendered;
+ OMX_U16 usCustomRendered;
+ OMX_TI_EXIFTAGSTATUS eStatusExposureMode;
+ OMX_U16 usExposureMode;
+ OMX_TI_EXIFTAGSTATUS eStatusWhiteBalance;
+ OMX_U16 usWhiteBalance;
+ OMX_TI_EXIFTAGSTATUS eStatusDigitalZoomRatio;
+ OMX_U32 ulDigitalZoomRatio[2];
+ OMX_TI_EXIFTAGSTATUS eStatusFocalLengthIn35mmFilm;
+ OMX_U16 usFocalLengthIn35mmFilm;
+ OMX_TI_EXIFTAGSTATUS eStatusSceneCaptureType;
+ OMX_U16 usSceneCaptureType;
+ OMX_TI_EXIFTAGSTATUS eStatusGainControl;
+ OMX_U16 usGainControl;
+ OMX_TI_EXIFTAGSTATUS eStatusContrast;
+ OMX_U16 usContrast;
+ OMX_TI_EXIFTAGSTATUS eStatusSaturation;
+ OMX_U16 usSaturation;
+ OMX_TI_EXIFTAGSTATUS eStatusSharpness;
+ OMX_U16 usSharpness;
+ OMX_TI_EXIFTAGSTATUS eStatusDeviceSettingDescription;
+ OMX_S8* pDeviceSettingDescriptionBuff;
+ OMX_U32 ulDeviceSettingDescriptionBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusSubjectDistanceRange;
+ OMX_U16 usSubjectDistanceRange;
+
+ OMX_TI_EXIFTAGSTATUS eStatusImageUniqueID;
+ OMX_S8 cImageUniqueID[33];
+ OMX_U8* pPrivateNextIFDPointer; //Should not be used by the application
+ OMX_U8* pPrivateThumbnailSize; //Should not be used by the application
+ OMX_U8* pPrivateTiffHeaderPointer; //Should not be used by the application
+
+ OMX_TI_EXIFTAGSTATUS eStatusGpsVersionId;
+ OMX_U8 ucGpsVersionId[4];
+ OMX_TI_EXIFTAGSTATUS eStatusGpslatitudeRef;
+ OMX_S8 cGpslatitudeRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsLatitude;
+ OMX_U32 ulGpsLatitude[6];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsLongitudeRef;
+ OMX_S8 cGpsLongitudeRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsLongitude;
+ OMX_U32 ulGpsLongitude[6];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsAltitudeRef;
+ OMX_U8 ucGpsAltitudeRef;
+ OMX_TI_EXIFTAGSTATUS eStatusGpsAltitude;
+ OMX_U32 ulGpsAltitude[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsTimeStamp;
+ OMX_U32 ulGpsTimeStamp[6];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsSatellites;
+ OMX_S8* pGpsSatellitesBuff;
+ OMX_U32 ulGpsSatellitesBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusGpsStatus;
+ OMX_S8 cGpsStatus[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsMeasureMode;
+ OMX_S8 cGpsMeasureMode[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDop;
+ OMX_U32 ulGpsDop[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsSpeedRef;
+ OMX_S8 cGpsSpeedRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsSpeed;
+ OMX_U32 ulGpsSpeed[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsTrackRef;
+ OMX_S8 cGpsTrackRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsTrack;
+ OMX_U32 ulGpsTrack[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsImgDirectionRef;
+ OMX_S8 cGpsImgDirectionRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsImgDirection;
+ OMX_U32 ulGpsImgDirection[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsMapDatum;
+ OMX_S8* pGpsMapDatumBuff;
+ OMX_U32 ulGpsMapDatumBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestLatitudeRef;
+ OMX_S8 cGpsDestLatitudeRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestLatitude;
+ OMX_U32 ulGpsDestLatitude[6];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestLongitudeRef;
+ OMX_S8 cGpsDestLongitudeRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestLongitude;
+ OMX_U32 ulGpsDestLongitude[6];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestBearingRef;
+ OMX_S8 cGpsDestBearingRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestBearing;
+ OMX_U32 ulGpsDestBearing[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestDistanceRef;
+ OMX_S8 cGpsDestDistanceRef[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDestDistance;
+ OMX_U32 ulGpsDestDistance[2];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsProcessingMethod;
+ OMX_S8* pGpsProcessingMethodBuff;
+ OMX_U32 ulGpsProcessingMethodBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusGpsAreaInformation;
+ OMX_S8* pGpsAreaInformationBuff;
+ OMX_U32 ulGpsAreaInformationBuffSizeBytes;
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDateStamp;
+ OMX_S8 cGpsDateStamp[11];
+ OMX_TI_EXIFTAGSTATUS eStatusGpsDifferential;
+ OMX_U16 usGpsDifferential;
+} OMX_TI_CONFIG_EXIF_TAGS;
+
+/**
+ * The OMX_TI_SENFACING_TYPE enumeration is used to define the
+ * sensor facing.
+ */
+typedef enum OMX_TI_SENFACING_TYPE {
+ OMX_TI_SENFACING_FRONT,
+ OMX_TI_SENFACING_BACK,
+ OMX_TI_SENFACING_MAX = 0x7FFFFFFF
+}OMX_TI_SENFACING_TYPE;
+
+/**
+ * Structure used to configure current OMX_TI_SENMOUNT_TYPE
+ *
+ * @param nSenId
+ * @param nRotation
+ * @param bMirror
+ * @param bFlip
+ * @param eFacing
+ */
+typedef struct OMX_TI_SENMOUNT_TYPE {
+ OMX_U32 nSenId;
+ OMX_U32 nRotation;
+ OMX_BOOL bMirror;
+ OMX_BOOL bFlip;
+ OMX_TI_SENFACING_TYPE eFacing;
+}OMX_TI_SENMOUNT_TYPE;
+
+/**
+ * Structure used to configure current OMX_TI_VARFPSTYPE
+ *
+ * @param nVarFPSMin Number of the smallest FPS supported.
+ * @param nVarFPSMax Number of the biggest FPS supported.
+ */
+typedef struct OMX_TI_VARFPSTYPE {
+ OMX_U32 nVarFPSMin;
+ OMX_U32 nVarFPSMax;
+} OMX_TI_VARFPSTYPE;
+
+/**
+ * Structure used to configure current OMX_TI_CONFIG_SHAREDBUFFER
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSharedBuffSize : Size of the pSharedBuff in bytes
+ * pSharedBuff : Pointer to a buffer
+ */
+typedef struct OMX_TI_CONFIG_SHAREDBUFFER {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSharedBuffSize;
+ OMX_U8* pSharedBuff;
+} OMX_TI_CONFIG_SHAREDBUFFER;
+
+/**
+ * Structure used to configure current OMX_TI_CAPRESTYPE
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nWidthMin : Number of the smallest width supported
+ * nHeightMin : Number of the smallest height supported
+ * nWidthMax : Number of the biggest width supported
+ * nHeightMax : Number of the biggest height supported
+ * nMaxResInPixels : Max resolution in pixels. Used for description of 3d resolutions.
+ */
+typedef struct OMX_TI_CAPRESTYPE {
+ OMX_U32 nSize; //- OMX struct header not required as this struct wont be queried on its own?
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nWidthMin; // smallest width supported
+ OMX_U32 nHeightMin; // smallest height supported
+ OMX_U32 nWidthMax; // biggest width supported
+ OMX_U32 nHeightMax; // biggest height supported
+ OMX_U32 nMaxResInPixels;// max resolution in pixels
+} OMX_TI_CAPRESTYPE;
+
+/**
+ * Structure used to configure current OMX_TI_CAPTYPE
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * ulPreviewFormatCount : Number of the supported preview pixelformat count
+ * ePreviewFormats : Array containing the supported preview pixelformat count
+ * ulImageFormatCount : Number of the supported image pixelformat count
+ * eImageFormats : Array containing the supported image pixelformat count
+ * tPreviewResRange : Supported preview resolution range
+ * tRotatedPreviewResRange : Supported rotated preview resolution range
+ * tImageResRange : Supported image resolution range
+ * tThumbResRange : Supported thumbnail resolution range
+ * ulWhiteBalanceCount : Supported whitebalance mode count
+ * eWhiteBalanceModes : Array containing the whitebalance modes
+ * ulColorEffectCount : Supported effects count
+ * eColorEffects : Array containing the supported effects
+ * xMaxWidthZoom : Fixed point value stored as Q16 representing the maximum value for the Zoom allowed on Width
+ * xMaxHeightZoom : Fixed point value stored as Q16 representing the maximum value for the Zoom allowed on Height
+ * ulFlickerCount : Number of the supported anti-flicker modes
+ * eFlicker : Array containing the supported anti-flicker modes
+ * ulExposureModeCount : Number of the supported exposure modes
+ * eExposureModes : Array containing the supported exposure modes
+ * bLensDistortionCorrectionSupported : Flag for Lens Distortion Correction Algorithm support
+ * bISONoiseFilterSupported : Flag for Noise Filter Algorithm support
+ * xEVCompensationMin : Fixed point value stored as Q16 representing the EVCompensation minumum allowed value
+ * xEVCompensationMax : Fixed point value stored as Q16 representing the EVCompensation maximum allowed value
+ * nSensitivityMax : nSensitivityMax = 100 implies maximum supported equal to "ISO 100"
+ * ulFocusModeCount : Number of the supported focus modes
+ * eFocusModes : Array containing the supported focus modes
+ * ulSceneCount : Number of the supported scenes
+ * eSceneModes : Array containing the supported scenes
+ * ulFlashCount : Number of the supported flash modes
+ * eFlashModes : Array containing the supported flash modes
+ * xFramerateMin : Fixed point value stored as Q16 representing the minimum framerate allowed
+ * xFramerateMax : Fixed point value stored as Q16 representing the maximum framerate allowed
+ * bContrastSupported : Flag showing if the contrast is supported
+ * bSaturationSupported : Flag showing if the saturation is supported
+ * bBrightnessSupported : Flag showing if the brightness is supported
+ * bProcessingLevelSupported : Flag showing if the processing level is supported
+ * bQFactorSupported : Flag showing if the QFactor is supported
+ * ulPrvVarFPSModesCount : Number of preview FPS modes
+ * tPrvVarFPSModes : Preview FPS modes
+ * ulCapVarFPSModesCount : Number of capture FPS modes
+ * tCapVarFPSModes : Capture FPS modes
+ * tSenMounting : Sensor mount information
+ * ulAutoConvModesCount : Supported auto convergence modes count
+ * eAutoConvModes : Array containing the auto convergence modes
+ * ulBracketingModesCount : Supported bracketing modes count
+ * eBracketingModes : Array containing the bracketing modes
+ * bGbceSupported : Flag showing if the Gbce is supported
+ * bRawJpegSupported : Flag showing if the Raw + Jpeg is supported
+ * ulImageCodingFormatCount : Supported image coding formats count
+ * eImageCodingFormat : Array containing the image coding formats
+ * uSenNativeResWidth : Sensor native resolution width
+ * uSenNativeResHeight : Sensor native resolution height
+ * ulAlgoAreasFocusCount : Supported number of AlgoAreas for focus areas
+ * ulAlgoAreasExposureCount : Supported number of AlgoAreas for exposure areas
+ * bAELockSupported : Flag showing if the AE Lock is supported
+ * bAWBLockSupported : Flag showing if the AWB Lock is supported
+ * bAFLockSupported : Flag showing if the Af Lock is supported
+ * nFocalLength : Focal length defined in terms of 0.01mm
+ * ulPrvFrameLayoutCount : supported frame layout count for preview
+ * ePrvFrameLayout : Array containing the frame layouts for preview
+ * ulCapFrameLayoutCount : supported frame layout count for capture
+ * eCapFrameLayout : Array containing the frame layouts for capture
+ * bVideoNoiseFilterSupported : Flag showing if the video noise filter is supported
+ * bVideoStabilizationSupported : Flag showing if the video stabilization is supported
+ * bStillCapDuringVideoSupported : Flag showing if the still capture is supported during video
+ * bMechanicalMisalignmentSupported : Flag showing if the mechanical misalignment is supported
+ * bFacePrioritySupported : Flag showing if the face priority is supported
+ * bRegionPrioritySupported : Flag showing if the region priority is supported
+ * bGlbceSupported : Flag showing if the GLBCE is supported
+ * nManualConvMin : Manual convergence min value
+ * nManualConvMax : Manual convergence max value
+ * nManualExpMin : Manual exposure time min value
+ * nManualExpMax : Manual exposure time max value
+ * nBrightnessMin : Brightness min value
+ * nBrightnessMax : Brightness max value
+ * nContrastMin : Contrast min value
+ * nContrastMax : Contrast max value
+ * nSharpnessMin : Sharpness min value
+ * nSharpnessMax : Sharpness max value
+ * nSaturationMin : Saturation min value
+ * nSaturationMax : Saturation max value
+ */
+typedef struct OMX_TI_CAPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 ulPreviewFormatCount; // supported preview pixelformat count
+ OMX_COLOR_FORMATTYPE ePreviewFormats[32];
+ OMX_U16 ulImageFormatCount; // supported image pixelformat count
+ OMX_COLOR_FORMATTYPE eImageFormats[32];
+ OMX_TI_CAPRESTYPE tPreviewResRange; // supported preview resolution range
+ OMX_TI_CAPRESTYPE tRotatedPreviewResRange; // supported rotated preview resolution range
+ OMX_TI_CAPRESTYPE tImageResRange; // supported image resolution range
+ OMX_TI_CAPRESTYPE tThumbResRange; // supported thumbnail resolution range
+ OMX_U16 ulWhiteBalanceCount; // supported whitebalance mode count
+ OMX_WHITEBALCONTROLTYPE eWhiteBalanceModes[32];
+ OMX_U16 ulColorEffectCount; // supported effects count
+ OMX_IMAGEFILTERTYPE eColorEffects[32];
+ OMX_S32 xMaxWidthZoom; // Fixed point value stored as Q16
+ OMX_S32 xMaxHeightZoom; // Fixed point value stored as Q16
+ OMX_U16 ulFlickerCount; // supported anti-flicker mode count
+ OMX_COMMONFLICKERCANCELTYPE eFlicker[32];
+ OMX_U16 ulExposureModeCount; // supported exposure mode count
+ OMX_EXPOSURECONTROLTYPE eExposureModes[32];
+ OMX_BOOL bLensDistortionCorrectionSupported;
+ OMX_BOOL bISONoiseFilterSupported;
+ OMX_S32 xEVCompensationMin; // Fixed point value stored as Q16
+ OMX_S32 xEVCompensationMax; // Fixed point value stored as Q16
+ OMX_U32 nSensitivityMax; // nSensitivityMax = 100 implies maximum supported equal to "ISO 100"
+ OMX_U16 ulFocusModeCount; // supported focus mode count
+ OMX_IMAGE_FOCUSCONTROLTYPE eFocusModes[32];
+ OMX_U16 ulSceneCount; // supported scene count
+ OMX_SCENEMODETYPE eSceneModes[64];
+ OMX_U16 ulFlashCount; // supported flash modes count
+ OMX_IMAGE_FLASHCONTROLTYPE eFlashModes[32];
+ OMX_U32 xFramerateMin; // Fixed point value stored as Q16
+ OMX_U32 xFramerateMax; // Fixed point value stored as Q16
+ OMX_BOOL bContrastSupported;
+ OMX_BOOL bSaturationSupported;
+ OMX_BOOL bBrightnessSupported;
+ OMX_BOOL bProcessingLevelSupported;
+ OMX_BOOL bQFactorSupported;
+ OMX_U16 ulPrvVarFPSModesCount; // supported variable FPS preview modes count
+ OMX_TI_VARFPSTYPE tPrvVarFPSModes[10];
+ OMX_U16 ulCapVarFPSModesCount; // supported variable FPS capture modes count
+ OMX_TI_VARFPSTYPE tCapVarFPSModes[10];
+ OMX_TI_SENMOUNT_TYPE tSenMounting;
+ OMX_U16 ulAutoConvModesCount; // supported auto convergence modes count
+ OMX_TI_AUTOCONVERGENCEMODETYPE eAutoConvModes[32];
+ OMX_U16 ulBracketingModesCount; // supported bracketing modes count
+ OMX_BRACKETMODETYPE eBracketingModes[32];
+ OMX_BOOL bGbceSupported; // Flag showing if the Gbce is supported
+ OMX_BOOL bRawJpegSupported; // Flag showing if the Raw + Jpeg issupported
+ OMX_U16 ulImageCodingFormatCount;
+ OMX_IMAGE_CODINGTYPE eImageCodingFormat[32];
+ OMX_U16 uSenNativeResWidth;
+ OMX_U16 uSenNativeResHeight;
+ OMX_U16 ulAlgoAreasFocusCount;
+ OMX_U16 ulAlgoAreasExposureCount;
+ OMX_BOOL bAELockSupported;
+ OMX_BOOL bAWBLockSupported;
+ OMX_BOOL bAFLockSupported;
+ OMX_U16 nFocalLength;
+ OMX_U16 ulPrvFrameLayoutCount; // supported frame layout count
+ OMX_TI_STEREOFRAMELAYOUTTYPE ePrvFrameLayout[16];
+ OMX_U16 ulCapFrameLayoutCount; // supported frame layout count
+ OMX_TI_STEREOFRAMELAYOUTTYPE eCapFrameLayout[16];
+ OMX_BOOL bVideoNoiseFilterSupported;
+ OMX_BOOL bVideoStabilizationSupported;
+ OMX_BOOL bStillCapDuringVideoSupported;
+ OMX_BOOL bMechanicalMisalignmentSupported;
+ OMX_BOOL bFacePrioritySupported;
+ OMX_BOOL bRegionPrioritySupported;
+ OMX_BOOL bGlbceSupported;
+ OMX_S16 nManualConvMin;
+ OMX_S16 nManualConvMax;
+ OMX_U16 nManualExpMin;
+ OMX_U16 nManualExpMax;
+ OMX_S16 nBrightnessMin;
+ OMX_S16 nBrightnessMax;
+ OMX_S16 nContrastMin;
+ OMX_S16 nContrastMax;
+ OMX_S16 nSharpnessMin;
+ OMX_S16 nSharpnessMax;
+ OMX_S16 nSaturationMin;
+ OMX_S16 nSaturationMax;
+} OMX_TI_CAPTYPE;
+
+
+
+/**
+ * Defines 3A Face priority mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bAwbFaceEnable : Enable Face priority for Auto White Balance
+ * bAeFaceEnable : Enable Face priority for Auto Exposure
+ * bAfFaceEnable : Enable Face priority for Auto Focus
+ */
+typedef struct OMX_TI_CONFIG_3A_FACE_PRIORITY {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bAwbFaceEnable;
+ OMX_BOOL bAeFaceEnable;
+ OMX_BOOL bAfFaceEnable;
+} OMX_TI_CONFIG_3A_FACE_PRIORITY;
+
+/**
+ * Defines 3A Region priority mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bAwbFaceEnable : Enable Region priority for Auto White Balance
+ * bAeFaceEnable : Enable Region priority for Auto Exposure
+ * bAfFaceEnable : Enable Region priority for Auto Focus
+ */
+typedef struct OMX_TI_CONFIG_3A_REGION_PRIORITY {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bAwbRegionEnable;
+ OMX_BOOL bAeRegionEnable;
+ OMX_BOOL bAfRegionEnable;
+} OMX_TI_CONFIG_3A_REGION_PRIORITY;
+
+/*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port that this structure applies to
+* bAutoConvergence : Enable/Disable Auto Convergence
+*/
+typedef struct OMX_TI_PARAM_AUTOCONVERGENCETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bAutoConvergence;
+} OMX_TI_PARAM_AUTOCONVERGENCETYPE;
+
+/**
+ * Focus distance configuration
+ *
+ * STRUCT MEMBERS:
+ * nSize: Size of the structure in bytes
+ * nVersion: OMX specification version information
+ * nPortIndex: Port that this structure applies to
+ * nFocusDistanceNear : Specifies the near focus distance in mm ( 0 equals infinity )
+ * nFocusDistanceOptimal : Specifies the optimal focus distance in mm ( 0 equals infinity )
+ * nFocusDistanceFar : Specifies the far focus distance in mm ( 0 equals infinity )
+ * nLensPosition : Specifies the current lens position in driver units
+ */
+typedef struct OMX_TI_CONFIG_FOCUSDISTANCETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFocusDistanceNear;
+ OMX_U32 nFocusDistanceOptimal;
+ OMX_U32 nFocusDistanceFar;
+ OMX_S32 nLensPosition;
+} OMX_TI_CONFIG_FOCUSDISTANCETYPE;
+
+/**
+ * The OMX_TI_BRIGHTNESSCONTRASTCRTLTYPE enumeration is used to define the
+ * brightness and contrast mode types.
+ */
+typedef enum OMX_TI_BRIGHTNESSCONTRASTCRTLTYPE {
+ OMX_TI_BceModeOff = 0,
+ OMX_TI_BceModeOn,
+ OMX_TI_BceModeAuto,
+ OMX_TI_BceModeMax = 0x7FFFFFFF
+} OMX_TI_BRIGHTNESSCONTRASTCRTLTYPE;
+
+/**
+ * Local and global brightness contrast type.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eControl : Control field for GLBCE
+ */
+typedef struct OMX_TI_CONFIG_LOCAL_AND_GLOBAL_BRIGHTNESSCONTRASTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_BRIGHTNESSCONTRASTCRTLTYPE eControl;
+} OMX_TI_CONFIG_LOCAL_AND_GLOBAL_BRIGHTNESSCONTRASTTYPE;
+
+/**
+ * Uncompressed image operating mode configuration structure.
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param xMin The minimum frame rate allowed.
+ * Units are Q16 frames per second.
+ * @param xMax The maximum frame rate allowed.
+ * Units are Q16 frames per second.
+ */
+
+typedef struct OMX_TI_CONFIG_VARFRMRANGETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 xMin;
+ OMX_U32 xMax;
+} OMX_TI_CONFIG_VARFRMRANGETYPE;
+
+/**
+ * Single preview capture modes
+ */
+ typedef enum OMX_TI_SINGLEPREVIEWMODETYPE {
+ OMX_TI_SinglePreviewMode_PreviewOnly,
+ OMX_TI_SinglePreviewMode_Video,
+ OMX_TI_SinglePreviewMode_ImageCapture,
+ OMX_TI_SinglePreviewMode_ImageCaptureHighSpeed,
+ OMX_TI_SinglePreviewMode_Reprocess,
+ OMX_TI_SinglePreviewMode = 0x7FFFFFFF
+ } OMX_TI_SINGLEPREVIEWMODETYPE;
+
+/**
+ * Define configuration structure for
+ * single preview capture mode
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * eMode : Select the subusecase mode (Video/HQ/HS)
+ */
+ typedef struct OMX_TI_CONFIG_SINGLEPREVIEWMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_TI_SINGLEPREVIEWMODETYPE eMode;
+ } OMX_TI_CONFIG_SINGLEPREVIEWMODETYPE;
+
+
+/**
+ * Configuratin structure for freeze AWB parameter modifications.
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param nPortIndex Port index to which to apply.
+ * @param nTimeDelay Time for which the AWB parameters to be frozen.
+ * measured in milliseconds
+ */
+ typedef struct OMX_TI_CONFIG_FREEZE_AWB {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nTimeDelay;
+ } OMX_TI_CONFIG_FREEZE_AWB;
+
+/**
+ * Configuration structure used to set
+ * minimum time between two sequential WB coefficients modifications.
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param nPortIndex Port index to which to apply.
+ * @param nDelayTime The time in milliseconds.
+ */
+ typedef struct OMX_TI_CONFIG_AWB_DELAY {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDelayTime;
+ } OMX_TI_CONFIG_AWB_DELAY;
+
+/**
+ * Configuration structure used to set
+ * minimum time delay between
+ * two sequential AE parameters modifications
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param nPortIndex Port index to which to apply.
+ * @param nDelayTime The time in milliseconds.
+ */
+ typedef struct OMX_TI_CONFIG_AE_DELAY {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDelayTime;
+ } OMX_TI_CONFIG_AE_DELAY;
+
+
+/**
+ * Configuration structure used to freeze AE modifications
+ * for a nTimeDelay milliseconds
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param nPortIndex Port index to which to apply.
+ * @param nTimeDelay The time in milliseconds.
+ */
+ typedef struct OMX_TI_CONFIG_FREEZE_AE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nTimeDelay;
+ } OMX_TI_CONFIG_FREEZE_AE;
+
+/**
+ * Configuration structure used to set
+ * the AE gain threshold
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param uMinTH Minimum value for AE gain.
+ * @param uMaxTH Maximum value for AE gain.
+ */
+ typedef struct OMX_TI_CONFIG_AE_THRESHOLD {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 uMinTH;
+ OMX_U32 uMaxTH;
+ } OMX_TI_CONFIG_AE_THRESHOLD;
+
+/**
+ * Enumeration describing the main gestures
+ */
+ typedef enum OMX_TI_GESTURES_TYPE {
+ OMX_TI_GESTURE_NO_GESTURE = 0x70000001,
+ OMX_TI_GESTURE_SWIPE_RIGHT,
+ OMX_TI_GESTURE_SWIPE_LEFT,
+ OMX_TI_GESTURE_FIST_RIGHT,
+ OMX_TI_GESTURE_FIST_LEFT,
+
+ OMX_TI_GESTURE_COUNT,
+ OMX_TI_GESTURE_MAX = 0x7FFFFFFF
+ } OMX_TI_GESTURES_TYPE;
+
+/**
+ * Enumeration describing the main gesture objects
+ */
+ typedef enum OMX_TI_OBJECT_TYPE {
+ OMX_TI_OBJECT_PALM,
+ OMX_TI_OBJECT_FIST,
+ OMX_TI_OBJECT_FACE,
+
+ OMX_TI_OBJECT_MAX = 0x7FFFFFFF
+ } OMX_TI_OBJECT_TYPE;
+
+/**
+ * Data structure carrying information about
+ * objects located at a certain area of frame buffer.
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param nPortIndex Port index to which to apply.
+ * @param eType The object type.
+ * @param nTop The top coordinate.
+ * @param nLeft The left coordinate.
+ * @param nWidth The width of the object.
+ * @param nHeight The height of the object.
+ */
+ typedef struct OMX_CONFIG_OBJECT_RECT_TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_OBJECT_TYPE eType;
+ OMX_S32 nTop;
+ OMX_S32 nLeft;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+ } OMX_CONFIG_OBJECT_RECT_TYPE;
+
+/**
+ * Data structure carrying information about
+ * gestures detected at a certain frame.
+ *
+ * @param nSize Size of the structure in bytes.
+ * @param nVersion OMX specification version information.
+ * @param nPortIndex Port index to which to apply.
+ * @param nTimeStamp Frame id.
+ * @param eType Type of the gesture detected at that frame.
+ * @param nNumDetectedGestures Number ot the areas of the frame in which this gesture is detected.
+ * @param nGestureAreas The areas where this gesture is detected.
+ */
+ typedef struct OMX_TI_CONFIG_GESTURES_INFO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TICKS nTimeStamp;
+ OMX_TI_GESTURES_TYPE eType;
+ OMX_U32 nNumDetectedGestures;
+ OMX_CONFIG_OBJECT_RECT_TYPE nGestureAreas[35];
+ } OMX_TI_CONFIG_GESTURES_INFO;
+
+/**
+* Define the frames queue len for ZSL
+*
+* STRUCT MEMBERS:
+* nSize: Size of the structure in bytes
+* nVersion: OMX specification version information
+* nHistoryLen: History len in number of frames
+*/
+ typedef struct OMX_TI_PARAM_ZSLHISTORYLENTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nHistoryLen;
+ } OMX_TI_PARAM_ZSLHISTORYLENTYPE;
+
+/**
+* Define the frame delay in ms for ZSL
+*
+* STRUCT MEMBERS:
+* nSize: Size of the structure in bytes
+* nVersion: OMX specification version information
+* nDelay: Capture frame delay in ms
+*/
+ typedef struct OMX_TI_CONFIG_ZSLDELAYTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_S32 nDelay;
+ } OMX_TI_CONFIG_ZSLDELAYTYPE;
+
+/**
+* AlogAreas purpose
+* This type specifies the purpose of areas specified in OMX_ALGOAREASTYPE.
+* */
+ typedef enum OMX_ALGOAREAPURPOSE{
+ OMX_AlgoAreaFocus = 0, // Multi region focus
+ OMX_AlgoAreaExposure,
+ }OMX_ALGOAREAPURPOSE;
+
+ typedef struct OMX_ALGOAREA {
+ OMX_S32 nLeft; /**< The leftmost coordinate of the area rectangle */
+ OMX_S32 nTop; /**< The topmost coordinate of the area rectangle */
+ OMX_U32 nWidth; /**< The width of the area rectangle in pixels */
+ OMX_U32 nHeight; /**< The height of the area rectangle in pixels */
+ OMX_U32 nPriority; /**< Priority - ranges from 1 to 1000 */
+ }OMX_ALGOAREA;
+
+/**
+* Algorythm areas type
+* This type defines areas for Multi Region Focus,
+* or another algorithm region parameters,
+* such as Multi Region Auto Exposure.
+*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port index
+* tAreaPosition : Area definition - coordinates and purpose - Multi Region Focus, Auto Exposure, etc.
+* nNumAreas : Number of areas defined in the array
+* nAlgoAreaPurpose : Algo area purpose - eg. Multi Region Focus is OMX_AlgoAreaFocus
+*/
+ typedef struct OMX_ALGOAREASTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_U32 nNumAreas;
+ OMX_ALGOAREA tAlgoAreas[MAX_ALGOAREAS];
+ OMX_ALGOAREAPURPOSE nAlgoAreaPurpose;
+ } OMX_ALGOAREASTYPE;
+
+/*==========================================================================*/
+/*!
+@brief OMX_TI_PARAM_ENHANCEDPORTRECONFIG : Suport added to new port reconfig usage
+@param bUsePortReconfigForCrop Enables port reconfig for crop.
+@param bUsePortReconfigForPadding Enables port reconfig for padding
+*/
+/*==========================================================================*/
+
+typedef struct OMX_TI_PARAM_ENHANCEDPORTRECONFIG {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bUsePortReconfigForCrop;
+ OMX_BOOL bUsePortReconfigForPadding;
+} OMX_TI_PARAM_ENHANCEDPORTRECONFIG;
+
+/**
+* OMX_TI_H3aPAXELCFG: AF/AEWB paxel description structure
+* @param nVPos: vertical start point of paxel grid w.r.t first pixel of input image frame
+* @param nVSize: vertical paxel size
+* @param nHPos: horizontal start point of paxel grid w.r.t first pixel of input image frame
+* @param nHSize: horizontal paxel size
+* @param nVCount: num of vert paxels. AF/AEWB paxels are always adjacent to each other
+* @param nVIncr: num of pixels to skip within a paxel, vertically
+* @param nHCount: num of horz paxels. AF/AEWB paxels are always adjacent to each other
+* @param nHIncr: num of pixels to skip within a paxel, horizontally
+**/
+typedef struct {
+ OMX_U16 nVPos;
+ OMX_U8 nVSize;
+ OMX_U16 nHPos;
+ OMX_U8 nHSize;
+ OMX_U8 nVCount;
+ OMX_U8 nVIncr;
+ OMX_U8 nHCount;
+ OMX_U8 nHIncr;
+} OMX_TI_H3aPAXELCFG;
+
+/**
+* OMX_TI_AF_COLOR_PAXEL_STATS: struct af_h3a_color_paxel
+* @param nSum : Sum of the pixels used to arrive at the statistics for a paxel
+* @param nFVSum : Focus Value (sum/peak) for a paxel
+* @param nFVSquaredSum : Focus Value Squared (sum/peak) for a paxel
+* @param nReserved : To be ignored
+**/
+typedef struct OMX_TI_AF_COLOR_PAXEL_STATS {
+ OMX_U32 nSum;
+ OMX_U32 nFVSum;
+ OMX_U32 nFVSquaredSum;
+ OMX_U32 nReserved;
+} OMX_TI_AF_COLOR_PAXEL_STATS;
+
+/**
+* OMX_TI_AFPAXELDATA
+* @param tGPaxel : Paxel information for green color
+* @param tRBPaxel : Paxel information for red/blue color
+* @param tBRPaxel : Paxel information for blue/red color
+**/
+typedef struct {
+ OMX_TI_AF_COLOR_PAXEL_STATS tGPaxel;
+ OMX_TI_AF_COLOR_PAXEL_STATS tRBPaxel;
+ OMX_TI_AF_COLOR_PAXEL_STATS tBRPaxel;
+} OMX_TI_AFPAXELDATA;
+
+/**
+* OMX_TI_AF_RGB_POS_TYPE
+* Defines the RGB bayer pattern assumed while extracting AF statistics individually for R,G,B colour channels
+**/
+typedef enum OMX_TI_AF_RGB_POS_TYPE {
+ OMX_TI_AF_RGBPOSITION_BAYER_GR_GB = 0,
+ OMX_TI_AF_RGBPOSITION_BAYER_RG_GB = 1,
+ OMX_TI_AF_RGBPOSITION_BAYER_GR_BG = 2,
+ OMX_TI_AF_RGBPOSITION_BAYER_RG_BG = 3,
+ OMX_TI_AF_RGBPOSITION_CUSTOM_GG_RB = 4,
+ OMX_TI_AF_RGBPOSITION_CUSTOM_RB_GG = 5,
+ OMX_TI_AF_RGBPOSITION_BAYER_FORMAT = 0x7FFFFFFF
+} OMX_TI_AF_RGB_POS_TYPE;
+
+/* Max size of AF buffer output by ISP H3A engine */
+#define OMX_TI_AF_MAX_NUM_PAXELS (127 * 35)
+
+/**
+ * The extra data for AutoFocus data
+ * @param eAFBayerRgbPosition : When Vertical focus is disabled, R,G,B location w.r.t. to paxel start location is specified by this field.
+ * @param bAFPeakModeEnable : If enabled, peak for FV, FV^2 is computed for a paxel. If disabled, average of FV, FV^2 is computed for a paxel
+ * @param bAFVerticalFocusEnable : Whether vertical focus is enabled.
+ * @param tAFPaxelWindow : AF paxel description
+ * @param ptAFPaxelStatistics : Output AF buffer
+ */
+typedef struct OMX_TI_AF_STATISTICS_TYPE {
+ OMX_TI_AF_RGB_POS_TYPE eAFBayerRgbPosition;
+ OMX_BOOL bAFPeakModeEnable;
+ OMX_BOOL bAFVerticalFocusEnable;
+ OMX_TI_H3aPAXELCFG tAFPaxelWindow;
+ OMX_TI_AFPAXELDATA ptAFPaxelStatistics[OMX_TI_AF_MAX_NUM_PAXELS];
+} OMX_TI_AF_STATISTICS_TYPE;
+
+
+typedef struct {
+ /** Average value for red pixels in current paxel */
+ OMX_U16 red;
+ /** Average value for green pixels in current paxel */
+ OMX_U16 green;
+ /** Average value for blue pixels in current paxel */
+ OMX_U16 blue;
+ /** Flag indicating whether current paxel is valid 0:invalid, !0:valid */
+ OMX_U16 valid;
+} OMX_TI_H3AAEWBPAXELDATA;
+
+typedef struct OMX_TI_H3AAFDATA {
+ OMX_U32 nSize; /**< The size of the structure
+ including the length of data field containing the histogram data */
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U8 *data;
+} OMX_TI_H3AAFDATA;
+
+
+#define OMX_TI_AEWB_MAX_NUM_PAXELS (35 * 127)
+
+/**
+* OMX_TI_AEWBPAXELDATA
+* @param nSubsampleAccumulatedValues[4] : Sub sample accumulator(s), not-clipped. Seperate for each pixel in 2x2 sub-sample
+* @param nSaturatorAccumulatedValues[4] : Saturator accumulator(s), clipped based upon threshold. Seperate for each pixel in 2x2 sub-sample
+* @param nUnsaturatedCount : Count of unsaturated 2x2 sub-samples in a paxel
+**/
+typedef struct OMX_TI_AEWBPAXELDATA {
+ OMX_U16 nSubsampleAccumulatedValues[4];
+ OMX_U16 nSaturatorAccumulatedValues[4];
+ OMX_U32 nUnsaturatedCount;
+} OMX_TI_AEWBPAXELDATA;
+
+/**
+* OMX_TI_AEWBMODE
+* @enum OMX_TI_AEWB_MODE_SUM_OF_SQUARE : Sum of square calculated across sub-samples in a paxel
+* @enum OMX_TI_AEWB_MODE_MINMAX : Min-max calculted across sub-samples in a paxel
+* @enum OMX_TI_AEWB_MODE_SUM_ONLY : Only Sum calculated across sub-samples in a paxel
+**/
+typedef enum {
+ OMX_TI_AEWB_MODE_SUM_OF_SQUARE=0,
+ OMX_TI_AEWB_MODE_MINMAX=1,
+ OMX_TI_AEWB_MODE_SUM_ONLY=2,
+ OMX_TI_AEWB_MODE_MAX = 0x7FFFFFFF
+} OMX_TI_AEWBMODE;
+
+/**
+ * The extra data for AutoExposure, AutoWhiteBalance data
+ * @param eAEWBMode : AEWB mode
+ * @param nAEWBThresholdPixelValue : Threshold against which pixel values are compared
+ * @param nAccumulationShift : Right shift value applied on result of pixel accumulation
+ * @param tAEWBPaxelWindow : AE/AWB paxel description
+ * @param ptAEWBPaxelStatistics : Output AE/AWB buffer
+ */
+typedef struct OMX_TI_AEWB_STATISTICS_TYPE {
+ OMX_TI_AEWBMODE eAEWBMode;
+ OMX_U16 nAEWBThresholdPixelValue;
+ OMX_U8 nAccumulationShift;
+ OMX_TI_H3aPAXELCFG tAEWBPaxelWindow;
+ OMX_TI_AEWBPAXELDATA ptAEWBPaxelStatistics[OMX_TI_AEWB_MAX_NUM_PAXELS];
+} OMX_TI_AEWB_STATISTICS_TYPE;
+
+
+
+typedef enum OMX_TI_BSC_COLOUR_ELEMENT_TYPE {
+ OMX_TI_BSC_COLOUR_ELEMENT_Y = 0,
+ OMX_TI_BSC_COLOUR_ELEMENT_Cb = 1,
+ OMX_TI_BSC_COLOUR_ELEMENT_Cr = 2,
+ OMX_TIBSC_COLOUR_ELEMENT_MAX = 0x7FFFFFFF
+} OMX_TI_BSC_COLOUR_ELEMENT_TYPE;
+
+
+/**
+ * OMX_TI_BSC_POSITIONPARAMETERS
+ * @param nVectors : number of row/column sum vectors. Max value = 4
+ * @param nShift : down-shift of input data
+ * @param nVPos : vertical position of first pixel to be summed
+ * @param nHPos : horizontal position of first pixel to be summed
+ * @param nVNum : number of pixels sampled vertically
+ * @param nHNum : number of pixels sampled horizontally
+ * @param nVSkip : vertical spacing between adjacent pixels to be summed
+ * @param nHSkip : horizontal pixel spacing between adjacent pixels to be summed
+ *
+ * The number of row/column sums cannot exceed 1920, implies:
+ * - (nVectors + 1) * (nVNum) <=1920, for row sums
+ * - (nVectors + 1) * (nHNum) <=1920, for column sums
+ */
+typedef struct OMX_TI_BSC_POSITIONPARAMETERS {
+ OMX_U8 nVectors;
+ OMX_U8 nShift;
+ OMX_U16 nVPos;
+ OMX_U16 nHPos;
+ OMX_U16 nVNum;
+ OMX_U16 nHNum;
+ OMX_U8 nVSkip;
+ OMX_U8 nHSkip;
+} OMX_TI_BSC_POSITIONPARAMETERS;
+
+/* Max number of row/column sums supported by Bsc engine*/
+#define OMX_TI_BSC_MAX_NUM_ROW_COLUMN_SUMS (1920)
+
+/**
+ * The extra data for ISP Boundary Signal Calculator engine
+ * @param eBscColourElement : Selects the element to be summed (Y, Cb or Cr)
+ * @param nRowPosition : Bsc row sum descriptor
+ * @param nColumnPosition : Bsc column sum descriptor
+ * @param ptBscRowSumData : Each value corresponds to sum value in a row.
+ * Num of row sums = nRowPosition.nVectors * nRowPosition.VNum
+ * @param ptBscColumnSumData : Each value corresponds to sum value in a column.
+ * Num of column sums = nColumnPosition.nVectors * nColumnPosition.HNum
+ */
+typedef struct OMX_TI_BSC_STATISTICS_TYPE {
+ OMX_TI_BSC_COLOUR_ELEMENT_TYPE eBscColourElement;
+ OMX_TI_BSC_POSITIONPARAMETERS nRowPosition;
+ OMX_TI_BSC_POSITIONPARAMETERS nColumnPosition;
+ OMX_U16 ptBscRowSumData[OMX_TI_BSC_MAX_NUM_ROW_COLUMN_SUMS];
+ OMX_U16 ptBscColumnSumData[OMX_TI_BSC_MAX_NUM_ROW_COLUMN_SUMS];
+} OMX_TI_BSC_STATISTICS_TYPE;
+
+
+#define AUX_IMAGEDATA_MAX_SIZE_BYTES ((320 * 240 * 3)/2)
+
+/**
+ * The extra data for AuxiliaryImageData
+ * @param eAuxImageFormat : Format of image. In case of Aux buffer, it is OMX_COLOR_FormatYUV420SemiPlanar (YUV 4:2:0)
+ * @param nAuxImageWidth : Width of Auxiliary Image (<=320)
+ * @param nAuxImageHeight : Height of Auxiliary Image (<=240)
+ * @param nAuxImageStrideBytes : Width in bytes for auxiliary buffer. In case of YUV4:2:0, stride for UV component is half of this value.
+ * @param ptAuxImage : Data Pointer for Auxiliary data. First 320*240 bytes is Y Component. Remaining is UV component.
+ */
+typedef struct OMX_TI_AUX_IMAGEDATA_TYPE {
+ OMX_COLOR_FORMATTYPE eAuxImageFormat;
+ OMX_U16 nAuxImageWidth;
+ OMX_U16 nAuxImageHeight;
+ OMX_U16 nAuxImageStrideBytes;
+ OMX_U8 ptAuxImage[AUX_IMAGEDATA_MAX_SIZE_BYTES];
+} OMX_TI_AUX_IMAGEDATA_TYPE;
+
+
+/**
+* Data structure carrying information about
+* VTC slice height.
+*
+* @param nSize Size of the structure in bytes.
+* @param nVersion OMX specification version information.
+* @param nSliceHeight Definition of slice height.
+*
+*
+*
+*
+*/
+typedef struct OMX_TI_PARAM_VTCSLICE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nSliceHeight;
+ OMX_U32 nInternalBuffers;
+ OMX_PTR IonBufhdl[2];
+} OMX_TI_PARAM_VTCSLICE;
+
+
+/**
+ * nSize is the size of the structure including the length of data field containing
+ * the histogram data.
+ * nBins is the number of bins in the histogram.
+ * eComponentType specifies the type of the histogram bins according to enum.
+ * It can be selected to generate multiple component types, then the extradata struct
+ * is repeated for each component type.
+ */
+typedef struct OMX_TI_HISTOGRAMTYPE {
+ OMX_U32 nSize; /**< The size of the structure
+ including the length of data field containing the histogram data */
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+ OMX_U32 nBins; /**< The number of bins in the histogram */
+ OMX_HISTCOMPONENTTYPE eComponentType; /**< Specifies the type of the histogram bins according to enum.
+ It can be selected to generate multiple component types,
+ then the extradata struct is repeated for each component type */
+ OMX_U8 *data;
+} OMX_TI_HISTOGRAMTYPE;
+
+
+
+typedef struct OMX_TI_CPCAMDATA {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_CAMERAVIEWTYPE eCameraView;
+
+ /* Face Detect */
+ OMX_U16 ulFaceCount; // faces detected
+ OMX_TI_FACERESULT tFacePosition[35]; // 35 is max faces supported by FDIF
+
+
+ /**** Ancillary Data ******/
+ OMX_U32 nFrameNumber;
+ OMX_U16 nInputImageHeight;
+ OMX_U16 nInputImageWidth;
+ OMX_U16 nOutputImageHeight;
+ OMX_U16 nOutputImageWidth;
+ OMX_U16 nDigitalZoomFactor;
+ OMX_S16 nCropCenterColumn;
+ OMX_S16 nCropCenterRow;
+ OMX_U16 nOpticalZoomValue;
+ OMX_U8 nAFStatus;
+ OMX_U8 nAWBStatus;
+ OMX_U8 nAEStatus;
+ OMX_U32 nExposureTime;
+ OMX_U16 nEVCompensation;
+ OMX_U8 nDigitalGainValue;
+ OMX_U8 nAnalogGainValue;
+ OMX_U16 nCurrentISO;
+ OMX_U16 nReferenceISO;
+ OMX_U8 nApertureValue;
+ OMX_U8 nPixelRange;
+ OMX_U8 nCameraShake;
+ OMX_U8 nNumFacesDetected;
+
+ /* Not Yet Supported */
+ OMX_U16 nFocalDistance;
+ OMX_U16 nShotNumber;
+ OMX_U8 nFlashStatus;
+
+
+ /*** White Balance gains ****/
+ /**< White Balance Color Temperature in Kelvins */
+ OMX_U16 nColorTemperature;
+
+ /**< Bayer applied R color channel gain in (U13Q9) */
+ OMX_U16 nGainR;
+
+ /**< Bayer applied Gr color channel gain in (U13Q9) */
+ OMX_U16 nGainGR;
+
+ /**< Bayer applied Gb color channel gain in (U13Q9) */
+ OMX_U16 nGainGB;
+
+ /**< Bayer applied B color channel gain in (U13Q9) */
+ OMX_U16 nGainB;
+
+ /* BELOW ARE NOT SUPPORTED , Default set to 0 */
+ OMX_S16 nOffsetR; /**< Bayer applied R color channel offset */
+ OMX_S16 nOffsetGR; /**< Bayer applied Gr color channel offset */
+ OMX_S16 nOffsetGB; /**< Bayer applied Gb color channel offset */
+ OMX_S16 nOffsetB; /**< Bayer applied B color channel offset */
+
+
+ /* AEWB,AF,HIST data size */
+ OMX_U32 nAewbDataSize;
+ OMX_U32 nAfDataSize;
+ OMX_U32 nHistSize;
+
+
+
+ /*** H3A AF-AEW DATA ***/
+ OMX_TI_H3aPAXELCFG tAfPaxelWin;
+ OMX_TI_H3aPAXELCFG tAewbPaxelWin;
+ OMX_TI_H3AAEWBPAXELDATA *tpPaxel;
+ OMX_TI_H3AAFDATA tH3A_Af;
+ /* Histogram */
+ OMX_TI_HISTOGRAMTYPE Histogram;
+
+
+} OMX_TI_CPCAMDATA;
+
+/**
+* Start/Stop mechanical misalignment
+*
+* STRUCT MEMBERS:
+* nSize: Size of the structure in bytes
+* nVersion: OMX specification version information
+* nPortIndex: Index of the port on which Mechanical Misalignment to be enabled/disabled
+* bMM: Mechanical Misalignment enable/disable flag
+*/
+ typedef struct OMX_TI_CONFIG_MM {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bMM;
+ } OMX_TI_CONFIG_MM;
+
+/**
+* Start/Stop Affine transformation for Mm/Ac
+*
+* STRUCT MEMBERS:
+* nSize: Size of the structure in bytes
+* nVersion: OMX specification version information
+* bAffine: Enable / Disable
+*/
+ typedef struct OMX_TI_PARAM_AFFINE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bAffine;
+ } OMX_TI_PARAM_AFFINE;
+
+/**
+* A pointer to this struct is passed to the OMX_SetParameter when the extension
+* index for the 'OMX.google.android.index.enableAndroidNativeBuffers' extension
+* is given.
+* The corresponding extension Index is OMX_TI_IndexUseNativeBuffers.
+* This will be used to inform OMX about the presence of gralloc pointers instead
+* of virtual pointers
+*/
+typedef struct OMX_TI_PARAMUSENATIVEBUFFER {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+} OMX_TI_PARAMUSENATIVEBUFFER;
+
+/**
+* A pointer to this struct is passed to OMX_GetParameter when the extension
+* index for the 'OMX.google.android.index.getAndroidNativeBufferUsage'
+* extension is given.
+* The corresponding extension Index is OMX_TI_IndexAndroidNativeBufferUsage.
+* The usage bits returned from this query will be used to allocate the Gralloc
+* buffers that get passed to the useAndroidNativeBuffer command.
+*/
+typedef struct OMX_TI_PARAMNATIVEBUFFERUSAGE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nUsage;
+} OMX_TI_PARAMNATIVEBUFFERUSAGE;
+
+/**
+ * OMX_TI_ZSL_PRIORITY_TYPE Enumerated Value
+ */
+typedef enum OMX_TI_ZSL_PRIORITY_TYPE {
+ OMX_TI_ZSL_PRIORITY_TIME,
+ OMX_TI_ZSL_PRIORITY_FOCUS,
+ OMX_TI_ZSL_PRIORITY = 0x7FFFFFFF
+} OMX_TI_ZSL_PRIORITY_TYPE;
+
+/**
+* Define the priority tha twill be used to select ZSL frame
+*
+* STRUCT MEMBERS:
+* nSize: Size of the structure in bytes
+* nVersion: OMX specification version information
+* ePriority: Priority
+*/
+typedef struct OMX_TI_CONFIG_ZSLFRAMESELECTPRIOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_TI_ZSL_PRIORITY_TYPE ePriority;
+} OMX_TI_CONFIG_ZSLFRAMESELECTPRIOTYPE;
+
+/**
+* MIPI, ECC, and CRC counters
+* Mipi counter counts the frames from the MIPI receiver (CSI_RX).
+* TCMD application will use this test
+* to validate the MIPI channel integrity (TX to RX).
+*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port that this structure applies to
+* bResetMIPICounter : if OMX_SetConfig() is called with value True
+* for this parameter, the MIPICounter shall be reset to 0, by ducati.
+* nMIPICounter : MIPI frame counter
+* nECCCounter : ECC counter
+* nCRCCounter : CRC counter
+*/
+typedef struct OMX_CONFIG_MIPICOUNTERS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bResetMIPICounter;
+ OMX_U32 nMIPICounter;
+ OMX_U32 nECCCounter;
+ OMX_U32 nCRCCounter;
+ OMX_U32 nFifoOvfCounter;
+ OMX_U32 nOCPCounter;
+ OMX_U32 nEccCorrCounter;
+ OMX_U32 SoTErrCnt;
+ OMX_U32 SoTSyncErrCnt;
+ OMX_U32 ULPMCnt;
+ OMX_U32 ULPMExitCnt;
+ OMX_U32 ULPMEnterCnt;
+ OMX_U32 ControlErrCnt;
+ OMX_U32 ErrEscapeCnt;
+ OMX_U32 CSIRxTimeoutCnt;
+ OMX_U32 bStopStartCntrs;
+} OMX_CONFIG_MIPICOUNTERS;
+
+/**
+* CSI Timing Register
+*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port that this structure applies to
+* nReadWrite : if OMX_SetConfig() is called with value True
+* for this parameter, the ISS_CAMERARX_CORE1_REG0 register will be
+* written with the supplied values below.
+* nThsSettle :
+* nThsTerm :
+* nHsClkCfg :
+*/
+typedef struct OMX_CONFIG_CSITIMINGRW {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nReadWrite;
+ OMX_U8 nThsSettle;
+ OMX_U8 nThsTerm;
+ OMX_U8 nHsClkCfg;
+} OMX_CONFIG_CSITIMINGRW;
+
+/**
+* CSI Complex IO Data
+*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port that this structure applies to
+* nFrameCount : Recieved Frames on the CSI2Rx
+* nLaneCount : Number of active lanes
+* nCSISpeed : CSI2Rx speed
+*/
+typedef struct OMX_CONFIG_CSICMPXIO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFrameCount;
+ OMX_U32 nLaneCount;
+ OMX_U32 nCSISpeed;
+} OMX_CONFIG_CSICMPXIO;
+
+/**
+ * Auto Focus Score
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nAutoFocusScore : Auto Focus Score
+ */
+typedef struct OMX_CONFIG_AUTOFOCUSSCORE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nAutoFocusScore;
+} OMX_CONFIG_AUTOFOCUSSCORE;
+
+/**
+ * Color Bar test pattern
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnableColorBars : Enable Color Bars test pattern
+ */
+typedef struct OMX_CONFIG_COLORBARS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 bEnableColorBars;
+} OMX_CONFIG_COLORBARS;
+
+/**
+* Sensor OTP EEEPROM data
+*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port that this structure applies to
+* pData : pointer to the client's buffer
+* nDataSize : size of the EEPROM data in bytes
+* nClientDataSize : size of the client's buffer
+* SensorIndex : index of the eeprom buffer
+*/
+typedef struct OMX_CONFIG_OTPEEPROM {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_PTR pData;
+ OMX_U32 nDataSize;
+ OMX_U32 nClientDataSize;
+ OMX_U8 SensorIndex;
+}OMX_CONFIG_OTPEEPROM;
+
+/**
+ * The OMX_ISP_TYPE enumeration is used to define the
+ * TI ISP & ST ISP types.
+ */
+typedef enum OMX_ISP_TYPE {
+ OMX_TIISP = 0,
+ OMX_STISP= 1,
+ OMX_ISPUnknown
+} OMX_ISP_TYPE;
+
+/**
+* ISP Information
+*
+* STRUCT MEMBERS:
+* nSize : Size of the structure in bytes
+* nVersion : OMX specification version information
+* nPortIndex : Port that this structure applies to
+* eIspType : ISP Type (TI ISP/ ST ISP)
+* nHardwareVersion : Hardware version of ISP
+* nSoftwareVersion : Software version of ISP
+*/
+typedef struct OMX_CONFIG_ISPINFO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_ISP_TYPE eIspType;
+ OMX_U32 nHardwareVersion;
+ OMX_U32 nSoftwareVersion;
+ OMX_S8 cDucatiVersion[32];
+}OMX_CONFIG_ISPINFO;
+
+typedef enum OMX_TI_PORTTAPPOINTTYPE {
+ OMX_TI_PortTap_Bayer_SensorOutput,
+ OMX_TI_PortTap_Bayer_PostLsc,
+ OMX_TI_PortTap_Bayer_PreBayerToYUVConversion,
+ OMX_TI_PortTap_YUV_PostBayerToYUVConversion,
+ OMX_TI_PortTap_YUV_PreJPEGCompression,
+ OMX_TI_PortTap = 0x7FFFFFFF
+} OMX_TI_PORTTAPPOINTTYPE;
+
+/**
+ * Define configuration structure for
+ * tap in/out points for the selected port
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eTapPoint : Select the tap in/out point for the port
+ */
+typedef struct OMX_TI_CONFIG_PORTTAPPOINTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_PORTTAPPOINTTYPE eTapPoint;
+} OMX_TI_CONFIG_PORTTAPPOINTTYPE;
+
+/**
+ * Available methods to apply vect shot exposure and gain
+ */
+typedef enum OMX_TI_EXPGAINAPPLYMETHODTYPE {
+ OMX_TI_EXPGAINAPPLYMETHOD_ABSOLUTE,
+ OMX_TI_EXPGAINAPPLYMETHOD_RELATIVE,
+ OMX_TI_EXPGAINAPPLYMETHOD_FORCE_RELATIVE,
+ OMX_TI_EXPGAINAPPLYMETHOD_FORCE_ABSOLUTE,
+ OMX_TI_EXPGAINAPPLYMETHOD = 0x7FFFFFFF
+} OMX_TI_EXPGAINAPPLYMETHODTYPE;
+
+/**
+ * Define configuration structure for
+ * shot configuration for the selected port
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nConfigId : A unique config identification number that will be
+ * put in ancillary data for the corresponding output frame
+ * nFrames : Number of sequential frames that will use this
+ * configuration
+ * nEC : Total exposure compensation value
+ * nExp : Exposure value for this configuration slot
+ * nGain : Gain value for this configuration slot
+ * eExpGainApplyMethod : Selects the method which will be used to apply exposure and gain
+ * bNoSnapshot : Determinates whether a snapshot image will be send
+ * on the preview port for this shot config
+ */
+typedef struct OMX_TI_CONFIG_SHOTCONFIG {
+ OMX_U32 nConfigId;
+ OMX_U32 nFrames;
+ OMX_S32 nEC;
+ OMX_S32 nExp;
+ OMX_S32 nGain;
+ OMX_TI_EXPGAINAPPLYMETHODTYPE eExpGainApplyMethod;
+ OMX_BOOL bNoSnapshot;
+} OMX_TI_CONFIG_SHOTCONFIG;
+
+/**
+ * Define configuration structure for
+ * shot configuration vector for the selected port
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bFlushQueue : If TRUE: Flush queue and abort processing before enqueing
+ * new shot configurations
+ * nNumConfigs : Number of valid configurations in the nShotConfig array
+ * nShotConfig : Array of shot configurations
+ * nSlotsAvilable : Return value with number of available slots in the queue
+ */
+typedef struct OMX_TI_CONFIG_ENQUEUESHOTCONFIGS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bFlushQueue;
+ OMX_U32 nNumConfigs;
+ OMX_TI_CONFIG_SHOTCONFIG nShotConfig[5];
+} OMX_TI_CONFIG_ENQUEUESHOTCONFIGS;
+
+/**
+ * Define configuration structure to
+ * query available/free shots in shot queue.
+ * Will be supported only as GetConfig function.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nAvailableShots : Number of available shots
+ */
+typedef struct OMX_TI_CONFIG_QUERYAVAILABLESHOTS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nAvailableShots;
+} OMX_TI_CONFIG_QUERYAVAILABLESHOTS;
+
+/**
+ * Available vector shot capture stop methods
+ */
+typedef enum OMX_TI_VECTSHOTSTOPMETHOD {
+ OMX_TI_VECTSHOTSTOPMETHOD_GOTO_PREVIEW,
+ OMX_TI_VECTSHOTSTOPMETHOD_WAIT_IN_CAPTURE,
+ OMX_TI_VECTSHOTSTOPMETHOD_MAX = 0x7FFFFFFF
+} OMX_TI_VECTSHOTSTOPMETHOD;
+
+/**
+ * Define configuration structure to
+ * specify the beahvior of vector shot capture
+ * when the shot queue is empty
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eStopMethod : Select the stop method
+ */
+typedef struct OMX_TI_CONFIG_VECTSHOTSTOPMETHODTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VECTSHOTSTOPMETHOD eStopMethod;
+} OMX_TI_CONFIG_VECTSHOTSTOPMETHODTYPE;
+
+/* Number of elements per color */
+#define OMX_TI_GAMMATABLE_SIZE (512)
+
+/**
+ * Describes each element of gamma table
+ */
+typedef struct OMX_TI_GAMMATABLE_ELEM_TYPE {
+ OMX_S16 nOffset;
+ OMX_S16 nSlope;
+} OMX_TI_GAMMATABLE_ELEM_TYPE;
+
+/**
+ * Gamma table
+ *
+ * STRUCT MEMBERS:
+ * pR : Red color table
+ * pG : Blue color table
+ * pB : Green color table
+ */
+typedef struct OMX_TI_CONFIG_GAMMATABLE_TYPE {
+ OMX_TI_GAMMATABLE_ELEM_TYPE pR[OMX_TI_GAMMATABLE_SIZE];
+ OMX_TI_GAMMATABLE_ELEM_TYPE pG[OMX_TI_GAMMATABLE_SIZE];
+ OMX_TI_GAMMATABLE_ELEM_TYPE pB[OMX_TI_GAMMATABLE_SIZE];
+} OMX_TI_CONFIG_GAMMATABLE_TYPE;
+/**
+ * Define configuration structure to
+ * specify computing of image pyramids
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nLevelsCount : Number of levels of the pyramid
+ * nScalingFactor : (Format: Q16) Scaling factor for
+ * the levels of the pyramid
+ */
+typedef struct OMX_TI_PARAM_IMAGEPYRAMIDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nLevelsCount;
+ OMX_U32 nScalingFactor; // Q16
+} OMX_TI_PARAM_IMAGEPYRAMIDTYPE;
+
+
+
+/* 16 Extended to allow precise H3A for preview */
+#define OMX_MAX_WINHC (36)
+/* 32 Extended to allow precise H3A for preview */
+#define OMX_MAX_WINVC (128)
+/* One paxel is 32 Bytes + on every 8 paxel 8*2 Bytes for number of unsaturated pixels in previouse 8 paxels */
+#define OMX_AWWB_H3A_PAXEL_SIZE_BYTES (32 + 2)
+/*AF SCM Range Constants */
+#define OMX_AF_PAXEL_VERTICAL_COUNT_MAX (127)
+/*AF SCM Range Constants */
+#define OMX_AF_PAXEL_HORIZONTAL_COUNT_MAX (35)
+/* Max sensor with */
+#define OMX_ISP_IN_WIDTH (4032)
+/* Max sensor height */
+#define OMX_ISP_IN_HEIGHT (3024)
+
+
+//!< Noise filter number of THR coefficients
+#define OMX_ISS_NF_THR_COUNT (8)
+//!< Noise filter number of STR coefficients
+#define OMX_ISS_NF_STR_COUNT (8)
+//!< Noise filter number of SPR coefficients
+#define OMX_ISS_NF_SPR_COUNT (8)
+//!< Numbers of values in Gamma table
+#define OMX_ISS_PREV_GAMMA_TABLE (1024)
+//!< Number of offset values on table
+#define OMX_ISS_PREV_RGB2RGB_OFFSET (3)
+//!< Numbers of values in rows and colomns
+#define OMX_ISS_PREV_RGB2RGB_MATRIX (3)
+//!< GBCE enhancement table size
+#define OMX_ISS_GBCE_TABLE_SIZE (1024)
+//!< Edge enhancement table size
+#define OMX_ISS_EE_TABLE_SIZE (1024)
+//!< Edge enhancement number of coefficients
+#define OMX_ISS_COEFF (9)
+//!< Histogram dims count
+#define OMX_ISS_HIST_DIMS_COUNT (4)
+//!< Histogram gain table size
+#define OMX_ISS_HIST_GAIN_TBL (4)
+//!< Number of offset values on table
+#define OMX_ISS_PREV_RGB2YUV_OFFSET (3)
+//!< Numbers of values in rows and colomns
+#define OMX_ISS_PREV_RGB2YUV_MATRIX (3)
+
+/*--------data declarations -----------------------------------*/
+typedef enum {
+ OMX_IPIPE_BAYER_PATTERN_RGGB,
+ OMX_IPIPE_BAYER_PATTERN_GRBG,
+ OMX_IPIPE_BAYER_PATTERN_GBRG,
+ OMX_IPIPE_BAYER_PATTERN_BGGR,
+ OMX_IPIPE_BAYER_PATTERN_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_BAYER_PATTERNTYPE;
+
+typedef enum {
+ OMX_IPIPE_BAYER_MSB_BIT15,
+ OMX_IPIPE_BAYER_MSB_BIT14,
+ OMX_IPIPE_BAYER_MSB_BIT13,
+ OMX_IPIPE_BAYER_MSB_BIT12,
+ OMX_IPIPE_BAYER_MSB_BIT11,
+ OMX_IPIPE_BAYER_MSB_BIT10,
+ OMX_IPIPE_BAYER_MSB_BIT9,
+ OMX_IPIPE_BAYER_MSB_BIT8,
+ OMX_IPIPE_BAYER_MSB_BIT7,
+ OMX_IPIPE_BAYER_MSB_BIT_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_BAYER_MSB_POSTYPE;
+
+typedef enum {
+ OMX_ISIF_LSC_8_PIXEL = 3,
+ OMX_ISIF_LSC_16_PIXEL = 4,
+ OMX_ISIF_LSC_32_PIXEL = 5,
+ OMX_ISIF_LSC_64_PIXEL = 6,
+ OMX_ISIF_LSC_128_PIXEL = 7,
+ OMX_ISIF_LSC_128_PIXEL_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_LSC_GAIN_MODE_MNTYPE;
+
+typedef enum {
+ OMX_LSC_GAIN_0Q8 = 0,
+ OMX_LSC_GAIN_0Q8_PLUS_1 = 1,
+ OMX_LSC_GAIN_1Q7 = 2,
+ OMX_LSC_GAIN_1Q7_PLUS_1 = 3,
+ OMX_LSC_GAIN_2Q6 = 4,
+ OMX_LSC_GAIN_2Q6_PLUS_1 = 5,
+ OMX_LSC_GAIN_3Q5 = 6,
+ OMX_LSC_GAIN_3Q5_PLUS_1 = 7,
+ OMX_LSC_GAIN_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_LSC_GAIN_FORMATTYPE;
+
+typedef enum {
+ OMX_ISIF_LSC_OFFSET_NO_SHIFT = 0,
+ OMX_ISIF_LSC_OFFSET_1_LEFT_SHIFT = 1,
+ OMX_ISIF_LSC_OFFSET_2_LEFT_SHIFT = 2,
+ OMX_ISIF_LSC_OFFSET_3_LEFT_SHIFT = 3,
+ OMX_ISIF_LSC_OFFSET_4_LEFT_SHIFT = 4,
+ OMX_ISIF_LSC_OFFSET_5_LEFT_SHIFT = 5,
+ OMX_ISIF_LSC_OFFSET_5_LEFT_SHIFT_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_LSC_OFFSET_SHIFTTYPE;
+
+typedef enum {
+ OMX_ISIF_LSC_OFFSET_OFF = 0,
+ OMX_ISIF_LSC_OFFSET_ON = 1,
+ OMX_ISIF_LSC_OFFSET_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_LSC_OFFSET_ENABLETYPE;
+
+typedef struct {
+ //!< DLSCCFG ENABLE-- enable 2d LSC module
+ OMX_U8 nEnable;
+ //!< HVAL LSCHVAL--LSC HSIZE
+ OMX_U16 nLscHSize;
+ //!< HVAL LSCHVAL--LSC VSIZE
+ OMX_U16 nLscVSize;
+ //!< HOFST LSCHOFST DATAHOFST 0-16383-- H-direction data offset
+ OMX_U16 nHDirDataOffset;
+ //!< VOFST LSCVOFST DATAHOFST 0-16383-- V-direction data offset
+ OMX_U16 nVDirDataOffset;
+ //!< X DLSCINI 6:0-- H-position of the paxel
+ OMX_U8 nHPosInPaxel;
+ //!< Y DLSCINI 6:0-- V-position of the paxel
+ OMX_U8 nVPosInPaxel;
+
+ //!< GAIN_MODE_M DLSCCFG
+ OMX_TI_3ASKIP_ISIF_LSC_GAIN_MODE_MNTYPE ePaxHeight;
+ //!< GAIN_MODE_N DLSCCFG
+ OMX_TI_3ASKIP_ISIF_LSC_GAIN_MODE_MNTYPE ePaxLength;
+ //!< GAIN_FORMAT DLSCCFG
+ OMX_TI_3ASKIP_ISIF_LSC_GAIN_FORMATTYPE eGainFormat;
+ //!< offset scaling factor
+ OMX_U8 nOffsetScalingFactor;
+ //!< OFSTSFT DLSCOFST--offset shift value
+ OMX_TI_3ASKIP_ISIF_LSC_OFFSET_SHIFTTYPE eOffsetShiftVal;
+ //!< OFSTSFT DLSCOFST--offset enable value
+ OMX_TI_3ASKIP_ISIF_LSC_OFFSET_ENABLETYPE eOffsetEnable;
+ //!< gain table address--32 bit aligned
+ OMX_U32 pGainTableAddress[256];
+ //!< gain table length
+ OMX_U16 nGainTableLength;
+ //!< offset table address
+ OMX_U32 pOffsetTableAddress[256];
+ //!< offset table length
+ OMX_U16 nOffsetTableLength;
+} OMX_TI_3ASKIP_ISIF_2DLSC_CFGTYPE;
+
+typedef enum {
+ OMX_ISIF_HORIZONTAL_CLAMP_DISABLED = 0,
+ OMX_ISIF_HORIZONTAL_CLAMP_ENABLED = 1,
+ OMX_ISIF_PREVIOUS_HORIZONTAL_CLAMP_ENABLED = 2,
+ OMX_ISIF_CLAMP_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_HORIZONTAL_CLAMP_MODETYPE;
+
+typedef enum {
+ OMX_ISIF_ONE_COLOR_CLAMP = 0,
+ OMX_ISIF_FOUR_COLOR_CLAMP = 1,
+ OMX_ISIF_COLOR_CLAMP_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_BLACK_CLAMP_MODETYPE;
+
+typedef enum {
+ OMX_ISIF_HBLACK_2PIXEL_TALL = 0,
+ OMX_ISIF_HBLACK_4PIXEL_TALL = 1,
+ OMX_ISIF_HBLACK_8PIXEL_TALL = 2,
+ OMX_ISIF_HBLACK_16PIXEL_TALL = 3,
+ OMX_ISIF_HBLACK_PIXEL_TALL_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_HBLACK_PIXEL_HEIGHTTYPE;
+
+typedef enum {
+ OMX_ISIF_HBLACK_32PIXEL_WIDE = 0,
+ OMX_ISIF_HBLACK_64PIXEL_WIDE = 1,
+ OMX_ISIF_HBLACK_128PIXEL_WIDE = 2,
+ OMX_ISIF_HBLACK_256PIXEL_WIDE = 3,
+ OMX_ISIF_HBLACK_PIXEL_WIDE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_HBLACK_PIXEL_WIDTHTYPE;
+
+typedef enum {
+ OMX_ISIF_VBLACK_PIXEL_NOT_LIMITED = 0,
+ OMX_ISIF_VBLACK_PIXEL_LIMITED = 1,
+ OMX_ISIF_VBLACK_PIXEL_LIMITED_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_HBLACK_PIXEL_VALUE_LIMTYPE;
+
+typedef enum {
+ OMX_ISIF_VBLACK_BASE_WINDOW_LEFT = 0,
+ OMX_ISIF_VBLACK_BASE_WINDOW_RIGHT = 1,
+ OMX_ISIF_VBLACK_BASE_WINDOW_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_HBLACK_BASE_WINDOWTYPE;
+
+typedef struct {
+ //!< CLHSV CLHWIN2 12-0--Vertical black clamp.
+ //!< Window Start position (V).Range: 0 - 8191
+ OMX_U16 nVPos;
+ //!< CLHWN CLHWIN0--[Horizontal Black clamp]
+ //!< Vertical dimension of a Window (2^N).
+ OMX_TI_3ASKIP_ISIF_HBLACK_PIXEL_HEIGHTTYPE eVSize;
+ //!< CLHSH CLHWIN1 12-0--Horizontal black clamp.
+ //!< Window Start position (H).Range: 0 - 8191
+ OMX_U16 nHPos;
+ //!< CLHWM CLHWIN0--[Horizontal Black clamp]
+ //!< Horizontal dimension of a Window (2^M).
+ OMX_TI_3ASKIP_ISIF_HBLACK_PIXEL_WIDTHTYPE eHSize;
+ //!< CLHLMT CLHWIN0--Horizontal Black clamp. Pixel value
+ //!< limitation for the Horizontal clamp value calculation
+ OMX_TI_3ASKIP_ISIF_HBLACK_PIXEL_VALUE_LIMTYPE ePixelValueLimit;
+ //!< CLHWBS CLHWIN0--[Horizontal Black clamp] Base Window select
+ OMX_TI_3ASKIP_ISIF_HBLACK_BASE_WINDOWTYPE eRightWindow;
+ //!< CLHWC CLHWIN0--[Horizontal Black clamp]
+ //!< Window count per color. Window count = CLHWC+1. Range: 1 - 32
+ OMX_U8 nWindowCountPerColor;
+} OMX_TI_3ASKIP_ISIFHBLACKPARAMSTYPE;
+
+typedef enum {
+ OMX_ISIF_VBLACK_2PIXEL_WIDE = 0,
+ OMX_ISIF_VBLACK_4PIXEL_WIDE = 1,
+ OMX_ISIF_VBLACK_8PIXEL_WIDE = 2,
+ OMX_ISIF_VBLACK_16PIXEL_WIDE = 3,
+ OMX_ISIF_VBLACK_32PIXEL_WIDE = 4,
+ OMX_ISIF_VBLACK_64PIXEL_WIDE = 5,
+ OMX_ISIF_VBLACK_PIXEL_WIDE = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_VBLACK_PIXEL_WIDTHTYPE;
+
+typedef enum {
+ OMX_ISIF_VALUE_HORIZONTAL_DIRECTION = 0,
+ OMX_ISIF_VALUE_CONFIG_REGISTER = 1,
+ OMX_ISIF_VALUE_NOUPDATE = 2,
+ OMX_ISIF_VALUE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_VBLACK_RESET_MODETYPE;
+
+typedef struct {
+ //!< CLVSV CLVWIN2 12-0--Vertical black clamp.
+ //!< Window Start position (V).Range: 0 - 8191
+ OMX_U16 nVPos;
+ //!< CLVOBV CLVWIN3 12-0 range 0-8192-- Vertical black clamp.
+ //!< Optical black V valid (V).Range: 0 - 8191
+ OMX_U16 nVSize;
+ //!< CLVSH CLVWIN1 12-0--Vertical black clamp. Window Start
+ //!< position (H).Range: 0 - 8191
+ OMX_U16 nHPos;
+ //!< CLVOBH CLVWIN0-- Vertical Black clamp. Optical Black H valid (2^L).
+ OMX_TI_3ASKIP_ISIF_VBLACK_PIXEL_WIDTHTYPE HSize;
+ //!< CLVCOEF CLVWIN0-- Vertical Black clamp .Line average coefficient (k).
+ OMX_U8 line_avg_coef;
+ //!< CLVRVSL CLVWIN0-- Vertical Black clamp. Select the reset value
+ //!< for the Clamp value of the Previous line
+ OMX_TI_3ASKIP_ISIF_VBLACK_RESET_MODETYPE reset_mode;
+ //!< CLVRV reset value U12--Vertical black clamp reset value
+ //!< (U12) Range: 0 to 4095
+ OMX_U16 reset_value;
+} OMX_TI_3ASKIP_ISIF_VERTICAL_BLACK_PARAMSTYPE;
+
+typedef struct {
+ //!< CLEN CLAMPCFG-- clamp module enablement
+ OMX_U8 nEnable;
+ //!< CLMD CLAMPCFG-- horizontal clamp mode
+ OMX_TI_3ASKIP_ISIF_HORIZONTAL_CLAMP_MODETYPE eHClampMode;
+ //!< CLHMD CLAMPCFG-- black clamp mode
+ OMX_TI_3ASKIP_ISIF_BLACK_CLAMP_MODETYPE eBlackClampMode;
+ //!< CLDCOFST CLDC s13-- clamp dc-offset value
+ OMX_U16 nDCOffsetClampVal;
+ //!< CLSV 12-0 (range 0-8191)--black clamp v-start position
+ OMX_U16 nBlackClampVStartPos;
+ //!< CLHWIN0-- horizontal black clamp parameters
+ OMX_TI_3ASKIP_ISIF_VERTICAL_BLACK_PARAMSTYPE tHorizontalBlack;
+ //!< CLVWIN0-- vertical black clamp parameters
+ OMX_TI_3ASKIP_ISIF_VERTICAL_BLACK_PARAMSTYPE tVerticalBlack;
+} OMX_TI_3ASKIP_ISIF_CLAMP_CFGTYPE;
+
+typedef struct {
+ //!< FLSHEN FLSHCFG0-- flash enable
+ OMX_U8 nEnable;
+ //!< SFLSH FLSHCFG1--Start line to set the FLASH timing signal.
+ OMX_U16 nFlashTimingStartLine;
+ //!< VFLSH FLSHCFG--Valid width of the FLASH timing signal.
+ //!< Valid width = Crystal-clock x 2 x (VFLSH + 1)
+ OMX_U16 nFlashTimingWidth;
+} OMX_TI_3ASKIP_ISIF_FLASH_CFGTYPE;
+
+typedef struct {
+ //!< gain offset feature-flag
+ OMX_U8 gain_offset_featureflag;
+ //!< CGR CRGAIN-- gain R
+ OMX_U16 gain_r;
+ //!< CGGR CGRGAIN-- gain GR
+ OMX_U16 gain_gr;
+ //!< CGGB CGBGAIN-- gain GB
+ OMX_U16 gain_gb;
+ OMX_U16 gain_bg;
+ //!< COFT COFSTA--offset
+ OMX_U16 offset;
+} OMX_TI_3ASKIP_ISIF_GAINOFFSET_CFGTYPE;
+
+typedef enum {
+ OMX_ISIF_VDLC_WHOLE_LINE = 0,
+ OMX_ISIF_VDLC_DISABLE_ABOVE_UPPER_PIXEL = 1,
+ OMX_ISIF_VDLC_MAX = 0x7FFFFFFF
+
+} OMX_TI_3ASKIP_ISIF_VDLC_PIXEL_DEPENDENCYTYPE;
+
+typedef enum {
+ OMX_ISIF_VLDC_FED_THRO_ONSATURATION = 0,
+ OMX_ISIF_VLDC_HORIZONTAL_INTERPOLATION_ONSATURATION = 1,
+ OMX_ISIF_VLDC_HORIZONTAL_INTERPOLATION = 2,
+ OMX_ISIF_VLDC_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_ISIF_VLDC_MODE_SELECTTYPE;
+
+typedef struct {
+ //!< DFCMEM0--Vertical Defect position
+ OMX_U16 nVerticalDefectPosition;
+ //!< DFCMEM1 12-0--horizontal defect position
+ OMX_U16 nHorizontalDefectPosition;
+ //!< DFCMEM2--Defect correction Memory 2
+ OMX_U8 nSub1ValueVldc;
+ //!< DFCMEM3--Defect correction Memory 3
+ OMX_U8 nSub2LessThanVldc;
+ //!< DFCMEM4--Defect correction Memory 4
+ OMX_U8 nSub3GreaterThanVldc;
+} OMX_TI_3ASKIP_ISIF_VLDCDEFECT_LINEPARAMSTYPE;
+
+typedef struct {
+ //!< VDFCEN DFCCTL--enable VLDC module
+ OMX_U8 nEnable;
+ //!< VDFCUDA DFCCTL--pixel dependency
+ OMX_TI_3ASKIP_ISIF_VDLC_PIXEL_DEPENDENCYTYPE eDisableVldcUpperPixels;
+ //!< VDFLSFT DFCCTL-- VLDC shift values
+ OMX_U8 nVldcShiftVal;
+ //!< VDFCSL DFCCTL--VLDC mode select
+ OMX_TI_3ASKIP_ISIF_VLDC_MODE_SELECTTYPE eVldcModeSelect;
+ //!< VDFSLV VDFSATLV OMX_U12 range 0 - 4095-- VLDC saturation level
+ OMX_U16 nVldcSaturationLvl;
+ //!< number of defect lines-maximum8
+ OMX_U8 nDefectLines;
+ //!< DFCMEM0 -8-- defect line paramaters
+ OMX_TI_3ASKIP_ISIF_VLDCDEFECT_LINEPARAMSTYPE tVldcDefectLineParams;
+} OMX_TI_3ASKIP_ISIF_VLDC_CFGTYPE;
+
+typedef enum {
+ OMX_NOISE_FILTER_1 = 1,
+ OMX_NOISE_FILTER_2 = 2,
+ OMX_NOISE_FILTER_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_NOISE_FILTERTYPE;
+
+typedef enum {
+ OMX_IPIPE_NF_SPR_SINGLE = 0,
+ OMX_IPIPE_NF_SPR_LUT = 1,
+ OMX_IPIPE_NF_SPR_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_NF_SELTYPE;
+
+typedef enum {
+ OMX_IPIPE_NF_LSC_GAIN_OFF = 0,
+ OMX_IPIPE_NF_LSC_GAIN_ON = 1,
+ OMX_IPIPE_NF_LSC_GAIN_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_NF_LSC_GAINTYPE;
+
+typedef enum {
+ OMX_IPIPE_NF_SAMPLE_BOX = 0,
+ OMX_IPIPE_NF_SAMPLE_DIAMOND = 1,
+ OMX_IPIPE_NF_SAMPLE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_NF_SAMPLE_METHODTYPE;
+
+typedef struct {
+ //!< Enable-disable for Noise filter in ipipe
+ OMX_U8 nEnable;
+ //!< Noise filter number
+ OMX_TI_3ASKIP_IPIPE_NOISE_FILTERTYPE eNFNum;
+ //!< Selecting the spread in NF
+ OMX_TI_3ASKIP_IPIPE_NF_SELTYPE eSel;
+ //!< Controling the lsc gain applied in Noise Filter
+ OMX_TI_3ASKIP_IPIPE_NF_LSC_GAINTYPE eLscGain;
+ //!< Selecting the sampling method
+ OMX_TI_3ASKIP_IPIPE_NF_SAMPLE_METHODTYPE eTyp;
+ OMX_U8 nDownShiftVal;
+ OMX_U8 nSpread;
+ OMX_U16 pThr[OMX_ISS_NF_THR_COUNT];
+ OMX_U8 pStr[OMX_ISS_NF_STR_COUNT];
+ OMX_U8 pSpr[OMX_ISS_NF_SPR_COUNT];
+ OMX_U16 nEdgeMin;
+ OMX_U16 nEdgeMax;
+} OMX_TI_3ASKIP_IPIPE_NOISE_FILTER_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPE_GIC_LSC_GAIN_OFF = 0,
+ OMX_IPIPE_GIC_LSC_GAIN_ON = 1,
+ OMX_IPIPE_GIC_LSC_GAIN_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_GIC_LSC_GAINTYPE;
+
+typedef enum {
+ OMX_IPIPE_GIC_GICTHR = 0,
+ OMX_IPIPE_GIC_NF2THR = 1,
+ OMX_IPIPE_GIC_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_GIC_SELTYPE;
+
+typedef enum {
+ OMX_IPIPE_GIC_DIFF_INDEX = 0,
+ OMX_IPIPE_GIC_HPD_INDEX = 1,
+ OMX_IPIPE_GIC_INDEX_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_GIC_INDEXTYPE;
+
+typedef struct {
+ /* works only when data format is GR,GB */
+ //!< Enable-disable for diffrerent components in ipipe
+ OMX_U16 nEnable;
+ //!< Selecting LSC gain in GIC
+ OMX_TI_3ASKIP_IPIPE_GIC_LSC_GAINTYPE eLscGain;
+ //!< Slection of threshold vaue in GIC filter
+ OMX_TI_3ASKIP_IPIPE_GIC_SELTYPE eSel;
+ //!< Selecting the index in GIC
+ OMX_TI_3ASKIP_IPIPE_GIC_INDEXTYPE eTyp;
+ OMX_U8 nGicGain;
+ OMX_U8 nGicNfGain;
+ OMX_U16 nGicThr;
+ OMX_U16 nGicSlope;
+} OMX_TI_3ASKIP_IPIPE_GIC_CFGTYPE;
+
+typedef struct {
+ /*offseet after R,GR,GB,B*/
+ OMX_U16 pOffset[4];
+ /*gain for R gr gb B*/
+ OMX_U16 pGain[4];
+} OMX_TI_3ASKIP_IPIPE_WB_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPE_CFA_MODE_2DIR = 0,
+ OMX_IPIPE_CFA_MODE_2DIR_DA = 1,
+ OMX_IPIPE_CFA_MODE_DAA = 2,
+ OMX_IPIPE_CFA_MODE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_CFA_MODETYPE;
+
+typedef struct {
+ OMX_U16 nHpfThr;
+ OMX_U16 nHpfSlope;
+ OMX_U16 nMixThr;
+ OMX_U16 nMixSlope;
+ OMX_U16 nDirThr;
+ OMX_U16 nDirSlope;
+ OMX_U16 nDirNdwt;
+} OMX_TI_3ASKIP_IPIPE_CFA_DIRTYPE;
+
+typedef struct {
+ OMX_U8 nMonoHueFra;
+ OMX_U8 nMonoEdgThr;
+ OMX_U16 nMonoThrMin;
+ OMX_U16 nMonoThrSlope;
+ OMX_U16 nMonoSlpMin;
+ OMX_U16 nMonoSlpSlp;
+ OMX_U16 nMonoLpwt;
+} OMX_TI_3ASKIP_IPIPE_CFA_DAATYPE;
+
+typedef struct {
+ OMX_U8 nEnable;
+ OMX_TI_3ASKIP_IPIPE_CFA_MODETYPE eMode;
+ OMX_TI_3ASKIP_IPIPE_CFA_DIRTYPE tDir;
+ OMX_TI_3ASKIP_IPIPE_CFA_DAATYPE tDaa;
+} OMX_TI_3ASKIP_IPIPE_CFA_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPE_GAMMA_TBL_64 = 0,
+ OMX_IPIPE_GAMMA_TBL_128 = 1,
+ OMX_IPIPE_GAMMA_TBL_256 = 2,
+ OMX_IPIPE_GAMMA_TBL_512 = 3,
+ OMX_IPIPE_GAMMA_TBL_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_GAMMA_TABLE_SIZETYPE;
+
+typedef enum {
+ OMX_IPIPE_GAMMA_BYPASS_ENABLE = 1,
+ OMX_IPIPE_GAMMA_BYPASS_DISABLE = 0,
+ OMX_IPIPE_GAMMA_BYPASS_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_GAMMA_BYPASSTYPE;
+
+typedef struct {
+ OMX_U8 nEnable;
+ OMX_TI_3ASKIP_IPIPE_GAMMA_TABLE_SIZETYPE eGammaTblSize;
+ //!< May not be needed, since table is always in RAM
+ OMX_U8 nTbl;
+ //!< o not bypassed
+ OMX_TI_3ASKIP_IPIPE_GAMMA_BYPASSTYPE eBypassB;
+ OMX_TI_3ASKIP_IPIPE_GAMMA_BYPASSTYPE eBypassG;
+ OMX_TI_3ASKIP_IPIPE_GAMMA_BYPASSTYPE eBypassR;
+ /*poOMX_Ser to red gamma table Red gamma table - (U8Q0)
+ * Blue gamma table - (U8Q0)
+ * Green gamma table - (U8Q0)
+ */
+ OMX_S8 pRedTable[OMX_ISS_PREV_GAMMA_TABLE];
+ OMX_S8 pBlueTable[OMX_ISS_PREV_GAMMA_TABLE];
+ OMX_S8 pGreenTable[OMX_ISS_PREV_GAMMA_TABLE];
+} OMX_TI_3ASKIP_IPIPE_GAMMA_CFGTYPE;
+
+typedef struct {
+ /* [RR] [GR] [BR]
+ * [RG] [GG] [BG]
+ * [RB] [GB] [BB]*/
+ /* Blending values(S12Q8 format) */
+ /*RR,GR,BR,RG,GG,BG,RB,GB,BB each 11 bits*/
+ OMX_U16 pMulOff[OMX_ISS_PREV_RGB2RGB_MATRIX][OMX_ISS_PREV_RGB2RGB_MATRIX];
+ /* Blending offset value for R,G,B - (S10Q0) */
+ /*R,G,B each 13 bits*/
+ OMX_U16 pOft[OMX_ISS_PREV_RGB2RGB_OFFSET];
+} OMX_TI_3ASKIP_IPIPE_RGBRGB_CFGTYPE;
+
+typedef struct {
+ OMX_U8 nBrightness;
+ OMX_U8 nContrast;
+ /* [CSCRY] [CSCGY] [CSCBY]
+ * [CSCRCB] [CSCGCB] [CSCBCB]
+ * [CSCRCR] [CSCGCR] [CSCBCR] */
+ /* Color space conversion coefficients(S10Q8) */
+ /*RY,GY,BY,RCB,GCB,BCB ,RCR,GCR,BCR 12 bits*/
+ OMX_S16 pMulVal[OMX_ISS_PREV_RGB2YUV_MATRIX][OMX_ISS_PREV_RGB2YUV_MATRIX];
+ /* CSC offset values for Y offset, CB offset
+ * and CR offset respectively (S8Q0) */
+ /*Y,CB,CR -11bits*/
+ OMX_S16 pOffset[OMX_ISS_PREV_RGB2YUV_OFFSET];
+} OMX_TI_3ASKIP_IPIPE_RGBYUV_CFGTYPE;
+
+typedef enum {
+ //!< Cr CB unmodified
+ OMX_IPIPE_GBCE_METHOD_Y_VALUE = 0,
+ OMX_IPIPE_GBCE_METHOD_GAIN_TBL = 1,
+ OMX_IPIPE_GBCE_METHOD_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_GBCE_METHODTYPE;
+
+typedef struct {
+ //!< Enable-disable for GBCE in ipipe
+ OMX_U16 nEnable;
+ //!< Selecting the type of GBCE method
+ OMX_TI_3ASKIP_IPIPE_GBCE_METHODTYPE nTyp;
+ //!< GBCE LookUp Tabale
+ OMX_U16 pLookupTable[OMX_ISS_GBCE_TABLE_SIZE];
+} OMX_TI_3ASKIP_IPIPE_GBCE_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPE_PROC_COMPR_NO,
+ OMX_IPIPE_PROC_COMPR_DPCM,
+ OMX_IPIPE_PROC_COMPR_ALAW,
+ OMX_IPIPE_PROC_COMPR_PACK,
+ OMX_IPIPE_PROC_COMPR_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_PROC_COMPRESSIONTYPE;
+
+typedef enum {
+ OMX_IPIPE_YUV_PHS_POS_COSITED = 0,
+ OMX_IPIPE_YUV_PHS_POS_CENTERED = 1,
+ OMX_IPIPE_YUV_PHS_POS_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_YUV_PHASE_POSTYPE;
+
+typedef enum {
+ OMX_IPIPE_VP_DEV_CSIA,
+ OMX_IPIPE_VP_DEV_CSIB,
+ OMX_IPIPE_VP_DEV_CCP,
+ OMX_IPIPE_VP_DEV_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_VP_DEVICETYPE;
+
+//ISS configuration structure which controls the operation of yuv444 to yuv 422
+typedef struct {
+ OMX_TI_3ASKIP_IPIPE_YUV_PHASE_POSTYPE ePos;
+ OMX_U8 nLpfEn;
+} OMX_TI_3ASKIP_IPIPE_YUV444YUV422_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPE_HALO_REDUCTION_ENABLE = 1,
+ OMX_IPIPE_HALO_REDUCTION_DISABLE = 0,
+ OMX_IPIPE_HALO_REDUCTION_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_EE_HALO_CTRLTYPE;
+
+/* ISS configuration structure Edge enhancement */
+typedef struct {
+ /** Defect Correction Enable */
+ OMX_U16 nEnable;
+ //Enable-disable for halo reduction in Edge enhancement
+ OMX_TI_3ASKIP_IPIPE_EE_HALO_CTRLTYPE eHaloReduction;
+ // 9 coefficients
+ OMX_S16 pMulVal[OMX_ISS_COEFF];
+ OMX_U8 nSel;
+ OMX_U8 nShiftHp;
+ OMX_U16 nThreshold;
+ OMX_U16 nGain;
+ OMX_U16 nHpfLowThr;
+ OMX_U8 nHpfHighThr;
+ OMX_U8 nHpfGradientGain;
+ OMX_U8 nHpfgradientOffset;
+ OMX_S16 pEeTable[OMX_ISS_EE_TABLE_SIZE];
+} OMX_TI_3ASKIP_IPIPE_EE_CFGTYPE;
+
+// ISS configuration structure for CAR module in ipipe
+typedef struct {
+ // Enable-disable for CAR module in ipipe
+ OMX_U8 nEnable;
+ OMX_U8 nTyp;
+ OMX_U8 nSw0Thr;
+ OMX_U8 nSw1Thr;
+ OMX_U8 nHpfType;
+ OMX_U8 nHpfShift;
+ OMX_U8 nHpfThr;
+ OMX_U8 nGn1Gain;
+ OMX_U8 nGn1Shift;
+ OMX_U16 nGn1Min;
+ OMX_U8 nGn2Gain;
+ OMX_U8 nGn2Shift;
+ OMX_U16 nGn2Min;
+} OMX_TI_3ASKIP_IPIPE_CAR_CFGTYPE;
+
+//!< ISS configuration structure for LSC
+typedef struct {
+ OMX_U16 nVOffset;
+ //<! va1
+ OMX_S16 nVLinearCoeff;
+ //<! va2
+ OMX_S16 nVQuadraticCoeff;
+ //<! vs1
+ OMX_U8 nVLinearShift;
+ //<! vs2
+ OMX_U8 nVQuadraticShift;
+ OMX_U16 nHOffset;
+ //<! va1
+ OMX_S16 nHLinearCoeff;
+ //<! va2
+ OMX_S16 nHQuadraticCoeff;
+ //<! vs1
+ OMX_U8 nHLinearShift;
+ //<! vs2
+ OMX_U8 nHQuadraticShift;
+ //!< Gain value for R
+ OMX_U8 nGainR;
+ //!< Gain value for GR
+ OMX_U8 nGainGR;
+ //!< Gain value for GB
+ OMX_U8 nGainGB;
+ //!< Gain value for B
+ OMX_U8 nGainB;
+ //!< Offset value for R
+ OMX_U8 nOffR;
+ //!< Offset value for GR
+ OMX_U8 nOffGR;
+ //!< Offset value for GB
+ OMX_U8 nOffGB;
+ //!< Offset value for B
+ OMX_U8 nOffB;
+ //<! LSC_SHIFT
+ OMX_U8 nShift;
+ //<! LSC_MAX
+ OMX_U16 nMax;
+} OMX_TI_3ASKIP_IPIPE_LSC_CFGTYPE;
+
+typedef struct {
+ OMX_U16 nVPos;
+ OMX_U16 nVSize;
+ OMX_U16 nHPos;
+ OMX_U16 nHSize;
+} OMX_TI_3ASKIP_IPIPE_HIST_DIMTYPE;
+
+//!< ISS configuration structure for Histogram in ipipe
+typedef struct {
+ //!< Enable-disable for Histogram in ipipe
+ OMX_U8 nEnable;
+ OMX_U8 nOst;
+ OMX_U8 nSel;
+ OMX_U8 nType;
+ OMX_U8 nBins;
+ OMX_U8 nShift;
+ //!< Bits [3:0], 0 is disable
+ OMX_U8 nCol;
+ //!< [3:0], 0 is disable
+ OMX_U8 nRegions;
+ //!< Pointer to array of 4 structs
+ OMX_TI_3ASKIP_IPIPE_HIST_DIMTYPE pHistDim[OMX_ISS_HIST_DIMS_COUNT];
+ OMX_U8 nClearTable;
+ OMX_U8 nTableSel;
+ //!< r,gr,gb,b
+ OMX_U8 pGainTbl[OMX_ISS_HIST_GAIN_TBL];
+} OMX_TI_3ASKIP_IPIPE_HIST_CFGTYPE;
+
+typedef enum {
+ OMX_BOXCAR_DISABLED = 0,
+ OMX_BOXCAR_ENABLED = 1,
+ OMX_BOXCAR_ENB_DSB_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_BOXCAR_ENABLETYPE;
+
+typedef enum {
+ OMX_BOXCAR_FREE_RUN = 0,
+ OMX_BOXCAR_ONE_SHOT = 1,
+ OMX_BOXCAR_FREE_ONE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_BOXCAR_MODETYPE;
+
+typedef enum {
+ OMX_BOXCAR_8x8 = 0,
+ OMX_BOXCAR_16x16 = 1,
+ OMX_BOXCAR_SIZE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_BOXCAR_SIZETYPE;
+
+typedef struct {
+ OMX_U8 nVectors;
+ OMX_U8 nShift;
+ //!< Vertical position
+ OMX_U16 nVPos;
+ //!< Horizontal position
+ OMX_U16 nHPos;
+ //!< Vertical number
+ OMX_U16 nVNum;
+ //!< Horizontal number
+ OMX_U16 nHNum;
+ //!< Horizontal skip
+ OMX_U8 nVSkip;
+ //!< Vertical skip
+ OMX_U8 nHSkip;
+} OMX_TI_3ASKIP_IPIPE_BSCPOS_PARAMSTYPE;
+
+typedef struct {
+ //!< Enable-disable for BSC in ipipe
+ OMX_U8 nEnable;
+ //!< BSC mode in ipipe
+ OMX_U8 nMode;
+ //!< BSC Color Sample
+ OMX_U8 nColSample;
+ //!< BSC Row Sample
+ OMX_U8 nRowSample;
+ //!< Y or CB or CR
+ OMX_U8 nElement;
+ //!< Color Position parameters
+ OMX_TI_3ASKIP_IPIPE_BSCPOS_PARAMSTYPE nColPos;
+ //!< Row Position parameters
+ OMX_TI_3ASKIP_IPIPE_BSCPOS_PARAMSTYPE nRowPos;
+} OMX_TI_3ASKIP_IPIPE_BSC_CFGTYPE;
+
+//!< Enable-disable enum for DFS in ipipeif
+typedef enum {
+ OMX_IPIPEIF_FEATURE_ENABLE = 1,
+ OMX_IPIPEIF_FEATURE_DISABLE = 0,
+ OMX_IPIPEIF_FEATURE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPEIF_FEATURE_SELECTTYPE;
+
+typedef struct {
+ //!< Enable-disable for DFS in ipipeif
+ OMX_TI_3ASKIP_IPIPEIF_FEATURE_SELECTTYPE eDfsGainEn;
+ //!< Valid only if eDfsGainEn = OMX_IPIPEIF_FEATURE_ENABLE
+ OMX_U16 nDfsGainVal;
+ //!< Valid only if eDfsGainEn = OMX_IPIPEIF_FEATURE_ENABLE
+ OMX_U16 nDfsGainThr;
+ //!< Valid only if eDfsGainEn = OMX_IPIPEIF_FEATURE_ENABLE
+ OMX_U16 nOclip;
+ //!< Set to 0 if Sensor Parallel interface data is
+ //!< to be subtracted by DRK frm in SDRAM
+ OMX_U8 nDfsDir;
+} OMX_TI_3ASKIP_IPIPEIF_DFS_CFGTYPE;
+
+//!< ISS struct to control defect pixel corrction in ipipeif
+typedef struct {
+ //!< Enable-disable for DPC in ipipeif
+ OMX_TI_3ASKIP_IPIPEIF_FEATURE_SELECTTYPE eDpcEn;
+ OMX_U16 eDpcThr;
+} OMX_TI_3ASKIP_IPIPEIF_DPC_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPEIF_DPCM_PREDICTION_SIMPLE = 0,
+ OMX_IPIPEIF_DPCM_PREDICTION_ADVANCED = 1,
+ OMX_IPIPEIF_DPCM_PREDICTION_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPEIF_DPCM_PRED_TYPTYPE;
+
+typedef enum {
+ OMX_IPIPEIF_DPCM_BIT_SIZE_8_10 = 0,
+ OMX_IPIPEIF_DPCM_BIT_SIZE_8_12 = 1,
+ OMX_IPIPEIF_DPCM_BIT_SIZE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPEIF_DPCM_BIT_SIZETYPE;
+
+typedef struct {
+ //!< Enable-disable for DPCM in ipipeif
+ OMX_TI_3ASKIP_IPIPEIF_FEATURE_SELECTTYPE nDpcmEn;
+ //!< Valid only if DPCM is enabled; dpcm_en=1
+ OMX_TI_3ASKIP_IPIPEIF_DPCM_PRED_TYPTYPE nDpcmPredictor;
+ //!< Valid only if DPCM is enabled; dpcm_en=1
+ OMX_TI_3ASKIP_IPIPEIF_DPCM_BIT_SIZETYPE nDpcmBitSize;
+} OMX_TI_3ASKIP_IPIPEIF_DPCM_CFGTYPE;
+
+typedef enum {
+ OMX_RSZ_IP_IPIPE = 0,
+ OMX_RSZ_IP_IPIPEIF = 1,
+ OMX_RSZ_IP_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_RSZ_IP_PORT_SELTYPE;
+
+typedef enum {
+ OMX_MEM_INPUT_IPIPEIF,
+ OMX_MEM_INPUT_CCP,
+ OMX_MEM_INPUT_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_MEM_PROC_INPUT_SELECTTYPE;
+
+//!< ISS low pass filter params for Horizontal resizing
+typedef struct {
+ OMX_U8 nCIntensity;
+ OMX_U8 nYIntensity;
+} OMX_TI_3ASKIP_RSZ_LPF_CFGTYPE;
+
+//!< Enable-Disable H3A Features
+typedef enum {
+ OMX_H3A_FEATURE_DISABLE = 0,
+ OMX_H3A_FEATURE_ENABLE = 1,
+ OMX_H3A_FEATURE_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE;
+
+typedef struct {
+ //!< AEWINBLK WINSV single row of black line vpos
+ OMX_U16 nVPos;
+ //!< AEWINBLK WINH win height
+ OMX_U16 nHPos;
+} OMX_TI_3ASKIP_H3A_AEWB_BLKDIMSTYPE;
+
+typedef struct {
+ OMX_U8 pFirCoef[5];
+ OMX_U8 nVfvThres;
+} OMX_TI_3ASKIP_H3A_AF_FIRPARAMTYPE;
+
+typedef struct {
+ //!< Enable-disable for H3A AF Median engine
+ OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE eAfMedianEn;
+ //!< Enable-disable for H3A AEWB Median engine
+ OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE eAewbMedianEn;
+ //!< Valid only if eAfMedianEn is set to OMX_H3A_FEATURE_ENABLE
+ OMX_U8 nMedianFilterThreshold;
+ //!< Enable-disable for AFAlaw engine
+ OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE eAfAlawEn;
+ //!< Enable-disable for AEWBAlaw engine
+ OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE eAewbAlawEn;
+ //!< Enable-disable for IPIPEIFAve filter engine
+ OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE eIpipeifAveFiltEn;
+ //!< Enable-disable for H3A decimation
+ OMX_TI_3ASKIP_H3A_FEATURE_ENABLETYPE eH3aDecimEnable;
+ //!< Reserved
+ OMX_U32 nReserved;
+} OMX_TI_3ASKIP_H3A_COMMON_CFGTYPE;
+
+typedef enum {
+ OMX_IPIPE_DPC_OTF_ALG_MINMAX2 = 0,
+ OMX_IPIPE_DPC_OTF_ALG_MINMAX3 = 1,
+ OMX_IPIPE_DPC_OTF_ALG_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_DPC_ALGOTYPE;
+
+typedef enum {
+ OMX_IPIPE_DPC_OTF_MAX1_MIN1 = 0,
+ OMX_IPIPE_DPC_OTF_MAX2_MIN2 = 1,
+ OMX_IPIPE_DPC_OTF_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_IPIPE_DPC_OTFTYPE;
+
+typedef struct {
+ OMX_U16 thr_cor_r;
+ OMX_U16 thr_cor_gr;
+ OMX_U16 thr_cor_gb;
+ OMX_U16 thr_cor_b;
+
+ OMX_U16 thr_det_r;
+ OMX_U16 thr_det_gr;
+ OMX_U16 thr_det_gb;
+ OMX_U16 thr_det_b;
+} OMX_TI_3ASKIP_IPIPE_DPCOTF_DPC2TYPE;
+
+typedef struct {
+ OMX_U8 nDThr;
+ OMX_U8 nDSlp;
+ OMX_U16 nDMin;
+ OMX_U16 nDMax;
+} OMX_TI_3ASKIP_IPIPE_DPCOFT_FILTERTYPE;
+
+typedef struct {
+ OMX_U8 eShift;
+ OMX_TI_3ASKIP_IPIPE_DPCOFT_FILTERTYPE eOtfCorr;
+ OMX_TI_3ASKIP_IPIPE_DPCOFT_FILTERTYPE eOtfDett;
+} OMX_TI_3ASKIP_IPIPE_DPCOTF_DPC3TYPE;
+
+/* Union which helps selec either dpc2-dpc 3 params */
+typedef union {
+ OMX_TI_3ASKIP_IPIPE_DPCOTF_DPC2TYPE tDpc2Params;
+ OMX_TI_3ASKIP_IPIPE_DPCOTF_DPC3TYPE tDpc3Params;
+} OMX_TI_3ASKIP_IPIPE_DPCOTF_FILTER_PARAMSTYPE;
+
+typedef struct {
+ //!< Enable-disable for DPC
+ OMX_U8 nEnable;
+ //!< ISS dpc otf type
+ OMX_TI_3ASKIP_IPIPE_DPC_OTFTYPE eType;
+ //!< ISS dpc otf definitions
+ OMX_TI_3ASKIP_IPIPE_DPC_ALGOTYPE eAlgo;
+ //!< Union which helps selec either dpc2-dpc 3 params
+ OMX_TI_3ASKIP_IPIPE_DPCOTF_FILTER_PARAMSTYPE tDpcData;
+} OMX_TI_3ASKIP_IPIPE_DPCOTF_CFGTYPE;
+
+typedef struct {
+ OMX_U16 thr;
+ OMX_U16 gain;
+ OMX_U16 shift;
+ OMX_U16 min;
+} OMX_TI_3ASKIP_IPIPE_CHROMA_PARAMSTYPE;
+
+typedef struct {
+ //!< Enable-disable for CGC in ipipe
+ OMX_U16 enable;
+ OMX_TI_3ASKIP_IPIPE_CHROMA_PARAMSTYPE y_chroma_low;
+ OMX_TI_3ASKIP_IPIPE_CHROMA_PARAMSTYPE y_chroma_high;
+ OMX_TI_3ASKIP_IPIPE_CHROMA_PARAMSTYPE c_chroma;
+} OMX_TI_3ASKIP_IPIPE_CGS_CFGTYPE;
+
+typedef enum {
+ OMX_TRANSFER_ONLINE = 0,
+ OMX_TRANSFER_OFFLINE = 1,
+ OMX_TRANSFER_MAX = 0x7FFFFFFF
+} OMX_TI_3ASKIP_CAM_TRANSFERTYPE;
+
+typedef struct {
+ OMX_U32 exp;
+ OMX_U32 a_gain;
+ OMX_U8 mask;
+ OMX_U32 nAgainErr;
+ OMX_U32 nDigitalISPGain;
+} OMX_TI_3ASKIP_CAM_CONTROL_EXPGAINTYPE;
+
+typedef enum {
+ /* IDs for L sensor and mono usecases */
+ OMX_TI_3aSkipIndexLLeftStart = 0,
+ OMX_TI_3aSkipIndexL_ColorPattern = OMX_TI_3aSkipIndexLLeftStart, /**< 0x00000000 reference: OMX_TI_3ASKIP_IPIPE_BAYER_PATTERNTYPE */
+ OMX_TI_3aSkipIndexL_MsbPos, /**< 0x00000001 reference: OMX_TI_3ASKIP_IPIPE_BAYER_MSB_POSTYPE */
+ OMX_TI_3aSkipIndexL_VpDevice, /**< 0x00000002 reference: OMX_TI_3ASKIP_IPIPE_VP_DEVICETYPE */
+
+ OMX_TI_3aSkipIndexL_Lsc2D, /**< 0x00000003 reference: OMX_TI_3ASKIP_ISIF_2DLSC_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Clamp, /**< 0x00000004 reference: OMX_TI_3ASKIP_ISIF_CLAMP_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Flash, /**< 0x00000005 reference: OMX_TI_3ASKIP_ISIF_FLASH_CFGTYPE */
+ OMX_TI_3aSkipIndexL_GainOffset, /**< 0x00000006 reference: OMX_TI_3ASKIP_ISIF_GAINOFFSET_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Vlcd, /**< 0x00000007 reference: OMX_TI_3ASKIP_ISIF_VLDC_CFGTYPE */
+
+ OMX_TI_3aSkipIndexL_Nf1, /**< 0x00000008 reference: OMX_TI_3ASKIP_IPIPE_NOISE_FILTER_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Nf2, /**< 0x00000009 reference: OMX_TI_3ASKIP_IPIPE_NOISE_FILTER_CFGTYPE */
+ OMX_TI_3aSkipIndexL_GIC, /**< 0x0000000A reference: OMX_TI_3ASKIP_IPIPE_GIC_CFGTYPE */
+ OMX_TI_3aSkipIndexL_WB, /**< 0x0000000B reference: OMX_TI_3ASKIP_IPIPE_WB_CFGTYPE */
+ OMX_TI_3aSkipIndexL_CFA, /**< 0x0000000C reference: OMX_TI_3ASKIP_IPIPE_CFA_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Gamma, /**< 0x0000000D reference: OMX_TI_3ASKIP_IPIPE_GAMMA_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Rgb2Rgb1, /**< 0x0000000E reference: OMX_TI_3ASKIP_IPIPE_RGBRGB_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Rgb2Rgb2, /**< 0x0000000F reference: OMX_TI_3ASKIP_IPIPE_RGBRGB_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Rgb2Yuv, /**< 0x00000010 reference: OMX_TI_3ASKIP_IPIPE_RGBYUV_CFGTYPE */
+ OMX_TI_3aSkipIndexL_GBCE, /**< 0x00000011 reference: OMX_TI_3ASKIP_IPIPE_GBCE_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Yuv2Yuv, /**< 0x00000012 reference: OMX_TI_3ASKIP_IPIPE_YUV444YUV422_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Ee, /**< 0x00000013 reference: OMX_TI_3ASKIP_IPIPE_EE_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Car, /**< 0x00000014 reference: OMX_TI_3ASKIP_IPIPE_CAR_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Lsc, /**< 0x00000015 reference: OMX_TI_3ASKIP_IPIPE_LSC_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Histogram, /**< 0x00000016 reference: OMX_TI_3ASKIP_IPIPE_HIST_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Bsc, /**< 0x00000017 reference: OMX_TI_3ASKIP_IPIPE_BSC_CFGTYPE */
+ OMX_TI_3aSkipIndexL_DpcOtf, /**< 0x00000018 reference: OMX_TI_3ASKIP_IPIPE_DPCOTF_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Cgs, /**< 0x00000019 reference: OMX_TI_3ASKIP_IPIPE_CGS_CFGTYPE */
+
+ OMX_TI_3aSkipIndexL_Dfs, /**< 0x0000001A reference: OMX_TI_3ASKIP_IPIPEIF_DFS_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Dpc1, /**< 0x0000001B reference: OMX_TI_3ASKIP_IPIPEIF_DPC_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Dpc2, /**< 0x0000001C reference: OMX_TI_3ASKIP_IPIPEIF_DPC_CFGTYPE */
+ OMX_TI_3aSkipIndexL_Dpcm, /**< 0x0000001D reference: OMX_TI_3ASKIP_IPIPEIF_DPCM_CFGTYPE */
+
+ OMX_TI_3aSkipIndexL_HLpf, /**< 0x0000001E reference: OMX_TI_3ASKIP_RSZ_LPF_CFGTYPE */
+ OMX_TI_3aSkipIndexL_VLpf, /**< 0x0000001F reference: OMX_TI_3ASKIP_RSZ_LPF_CFGTYPE */
+
+ OMX_TI_3aSkipIndexL_H3aCommonParams, /**< 0x00000020 reference: OMX_TI_3ASKIP_H3A_COMMON_CFGTYPE */
+ OMX_TI_3aSkipIndexL_CamControlExpGain, /**< 0x00000021 reference: OMX_TI_3ASKIP_CAM_CONTROL_EXPGAINTYPE */
+ OMX_TI_3aSkipIndexLLeftMax, /**< 0x00000022 */
+
+ /* IDs for R sensor */
+ OMX_TI_3aSkipIndexRightStart = 0x01000000,
+ OMX_TI_3aSkipIndexR_ColorPattern = OMX_TI_3aSkipIndexRightStart, /**< 0x01000000 reference: OMX_TI_3ASKIP_IPIPE_BAYER_PATTERNTYPE */
+ OMX_TI_3aSkipIndexR_MsbPos, /**< 0x01000001 reference: OMX_TI_3ASKIP_IPIPE_BAYER_MSB_POSTYPE */
+ OMX_TI_3aSkipIndexR_VpDevice, /**< 0x01000002 reference: OMX_TI_3ASKIP_IPIPE_VP_DEVICETYPE */
+
+ OMX_TI_3aSkipIndexR_Lsc2D, /**< 0x01000003 reference: OMX_TI_3ASKIP_ISIF_2DLSC_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Clamp, /**< 0x01000004 reference: OMX_TI_3ASKIP_ISIF_CLAMP_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Flash, /**< 0x01000005 reference: OMX_TI_3ASKIP_ISIF_FLASH_CFGTYPE */
+ OMX_TI_3aSkipIndexR_GainOffset, /**< 0x01000006 reference: OMX_TI_3ASKIP_ISIF_GAINOFFSET_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Vlcd, /**< 0x01000007 reference: OMX_TI_3ASKIP_ISIF_VLDC_CFGTYPE */
+
+ OMX_TI_3aSkipIndexR_Nf1, /**< 0x01000008 reference: OMX_TI_3ASKIP_IPIPE_NOISE_FILTER_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Nf2, /**< 0x01000009 reference: OMX_TI_3ASKIP_IPIPE_NOISE_FILTER_CFGTYPE */
+ OMX_TI_3aSkipIndexR_GIC, /**< 0x0100000A reference: OMX_TI_3ASKIP_IPIPE_GIC_CFGTYPE */
+ OMX_TI_3aSkipIndexR_WB, /**< 0x0100000B reference: OMX_TI_3ASKIP_IPIPE_WB_CFGTYPE */
+ OMX_TI_3aSkipIndexR_CFA, /**< 0x0100000C reference: OMX_TI_3ASKIP_IPIPE_CFA_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Gamma, /**< 0x0100000D reference: OMX_TI_3ASKIP_IPIPE_GAMMA_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Rgb2Rgb1, /**< 0x0100000E reference: OMX_TI_3ASKIP_IPIPE_RGBRGB_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Rgb2Rgb2, /**< 0x0100000F reference: OMX_TI_3ASKIP_IPIPE_RGBRGB_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Rgb2Yuv, /**< 0x01000010 reference: OMX_TI_3ASKIP_IPIPE_RGBYUV_CFGTYPE */
+ OMX_TI_3aSkipIndexR_GBCE, /**< 0x01000011 reference: OMX_TI_3ASKIP_IPIPE_GBCE_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Yuv2Yuv, /**< 0x01000012 reference: OMX_TI_3ASKIP_IPIPE_YUV444YUV422_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Ee, /**< 0x01000013 reference: OMX_TI_3ASKIP_IPIPE_EE_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Car, /**< 0x01000014 reference: OMX_TI_3ASKIP_IPIPE_CAR_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Lsc, /**< 0x01000015 reference: OMX_TI_3ASKIP_IPIPE_LSC_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Histogram, /**< 0x01000016 reference: OMX_TI_3ASKIP_IPIPE_HIST_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Bsc, /**< 0x01000017 reference: OMX_TI_3ASKIP_IPIPE_BSC_CFGTYPE */
+ OMX_TI_3aSkipIndexR_DpcOtf, /**< 0x01000018 reference: OMX_TI_3ASKIP_IPIPE_DPCOTF_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Cgs, /**< 0x01000019 reference: OMX_TI_3ASKIP_IPIPE_CGS_CFGTYPE */
+
+ OMX_TI_3aSkipIndexR_Dfs, /**< 0x0100001A reference: OMX_TI_3ASKIP_IPIPEIF_DFS_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Dpc1, /**< 0x0100001B reference: OMX_TI_3ASKIP_IPIPEIF_DPC_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Dpc2, /**< 0x0100001C reference: OMX_TI_3ASKIP_IPIPEIF_DPC_CFGTYPE */
+ OMX_TI_3aSkipIndexR_Dpcm, /**< 0x0100001D reference: OMX_TI_3ASKIP_IPIPEIF_DPCM_CFGTYPE */
+
+ OMX_TI_3aSkipIndexR_HLpf, /**< 0x0100001E reference: OMX_TI_3ASKIP_RSZ_LPF_CFGTYPE */
+ OMX_TI_3aSkipIndexR_VLpf, /**< 0x0100001F reference: OMX_TI_3ASKIP_RSZ_LPF_CFGTYPE */
+
+ OMX_TI_3aSkipIndexR_H3aCommonParams, /**< 0x01000020 reference: OMX_TI_3ASKIP_H3A_COMMON_CFGTYPE */
+ OMX_TI_3aSkipIndexR_CamControlExpGain, /**< 0x01000021 reference: OMX_TI_3ASKIP_CAM_CONTROL_EXPGAINTYPE */
+ OMX_TI_Index3aSkipRightMax, /**< 0x01000022 */
+ OMX_TI_Index3aSkip_MAX = 0x7FFFFFFF
+
+} OMX_TI_3ASKIP_TI_3ASKIPINDEXTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+
+
diff --git a/domx/omx_core/inc/OMX_TI_Image.h b/domx/omx_core/inc/OMX_TI_Image.h
new file mode 100755
index 0000000..88f7b26
--- /dev/null
+++ b/domx/omx_core/inc/OMX_TI_Image.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*
+ * @file:OMX_TI_Image.h
+ * This header defines the structures specific to the param or config
+ * indices of Openmax Image Component.
+ *
+ * @path domx/system/omx_core/inc
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 11-Oct-2010 KMotov x0106653@ti.com Initial Version
+ *================================================================*/
+
+#ifndef OMX_TI_IMAGE_H
+#define OMX_TI_IMAGE_H
+
+/**
+ * The OMX_TI_IMAGE_CODINGTYPE enumeration is used to define the
+ * extended image coding types.
+ */
+typedef enum OMX_TI_IMAGE_CODINGTYPE {
+ OMX_TI_IMAGE_CodingJPS = OMX_IMAGE_CodingVendorStartUnused + 1, /**< JPS format */
+ OMX_TI_IMAGE_CodingMPO, /**< MPO format */
+ OMX_TI_IMAGE_CodingJPEG_SOC,
+ OMX_TI_IMAGE_CodingJPEG_SOC_SPOOFED
+} OMX_TI_IMAGE_CODINGTYPE;
+
+#endif /* OMX_TI_IMAGE_H */
diff --git a/domx/omx_core/inc/OMX_TI_Index.h b/domx/omx_core/inc/OMX_TI_Index.h
new file mode 100644
index 0000000..234ed07
--- /dev/null
+++ b/domx/omx_core/inc/OMX_TI_Index.h
@@ -0,0 +1,302 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_ti_index.h
+ * This file contains the vendor(TI) specific indexes
+ *
+ * @path \WTSD_DucatiMMSW\ omx\omx_il_1_x\omx_core\
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ * ! Revision History
+ * ! ============================
+ * ! 20-Dec-2008 x0052661@ti.com, initial version
+ * ! 20-jun-2012 x0078587@ti.com
+ * ================================================================*/
+
+#ifndef _OMX_TI_INDEX_H_
+#define _OMX_TI_INDEX_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <OMX_Types.h>
+
+
+/*******************************************************************
+ * EXTERNAL REFERENCE NOTE: only use if not found in header file
+ *******************************************************************/
+/*---------- function prototypes ------------------- */
+/*---------- data declarations ------------------- */
+/*******************************************************************
+ * PUBLIC DECLARATIONS: defined here, used elsewhere
+ *******************************************************************/
+/*---------- function prototypes ------------------- */
+/*---------- data declarations ------------------- */
+
+typedef enum OMX_TI_INDEXTYPE {
+
+ OMX_IndexConfigAutoPauseAfterCapture = OMX_IndexAutoPauseAfterCapture,
+
+ /* Vendor specific area for storing indices */
+
+ /*Common Indices*/
+ OMX_TI_IndexConfigChannelName = ((OMX_INDEXTYPE)OMX_IndexVendorStartUnused + 1), /**< reference: OMX_CONFIG_CHANNELNAME */
+
+ OMX_TI_IndexParamJPEGUncompressedMode, /**< 0x7F000002 reference: OMX_JPEG_PARAM_UNCOMPRESSEDMODETYPE */
+ OMX_TI_IndexParamJPEGCompressedMode, /**< 0x7F000003 reference: OMX_JPEG_PARAM_COMPRESSEDMODETYPE */
+ OMX_TI_IndexParamDecodeSubregion, /**< 0x7F000004 reference: OMX_IMAGE_PARAM_DECODE_SUBREGION */
+
+ /* H264 Encoder Indices*/
+ OMX_TI_IndexParamVideoDataSyncMode, /**< 0x7F000005 Refer to OMX_VIDEO_PARAM_DATASYNCMODETYPE structure */
+ OMX_TI_IndexParamVideoNALUsettings, /**< 0x7F000006 use OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE to configure the type os NALU to send along with the Different Frame Types */
+ OMX_TI_IndexParamVideoMEBlockSize, /**< 0x7F000007 use OMX_VIDEO_PARAM_MEBLOCKSIZETYPE to specify the minimum block size used for motion estimation */
+ OMX_TI_IndexParamVideoIntraPredictionSettings, /**< 0x7F000008 use OMX_VIDEO_PARAM_INTRAPREDTYPE to configure the intra prediction modes used for different block sizes */
+ OMX_TI_IndexParamVideoEncoderPreset, /**< 0x7F000009 use OMX_VIDEO_PARAM_ENCODER_PRESETTYPE to select the encoding mode & rate control preset */
+ OMX_TI_IndexParamVideoFrameDataContentSettings, /**< 0x7F00000A use OMX_TI_VIDEO_PARAM_FRAMEDATACONTENTTYPE to configure the data content tpye */
+ OMX_TI_IndexParamVideoTransformBlockSize, /**< 0x7F00000B use OMX_VIDEO_PARAM_TRANSFORM_BLOCKSIZETYPE to specify the block size used for ttransformation */
+ OMX_TI_IndexParamVideoVUIsettings, /**< 0x7F00000C use OMX_VIDEO_PARAM_VUIINFOTYPE */
+ OMX_TI_IndexParamVideoAdvancedFMO, /**< 0x7F00000D reference: TODO: */
+ OMX_TI_IndexConfigVideoPixelInfo, /**< 0x7F00000E Use OMX_VIDEO_CONFIG_PIXELINFOTYPE structure to know the pixel aspectratio & pixel range */
+ OMX_TI_IndexConfigVideoMESearchRange, /**< 0x7F00000F use OMX_VIDEO_CONFIG_MESEARCHRANGETYPE to specify the ME Search settings */
+ OMX_TI_IndexConfigVideoQPSettings, /**< 0x7F000010 use OMX_TI_VIDEO_CONFIG_QPSETTINGS to specify the ME Search settings */
+ OMX_TI_IndexConfigSliceSettings, /**< 0x7F000011 use OMX_VIDEO_CONFIG_SLICECODINGTYPE to specify the ME Search settings */
+ OMX_TI_IndexParamAVCInterlaceSettings, /**< 0x7F000012 use OMX_TI_VIDEO_PARAM_AVCINTERLACECODING to specify the interlace settings for AVC encoder */
+ OMX_TI_IndexParamStereoInfo2004Settings, /**< 0x7F000013 use OMX_TI_VIDEO_AVCENC_STEREOINFO2004 to specify the 2004 SEI for AVC Encoder */
+ OMX_TI_IndexParamStereoFramePacking2010Settings, /**< 0x7F000014 use OMX_TI_VIDEO_AVCENC_FRAMEPACKINGINFO2010 to specify the 2010 SEI for AVC Encoder */
+
+ /* Camera Indices */
+ OMX_TI_IndexConfigSensorSelect, /**< 0x7F000015 reference: OMX_CONFIG_SENSORSELECTTYPE */
+ OMX_IndexConfigFlickerCancel, /**< 0x7F000016 reference: OMX_CONFIG_FLICKERCANCELTYPE */
+ OMX_IndexConfigSensorCal, /**< 0x7F000017 reference: OMX_CONFIG_SENSORCALTYPE */
+ OMX_IndexConfigISOSetting, /**< 0x7F000018 reference: OMX_CONFIG_ISOSETTINGTYPE */
+ OMX_TI_IndexConfigSceneMode, /**< 0x7F000019 reference: OMX_CONFIG_SCENEMODETYPE */
+ OMX_IndexConfigDigitalZoomSpeed, /**< 0x7F00001A reference: OMX_CONFIG_DIGITALZOOMSPEEDTYPE */
+ OMX_IndexConfigDigitalZoomTarget, /**< 0x7F00001B reference: OMX_CONFIG_DIGITALZOOMTARGETTYPE */
+ OMX_IndexConfigCommonScaleQuality, /**< 0x7F00001C reference: OMX_CONFIG_SCALEQUALITYTYPE */
+ OMX_IndexConfigCommonDigitalZoomQuality, /**< 0x7F00001D reference: OMX_CONFIG_SCALEQUALITYTYPE */
+ OMX_IndexConfigOpticalZoomSpeed, /**< 0x7F00001E reference: OMX_CONFIG_DIGITALZOOMSPEEDTYPE */
+ OMX_IndexConfigOpticalZoomTarget, /**< 0x7F00001F reference: OMX_CONFIG_DIGITALZOOMTARGETTYPE */
+ OMX_IndexConfigSmoothZoom, /**< 0x7F000020 reference: OMX_CONFIG_SMOOTHZOOMTYPE */
+ OMX_IndexConfigBlemish, /**< 0x7F000021 reference: OMX_CONFIG_BLEMISHTYPE */
+ OMX_IndexConfigExtCaptureMode, /**< 0x7F000022 reference: OMX_CONFIG_EXTCAPTUREMODETYPE */
+ OMX_IndexConfigExtPrepareCapturing, /**< 0x7F000023 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigExtCapturing, /**< 0x7F000024 reference: OMX_CONFIG_EXTCAPTURING */
+
+ OMX_IndexCameraOperatingMode, /**< 0x7F000025 reference: OMX_CONFIG_CAMOPERATINGMODETYPE */
+ OMX_IndexParamCameraOperatingMode = OMX_IndexCameraOperatingMode, /**< 0x7F000025 reference: OMX_CONFIG_CAMOPERATINGMODETYPE */
+
+ OMX_IndexConfigDigitalFlash, /**< 0x7F000026 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigPrivacyIndicator, /**< 0x7F000027 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigTorchMode, /**< 0x7F000028 reference: OMX_CONFIG_TORCHMODETYPE */
+ OMX_IndexConfigSlowSync, /**< 0x7F000029 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigExtFocusRegion, /**< 0x7F00002A reference: OMX_CONFIG_EXTFOCUSREGIONTYPE */
+ OMX_IndexConfigFocusAssist, /**< 0x7F00002B reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigImageFocusLock, /**< 0x7F00002C reference: OMX_IMAGE_CONFIG_LOCKTYPE */
+ OMX_IndexConfigImageWhiteBalanceLock, /**< 0x7F00002D reference: OMX_IMAGE_CONFIG_LOCKTYPE */
+ OMX_IndexConfigImageExposureLock, /**< 0x7F00002E reference: OMX_IMAGE_CONFIG_LOCKTYPE */
+ OMX_IndexConfigImageAllLock, /**< 0x7F00002F reference: OMX_IMAGE_CONFIG_LOCKTYPE */
+ OMX_IndexConfigImageDeNoiseLevel, /**< 0x7F000030 reference: OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE */
+ OMX_IndexConfigSharpeningLevel, /**< 0x7F000031 reference: OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE */
+ OMX_IndexConfigDeBlurringLevel, /**< 0x7F000032 reference: OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE */
+ OMX_IndexConfigChromaCorrection, /**< 0x7F000033 reference: OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE */
+ OMX_IndexConfigDeMosaicingLevel, /**< 0x7F000034 reference: OMX_IMAGE_CONFIG_PROCESSINGLEVELTYPE */
+ OMX_IndexConfigCommonWhiteBalanceGain, /**< 0x7F000035 reference: OMX_CONFIG_WHITEBALGAINTYPE */
+ OMX_IndexConfigCommonRGB2RGB, /**< 0x7F000036 reference: OMX_CONFIG_COLORCONVERSIONTYPE_II */
+ OMX_IndexConfigCommonRGB2YUV, /**< 0x7F000037 reference: OMX_CONFIG_COLORCONVERSIONTYPE_II */
+ OMX_IndexConfigCommonYUV2RGB, /**< 0x7F000038 reference: OMX_CONFIG_EXT_COLORCONVERSIONTYPE */
+ OMX_IndexConfigCommonGammaTable, /**< 0x7F000039 reference: OMX_CONFIG_GAMMATABLETYPE */
+ OMX_IndexConfigImageFaceDetection, /**< 0x7F00003A reference: OMX_CONFIG_OBJDETECTIONTYPE */
+ OMX_IndexConfigImageBarcodeDetection, /**< 0x7F00003B reference: OMX_CONFIG_OBJDETECTIONTYPE */
+ OMX_IndexConfigImageSmileDetection, /**< 0x7F00003C reference: OMX_CONFIG_OBJDETECTIONTYPE */
+ OMX_IndexConfigImageBlinkDetection, /**< 0x7F00003D reference: OMX_CONFIG_OBJDETECTIONTYPE */
+ OMX_IndexConfigImageFrontObjectDetection, /**< 0x7F00003E reference: OMX_CONFIG_OBJDETECTIONTYPE */
+ OMX_IndexConfigHistogramMeasurement, /**< 0x7F00003F reference: OMX_CONFIG_HISTOGRAMTYPE */
+ OMX_IndexConfigDistanceMeasurement, /**< 0x7F000040 reference: OMX_CONFIG_DISTANCETYPE */
+ OMX_IndexConfigSnapshotToPreview, /**< 0x7F000041 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigJpegHeaderType, /**< 0x7F000042 reference: OMX_CONFIG_JPEGHEEADERTYPE */
+ OMX_IndexParamJpegMaxSize, /**< 0x7F000043 reference: OMX_IMAGE_JPEGMAXSIZE */
+ OMX_IndexConfigRestartMarker, /**< 0x7F000044 reference: OMX_CONFIG_RSTMARKER */
+ OMX_IndexParamImageStampOverlay, /**< 0x7F000045 reference: OMX_PARAM_IMAGESTAMPOVERLAYTYPE */
+ OMX_IndexParamThumbnail, /**< 0x7F000046 reference: OMX_PARAM_THUMBNAILTYPE */
+ OMX_IndexConfigImageStabilization, /**< 0x7F000047 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigMotionTriggeredImageStabilisation, /**< 0x7F000048 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigRedEyeRemoval, /**< 0x7F000049 reference: OMX_CONFIG_REDEYEREMOVALTYPE */
+ OMX_IndexParamHighISONoiseFiler, /**< 0x7F00004A reference: OMX_PARAM_ISONOISEFILTERTYPE */
+ OMX_IndexParamLensDistortionCorrection, /**< 0x7F00004B reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexParamLocalBrightnessAndContrast, /**< 0x7F00004C reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexConfigChromaticAberrationCorrection, /**< 0x7F00004D reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexParamVideoCaptureYUVRange, /**< 0x7F00004E reference: OMX_PARAM_VIDEOYUVRANGETYPE */
+ OMX_IndexConfigFocusRegion, /**< 0x7F00004F reference: OMX_CONFIG_EXTFOCUSREGIONTYPE */
+ OMX_IndexConfigImageMotionEstimation, /**< 0x7F000050 reference: OMX_CONFIG_OBJDETECTIONTYPE */
+ OMX_IndexParamProcessingOrder, /**< 0x7F000051 reference: OMX_CONFIGPROCESSINGORDERTYPE */
+ OMX_IndexParamFrameStabilisation, /**< 0x7F000052 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_IndexParamVideoNoiseFilter, /**< 0x7F000053 reference: OMX_PARAM_VIDEONOISEFILTERTYPE */
+ OMX_IndexConfigOtherExtraDataControl, /**< 0x7F000054 reference: OMX_CONFIG_EXTRADATATYPE */
+ OMX_TI_IndexParamBufferPreAnnouncement, /**< 0x7F000055 reference: OMX_TI_PARAM_BUFFERPREANNOUNCE */
+ OMX_TI_IndexConfigBufferRefCountNotification, /**< 0x7F000056 reference: OMX_TI_CONFIG_BUFFERREFCOUNTNOTIFYTYPE */
+ OMX_TI_IndexParam2DBufferAllocDimension, /**< 0x7F000057 reference: OMX_TI_PARAM_2DBUFERALLOCDIMENSION */
+ OMX_TI_IndexConfigWhiteBalanceManualColorTemp, /**< 0x7F000058 reference: OMX_CONFIG_WHITEBALANCECOLORTEMPTPYPE */
+ OMX_TI_IndexConfigFocusSpotWeighting, /**< 0x7F000059 reference: OMX_CONFIG_FOCUSSPOTWEIGHTINGTYPE */
+ OMX_TI_IndexParamSensorOverClockMode, /**< 0x7F00005A reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexParamDccUriInfo, /**< 0x7F00005B reference: OMX_PARAM_DCCURIINFO */
+ OMX_TI_IndexParamDccUriBuffer, /**< 0x7F00005C reference: OMX_PARAM_SHAREDBUFFER */
+
+ /* MPEG4 and H264 encoder specific Indices */
+ OMX_TI_IndexParamVideoIntraRefresh, /**< 0x7F00005D reference: OMX_TI_VIDEO_PARAM_INTRAREFRESHTYPE */
+
+ /* camera indices continues*/
+ OMX_TI_IndexConfigShutterCallback, /**< 0x7F00005E reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexParamVarFrameRate, /**< 0x7F00005F reference: OMX_PARAM_VARFARAMERATETYPE */
+ OMX_TI_IndexConfigAutoConvergence, /**< 0x7F000060 reference: OMX_TI_CONFIG_CONVERGENCETYPE */
+ OMX_TI_IndexConfigRightExposureValue, /**< 0x7F000061 reference: OMX_TI_CONFIG_EXPOSUREVALUERIGHTTYPE */
+ OMX_TI_IndexConfigExifTags, /**< 0x7F000062 reference: OMX_TI_CONFIG_SHAREDBUFFER */
+ OMX_TI_IndexParamVideoPayloadHeaderFlag, /**< 0x7F000063 reference: OMX_TI_PARAM_PAYLOADHEADERFLAG */
+ OMX_TI_IndexParamVideoIvfMode, /**< 0x7F000064 reference: OMX_TI_PARAM_IVFFLAG */
+ OMX_TI_IndexConfigCamCapabilities, /**< 0x7F000065 reference: OMX_TI_CONFIG_SHAREDBUFFER */
+ OMX_TI_IndexConfigFacePriority3a, /**< 0x7F000066 reference: OMX_TI_CONFIG_3A_FACE_PRIORITY */
+ OMX_TI_IndexConfigRegionPriority3a, /**< 0x7F000067 reference: OMX_TI_CONFIG_3A_REGION_PRIORITY */
+ OMX_TI_IndexParamAutoConvergence, /**< 0x7F000068 reference: OMX_TI_PARAM_AUTOCONVERGENCETYPE */
+ OMX_TI_IndexConfigAAAskipBuffer, /**< 0x7F000069 reference: OMX_TI_CONFIG_SHAREDBUFFER */
+ OMX_TI_IndexParamStereoFrmLayout, /**< 0x7F00006A reference: OMX_TI_FRAMELAYOUTTYPE */
+ OMX_TI_IndexConfigLocalBrightnessContrastEnhance, /**< 0x7F00006B reference: OMX_TI_CONFIG_LOCAL_AND_GLOBAL_BRIGHTNESSCONTRASTTYPE */
+ OMX_TI_IndexConfigGlobalBrightnessContrastEnhance, /**< 0x7F00006C reference: OMX_TI_CONFIG_LOCAL_AND_GLOBAL_BRIGHTNESSCONTRASTTYPE */
+ OMX_TI_IndexConfigVarFrmRange, /**< 0x7F00006D reference: OMX_TI_CONFIG_VARFRMRANGETYPE */
+
+ /*H264 Encoder specific Indices*/
+ OMX_TI_IndexParamAVCHRDBufferSizeSetting, /**< 0x7F00006E reference: OMX_TI_VIDEO_PARAM_AVCHRDBUFFERSETTING */
+ OMX_TI_IndexConfigAVCHRDBufferSizeSetting, /**< 0x7F00006F reference: OMX_TI_VIDEO_CONFIG_AVCHRDBUFFERSETTING */
+ OMX_TI_IndexConfigFocusDistance, /**< 0x7F000070 reference: OMX_TI_CONFIG_FOCUSDISTANCETYPE */
+ OMX_TI_IndexUseNativeBuffers, /**< 0x7F000071 reference: OMX_TI_ParamUseNativeBuffer(used only in proxy) */
+ OMX_TI_IndexConfigSinglePreviewMode, /**< 0x7F000072 reference: */
+ OMX_TI_IndexConfigFreezeAWB, /**< 0x7F000073 reference: */
+ OMX_TI_IndexConfigAWBMinDelayTime, /**< 0x7F000074 reference: */
+ OMX_TI_IndexConfigDetectedGesturesInfo, /**< 0x7F000075 reference: */
+ OMX_TI_IndexConfigAutoExpMinDelayTime, /**< 0x7F000076 reference: */
+ OMX_TI_IndexConfigFreezeAutoExp, /**< 0x7F000077 reference: */
+ OMX_TI_IndexConfigAutoExpThreshold, /**< 0x7F000078 reference: */
+ OMX_TI_IndexParamZslHistoryLen, /**< 0x7F000079 reference: OMX_TI_PARAM_ZSLHISTORYLENTYPE */
+ OMX_TI_IndexConfigZslDelay, /**< 0x7F00007A reference: OMX_TI_CONFIG_ZSLDELAYTYPE */
+ OMX_TI_IndexConfigMechanicalMisalignment, /**< 0x7F00007B reference: OMX_TI_CONFIG_MM */
+ OMX_TI_IndexParamAffineTransform, /**< 0x7F00007C reference: OMX_TI_CONFIG_AFFINE */
+ OMX_TI_IndexParamUseEnhancedPortReconfig, /**< 0x7F00007D reference: OMX_TI_IndexParamUseEnhancedPortReconfig */
+ OMX_TI_IndexEncoderStoreMetadatInBuffers, /**< 0x7F00007E reference: */
+ OMX_TI_IndexParamMetaDataBufferInfo, /**< 0x7F00007F reference: OMX_TI_PARAM_METADATABUFFERINFO */
+ OMX_TI_IndexConfigZslFrameSelectMethod, /**< 0x7F000080 reference: OMX_TI_CONFIG_ZSLFRAMESELECTMETHODTYPE */
+ OMX_TI_IndexAndroidNativeBufferUsage, /**< 0x7F000081 reference: OMX_TI_IndexAndroidNativeBufferUsage */
+ OMX_TI_IndexConfigAlgoAreas, /**< 0x7F000082 reference: OMX_PARAM_SHAREDBUFFER (pSharedBuff is OMX_ALGOAREASTYPE) */
+
+ OMX_TI_IndexParamSensorDetect, /**< 0x7F000083 reference: OMX_TI_PARAM_SENSORDETECT */
+ OMX_TI_IndexParamVideoSvc, /**< 0x7F000084 reference: OMX_TI_VIDEO_PARAM_SVCTYPE */
+ OMX_TI_IndexConfigVideoSvcLayerDetails, /**< 0x7F000085 reference: OMX_TI_VIDEO_CONFIG_SVCLAYERDETAILS */
+ OMX_TI_IndexConfigVideoSvcTargetLayer, /**< 0x7F000086 reference: OMX_TI_VIDEO_CONFIG_SVCTARGETLAYER */
+ OMX_TI_IndexConfigZslFremeSelectPrio, /**< 0x7F000087 reference: OMX_TI_CONFIG_ZSLFRAMESELECTPRIOTYPE */
+
+ OMX_TI_IndexUseBufferDescriptor, /**< 0x7F000088 reference: OMX_TI_PARAM_USEBUFFERDESCRIPTOR */
+ OMX_TI_IndexParamVtcSlice, /**< 0x7F000089 reference: OMX_TI_PARAM_VTCSLICE */
+
+ OMX_TI_IndexConfigAutofocusEnable, /**< 0x7F00008A reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexParamAVCEnableLTRMode, /**< 0x7F00008B reference: OMX_TI_VIDEO_PARAM_AVC_LTRP*/
+ OMX_TI_IndexConfigAVCEnableNextLTR, /**< 0x7F00008C reference: OMX_TI_VIDEO_CONFIG_AVC_LTRP*/
+ OMX_TI_IndexConfigAVCUpdateLTRInterval, /**< 0x7F00008D reference: OMX_TI_VIDEO_CONFIG_AVC_LTRP_INTERVAL*/
+ OMX_TI_IndexParamTimeStampInDecodeOrder, /**< 0x7F00008E reference: OMX_TI_PARAM_TIMESTAMP_IN_DECODE_ORDER */
+ OMX_TI_IndexParamVideoAutoFrameRateUpdate, /**< 0x7F00008F reference: OMX_TI_VIDEO_PARAM_AUTO_FRAMERATE_UPDATE */
+ OMX_TI_IndexParamBayerCompression, /**< 0x7F000090 reference: OMX_TI_PARAM_BAYERCOMPRESSION */
+ OMX_TI_IndexParamSkipGreyOutputFrames, /**< 0x7F000091 reference: OMX_TI_PARAM_SKIP_GREY_OUTPUT_FRAMES */
+ OMX_TI_IndexConfigMipiCounters, /**< 0x7F000092 reference: OMX_CONFIG_MIPICOUNTERS */
+ OMX_TI_IndexConfigCsiTimingRW, /**< 0x7F000093 reference: OMX_CONFIG_CSITIMINGRW */
+ OMX_TI_IndexConfigCSIcomplexIO, /**< 0x7F000094 reference: OMX_CONFIG_CSICMPXIO */
+ OMX_TI_IndexConfigAFScore, /**< 0x7F000095 reference: OMX_CONFIG_AUTOFOCUSSCORE */
+ OMX_TI_IndexConfigColorBars, /**< 0x7F000096 reference: OMX_CONFIG_COLORBARS */
+ OMX_TI_IndexConfigOTPEeprom, /**< 0x7F000097 reference: OMX_CONFIG_OTPEEPROM */
+ OMX_TI_IndexConfigISPInfo, /**< 0x7F000098 reference: OMX_CONFIG_ISPINFO */
+ OMX_TI_IndexConfigPicSizeControlInfo, /**< 0x7F000099 reference: OMX_TI_VIDEO_CONFIG_PICSIZECONTROLINFO */
+ OMX_TI_IndexConfigPortTapPoint, /**< 0x7F00009A reference: OMX_TI_CONFIG_PORTTAPPOINTTYPE */
+ OMX_TI_IndexConfigDisableNSF2, /**< 0x7F00009B reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexConfigDisableSharpening, /**< 0x7F00009C reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexConfigExternalGamma, /**< 0x7F00009D reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexConfigDisableThreeLinColorMap, /**< 0x7F00009E reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexParamComponentBufferAllocation, /**< 0x7F00009F reference: OMX_TI_PARAM_COMPONENTBUFALLOCTYPE */
+ OMX_TI_IndexConfigEnqueueShotConfigs, /**< 0x7F0000A0 reference: OMX_TI_CONFIG_ENQUEUESHOTCONFIGS */
+ OMX_TI_IndexConfigQueryAvailableShots, /**< 0x7F0000A1 reference: OMX_TI_CONFIG_QUERYAVAILABLESHOTS */
+ OMX_TI_IndexConfigDisableNSF1, /**< 0x7F0000A2 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexConfigDisableGIC, /**< 0x7F0000A3 reference: OMX_CONFIG_BOOLEANTYPE */
+ OMX_TI_IndexConfigVectShotStopMethod, /**< 0x7F0000A4 reference: OMX_TI_CONFIG_VECTSHOTSTOPMETHODTYPE */
+ OMX_TI_IndexParamComponentExpectedSuspensionState, /**< 0x7F0000A5 reference: OMX_PARAM_SUSPENSIONTYPE */
+ OMX_TI_IndexComponentHandle, /**< 0x7F0000A6 reference: OMX_TI_COMPONENT_HANDLE */
+ OMX_TI_IndexParamVideoEnableMetadata, /**< 0x7F0000A7 reference: OMX_TI_PARAM_DECMETADATA */
+ OMX_TI_IndexParamVideoDeblockingQP, /**< 0x7F0000A8 reference: OMX_TI_VIDEO_PARAM_DEBLOCKINGQP */
+ OMX_TI_IndexParamAVCTemporalScalabilitySetting, /**< 0x7F0000A9 reference: OMX_TI_VIDEO_PARAM_TEMPORAL_SCALABILITY*/
+ OMX_TI_IndexParamImagePyramid, /**< 0x7F0000AA reference: OMX_TI_PARAM_IMAGEPYRAMIDTYPE */
+
+ /*VC1 Encoder specific Indices*/
+ OMX_TI_IndexParamVC1InterlaceSettings, /**< 0x7F000AB reference:OMX_TI_VIDEO_PARAM_VC1INTERLACECODING*/
+ OMX_IndexConfigVideoVC1IntraPeriod, /**< 0x7F000AC reference: OMX_TI_VIDEO_CONFIG_VC1INTRAPERIOD */
+ OMX_TI_IndexParamVC1HRDBufferSizeSetting, /**< 0x7F000AD reference: OMX_TI_VIDEO_PARAM_VC1HRDBUFFERSETTING */
+ OMX_TI_IndexConfigVC1HRDBufferSizeSetting, /**< 0x7F000AE reference: OMX_TI_VIDEO_CONFIG_VC1HRDBUFFERSETTING */
+ OMX_TI_IndexParamVideoStdVC1, /**< 0x7F000AF reference: OMX_TI_VIDEO_VC1_STD_PARAMS */
+ OMX_TI_IndexParamVideoGetConfigData, /**< 0x7F000B0 reference: OMX_TI_VIDEO_GETCONFIGPARAMS */
+ OMX_IndexParamVC1BitStreamFormatSupported, /**< 0x7F000B1 reference: OMX_VC1BITSTREAMFORMATTYPE */
+ OMX_IndexParamVC1BitStreamFormat, /**< 0x7F000B2 reference: OMX_VC1BITSTREAMFORMATTYPE */
+ OMX_IndexParamVC1BitStreamFormatSelect, /**< 0x7F000B3 reference: OMX_VC1BITSTREAMFORMATTYPE */
+
+ /*H264 Encoder specific Indices*/
+ OMX_TI_IndexConfigVideoIntraRefresh, /**< 0x7F0000B4 reference: OMX_TI_VIDEO_PARAM_INTRAREFRESHTYPE */
+
+ OMX_TI_IndexConfigGammaTable, /**< 0x7F0000B5 reference: OMX_TI_CONFIG_SHAREDBUFFER */
+ OMX_TI_IndexConfigDynamicCameraDescriptor, /**< 0x7F0000B6 reference: OMX_TI_CONFIG_SHAREDBUFFER */
+
+ OMX_TI_IndexConfigStreamInterlaceFormats = ((OMX_INDEXTYPE)OMX_IndexVendorStartUnused + 0x100) /**< 0x7F000100 reference: OMX_STREAMINTERLACEFORMATTYPE */
+
+} OMX_TI_INDEXTYPE;
+
+
+
+/*******************************************************************
+ * PRIVATE DECLARATIONS: defined here, used only here
+ *******************************************************************/
+/*---------- data declarations ------------------- */
+/*---------- function prototypes ------------------- */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* _OMX_TI_INDEX_H_ */
+
diff --git a/domx/omx_core/inc/OMX_TI_Video.h b/domx/omx_core/inc/OMX_TI_Video.h
new file mode 100644
index 0000000..c97e234
--- /dev/null
+++ b/domx/omx_core/inc/OMX_TI_Video.h
@@ -0,0 +1,2695 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/* -------------------------------------------------------------------------- */
+/*
+ * @file:Omx_ti_video.h
+ * This header defines the structures specific to the param or config indices of Openmax Video Component.
+ *
+ * @path:
+ * \WTSD_DucatiMMSW\ omx\omx_il_1_x\omx_core\
+
+ * -------------------------------------------------------------------------- */
+
+/* =========================================================================
+ * !
+ * ! Revision History
+ * ! =====================================================================
+ * ! 24-Dec-2008 Navneet navneet@ti.com Initial Version
+ * ! 14-Jul-2009 Radha Purnima radhapurnima@ti.com
+ * ! 25-Aug-2009 Radha Purnima radhapurnima@ti.com
+ * ! 16-May-2009 Shivaraj Shetty shettyshivaraj@ti.com
+ * ! 20-jun-2012 x0078587@ti.com
+ * =========================================================================*/
+
+
+#ifndef OMX_TI_VIDEO_H
+#define OMX_TI_VIDEO_H
+#define H264ENC_MAXNUMSLCGPS 2
+#define OMXH264E_MAX_SLICE_SUPPORTED 64
+#define H264SVC_MAX_NUM_LAYER 9
+#include <OMX_Core.h>
+
+/**
+ * @brief mode selection for the data that is given to the Codec
+ */
+
+typedef enum OMX_VIDEO_DATASYNCMODETYPE {
+ OMX_Video_FixedLength, //!< Interms of multiples of 4K
+ OMX_Video_SliceMode, //!< Slice mode
+ OMX_Video_NumMBRows, //!< Number of rows, each row is 16 lines of video
+ OMX_Video_EntireFrame //!< Processing of entire frame data
+} OMX_VIDEO_DATASYNCMODETYPE;
+
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_DATAMODE :to configure how the input and output data is fed to the Codec
+ @param nPortIndex to specify the index of the port
+ @param eDataMode to specify the data mode
+ @sa OMX_VIDEO_DATASYNCMODETYPE
+ @param nNumDataUnits to specify the number of data units (where units are of type defined by eDataMode)
+ */
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_DATASYNCMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_DATASYNCMODETYPE eDataMode;
+ OMX_U32 nNumDataUnits;
+} OMX_VIDEO_PARAM_DATASYNCMODETYPE;
+
+/**
+ * @brief Aspect Ratio type selection for the encoded bit stream
+ */
+typedef enum OMX_VIDEO_ASPECTRATIOTYPE {
+ OMX_Video_AR_Unspecified, //!< Unspecified aspect ratio
+ OMX_Video_AR_Square, //!< 1:1 (square) aspect ratio
+ OMX_Video_AR_12_11, //!< 12:11 aspect ratio
+ OMX_Video_AR_10_11, //!< 10:11 aspect ratio
+ OMX_Video_AR_16_11, //!< 16:11 aspect ratio
+ OMX_Video_AR_40_33, //!< 40:33 aspect ratio
+ OMX_Video_AR_24_11, //!< 24:11 aspect ratio
+ OMX_Video_AR_20_11, //!< 20:11 aspect ratio
+ OMX_Video_AR_32_11, //!< 32:11 aspect ratio
+ OMX_Video_AR_80_33, //!< 80:33 aspect ratio
+ OMX_Video_AR_18_11, //!< 18:11 aspect ratio
+ OMX_Video_AR_15_15, //!< 15:15 aspect ratio
+ OMX_Video_AR_64_33, //!< 64:33 aspect ratio
+ OMX_Video_AR_160_99, //!< 160:99 aspect ratio
+ OMX_Video_AR_4_3, //!< 4:3 aspect ratio
+ OMX_Video_AR_3_2, //!< 3:2 aspect ratio
+ OMX_Video_AR_2_1, //!< 2:1 aspect ratio
+ OMX_Video_AR_Extended = 255, //!< Extended aspect ratio
+ OMX_Video_AR_Extended_MAX = 0X7FFFFFFF
+}OMX_VIDEO_ASPECTRATIOTYPE;
+
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_VUI_SELECT :to select the VUI Settings
+ @param bAspectRatioPresent flag to indicate the insertion of aspect ratio information in VUI part of bit-stream
+ @param ePixelAspectRatio to specify the Aspect Ratio
+ @param bFullRange to indicate whether pixel value range is specified as full range or not (0 to 255)
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_VUIINFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bAspectRatioPresent;
+ OMX_VIDEO_ASPECTRATIOTYPE ePixelAspectRatio;
+ OMX_BOOL bFullRange;
+}OMX_VIDEO_PARAM_VUIINFOTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_CONFIG_PIXELINFOTYPE :to specify the information related to the input pixel data (aspect ratio & range) to the Codec
+ so that codec can incorporate this info in the coded bit stream
+ @param nWidth to specify the Aspect ratio: width of the pixel
+ @param nHeight to specify the Aspect ratio: height of the pixel
+ */
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_CONFIG_PIXELINFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nWidth;
+ OMX_U32 nHeight;
+} OMX_VIDEO_CONFIG_PIXELINFOTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE : to configure what NALU need to send along the frames of different types (Intra,IDR...etc)
+ @param nStartofSequence to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the Start of sequence frame
+ @param nEndofSequence to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the End of sequence frame
+ @param nIDR to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the IDR frame
+ @param nIntraPicture to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the Intra frame
+ @param nNonIntraPicture to to configure the different NALU (specified via enabling/disabling (1/0) the bit positions) that need to send along with the Non Intra frame
+
+Bit Position: 13| 12| 11| 10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0
+NALU TYPE: SPS_VUI|FILLER|EOSTREAM|EOSEQ|AUD|PPS|SPS|SEI|IDR_SLICE|SLICE_DP_C|SLICE_DP_B|SLICE_DP_A|SLICE|UNSPECIFIED \n
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nStartofSequence;
+ OMX_U32 nEndofSequence;
+ OMX_U32 nIDR;
+ OMX_U32 nIntraPicture;
+ OMX_U32 nNonIntraPicture;
+}OMX_VIDEO_PARAM_AVCNALUCONTROLTYPE;
+
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_CONFIG_MESEARCHRANGETYPE : to configure Motion Estimation Parameters
+ @param eMVAccuracy to specify the Motion Vector Accuracy
+ @sa OMX_VIDEO_MOTIONVECTORTYPE
+ @param sHorSearchRangeP to Specify the Horizontal Search range for P Frame
+ @param sVerSearchRangeP to Specify the Vertical Search range for P Frame
+ @param sHorSearchRangeB to Specify the Horizontal Search range for B Frame
+ @param sVerSearchRangeB to Specify the Vertical Search range for B Frame
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_CONFIG_MESEARCHRANGETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_MOTIONVECTORTYPE eMVAccuracy;
+ OMX_U32 nHorSearchRangeP;
+ OMX_U32 nVerSearchRangeP;
+ OMX_U32 nHorSearchRangeB;
+ OMX_U32 nVerSearchRangeB;
+}OMX_VIDEO_CONFIG_MESEARCHRANGETYPE;
+
+/**
+ * @brief Block size specification
+ */
+typedef enum OMX_VIDEO_BLOCKSIZETYPE {
+ OMX_Video_Block_Size_16x16=0,
+ OMX_Video_Block_Size_8x8,
+ OMX_Video_Block_Size_8x4,
+ OMX_Video_Block_Size_4x8,
+ OMX_Video_Block_Size_4x4,
+ OMX_Video_Block_Size_MAX = 0X7FFFFFFF
+}OMX_VIDEO_BLOCKSIZETYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_PARAM_MEBLOCKSIZETYPE : to configure the Min Motion Estimation block size for P and B frames
+ @param eMinBlockSizeP to specify the Min Block size used for Motion Estimation incase of P Frames
+ @sa OMX_VIDEO_BLOCKSIZETYPE
+ @param eMinBlockSizeB to specify the Min Block size used for Motion Estimation incase of B Frames
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_MEBLOCKSIZETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_BLOCKSIZETYPE eMinBlockSizeP;
+ OMX_VIDEO_BLOCKSIZETYPE eMinBlockSizeB;
+}OMX_VIDEO_PARAM_MEBLOCKSIZETYPE;
+
+/**
+ * @brief to select the chroma component used for Intra Prediction
+ */
+typedef enum OMX_VIDEO_CHROMACOMPONENTTYPE {
+ OMX_Video_Chroma_Component_Cr_Only=0, //!< consider only Cr chroma component for Intra prediction
+ OMX_Video_Chroma_Component_Cb_Cr_Both, //!< consider both (Cb & Cr) chroma components for Intra prediction
+ OMX_Video_Chroma_Component_MAX = 0X7FFFFFFF
+}OMX_VIDEO_CHROMACOMPONENTTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_PARAM_INTRAPREDTYPE : to configure the Modes for the different block sizes during Intra Prediction
+ @param nLumaIntra4x4Enable to configure the Modes for 4x4 block size during luma intra prediction: bit position specifies the modes that are enabled/disabled
+ HOR_UP|VERT_LEFT|HOR_DOWN|VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|DC|HOR|VER
+ @param nLumaIntra8x8Enable to configure the Modes for 4x4 block size during luma intra prediction
+ HOR_UP|VERT_LEFT|HOR_DOWN|VERT_RIGHT|DIAG_DOWN_RIGHT|DIAG_DOWN_LEFT|DC|HOR|VER
+ @param nLumaIntra16x16Enable to configure the Modes for 4x4 block size during luma intra prediction
+ PLANE|DC|HOR|VER
+ @param nChromaIntra8x8Enable to configure the Modes for 4x4 block size during luma intra prediction
+ PLANE|DC|HOR|VER
+ @param eChromaComponentEnable to select the chroma components used for the intra prediction
+ @sa OMX_VIDEO_CHROMACOMPONENTTYPE
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_INTRAPREDTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nLumaIntra4x4Enable;
+ OMX_U32 nLumaIntra8x8Enable;
+ OMX_U32 nLumaIntra16x16Enable;
+ OMX_U32 nChromaIntra8x8Enable;
+ OMX_VIDEO_CHROMACOMPONENTTYPE eChromaComponentEnable;
+}OMX_VIDEO_PARAM_INTRAPREDTYPE;
+
+
+/**
+ * @brief Encoding Mode Preset
+ */
+typedef enum OMX_VIDEO_ENCODING_MODE_PRESETTYPE {
+ OMX_Video_Enc_Default=0, //!< for all the params default values are taken
+ OMX_Video_Enc_High_Quality, //!< todo: mention the parameters that takes specific values depending on this selection
+ OMX_Video_Enc_User_Defined,
+ OMX_Video_Enc_High_Speed_Med_Quality,
+ OMX_Video_Enc_Med_Speed_Med_Quality,
+ OMX_Video_Enc_Med_Speed_High_Quality,
+ OMX_Video_Enc_High_Speed,
+ OMX_Video_Enc_Preset_MAX = 0X7FFFFFFF
+}OMX_VIDEO_ENCODING_MODE_PRESETTYPE;
+
+/**
+ * @brief Rate Control Preset
+ */
+typedef enum OMX_VIDEO_RATECONTROL_PRESETTYPE {
+ OMX_Video_RC_Low_Delay, //!<todo: mention the parameters that takes specific values depending on this selection
+ OMX_Video_RC_Storage,
+ OMX_Video_RC_Twopass,
+ OMX_Video_RC_None,
+ OMX_Video_RC_User_Defined,
+ OMX_Video_RC_MAX = 0X7FFFFFFF
+}OMX_VIDEO_RATECONTROL_PRESETTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_PARAM_ENCODER_PRESETTYPE : to select the preset for Encoding Mode & Rate Control
+ @param eEncodingModePreset to specify Encoding Mode Preset
+ @sa OMX_VIDEO_ENCODING_MODE_PRESETTYPE
+ @param eRateControlPreset to specify Rate Control Preset
+ @sa OMX_VIDEO_RATECONTROL_PRESETTYPE
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_ENCODER_PRESETTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_ENCODING_MODE_PRESETTYPE eEncodingModePreset;
+ OMX_VIDEO_RATECONTROL_PRESETTYPE eRateControlPreset;
+}OMX_VIDEO_PARAM_ENCODER_PRESETTYPE;
+
+
+/**
+ * @brief input content type
+ */
+typedef enum OMX_TI_VIDEO_FRAMECONTENTTYPE {
+ OMX_TI_Video_Progressive = 0, //!<Progressive frame
+ OMX_TI_Video_Interlace_BothFieldsTogether = 1, //!<Interlaced frame
+ OMX_TI_Video_Interlace_OneField = 2,
+ OMX_TI_Video_AVC_2004_StereoInfoType = 3,
+ OMX_TI_Video_AVC_2010_StereoFramePackingType = 4,
+ OMX_TI_Video_FrameContentType_MAX = 0x7FFFFFFF
+}OMX_TI_VIDEO_FRAMECONTENTTYPE;
+
+/**
+ * @brief Specifies the type of interlace content
+ */
+typedef enum OMX_TI_VIDEO_AVC_INTERLACE_CODINGTYPE {
+ OMX_TI_Video_Interlace_PICAFF = 0, //!< PicAFF type of interlace coding
+ OMX_TI_Video_Interlace_MBAFF, //!< MBAFF type of interlace coding
+ OMX_TI_Video_Interlace_Fieldonly, //!< Field only coding
+ OMX_TI_Video_Interlace_Fieldonly_MRF=OMX_TI_Video_Interlace_Fieldonly,
+ OMX_TI_Video_Interlace_Fieldonly_ARF,
+ OMX_TI_Video_Interlace_Fieldonly_SPF, //!< Field only coding where codec decides the partiy of the field to be used based upon content
+ OMX_Video_Interlace_MAX = 0x7FFFFFFF
+}OMX_TI_VIDEO_AVC_INTERLACE_CODINGTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_FRAMEDATACONTENTTYPE : to configure the data content
+ @param eContentType to specify Content type
+ @sa OMX_VIDEO_FRAMECONTENTTYPE
+*/
+/* ==========================================================================*/
+typedef struct OMX_TI_VIDEO_PARAM_FRAMEDATACONTENTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_FRAMECONTENTTYPE eContentType;
+}OMX_TI_VIDEO_PARAM_FRAMEDATACONTENTTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_AVCINTERLACECODING : to configure the interlace encoding related settings
+ @param eInterlaceCodingType to specify the settings of interlace content
+ @sa OMX_VIDEO_INTERLACE_CODINGTYPE
+ @param bTopFieldFirst to specify the first field sent is top or bottom
+ @param bBottomFieldIntra to specify codec that encode bottomfield also as intra or not
+*/
+/* ==========================================================================*/
+typedef struct OMX_TI_VIDEO_PARAM_AVCINTERLACECODING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_AVC_INTERLACE_CODINGTYPE eInterlaceCodingType;
+ OMX_BOOL bTopFieldFirst;
+ OMX_BOOL bBottomFieldIntra;
+}OMX_TI_VIDEO_PARAM_AVCINTERLACECODING;
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_AVCENC_STEREOINFO2004 : to configure the 2004 related stereo information type
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_TI_VIDEO_PARAM_AVCENC_STEREOINFO2004 {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL btopFieldIsLeftViewFlag;
+ OMX_BOOL bViewSelfContainedFlag;
+} OMX_TI_VIDEO_AVCENC_STEREOINFO2004;
+
+typedef enum OMX_TI_VIDEO_AVCSTEREO_FRAMEPACKTYPE {
+ OMX_TI_Video_FRAMEPACK_CHECKERBOARD = 0,
+ OMX_TI_Video_FRAMEPACK_COLUMN_INTERLEAVING = 1,
+ OMX_TI_Video_FRAMEPACK_ROW_INTERLEAVING = 2,
+ OMX_TI_Video_FRAMEPACK_SIDE_BY_SIDE = 3,
+ OMX_TI_Video_FRAMEPACK_TOP_BOTTOM = 4,
+ OMX_TI_Video_FRAMEPACK_TYPE_DEFAULT = OMX_TI_Video_FRAMEPACK_SIDE_BY_SIDE,
+ OMX_TI_Video_FRAMEPACK_TYPE_MAX = 0x7FFFFFFF
+} OMX_TI_VIDEO_AVCSTEREO_FRAMEPACKTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_AVCENC_FRAMEPACKINGINFO2010 : to configure the 2010 related stereo information type
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_TI_VIDEO_PARAM_AVCENC_FRAMEPACKINGINFO2010 {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_AVCSTEREO_FRAMEPACKTYPE eFramePackingType;
+ OMX_U8 nFrame0PositionX;
+ OMX_U8 nFrame0PositionY;
+ OMX_U8 nFrame1PositionX;
+ OMX_U8 nFrame1PositionY;
+}OMX_TI_VIDEO_PARAM_AVCENC_FRAMEPACKINGINFO2010;
+
+/**
+ * @brief Specifies Transform Block Size
+ */
+typedef enum OMX_VIDEO_TRANSFORMBLOCKSIZETYPE {
+ OMX_Video_Transform_Block_Size_4x4 =0, //!< Transform blocks size is 8x8 : Valid for only High Profile
+ OMX_Video_Transform_Block_Size_8x8, //!< Transform blocks size is 4x4
+ OMX_Video_Transform_Block_Size_Adaptive, //!< Adaptive transform block size : encoder decides as per content
+ OMX_Video_Transform_Block_Size_MAX = 0X7FFFFFFF
+}OMX_VIDEO_TRANSFORMBLOCKSIZETYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_PARAM_TRANSFORM_BLOCKSIZETYPE : to select the Block Size used for transformation
+ @param eTransformBlocksize to specify Block size used for transformation
+ @sa OMX_VIDEO_TRANSFORMBLOCKSIZETYPE
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_VIDEO_PARAM_TRANSFORM_BLOCKSIZETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_TRANSFORMBLOCKSIZETYPE eTransformBlocksize;
+}OMX_VIDEO_PARAM_TRANSFORM_BLOCKSIZETYPE;
+
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_CONFIG_SLICECODINGTYPE : to configure the Slice Settings
+ @param eSliceMode to specify the Slice mode
+ @sa OMX_VIDEO_AVCSLICEMODETYPE
+ @param nSlicesize to specify the sliceSize
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_VIDEO_CONFIG_SLICECODINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_AVCSLICEMODETYPE eSliceMode;
+ OMX_U32 nSlicesize;
+}OMX_VIDEO_CONFIG_SLICECODINGTYPE;
+
+/**
+ * @brief Specifies Slice Group Change Direction Flag
+ */
+typedef enum OMX_VIDEO_SLIGRPCHANGEDIRTYPE {
+ OMX_Video_Raster_Scan = 0, //!< 0 : Raster scan order
+ OMX_Video_Clockwise = 0, //!< 0 : Clockwise (used for BOX OUT FMO Params)
+ OMX_Video_Right = 0, //!< 0 : RIGHT (Used for Wipe FMO type)
+ OMX_Video_Reverse_Raster_Scan= 1, //!< 1 : Reverse Raster Scan Order
+ OMX_Video_Counter_Clockwise = 1, //!< 1 : Counter Clockwise (used for BOX OUT FMO Params)
+ OMX_Video_Left = 1, //!< 1 : LEFT (Used for Wipe FMO type)
+ OMX_Video_Left_MAX = 0X7FFFFFFF
+} OMX_VIDEO_SLICEGRPCHANGEDIRTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_FMO_ADVANCEDSETTINGS : to configure the FMO Settings
+ @param
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_PARAM_AVCADVANCEDFMOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nNumSliceGroups;
+ OMX_U8 nSliceGroupMapType;
+ OMX_VIDEO_SLICEGRPCHANGEDIRTYPE eSliceGrpChangeDir;
+ OMX_U32 nSliceGroupChangeRate;
+ OMX_U32 nSliceGroupChangeCycle;
+ OMX_U32 nSliceGroupParams[H264ENC_MAXNUMSLCGPS];
+}OMX_VIDEO_PARAM_AVCADVANCEDFMOTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_CONFIG_QPSETTINGS : to configure the Qp Settings of I, P &B Frames
+ @param nQpI
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_VIDEO_CONFIG_QPSETTINGSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQpI;
+ OMX_U32 nQpMaxI;
+ OMX_U32 nQpMinI;
+ OMX_U32 nQpP;
+ OMX_U32 nQpMaxP;
+ OMX_U32 nQpMinP;
+ OMX_U32 nQpOffsetB;
+ OMX_U32 nQpMaxB;
+ OMX_U32 nQpMinB;
+}OMX_VIDEO_CONFIG_QPSETTINGSTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_AVCHRDBUFFERSETTING : to configure the HRD
+ (Hypothetical Reference Decoder) related params
+ @param nInitialBufferLevel Initial buffer level for HRD compliance
+ @param nHRDBufferSize Hypothetical Reference Decoder buffer size
+ @param nTargetBitrate Target bitrate to encode with
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_TI_VIDEO_PARAM_AVCHRDBUFFERSETTING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nInitialBufferLevel;
+ OMX_U32 nHRDBufferSize;
+ OMX_U32 nTargetBitrate;
+} OMX_TI_VIDEO_PARAM_AVCHRDBUFFERSETTING;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_CONFIG_AVCHRDBUFFERSETTING : to configure the HRD
+ (Hypothetical Reference Decoder) related params
+ @param nHRDBufferSize Hypothetical Reference Decoder Buffer Size
+ @param nEncodeBitrate Target bitrate to encode with
+
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_TI_VIDEO_CONFIG_AVCHRDBUFFERSETTING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nHRDBufferSize;
+ OMX_U32 nEncodeBitrate;
+} OMX_TI_VIDEO_CONFIG_AVCHRDBUFFERSETTING;
+
+/* ========================================================================= */
+/*!
+ @brief OMX_TI_VIDEO_CODINGTYPE :
+ Extension to video coding type enum for VP6 and VP7
+ @param
+*/
+/* ==========================================================================*/
+
+typedef enum OMX_TI_VIDEO_CODINGTYPE {
+ OMX_VIDEO_CodingVP6 =
+ (OMX_VIDEO_CODINGTYPE)OMX_VIDEO_CodingVendorStartUnused + 1, /* VP6 */
+ OMX_VIDEO_CodingVP7, /* VP7 */
+ OMX_TI_VIDEO_CodingSORENSONSPK, /* Sorenson spark*/
+ OMX_VIDEO_CodingSVC, /**< H.264/SVC */
+ OMX_VIDEO_CodingVP8 /* VP8 */
+}OMX_TI_VIDEO_CODINGTYPE;
+
+
+/* ========================================================================= */
+/*!
+ @brief OMX_TI_VIDEO_MPEG4LEVELTYPE:
+ Extension to MPEG-4 level to cater to level 6
+ @param
+*/
+/* ==========================================================================*/
+typedef enum OMX_TI_VIDEO_MPEG4LEVELTYPE {
+ OMX_TI_VIDEO_MPEG4Level6 =
+ (OMX_VIDEO_MPEG4LEVELTYPE)OMX_VIDEO_MPEG4LevelVendorStartUnused + 1
+} OMX_TI_VIDEO_MPEG4LEVELTYPE;
+
+
+
+/**
+ * @brief Specifies various intra refresh methods
+ */
+typedef enum OMX_TI_VIDEO_INTRAREFRESHTYPE {
+ OMX_TI_VIDEO_IntraRefreshNone = 0,
+ OMX_TI_VIDEO_IntraRefreshCyclicMbs,
+ OMX_TI_VIDEO_IntraRefreshCyclicRows,
+ OMX_TI_VIDEO_IntraRefreshMandatory,
+ OMX_TI_VIDEO_IntraRefreshAdaptive,
+ OMX_TI_VIDEO_IntraRefreshGDR,
+ OMX_TI_VIDEO_IntraRefreshMax = 0x7FFFFFFF
+} OMX_TI_VIDEO_INTRAREFRESHTYPE;
+
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_INTRAREFRESHTYPE : Configuration parameters for
+ intra refresh settings
+ @param eRefreshMode Various refresh modes supported
+ @param nIntraRefreshRate Intra refresh rate
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_TI_VIDEO_PARAM_INTRAREFRESHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_INTRAREFRESHTYPE eRefreshMode;
+ OMX_U32 nIntraRefreshRate;
+} OMX_TI_VIDEO_PARAM_INTRAREFRESHTYPE;
+
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_CONFIG_AVCINTRAREFRESHTYPE : Configuration parameters for H264 Encoder
+ intra refresh settings
+ @param eRefreshMode Various refresh modes supported
+ @param nIntraRefreshRate Intra refresh rate
+ @param nGDROverlapRows Number of rows overlap between successive GDR frames if RefreshMode set to GDR.
+ Else don't care. Value should be less than intraRefreshRate.
+*/
+/* ==========================================================================*/
+
+typedef struct OMX_TI_VIDEO_CONFIG_AVCINTRAREFRESHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_INTRAREFRESHTYPE eRefreshMode;
+ OMX_U32 nIntraRefreshRate;
+ OMX_U32 nGDROverlapRows;
+} OMX_TI_VIDEO_CONFIG_AVCINTRAREFRESHTYPE;
+
+
+/* ============================================================================= */
+/*!
+ @brief OMX_TI_STEREODECINFO : Structure to access 2004 SEI message generated by
+ H264 decoder as metatadata on its output port.
+ */
+/* ============================================================================= */
+
+typedef struct OMX_TI_STEREODECINFO {
+ OMX_U32 nFieldViewsFlag;
+ OMX_U32 nTopFieldIsLeftViewFlag;
+ OMX_U32 nCurrentFrameIsLeftViewFlag;
+ OMX_U32 nNextFrameIsSecondViewFlag;
+ OMX_U32 nLeftViewSelfContainedFlag;
+ OMX_U32 nRightViewSelfContainedFlag;
+} OMX_TI_STEREODECINFO;
+
+typedef struct OMX_TI_FRAMEPACKINGDECINFO {
+ OMX_U32 nFramePackingArrangementId;
+ OMX_U32 nFramePackingArrangementRepetitionPeriod;
+ OMX_U8 nFramePackingArrangementCancelFlag;
+ OMX_U8 nFramePackingArrangementType;
+ OMX_U8 nQuincunxSamplingFlag;
+ OMX_U8 nContentInterpretationType;
+ OMX_U8 nSpatialFlippingFlag;
+ OMX_U8 nFrame0FlippedFlag;
+ OMX_U8 nFieldViewsFlag;
+ OMX_U8 nCurrentFrameIsFrame0Flag;
+ OMX_U8 nFrame0SelfContainedFlag;
+ OMX_U8 nFrame1SelfContainedFlag;
+ OMX_U8 nFrame0GridPositionX;
+ OMX_U8 nFrame0GridPositionY;
+ OMX_U8 nFrame1GridPositionX;
+ OMX_U8 nFrame1GridPositionY;
+ OMX_U8 nFramePackingArrangementReservedByte;
+ OMX_U8 nFramePackingArrangementExtensionFlag;
+} OMX_TI_FRAMEPACKINGDECINFO;
+
+/* ============================================================================= */
+/*!
+ @brief OMX_TI_VIDEO_RANGEMAPPING : Structure to access luma and chroma range
+ mapping generated by decoders as
+ metatadata on its output port.
+ @param nRangeMappingLuma Luma scale factor for range mapping.
+ @param nRangeMappingChroma Chroma scale factor for range mapping.
+*/
+/* ============================================================================= */
+
+typedef struct OMX_TI_VIDEO_RANGEMAPPING {
+ OMX_U32 nRangeMappingLuma;
+ OMX_U32 nRangeMappingChroma;
+} OMX_TI_VIDEO_RANGEMAPPING;
+
+/* ============================================================================= */
+/*!
+ @brief OMX_TI_VIDEO_RESCALINGMATRIX : Structure to access rescaled
+ width/height generated by decoders
+ as metatadata on its output port.
+ @param nScaledHeight Scaled image width for post processing for decoder.
+ @param nScaledWidth Scaled image height for post processing for decoder.
+*/
+/* ============================================================================= */
+
+typedef struct OMX_TI_VIDEO_RESCALINGMATRIX {
+ OMX_U32 nScaledHeight;
+ OMX_U32 nScaledWidth;
+} OMX_TI_VIDEO_RESCALINGMATRIX;
+
+
+/*==========================================================================*/
+/*!
+ @brief OMX_TI_PARAM_PAYLOADHEADERFLAG : To specify the payload headerflag
+ for VP6/VP7 decoder.
+ @param bPayloadHeaderFlag Flag - TRUE indicates that frame length and
+ timestamp(for IVF format) will be part of
+ frame input buffer.
+ Flag - FALSE indecates that frame length and
+ timestamp(for IVF format) will not be part of
+ the input buffer.
+*/
+/*==========================================================================*/
+
+typedef struct OMX_TI_PARAM_PAYLOADHEADERFLAG {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bPayloadHeaderFlag;
+} OMX_TI_PARAM_PAYLOADHEADERFLAG;
+
+
+/*==========================================================================*/
+/*!
+@brief OMX_TI_PARAM_IVFFLAG : Suport added to handle IVF header Decoding Mode
+@param bIvfFlag TRUE enables IVF decoding mode.
+ FALSE indicates bitstream format is non-IVF.
+*/
+/*==========================================================================*/
+
+typedef struct OMX_TI_PARAM_IVFFLAG {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bIvfFlag;
+} OMX_TI_PARAM_IVFFLAG;
+
+// A pointer to this struct is passed to OMX_SetParameter() when the extension
+// index "OMX.google.android.index.storeMetaDataInBuffers"
+// is given.
+//
+// When meta data is stored in the video buffers passed between OMX clients
+// and OMX components, interpretation of the buffer data is up to the
+// buffer receiver, and the data may or may not be the actual video data, but
+// some information helpful for the receiver to locate the actual data.
+// The buffer receiver thus needs to know how to interpret what is stored
+// in these buffers, with mechanisms pre-determined externally. How to
+// interpret the meta data is outside of the scope of this method.
+//
+// Currently, this is specifically used to pass meta data from video source
+// (camera component, for instance) to video encoder to avoid memcpying of
+// input video frame data. To do this, bStoreMetaDta is set to OMX_TRUE.
+// If bStoreMetaData is set to false, real YUV frame data will be stored
+// in the buffers. In addition, if no OMX_SetParameter() call is made
+// with the corresponding extension index, real YUV data is stored
+// in the buffers.
+typedef struct OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bStoreMetaData;
+} OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS;
+
+
+/**
+ * Interlaced Video Content format
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nFormat : bitmapped value indentifying the interlaced formats supported by component
+ * nTimeStamp : temporal timestamp information for the second field
+ */
+typedef struct OMX_TI_INTERLACEFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nFormat;
+ OMX_TICKS nTimeStamp;
+} OMX_TI_INTERLACEFORMATTYPE;
+
+/**
+ * Interlace format types
+ */
+typedef enum OMX_TI_INTERLACETYPE {
+ OMX_InterlaceFrameProgressive= 0x00,
+ OMX_InterlaceInterleaveFrameTopFieldFirst= 0x01,
+ OMX_InterlaceInterleaveFrameBottomFieldFirst= 0x02,
+ OMX_InterlaceFrameTopFieldFirst= 0x04,
+ OMX_InterlaceFrameBottomFieldFirst= 0x08,
+ OMX_InterlaceInterleaveFieldTop= 0x10,
+ OMX_InterlaceInterleaveFieldBottom= 0x20,
+ OMX_InterlaceFmtMask= 0x7FFFFFFF
+} OMX_TI_INTERLACETYPE;
+
+/**
+ * To query if the stream contains interlaced or progressive conten
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bInterlaceFormat : whether the stream contains interlace or progressive content
+ * OMX_TRUE indicates interlace and OMX_FALSE indicates progressive
+ * nInterlaceFormats : bitmapped value identifying the interlace formats detected within the stream
+ */
+typedef struct OMX_TI_STREAMINTERLACEFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bInterlaceFormat;
+ OMX_U32 nInterlaceFormats;
+} OMX_TI_STREAMINTERLACEFORMAT;
+
+/*
+@brief OMX_TI_VIDEO_CONFIG_PICSIZECONTROLINFO : Structure to provide the configuration to compute min and max picture size
+@param minPicSizeRatioI : This ratio is used to compute minimum picture size for I frames in the following manner,
+minPicSize = averagePicSize >> minPicSizeRatioI. Allowed values are 1 to 4. Setting this to 0 will enable encoder chosen ratio.
+@param maxPicSizeRatioI : This ratio is used to compute maximum picture size for I frames in the following manner,
+maxPicSize = averagePicSize * maxPicSizeRatioI. Allowed values are 2 to 30. Setting this to 0 or 1 will enable encoder chosen ratio.
+@param minPicSizeRatioP : This ratio is used to compute minimum picture size for P frames in the following manner,
+minPicSize = averagePicSize >> minPicSizeRatioP. Allowed values are 1 to 4. Setting this to 0 will enable encoder chosen ratio.
+@param maxPicSizeRatioP : This ratio is used to compute maximum picture size for P frames in the following manner,
+maxPicSize = averagePicSize * maxPicSizeRatioP. Allowed values are 2 to 30. Setting this to 0 or 1 will enable encoder chosen ratio.
+@param minPicSizeRatioB : This ratio is used to compute minimum picture size for B frames in the following manner,
+minPicSize = averagePicSize >> minPicSizeRatioB. Allowed values are 1 to 4. Setting this to 0 will enable encoder chosen ratio.
+@param maxPicSizeRatioB : This ratio is used to compute maximum picture size for B frames in the following manner,
+maxPicSize = averagePicSize * maxPicSizeRatioB. Allowed values are 2 to 30. Setting this to 0 or 1 will enable encoder chosen ratio.
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_CONFIG_PICSIZECONTROLINFO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 minPicSizeRatioI;
+ OMX_U16 maxPicSizeRatioI;
+ OMX_U16 minPicSizeRatioP;
+ OMX_U16 maxPicSizeRatioP;
+ OMX_U16 minPicSizeRatioB;
+ OMX_U16 maxPicSizeRatioB;
+} OMX_TI_VIDEO_CONFIG_PICSIZECONTROLINFO;
+
+
+/*!====================================================================!
+
+ Currently we only support SVC baseline profile
+
+ * !====================================================================!*/
+typedef enum OMX_TI_VIDEO_SVCPROFILETYPE {
+ OMX_VIDEO_SVCProfileBaseline = (OMX_VIDEO_AVCPROFILETYPE)OMX_VIDEO_AVCProfileVendorStartUnused + 1, /**< Baseline profile */
+ OMX_VIDEO_SVCProfileHigh = (OMX_VIDEO_AVCPROFILETYPE)OMX_VIDEO_AVCProfileVendorStartUnused + 2, /**< High profile */
+ OMX_VIDEO_SVCProfileHighIntra = (OMX_VIDEO_AVCPROFILETYPE)OMX_VIDEO_AVCProfileVendorStartUnused + 3, /**< High Intra profile */
+ OMX_VIDEO_SVCProfileMax = 0x7FFFFFFF
+} OMX_TI_VIDEO_SVCPROFILETYPE;
+
+
+/*!====================================================================!
+
+ Currently we support only SVC baseline profile upto level 4.1 for SVC encoder.
+
+ * !====================================================================!*/
+typedef enum OMX_TI_VIDEO_SVCLEVELTYPE {
+ OMX_VIDEO_SVCLevel1 = 0x01, /**< Level 1 */
+ OMX_VIDEO_SVCLevel1b = 0x02, /**< Level 1b */
+ OMX_VIDEO_SVCLevel11 = 0x04, /**< Level 1.1 */
+ OMX_VIDEO_SVCLevel12 = 0x08, /**< Level 1.2 */
+ OMX_VIDEO_SVCLevel13 = 0x10, /**< Level 1.3 */
+ OMX_VIDEO_SVCLevel2 = 0x20, /**< Level 2 */
+ OMX_VIDEO_SVCLevel21 = 0x40, /**< Level 2.1 */
+ OMX_VIDEO_SVCLevel22 = 0x80, /**< Level 2.2 */
+ OMX_VIDEO_SVCLevel3 = 0x100, /**< Level 3 */
+ OMX_VIDEO_SVCLevel31 = 0x200, /**< Level 3.1 */
+ OMX_VIDEO_SVCLevel32 = 0x400, /**< Level 3.2 */
+ OMX_VIDEO_SVCLevel4 = 0x800, /**< Level 4 */
+ OMX_VIDEO_SVCLevel41 = 0x1000, /**< Level 4.1 */
+ OMX_VIDEO_SVCLevel42 = 0x2000, /**< Level 4.2 */
+ OMX_VIDEO_SVCLevel5 = 0x4000, /**< Level 5 */
+ OMX_VIDEO_SVCLevel51 = 0x8000, /**< Level 5.1 */
+ OMX_VIDEO_SVCLevelMax = 0x7FFFFFFF
+} OMX_TI_VIDEO_SVCLEVELTYPE;
+
+
+typedef enum OMX_TI_VIDEO_SVCSPATIALSCLFACTOR {
+ OMX_VIDEO_SVCScalabilityFactor15,
+ OMX_VIDEO_SVCScalabilityFactor20,
+} OMX_TI_VIDEO_SVCSPATIALSCLFACTOR;
+
+/* ============================================================================= */
+/* SVC Params
+@brief OMX_TI_VIDEO_PARAM_SVCTYPE : Structure to configure SVC related params
+
+@param nSize Size of the structure in bytes
+@param nVersion OMX specification version information
+@param nPortIndex Port that this structure applies to
+@param nPFrames Number of P + B (if any) frames between each I frame
+@param nBFrames Number of B frames between each I frame. Not supported now.
+ Would be supported when support for setting high profile would be enabled
+@param eProfile SVC profile to use. Only Baseline profile is supported
+@param eLevel SVC level to use. Level upto 4.1 is supported
+@param nNumOfSpatialLayers Number of Spatial layers. Supports values [1,9]
+@param nSpatialScalabilityFactor The resolution would be divided by this factor for Spatial scalability. Supports values 1.5 and 2
+@param pSpatialBitrateDistributionRatio[] The Bitrate distribution ratios (percentage) across all Spatial Layers. The values should be in the range [0,100]
+ and should be assigned from low to high. The total of all the distribution should be 100.
+@param nNumOfSNRLayers Number of SNR layers. Supports values [1,9]. Also nNumOfSpatialLayers*nNumOfSNRLayers <=9
+@param pSNRBitrateDistributionRatio[] The Bitrate distribution ratios (percentage) across all SNR Layers. The values should be in the range [0,100]
+ and should be assigned from low to high. The total of all the distribution should be 100.
+@param nNumOfTemporalLayers Number of Temporal layers. Supports values [1,4].
+@param bEntropyCodingCABAC to enable CABAC entropy coding. Not supported now. Would be supported when support for setting high profile
+ would be enabled
+@param bconstIpred flag to constrain the intra macroblocks from using pixels from neighboring inter macroblocks for prediction in P slices
+*/
+/* ============================================================================= */
+
+typedef struct OMX_TI_VIDEO_PARAM_SVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_TI_VIDEO_SVCPROFILETYPE eProfile;
+ OMX_TI_VIDEO_SVCLEVELTYPE eLevel;
+ OMX_U32 nRefFrames; // Needed only for Decoder...to be removed on confirmation
+ OMX_U32 nNumOfSpatialLayers;
+ OMX_TI_VIDEO_SVCSPATIALSCLFACTOR nSpatialScalabilityFactor;
+ OMX_U32 pSpatialBitrateDistributionRatio[H264SVC_MAX_NUM_LAYER];
+ OMX_U32 nNumOfSNRLayers;
+ OMX_U32 pSNRBitrateDistributionRatio[H264SVC_MAX_NUM_LAYER];
+ OMX_U32 nNumOfTemporalLayers;
+ OMX_BOOL bEntropyCodingCABAC;
+ OMX_BOOL bconstIpred;
+} OMX_TI_VIDEO_PARAM_SVCTYPE;
+
+typedef struct OMX_TI_VIDEO_CONFIG_SVCLAYERDETAILS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_U32 nNumLayers;
+ OMX_U32 nLayerId;
+ OMX_U8 nPriorityId;
+ OMX_U8 nDependencyId;
+ OMX_U8 nQualityId;
+ OMX_U8 nTemporalId;
+ OMX_U8 nBitrateInfoPresentFlag;
+ OMX_U8 nFramerateInfoPresentFlag;
+ OMX_U8 nFramesizeInfoPresentFlag;
+ OMX_U16 nAvgBitrate;
+ OMX_U16 nMaxBitrate;
+ OMX_U16 nAvgFramerate;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+
+ OMX_U32 nLayerIndex; /* Used to query for individual layer details */
+
+} OMX_TI_VIDEO_CONFIG_SVCLAYERDETAILS;
+
+typedef struct OMX_TI_VIDEO_CONFIG_SVCTARGETLAYER {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+
+ OMX_U32 nSvcTargetLayerDID;
+ OMX_U32 nSvcTargetLayerTID;
+ OMX_U32 nSvcTargetLayerQID;
+
+} OMX_TI_VIDEO_CONFIG_SVCTARGETLAYER;
+/* ========================================================================== */
+/*!
+@brief OMX_TI_VIDEO_SLICEDATAINFO : to configure the Slice Settings
+@param nNumofSlices number of validfields to be read
+@param nSliceSizeConfigured variable that indicates the MaxSlice configured
+ & (n*nSliceSizeConfigured) gives the buff offset
+ for nth slice in the o/p buffer
+@param nSliceSize gives the SliceSize
+*/
+/* ==========================================================================*/
+typedef struct OMX_TI_VIDEO_SLICEDATAINFO {
+ OMX_U32 nNumofSlices;
+ OMX_U32 nSliceSizeConfigured;
+ OMX_U32 nSliceSize[OMXH264E_MAX_SLICE_SUPPORTED];
+} OMX_TI_VIDEO_SLICEDATAINFO;
+/**
+* @brief mode selection for the data that is given to the Codec
+ */
+
+typedef enum _OMX_VIDEO_AVCLTRMODE {
+ OMX_H264ENC_LTRP_NONE = 0,
+ /**< No longterm refernce frame in the sequnce
+ */
+ OMX_H264ENC_LTRP_REFERTOIDR = 1,
+ /**< Mark all the I frames as long term-reference frames and
+ * based on the frame control IH264ENC_Control, refere to
+ * a long-term reference frame (I frame).
+ */
+ OMX_H264ENC_LTRP_REFERTOP_PROACTIVE =2,
+ /**< Two long term frames are supported in this schme and
+ * long-term index marking and refernce frame update is done based
+ * the IH264ENC_Control values
+ */
+ OMX_H264ENC_LTRP_REFERTOP_REACTIVE = 3
+ /**< This is not supported in the current version of encoder
+ */
+} OMX_VIDEO_AVCLTRMODE;
+
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_VIDEO_PARAM_AVC_LTRP : Structure to enable the configuration of Long Term reference Picture feature in H264 Encoder for the session
+Enabling this parameter will instruct encoder to keep its recent I/IDR frame in its reference buffer list.
+So it increases the DDR foot print by one frame buffer
+@param eLTRMode : enables the LongTerm Reference Picture, possible modes: 0, 1, 2
+@param nLTRInterval : interval of the write indicating to codec interms of the frame number
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_PARAM_AVC_LTRP {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_AVCLTRMODE eLTRMode;
+ OMX_U32 nLTRInterval;
+} OMX_TI_VIDEO_PARAM_AVC_LTRP;
+
+/*
+@brief OMX_TI_VIDEO_CONFIG_AVC_LTRP : Structure to provide the configuration to acknowledge successful decode of previous LTR
+@param eLTRFrameDecoded : tells the decoder that the LTR has been decoded successfully when set to TRUE
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_CONFIG_AVC_LTRP {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableNextLTR;
+} OMX_TI_VIDEO_CONFIG_AVC_LTRP;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_VIDEO_CONFIG_AVC_LTRP_INTERVAL : Structure to enable the update of the LTRP
+Interval during runtime
+@param nLTRInterval : interval of the write indicating to codec interms of the frame number
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_CONFIG_AVC_LTRP_INTERVAL {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nLTRInterval;
+} OMX_TI_VIDEO_CONFIG_AVC_LTRP_INTERVAL;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_VIDEO_CONFIG_AVC_LTRP_INTERVAL : Structure to enable timestamps in decode order
+ at i/p of decoders.
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_PARAM_TIMESTAMP_IN_DECODE_ORDER {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bEnabled;
+} OMX_TI_PARAM_TIMESTAMP_IN_DECODE_ORDER;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_VIDEO_PARAM_AUTO_FRAMERATE_UPDATE : Structure to enable dynamic update of frame rate
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_PARAM_AUTO_FRAMERATE_UPDATE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableAutoVFRUpdate;
+ OMX_U32 nDiffThresholdtoUpdate;
+ OMX_U32 nMaxSessionFrameRate;
+} OMX_TI_VIDEO_PARAM_AUTO_FRAMERATE_UPDATE;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_NUM_TEMPORAL_LAYERS : Enum to describe number of temporal layers
+@param OMX_Video_Temporal_Layers_1 to set Base layer
+@param OMX_Video_Temporal_Layers_2 to set Base layer + 1 Temporal Enhancement Layer
+@param OMX_Video_Temporal_Layers_3 to set Base layer + 2 Temporal Enhancement Layers
+@param OMX_Video_Temporal_Layers_4 to set Base layer + 3 Temporal Enhancement Layers
+*/
+/* ============================================================================= */
+typedef enum OMX_TI_NUM_TEMPORAL_LAYERS {
+ OMX_Video_Temporal_Layers_1 = 0x01,
+ OMX_Video_Temporal_Layers_2,
+ OMX_Video_Temporal_Layers_3,
+ OMX_Video_Temporal_Layers_4,
+ OMX_Video_Temporal_Layers_Max = 0X7FFFFFFF
+} OMX_TI_NUM_TEMPORAL_LAYERS;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_VIDEO_PARAM_TEMPORAL_SCALABILITY : Structure to enable temporal scalability
+@param nPortIndex to specify the index of the port
+@param nTemporalLayers to specify the number of Enhancement layers
+ @sa OMX_TI_NUM_TEMPORAL_LAYERS
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_PARAM_TEMPORAL_SCALABILITY {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_NUM_TEMPORAL_LAYERS nTemporalLayers;
+} OMX_TI_VIDEO_PARAM_TEMPORAL_SCALABILITY;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_PARAM_SKIP_GREY_OUTPUT_FRAMES : Structure to enable feature to skip grey output
+ frames which doesn't have proper reference.
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_PARAM_SKIP_GREY_OUTPUT_FRAMES {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bEnabled;
+} OMX_TI_PARAM_SKIP_GREY_OUTPUT_FRAMES;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_PARAM_DECMETADATA : Structure to enable different codec metadata
+ for video decoders.
+*/
+/* ============================================================================= */
+typedef struct OMX_TI_PARAM_DECMETADATA {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableMBInfo;
+ OMX_BOOL bEnableTranscodeMode;
+ OMX_BOOL bEnableSEIInfo;
+ OMX_BOOL bEnableVUIInfo;
+} OMX_TI_PARAM_DECMETADATA;
+
+/**
+ ******************************************************************************
+ * @enum OMX_TI_VIDEO_MBERRSTATUS
+ * @brief This enum indicates if a MB was in error or not
+ *
+ ******************************************************************************
+*/
+typedef enum {
+ OMX_TI_VIDEO_MB_NOERROR = 0,
+ /**
+ * MB was non-erroneous
+ */
+ OMX_TI_VIDEO_MB_ERROR = 1
+ /**
+ * MB was erroneous
+ */
+} OMX_TI_VIDEO_MBERRSTATUS;
+
+
+/**
+ * Macro definitions required for SEI support: HRD sequence parameter set
+ */
+#define OMX_TI_VIDEO_H264VDEC_MAXCPBCNT 32
+
+/**
+ * Macro definitions required for SEI support: HRD sequence parameter set
+ */
+#define OMX_TI_VIDEO_H264VDEC_MAXUSERDATA_PAYLOAD 300
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_HrdParams
+ *
+ * @brief This structure contains the HRD parameter elements.
+ *
+ * @param cpb_cnt_minus1 : Number of alternative CPB specifications in the
+ * bit-stream
+ * @param bit_rate_scale : Together with bit_rate_value[i], it specifies the
+ * maximum input bit-rate for the ith CPB.
+ * @param cpb_size_scale : Together with cpb_size_value[i], specifies the
+ * maximum CPB size for the ith CPB.
+ * @param bit_rate_value_minus1[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT] :Maximum input bitrate
+ * for the ith CPB
+ * @param cpb_size_value_minus1[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT] :Maximum CPB size for the
+ * ith CPB
+ * @param vbr_cbr_flag[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT] :Specifies the ith CPB is operated
+ * in Constant Bit-rate mode or variable bit-rate mode
+ * @param initial_cpb_removal_delay_length_minus1 :Length in bits of
+ * initial_cpb_removal_length syntax element
+ * @param cpb_removal_delay_length_minus1 :Length in bits of
+ * cpb_removal_delay_length syntax element
+ * @param dpb_output_delay_length_minus1 :Length in bits of
+ * dpb_output_delay_length syntax element
+ * @param time_offset_length : Length in bits of time_offset syntax element
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_HrdParams {
+ OMX_U32 cpb_cnt_minus1;
+ OMX_U8 bit_rate_scale;
+ OMX_U8 cpb_size_scale;
+ OMX_U32 bit_rate_value_minus1[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+ OMX_U32 cpb_size_value_minus1[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+ OMX_U8 vbr_cbr_flag[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+ OMX_U8 initial_cpb_removal_delay_length_minus1;
+ OMX_U8 cpb_removal_delay_length_minus1;
+ OMX_U8 dpb_output_delay_length_minus1;
+ OMX_U8 time_offset_length;
+} OMX_TI_VIDEO_H264VDEC_HrdParams;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SVCVuiParams
+ *
+ * @brief This structure contains VUI message syntax elements for scalable
+ * video stream
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call, c
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ *
+ * @param svc_vui_ext_num_entries_minus1:(svc_vui_ext_num_entries_minus1 + 1)
+ * specifies the number of information
+ * entries that are present in the SVC
+ * VUI parameters extension syntax
+ * structure
+ * @param svc_vui_ext_dependency_id:indicate the max value of DId for the
+ * i-th subset of coded video sequences
+ * @param svc_vui_ext_quality_id:indicate the max value of QId for the
+ * i-th subset of coded video sequences
+ * @param svc_vui_ext_temporal_id: indicate the max value of TId for the
+ * i-th subset of coded video sequences
+ * @param svc_vui_ext_timing_info_present_flag: Flag to tells that
+ * svc_vui_ext_num_units_in_tick,
+ * svc_vui_ext_time_scale,
+ * svc_vui_ext_fixed_frame_rate_flag
+ * are present for current coded
+ * sequence or not.
+ * @param svc_vui_ext_num_units_in_tick: specifies the value of num_units_in_tick
+ * @param svc_vui_ext_time_scale: specifies the value of time_scale
+ * @param svc_vui_ext_fixed_frame_rate_flag: specifies the value of
+ * fixed_frame_rate_flag
+ * @param svc_vui_ext_nal_hrd_parameters_present_flag:specifies the
+ * value of nal_hrd_parameters_present_flag
+ * @param svc_vui_ext_vcl_hrd_parameters_present_flag: ] specifies the
+ * value of vcl_hrd_parameters_present_flag
+ * @param svc_vui_ext_low_delay_hrd_flag: specifies the value
+ * of low_delay_hrd_flag
+ * @param svc_vui_ext_pic_struct_present_flag: specifies the value
+ * of pic_struct_present_flag
+ *
+ ******************************************************************************
+*/
+
+typedef struct sOMX_TI_VIDEO_H264VDEC_SVCVuiParams {
+ OMX_U32 parsed_flag;
+ OMX_U16 svc_vui_ext_num_entries_minus1;
+ OMX_U16 svc_vui_ext_dependency_id;
+ OMX_U16 svc_vui_ext_quality_id;
+ OMX_U16 svc_vui_ext_temporal_id;
+ OMX_U16 svc_vui_ext_timing_info_present_flag;
+ OMX_U32 svc_vui_ext_num_units_in_tick;
+ OMX_U32 svc_vui_ext_time_scale;
+ OMX_U16 svc_vui_ext_fixed_frame_rate_flag;
+ OMX_U16 svc_vui_ext_nal_hrd_parameters_present_flag;
+ OMX_U16 svc_vui_ext_vcl_hrd_parameters_present_flag;
+ OMX_U16 svc_vui_ext_low_delay_hrd_flag;
+ OMX_U16 svc_vui_ext_pic_struct_present_flag;
+} OMX_TI_VIDEO_H264VDEC_SVCVuiParams;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_VuiParams
+ *
+ * @brief This structure contains the VUI Sequence Parameter elements.
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call, c
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param aspect_ratio_info_present_flag :Indicates whether aspect ratio idc
+ * is present or not.
+ * @param aspect_ratio_idc : Aspect ratio of Luma samples
+ * @param sar_width : Horizontal size of sample aspect ratio
+ * @param sar_height : Vertical size of sample aspect ratio
+ * @param overscan_info_present_flag : Cropped decoded pictures are suitable
+ * for display or not.
+ * @param overscan_appropriate_flag : Overscan_appropriate_flag
+ * @param video_signal_type_present_flag : Flag indicates whether
+ * video_format, video_full_range_flag and colour_description_present_
+ * flag are present or not
+ * @param video_format :Video format indexed by a table. For example,PAL/NTSC
+ * @param video_full_range_flag : Black level, luma and chroma ranges. It
+ * should be used for BT.601 compliance
+ * @param colour_description_present_flag:Indicates whether colour_primaries,
+ * transfer_characteristics and matrix_coefficients are present.
+ * @param colour_primaries :Chromaticity co-ordinates of source primaries
+ * @param transfer_characteristics :Opto-electronic transfer characteristics
+ * of the source picture
+ * @param matrix_coefficients :Matrix coefficients for deriving Luma and
+ * chroma data from RGB components.
+ * @param chroma_location_info_present_flag : Flag indicates whether
+ * chroma_sample_loc_type_top field and chroma_sample_loctype
+ * bottom_field are present.
+ * @param chroma_sample_loc_type_top_field : Location of chroma_sample top
+ * field
+ * @param chroma_sample_loc_type_bottom_field :Location of chroma_sample
+ * bottom field
+ * @param timing_info_present_flag :Indicates whether num_units_in_tick,
+ * time_scale, and fixed_frame_rate_flag are present.
+ * @param num_units_in_tick :Number of units of a clock that corresponds to 1
+ * increment of a clock tick counter
+ * @param time_scale :Indicates actual increase in time for 1 increment of a
+ * clock tick counter
+ * @param fixed_frame_rate_flag :Indicates how the temporal distance between
+ * HRD output times of any two output pictures is constrained
+ * @param nal_hrd_parameters_present_flag :Indicates whether
+ * nal_hrd_parameters are present
+ * @param nal_hrd_pars : NAL HRD Parameters
+ * @param vcl_hrd_parameters_present_flag :Indicates whether
+ * vcl_hrd_parameters are present
+ * @param vcl_hrd_pars : VCL HRD Parameters
+ * @param low_delay_hrd_flag :HRD operational mode as in Annex C of the
+ * standard
+ * @param pic_struct_present_flag :Indicates whether picture timing SEI
+ * messages are present
+ * @param bitstream_restriction_flag :Indicates if the bit-stream restriction
+ * parameters are present
+ * @param motion_vectors_over_pic_boundaries_flag :Specifies whether motion
+ * vectors can point to regions outside the picture boundaries
+ * @param max_bytes_per_pic_denom :Maximum number of bytes not exceeded by
+ * the sum of sizes of all VCL NAL units of a single coded picture
+ * @param max_bits_per_mb_denom :Maximum number of bits taken by any coded MB
+ * @param log2_max_mv_length_vertical :Maximum value of any motion vector\u2019s
+ * vertical component
+ * @param log2_max_mv_length_horizontal :Maximum value of any motion vector\u2019s
+ * horizontal component
+ * @param max_dec_frame_reordering :
+ * @param num_reorder_frames :Maximum number of frames that need to be
+ * re-ordered
+ * @param max_dec_frame_buffering :Size of HRD decoded buffer (DPB) in terms
+ * of frame buffers
+ * @param svcVuiParams : struct instance of vui parameters for svc
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_VuiParams {
+ OMX_U32 parsed_flag;
+ OMX_U8 aspect_ratio_info_present_flag;
+ OMX_U32 aspect_ratio_idc;
+ OMX_U32 sar_width;
+ OMX_U32 sar_height;
+ OMX_U8 overscan_info_present_flag;
+ OMX_U8 overscan_appropriate_flag;
+ OMX_U8 video_signal_type_present_flag;
+ OMX_U8 video_format;
+ OMX_U8 video_full_range_flag;
+ OMX_U8 colour_description_present_flag;
+ OMX_U8 colour_primaries;
+ OMX_U8 transfer_characteristics;
+ OMX_U8 matrix_coefficients;
+ OMX_U8 chroma_location_info_present_flag;
+ OMX_U32 chroma_sample_loc_type_top_field;
+ OMX_U32 chroma_sample_loc_type_bottom_field;
+ OMX_U8 timing_info_present_flag;
+ OMX_U32 num_units_in_tick;
+ OMX_U32 time_scale;
+ OMX_U8 fixed_frame_rate_flag;
+ OMX_U8 nal_hrd_parameters_present_flag;
+ OMX_TI_VIDEO_H264VDEC_HrdParams nal_hrd_pars;
+ OMX_U8 vcl_hrd_parameters_present_flag;
+ OMX_TI_VIDEO_H264VDEC_HrdParams vcl_hrd_pars;
+ OMX_U8 low_delay_hrd_flag;
+ OMX_U8 pic_struct_present_flag;
+ OMX_U8 bitstream_restriction_flag;
+ OMX_U8 motion_vectors_over_pic_boundaries_flag;
+ OMX_U32 max_bytes_per_pic_denom;
+ OMX_U32 max_bits_per_mb_denom;
+ OMX_U32 log2_max_mv_length_vertical;
+ OMX_U32 log2_max_mv_length_horizontal;
+ OMX_U32 max_dec_frame_reordering;
+ OMX_U32 num_reorder_frames;
+ OMX_U32 max_dec_frame_buffering;
+ OMX_TI_VIDEO_H264VDEC_SVCVuiParams svcVuiParams;
+} OMX_TI_VIDEO_H264VDEC_VuiParams;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiUserDataRegITUT
+ *
+ * @brief This structure contains the user data SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param num_payload_bytes :Specifies the size of the payload
+ * @param itu_t_t35_country_code : A byte having a value specified as a
+ * country code by ITU-T Recommendation T.35 Annex A
+ * @param itu_t_t35_country_code_extension_byte :A byte having a value
+ * specified as a country code by ITU-T Recommendation T.35 Annex B
+ * @param itu_t_t35_payload_byte[] : A byte containing data registered as
+ * specified by ITU-T Recommendation T.35.
+ * @param dataOverflowFlag: This indicates if pay load data is more than the
+ * array size i.e., OMX_TI_VIDEO_H264VDEC_MAXUSERDATA_PAYLOAD.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiUserDataRegITUT {
+ OMX_U32 parsed_flag;
+ OMX_U32 num_payload_bytes;
+ OMX_U8 itu_t_t35_country_code;
+ OMX_U8 itu_t_t35_country_code_extension_byte;
+ OMX_U8 itu_t_t35_payload_byte[OMX_TI_VIDEO_H264VDEC_MAXUSERDATA_PAYLOAD];
+ OMX_U8 dataOverflowFlag;
+} OMX_TI_VIDEO_H264VDEC_SeiUserDataRegITUT;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiUserDataUnReg
+ *
+ * @brief This structure contains the user data SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param num_payload_bytes :Specifies the size of the payload
+ * @param uuid_iso_iec_11578 :Value specified as a UUID according to the
+ * procedures of ISO/IEC 11578:1996 Annex A.
+ * @param user_data_payload_byte :Byte containing data having syntax and
+ * semantics as specified by the UUID generator.
+ * @param dataOverflowFlag: This indicates if pay load data is more than the
+ * array size i.e., OMX_TI_VIDEO_H264VDEC_MAXUSERDATA_PAYLOAD.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiUserDataUnReg {
+ OMX_U32 parsed_flag;
+ OMX_U32 num_payload_bytes;
+ OMX_U8 uuid_iso_iec_11578[16];
+ OMX_U8 user_data_payload_byte[OMX_TI_VIDEO_H264VDEC_MAXUSERDATA_PAYLOAD];
+ OMX_U8 dataOverflowFlag;
+} OMX_TI_VIDEO_H264VDEC_SeiUserDataUnReg;
+
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiBufferingPeriod
+ *
+ * @brief This structure contains the buffering period SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param seq_parameter_set_id :Specifies the sequence parameter set that
+ * contains the sequence HRD attributes
+ * @param nal_cpb_removal_delay :Specifies the delay for the indexed NAL CPB
+ * between the time of arrival in the CPB of the first bit of the
+ * coded data associated with the access unit associated with the
+ * buffering period SEI message and the time of removal from the CPB
+ * of the coded data associated with the same access unit, for the
+ * first buffering period after HRD initialization.
+ * @param nal_cpb_removal_delay_offset :Used for the indexed NAL CPB in
+ * combination with the cpb_removal_delay to specify the initial
+ * delivery time of coded access units to the CPB
+ * @param vcl_cpb_removal_delay :Specifies the delay for the indexed VCL CPB
+ * between the time of arrival in the CPB of the first bit of the
+ * coded data associated with the access unit associated with the
+ * buffering period SEI message and the time of removal from the CPB
+ * of the coded data associated with the same access unit, for the
+ * first buffering period after HRD initialization.
+ * @param vcl_cpb_removal_delay_offset :Used for the indexed VCL CPB in
+ * combination with the cpb_removal_delay to specify the initial
+ * delivery time of coded access units to the CPB
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiBufferingPeriod {
+ OMX_U32 parsed_flag;
+ OMX_U32 seq_parameter_set_id;
+ OMX_U32 nal_cpb_removal_delay[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+ OMX_U32 nal_cpb_removal_delay_offset[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+ OMX_U32 vcl_cpb_removal_delay[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+ OMX_U32 vcl_cpb_removal_delay_offset[OMX_TI_VIDEO_H264VDEC_MAXCPBCNT];
+}OMX_TI_VIDEO_H264VDEC_SeiBufferingPeriod;
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiPanScanRect
+ *
+ * @brief This structure contains the pan scan rectangle SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param pan_scan_rect_id :Specifies an identifying number that may be used
+ * to identify the purpose of the pan-scan rectangle
+ * @param pan_scan_rect_cancel_flag :Equal to 1 indicates that the SEI
+ * message cancels the persistence of any previous pan-scan
+ * rectangle SEI message in output order.
+ * pan_scan_rect_cancel_flag equal to 0 indicates that
+ * pan-scan rectangle information follows.
+ * @param pan_scan_cnt_minus1 :Specifies the number of pan-scan rectangles
+ * that are present in the SEI message
+ * @param pan_scan_rect_left_offset :Specifies as signed integer quantities
+ * in units of one-sixteenth sample spacing relative to the luma
+ * sampling grid, the location of the pan-scan rectangle
+ * @param pan_scan_rect_right_offset :Specifies as signed integer quantities
+ * in units of one-sixteenth sample spacing relative to the luma
+ * sampling grid, the location of the pan-scan rectangle
+ * @param pan_scan_rect_top_offset : Top offset
+ * @param pan_scan_rect_bottom_offset : Bottom offset
+ * @param pan_scan_rect_repetition_period :Specifies the persistence of the
+ * pan-scan rectangle SEI message and may specify a picture order
+ * count interval within which another pan-scan rectangle SEI message
+ * with the same value of pan_scan_rect_id or the end of the coded
+ * video sequence shall be present in the bit-stream
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiPanScanRect {
+ OMX_U32 parsed_flag;
+ OMX_U32 pan_scan_rect_id;
+ OMX_U32 pan_scan_rect_cancel_flag;
+ OMX_U32 pan_scan_cnt_minus1;
+ OMX_S32 pan_scan_rect_left_offset[3];
+ OMX_S32 pan_scan_rect_right_offset[3];
+ OMX_S32 pan_scan_rect_top_offset[3];
+ OMX_S32 pan_scan_rect_bottom_offset[3];
+ OMX_U32 pan_scan_rect_repetition_period;
+} OMX_TI_VIDEO_H264VDEC_SeiPanScanRect;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiProgRefineStart
+ *
+ * @brief This structure contains the progressive refinement start SEI msg
+ * elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param progressive_refinement_id :Specifies an identification number for
+ * the progressive refinement operation.
+ * @param num_refinement_steps_minus1 :Specifies the number of reference
+ * frames in the tagged set of consecutive coded pictures
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiProgRefineStart {
+ OMX_U32 parsed_flag;
+ OMX_U32 progressive_refinement_id;
+ OMX_U32 num_refinement_steps_minus1;
+} OMX_TI_VIDEO_H264VDEC_SeiProgRefineStart;
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiProgRefineEnd
+ *
+ * @brief TThis structure contains the progressive refinement end SEI msg
+ * elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param progressive_refinement_id :Specifies an identification number for
+ * the progressive refinement operation.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiProgRefineEnd {
+ OMX_U32 parsed_flag;
+ OMX_U32 progressive_refinement_id;
+} OMX_TI_VIDEO_H264VDEC_SeiProgRefineEnd;
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiRecoveryPointInfo
+ *
+ * @brief This structure contains the sRecovery Point Info SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param exact_match_flag :Indicates whether decoded pictures at and
+ * subsequent to the specified recovery point in output order derived
+ * by starting the decoding process at the access unit associated with
+ * the recovery point SEI message, will be an exact match to the
+ * pictures that would be produced by starting the decoding process
+ * at the location of a previous IDR access unit in the NAL unit stream.
+ * @param recovery_frame_cnt :Specifies the recovery point of output pictures
+ * in output order
+ * @param broken_link_flag :Indicates the presence or absence of a broken
+ * link in the NAL unit stream
+ * @param changing_slice_group_idc :Indicates whether decoded pictures are
+ * correct or approximately correct in content at and subsequent to
+ * the recovery point in output order when all macro-blocks of the
+ * primary coded pictures are decoded within the changing slice group
+ * period.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiRecoveryPointInfo {
+ OMX_U32 parsed_flag;
+ OMX_U32 recovery_frame_cnt;
+ OMX_U32 exact_match_flag;
+ OMX_U32 broken_link_flag;
+ OMX_U32 changing_slice_group_idc;
+} OMX_TI_VIDEO_H264VDEC_SeiRecoveryPointInfo;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiPictureTiming
+ *
+ * @brief This structure contains the picture timing SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param NumClockTs :
+ * @param cpb_removal_delay :Specifies how many clock ticks to wait after
+ * removal from the CPB of the access unit associated with the
+ * most recent buffering period SEI message before removing from
+ * the buffer the access unit data associated with the picture
+ * timing SEI message.
+ * @param dpb_output_delay : Used to compute the DPB output time of the
+ * picture.
+ * @param pic_struct : Indicates whether a picture should be displayed as
+ * a frame or field
+ * @param clock_time_stamp_flag[4]:1 - Indicates number of clock timestamp
+ * syntax elements present and follow immediately
+ * 0 \u2013 Indicates associated clock timestamp syntax
+ * elements not present
+ * @param ct_type[4] : Indicates the scan type(interlaced or progressive)
+ * of the source material
+ * @param nuit_field_based_flag[4] : Used to calculate the clockTimestamp
+ * @param counting_type[4] : Specifies the method of dropping values of
+ * n_frames
+ * @param full_timestamp_flag[4] : 1 - Specifies that the n_frames syntax
+ * element is followed by seconds_value,
+ * minutes_value, and hours_value.
+ * 0 - Specifies that the n_frames syntax
+ * element is followed by seconds_flag
+ * @param discontinuity_flag[4] : Indicates whether the difference between
+ * the current value of clockTimestamp and the value of
+ * clockTimestamp computed from the previous clockTimestamp in
+ * output order can be interpreted as the time difference between
+ * the times of origin or capture of the associated frames or
+ * fields.
+ * @param cnt_dropped_flag[4] : Specifies the skipping of one or more
+ * values of n_frames using the counting method
+ * @param n_frames[4] : Specifies the value of nFrames used to compute
+ * clockTimestamp.
+ * @param seconds_flag[4] : equal to 1 specifies that seconds_value and
+ * minutes_flag are present when
+ * full_timestamp_flag is equal to 0.
+ * @param minutes_flag[4] : equal to 1 specifies that minutes_value and
+ * hours_flag are present when full_timestamp_flag
+ * is equal to 0 and seconds_flag is equal to 1.
+ * @param hours_flag[4] : equal to 1 specifies that hours_value is
+ * present when full_timestamp_flag is equal to 0
+ * and seconds_flag is equal to 1 and minutes_flag
+ * is equal to 1.
+ * @param seconds_value[4] : Specifies the value of sS used to compute
+ * clockTimestamp.
+ * @param minutes_value[4] : Specifies the value of mM used to compute
+ * clockTimestamp.
+ * @param hours_value[4] : Specifies the value of tOffset used to compute
+ * clockTimestamp
+ * @param time_offset[4] : Specifies the value of tOffset used to compute
+ * clockTimestamp
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiPictureTiming {
+ OMX_U32 parsed_flag;
+ OMX_U32 NumClockTs;
+ OMX_U32 cpb_removal_delay;
+ OMX_U32 dpb_output_delay;
+ OMX_U32 pic_struct;
+ OMX_U32 clock_time_stamp_flag[4];
+ OMX_U32 ct_type[4];
+ OMX_U32 nuit_field_based_flag[4];
+ OMX_U32 counting_type[4];
+ OMX_U32 full_timestamp_flag[4];
+ OMX_U32 discontinuity_flag[4];
+ OMX_U32 cnt_dropped_flag[4];
+ OMX_U32 n_frames[4];
+ OMX_U32 seconds_flag[4];
+ OMX_U32 minutes_flag[4];
+ OMX_U32 hours_flag[4];
+ OMX_U32 seconds_value[4];
+ OMX_U32 minutes_value[4];
+ OMX_U32 hours_value[4];
+ OMX_S32 time_offset[4];
+}OMX_TI_VIDEO_H264VDEC_SeiPictureTiming;
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRep
+ *
+ * @brief This structure contains the full frmae freeze repetition SEI msg
+ * elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param full_frame_freeze_repetition_period :Specifies the persistence of
+ * the full-frame freeze SEI message
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRep {
+ OMX_U32 parsed_flag;
+ OMX_U32 full_frame_freeze_repetition_period;
+} OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRep;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRel
+ *
+ * @brief This structure contains frame freeze release SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param payloadSize : Size of the frame_freeze_release payload
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRel {
+ OMX_U32 parsed_flag;
+ OMX_U32 payloadSize;
+} OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRel;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiStereoVideoInfo
+ *
+ * @brief This structure contains stereo video information SEI msg elements
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param field_views_flag : 1 - indicates that all pictures in the current
+ * coded video sequence are fields
+ * 0 - indicates that all pictures in the current
+ * coded video sequence are frames.
+ * @param top_field_is_left_view_flag :
+ * 1 - top field is a left view.
+ * 0 - topfield is right view.
+ * @param current_frame_is_left_view_flag :
+ * 1 - current frame is left view.
+ * 0 - current frame is right view.
+ * @param next_frame_is_second_view_flag :
+ * 1 - current picture and a next picture in
+ * output order form a stereo video pair.
+ * 0 - current picture and a previous picture in
+ * output order form a stereo video pair.
+ * @param left_view_self_contained_flag :
+ * 1 - it will not use right view as a reference
+ * picture for inter prediction
+ * 0 - it may use right view as a reference
+ * picture for inter prediction.
+ * @param right_view_self_contained_flag :
+ * 1 - it will not use left view as a reference
+ * picture for inter prediction
+ * 0 - it may use left view as a reference
+ * picture for inter prediction.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiStereoVideoInfo {
+ OMX_U32 parsed_flag;
+ OMX_U32 field_views_flag;
+ OMX_U32 top_field_is_left_view_flag;
+ OMX_U32 current_frame_is_left_view_flag;
+ OMX_U32 next_frame_is_second_view_flag;
+ OMX_U32 left_view_self_contained_flag;
+ OMX_U32 right_view_self_contained_flag;
+} OMX_TI_VIDEO_H264VDEC_SeiStereoVideoInfo;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiFramePacking
+ *
+ * @brief This structure contains frame packing arrangement SEI msg elements
+ *
+ * @param frame_packing_arrangement_id :
+ * contains an identifying number that may be used to identify
+ * the usage of the frame packing arrangement SEI message.
+ * @param frame_packing_arrangement_cancel_flag :
+ * 1 - equal to 1 indicates that the frame packing arrangement
+ * SEI message cancels the persistence of any previous frame
+ * packing arrangement SEI message in output order.
+ * 0 - indicates that frame packing arrangement info follows
+ * @param frame_packing_arrangement_type :
+ * indicates the type of packing arrangement of the frames
+ * @param quincunx_sampling_flag :
+ * 1 - indicates that each color component plane of each
+ * constituent frame is quincunx sampled
+ * 0 - indicates that each color component plane of each
+ * constituent frame is not quincunx sampled
+ * @param content_interpretation_type :
+ * 1 - frame 0 being associated with the left view and frame 1
+ * being associated with the right view
+ * 2 - frame 0 being associated with the right view and frame 1
+ * being associated with the left view
+ * @param spatial_flipping_flag :
+ * 1 - spatial flipping is enabled for any one of the frame
+ * constituent, if frame_packing_arrangement_type is 3 or 4.
+ * 0 - spatial flipping is disabled for any one of the frame
+ * constituent, if frame_packing_arrangement_type is 3 or 4.
+ * @param frame0_flipped_flag :
+ * 1 - frame 0 is spatially flipped
+ * 0 - frame 1 is spatially flipped
+ * @param field_views_flag :
+ * 1 - indicates that all pictures in the current coded video
+ * sequence are coded as complementary field pairs.
+ * 0 - indicates that all pictures in the current coded video
+ * sequence are coded as frame.
+ * @param current_frame_is_frame0_flag :
+ * 1 - indicates that the current decoded frame is constituent
+ * frame 0 and the next decoded frame in output order
+ * is constituent frame 1.
+ * 0 - indicates that the current decoded frame is constituent
+ * frame 1 and the next decoded frame in output order
+ * is constituent frame 0.
+ * @param frame0_self_contained_flag :
+ * 1 - indicates that the constituent frame 0 is dependent on
+ * constituent frame 1 in decoding process
+ * 0 - indicates that the constituent frame 0 may dependent on
+ * constituent frame 1 in decoding process
+ * @param frame1_self_contained_flag :
+ * 1 - indicates that the constituent frame 1 is dependent on
+ * constituent frame 0 in decoding process
+ * 0 - indicates that the constituent frame 1 may dependent on
+ * constituent frame 0 in decoding process
+ * @param frame0_grid_position_x :
+ * specifies the horizontal location of the upper left
+ * sample of constituent frame 0 in the units of one
+ * sixteenth of the luma samples
+ * @param frame0_grid_position_y :
+ * specifies the vertical location of the upper left
+ * sample of constituent frame 0 in the units of one
+ * sixteenth of the luma samples
+ * @param frame1_grid_position_x :
+ * specifies the horizontal location of the upper left
+ * sample of constituent frame 1 in the units of one
+ * sixteenth of the luma samples
+ * @param frame1_grid_position_y :
+ * specifies the vertical location of the upper left
+ * sample of constituent frame 1 in the units of one
+ * sixteenth of the luma samples
+ * @param frame_packing_arrangement_reserved_byte :
+ * reserved for the future use.
+ * @param frame_packing_arrangement_repetition_period :
+ * specifies the persistence of the frame packing arrangement
+ * SEI message and may specify a frame order count interval
+ * within which another frame packing arrangement SEI message
+ * with the same value of frame_packing_arrangement_id or the
+ * end of the coded video sequence shall be present in the
+ * bitstream.
+ * @param frame_packing_arrangement_extension_flag :
+ * 0 - indicates that no additional data follows within the
+ * frame packing arrangement SEI message.
+ * 1 - Reserved for the future use.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiFramePacking {
+ OMX_U32 parsed_flag;
+ OMX_U32 frame_packing_arrangement_id;
+ OMX_U32 frame_packing_arrangement_repetition_period;
+ OMX_U8 frame_packing_arrangement_cancel_flag;
+ OMX_U8 frame_packing_arrangement_type;
+ OMX_U8 quincunx_sampling_flag;
+ OMX_U8 content_interpretation_type;
+ OMX_U8 spatial_flipping_flag;
+ OMX_U8 frame0_flipped_flag;
+ OMX_U8 field_views_flag;
+ OMX_U8 current_frame_is_frame0_flag;
+ OMX_U8 frame0_self_contained_flag;
+ OMX_U8 frame1_self_contained_flag;
+ OMX_U8 frame0_grid_position_x;
+ OMX_U8 frame0_grid_position_y;
+ OMX_U8 frame1_grid_position_x;
+ OMX_U8 frame1_grid_position_y;
+ OMX_U8 frame_packing_arrangement_reserved_byte;
+ OMX_U8 frame_packing_arrangement_extension_flag;
+} OMX_TI_VIDEO_H264VDEC_SeiFramePacking;
+
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_SeiMessages
+ *
+ * @brief This structure contains all the supported SEI msg objects
+ *
+ * @param parsed_flag :1 - Indicates that in the current process call,
+ * contents of the structure is updated
+ * 0 - Indicates contents of the structure is not updated
+ * @param full_frame_freeze : Full-frame freeze SEI message
+ * @param full_frame_freeze_release :Cancels the effect of any full-frame
+ * freeze SEI message sent with pictures that precede the current
+ * picture in the output order.
+ * @param prog_refine_start :Specifies the beginning of a set of consecutive
+ * coded pictures that is labeled as the current picture followed
+ * by a sequence of one or more pictures of refinement of the
+ * quality of the current picture, rather than as a representation
+ * of a continually moving scene.
+ * @param prog_refine_end : Specifies end of progressive refinement.
+ * @param user_data_registered :Message contains user data registered as
+ * specified by ITU-T Recommendation T.35
+ * @param user_data_unregistered :Message contains unregistered user data
+ * identified by a UUID
+ * @param buffering_period_info :Message specifies the buffering period
+ * @param pan_scan_rect :Message specifies the coordinates of a rectangle
+ * relative to the cropping rectangle of the sequence parameter set
+ * @param recovery_pt_info :The recovery point SEI message assists a decoder
+ * in determining when the decoding process will produce acceptable
+ * pictures for display after the decoder initiates random access or
+ * after the encoder indicates a broken link in the sequence.
+ * @param pic_timing :Specifies timing information regarding cpb delays, dpb
+* output delay, and so on.
+ * @param stereo_video_info :stereo video information SEI message consist of
+ * pair of picture forming stereo view content.
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_SeiMessages {
+ OMX_U32 parsed_flag;
+ OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRep full_frame_freeze;
+ OMX_TI_VIDEO_H264VDEC_SeiFullFrameFreezeRel full_frame_freeze_release;
+ OMX_TI_VIDEO_H264VDEC_SeiProgRefineStart prog_refine_start;
+ OMX_TI_VIDEO_H264VDEC_SeiProgRefineEnd prog_refine_end;
+ OMX_TI_VIDEO_H264VDEC_SeiUserDataRegITUT user_data_registered;
+ OMX_TI_VIDEO_H264VDEC_SeiUserDataUnReg user_data_unregistered;
+ OMX_TI_VIDEO_H264VDEC_SeiBufferingPeriod buffering_period_info;
+ OMX_TI_VIDEO_H264VDEC_SeiPanScanRect pan_scan_rect;
+ OMX_TI_VIDEO_H264VDEC_SeiRecoveryPointInfo recovery_pt_info;
+ OMX_TI_VIDEO_H264VDEC_SeiPictureTiming pic_timing;
+ OMX_TI_VIDEO_H264VDEC_SeiStereoVideoInfo stereo_video_info;
+ OMX_TI_VIDEO_H264VDEC_SeiFramePacking frame_packing;
+} OMX_TI_VIDEO_H264VDEC_SeiMessages;
+
+
+/**
+ ******************************************************************************
+ * @struct _sErrConcealStr
+ * @brief This str holds up the required Info for implementing the SCV EC,
+ * this will get updated by H.264 decoder while decoding the SVC
+ * Base/Target Layers
+ *
+ * @param CurrMbInfoBufPointer :Base Address of the current decoded frame
+ * MB Info buffer
+ *
+ * @param CurrMbStatusBufPointer: Base Address of the current decoded frame
+ * MB staus buffer pointer
+ *
+ * @param currFrameY : Base Address of the current decoded Luma
+ * frame buffer pointer (physical pointer)
+ *
+ * @param currFrameUV : Base Address of the current decoded Chroma
+ * frame buffer pointer (physical pointer)
+ *
+ * @param refConclY : Base Address of the ref decoded Luma
+ * frame buffer pointer (virtual pointer)
+ *
+ * @param refConclUV : Base Address of the ref decoded Chroma
+ * frame buffer pointer (virtual pointer)
+ *
+ * @param TilerBaseAddress : TBA vaule for the VDMA
+ *
+ * @param pSliceInfoFlags : Flag to enable slice info
+ *
+ * @param ref_width : Resultant Horizontal LUMA picture size
+ * after Pad size addition on both Left
+ * & Right sides. This gets used as
+ * stride during vDMA programming.
+ * In case of TILER,the stride is fixed,
+ * independant of Picture width, and
+ * only changes with TILER mode.
+ *
+ * @param ref_width_c : Resultant Horizontal CHROMA picture size
+ * after Pad size addition on both Left &
+ * Right sides.
+ *
+ *
+ * @param ref_frame_height : In case of Interlaced streams,the picure
+ * store is different i.e., store each field
+ * by applying PAD on top & bottom lines.
+ * Hence the picture height will be Height
+ * plus four times the Pad size. This
+ * variable holds this resultant value.
+ *
+ * @param mb_width : Picture width in terms of Macroblocks
+ *
+ * @param mb_height : Picture height in terms of Macroblocks.
+ *
+ * @param image_width : Image width of the decoded frame
+ *
+ * @param image_width : Image height of the decoded frame
+ *
+ * @param frameType : Frame type of the current frame.
+ *
+ * @param picaff_frame : Flag to indicate whether current picture
+ * is of Frame type & referring to Field
+ * picture as reference.
+ *
+ * @param mb_aff_frame_flag : Flag to indicate whether the current
+ * decoding picture is MBAFF type.
+ *
+ * @param field_pic_flag : Flag to indicate whether the current
+ * decoding picture is field type.
+ *
+ * @param bottom_field_flag : This parameter equal to 1 specifies that
+ * the slice is part of a coded bottom field.
+ * bottom_field_flag equalto 0 specifies
+ * that the picture is a coded top field.
+ *
+ * @param nonPairedFieldPic : Flag to indicate Non paired field picture.
+ *
+ * @param prev_pic_bottom_field : this variable Indicates if the previous
+ * picture was a bottom field or not (a Flag)
+ ******************************************************************************
+*/
+
+typedef struct OMX_TI_VIDEO_H264VDEC_ErrConcealStr {
+ OMX_S32 ErrConcealmentEnable;
+ OMX_S32 CurrMbInfoBufPointer;
+ OMX_S32 CurrMbStatusBufPointer;
+ OMX_S32 CurrMbInfoIresBufPointer;
+ OMX_S32 currFrameY;
+ OMX_S32 currFrameUV;
+ OMX_S32 refConclY;
+ OMX_S32 refConclUV;
+ OMX_U32 TilerBaseAddress;
+ OMX_U16 ref_width;
+ OMX_U16 ref_width_c;
+ OMX_U16 ref_frame_height;
+ OMX_U16 mb_width;
+ OMX_U16 mb_height;
+ OMX_U16 image_width;
+ OMX_U16 image_height;
+ OMX_U8 frameType;
+ OMX_U8 picaff_frame;
+ OMX_U8 mb_aff_frame_flag;
+ OMX_U8 field_pic_flag;
+ OMX_U8 bottom_field_flag;
+ OMX_U8 nonPairedFieldPic;
+ OMX_U8 prev_pic_bottom_field;
+}OMX_TI_VIDEO_H264VDEC_ErrConcealStr;
+
+/**
+ * Size of sliceinfo flags - We have two slice info flag arrays in SL2, one
+ * for ECD3 and the other for MC3. ECD3 flag is one bit per MB. Since Maximum
+ * supported number of MBs in a frame is 128 x 128 = 16384, we need 16384/8 =
+ * 2048 bytes for the slice info flag array for ECD3. But for the MC3 array,
+ * we always make the next bit also as 1 to enable loading into ping and pong
+ * memories of MCBUF. So we need an extra bit for the MC3 array, to avoid
+ * buffer overflow when the last MB is a new slice. To keep the next SL2 buffer
+ * in 16-byte aligned position (some buffers need it) we round the size to next
+ * multiple of 16, i.e., 2064.
+*/
+#define OMX_TI_VIDEO_SLICEINFO_FLAGSIZE 2064
+
+/**
+ ******************************************************************************
+ * @struct _sErrConcealLayerStr
+ * @brief This str holds up the required Info for implementing the SCV EC,
+ * this will get updated by H.264 decoder while decoding the SVC
+ * Base/Target Layers
+ *
+ * @param svcEcStr : structure instance of sSVCErrConcealStr
+ *
+ * @param pSliceInfoFlags : Array to store the sliceInfo flag
+ *
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_ErrConcealLayerStr {
+ OMX_TI_VIDEO_H264VDEC_ErrConcealStr sECStr;
+ OMX_U8 pSliceInfoFlags[OMX_TI_VIDEO_SLICEINFO_FLAGSIZE];
+}OMX_TI_VIDEO_H264VDEC_ErrConcealLayerStr;
+
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_CommonInfo
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_CommonInfo {
+ OMX_U32 codec_type : 8;
+ OMX_U32 fmt_type : 8;
+ OMX_U32 mb_ll_avail : 1;
+ OMX_U32 mb_ul_avail : 1;
+ OMX_U32 mb_uu_avail : 1;
+ OMX_U32 mb_ur_avail : 1;
+ OMX_U32 pic_bound_l : 1;
+ OMX_U32 pic_bound_u : 1;
+ OMX_U32 pic_bound_r : 1;
+ OMX_U32 pic_bound_b : 1;
+ OMX_U32 first_mb_flag : 1;
+ OMX_U32 error_flag : 1;
+ OMX_U32 zero : 6;
+ OMX_U32 zeroes : 16;
+ OMX_U32 mb_addr : 16;
+
+} OMX_TI_VIDEO_H264VDEC_CommonInfo;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_MotionVector
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_MotionVector {
+ OMX_S16 x;
+ OMX_S16 y;
+} OMX_TI_VIDEO_H264VDEC_MotionVector;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_CabacContext
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_CabacContext {
+ OMX_TI_VIDEO_H264VDEC_MotionVector mvd_l0[4];
+ OMX_TI_VIDEO_H264VDEC_MotionVector mvd_l1[4];
+
+} OMX_TI_VIDEO_H264VDEC_CabacContext;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_TotalCoefLuma
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_TotalCoefLuma {
+ OMX_U8 right[3];
+ OMX_U8 bottom_right;
+ OMX_U8 bottom[3];
+ OMX_U8 zero;
+} OMX_TI_VIDEO_H264VDEC_TotalCoefLuma;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_TotalCoefChroma
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_TotalCoefChroma {
+ OMX_U8 right_cb;
+ OMX_U8 bottom_right_cb;
+ OMX_U8 bottom_cb;
+ OMX_U8 zero;
+ OMX_U8 right_cr;
+ OMX_U8 bottom_right_cr;
+ OMX_U8 bottom_cr;
+ OMX_U8 zero1;
+} OMX_TI_VIDEO_H264VDEC_TotalCoefChroma;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_CavlcContext
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_CavlcContext {
+ unsigned long long zeroes[2];
+ OMX_TI_VIDEO_H264VDEC_TotalCoefLuma total_coef_luma;
+ OMX_TI_VIDEO_H264VDEC_TotalCoefChroma total_coef_chroma;
+
+} OMX_TI_VIDEO_H264VDEC_CavlcContext;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_IntraPredMode
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_IntraPredMode {
+ OMX_U32 ipred_mode0 : 4;
+ OMX_U32 ipred_mode1 : 4;
+ OMX_U32 ipred_mode2 : 4;
+ OMX_U32 ipred_mode3 : 4;
+ OMX_U32 ipred_mode4 : 4;
+ OMX_U32 ipred_mode5 : 4;
+ OMX_U32 ipred_mode6 : 4;
+ OMX_U32 ipred_mode7 : 4;
+ OMX_U32 ipred_mode8 : 4;
+ OMX_U32 ipred_mode9 : 4;
+ OMX_U32 ipred_mode10 : 4;
+ OMX_U32 ipred_mode11 : 4;
+ OMX_U32 ipred_mode12 : 4;
+ OMX_U32 ipred_mode13 : 4;
+ OMX_U32 ipred_mode14 : 4;
+ OMX_U32 ipred_mode15 : 4;
+
+} OMX_TI_VIDEO_H264VDEC_IntraPredMode;
+
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_MbPredType
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_MbPredType {
+ OMX_U32 mbskip : 1;
+ OMX_U32 tr8x8 : 1;
+ OMX_U32 mb_field : 1;
+ OMX_U32 cond_mbskip : 1;
+ OMX_U32 c_ipred_mode : 2;
+ OMX_U32 zero : 1;
+ OMX_U32 end_of_slice : 1;
+ OMX_U32 mb_y_mod2 : 1;
+ OMX_U32 zero1 : 7;
+ OMX_U32 refidx_equal_flag_l0 : 1;
+ OMX_U32 refidx_equal_flag_l1 : 1;
+ OMX_U32 mv_equal_flag_l0 : 1;
+ OMX_U32 mv_equal_flag_l1 : 1;
+ OMX_U32 zeroes : 4;
+ OMX_U32 mb_type : 8;
+ OMX_U8 sub_mb_type[4];
+
+} OMX_TI_VIDEO_H264VDEC_MbPredType;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_QpCbp
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_QpCbp {
+ OMX_U32 cbp;
+ OMX_U8 qp_y;
+ OMX_U8 qp_cb;
+ OMX_U8 qp_cr;
+ OMX_U8 zero;
+} OMX_TI_VIDEO_H264VDEC_QpCbp;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_RefPicControl
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_RefPicControl {
+ OMX_U8 refidx[4];
+ OMX_U8 refpicid[4];
+
+} OMX_TI_VIDEO_H264VDEC_RefPicControl;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_MvBidirectional16
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_MvBidirectional16 {
+ OMX_TI_VIDEO_H264VDEC_MotionVector mv_forward[16];
+ OMX_TI_VIDEO_H264VDEC_MotionVector mv_backward[16];
+} OMX_TI_VIDEO_H264VDEC_MvBidirectional16;
+
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_MvBidirectional4
+ *
+ * @brief
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_MvBidirectional4 {
+ OMX_TI_VIDEO_H264VDEC_MotionVector mv_forward[4];
+ OMX_TI_VIDEO_H264VDEC_MotionVector mv_backward[4];
+
+} OMX_TI_VIDEO_H264VDEC_MvBidirectional4;
+
+/**
+ ******************************************************************************
+ * @struct OMX_TI_VIDEO_H264VDEC_MbInfo
+ *
+ * @brief This structure details the data format for MB information shared to
+ * application. This helps application to understand all fields
+ * the way codec uses MB info internally. This structure is of size
+ * 208 Bytes.
+ *
+ * @param info : This elements gives details about the MB placement in the
+ * frame.
+ *
+ * @param cabac: This field holds the context data for a CABAC coded MB
+ *
+ * @param cavlc: This field holds the context data for a CAVLC coded MB
+ *
+ * @param ipred_mode: This field holds information of intra prediction modes
+ * at 4x4 level, for intra coded MB.
+ *
+ * @param mb_pred_type: This indicates prediction specific details for inter
+ * coded MB
+ *
+ * @param qp_cbp: This gives coded & QP informations for both LUMA & CHROMA
+ * components of a Macro Block.
+ *
+ * @param l0_ref_pic_control: Informs all details about reference indices
+ * at 8x8 block level in L0 direction
+ *
+ * @param l1_ref_pic_control: Informs all details about reference indices
+ * at 8x8 block level in L1 direction
+ *
+ * @param mv_forward: Lists all Motion vectors at 4x4 level in L0 direction
+ *
+ * @param bidirectional16: Lists all Motion vectors at 4x4 level in both
+ * directions
+ *
+ * @param bidirectional4: Lists all Motion vectors at 8x8 level in both
+ * directions
+ *
+ ******************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_H264VDEC_MbInfo {
+ OMX_TI_VIDEO_H264VDEC_CommonInfo info;
+
+ union {
+ OMX_TI_VIDEO_H264VDEC_CabacContext cabac;
+ OMX_TI_VIDEO_H264VDEC_CavlcContext cavlc;
+ } OMX_TI_VIDEO_H264VDEC_context;
+
+ OMX_TI_VIDEO_H264VDEC_IntraPredMode ipred_mode;
+ OMX_TI_VIDEO_H264VDEC_MbPredType mb_pred_type;
+ OMX_TI_VIDEO_H264VDEC_QpCbp qp_cbp;
+ OMX_TI_VIDEO_H264VDEC_RefPicControl l0_ref_pic_control;
+ OMX_TI_VIDEO_H264VDEC_RefPicControl l1_ref_pic_control;
+
+ union {
+ OMX_TI_VIDEO_H264VDEC_MotionVector mv_forward[16];
+ OMX_TI_VIDEO_H264VDEC_MvBidirectional16 bidirectional16;
+ OMX_TI_VIDEO_H264VDEC_MvBidirectional4 bidirectional4;
+ } OMX_TI_VIDEO_H264VDEC_motion_vecs;
+
+} OMX_TI_VIDEO_H264VDEC_MbInfo;
+
+
+
+/**
+********************************************************************************
+* @struct OMX_TI_VIDEO_VC1VDEC_MbInfo
+*
+* @brief MB information structure that is written out by the IVA-HD hardware.
+*
+* @note None:
+*
+********************************************************************************
+*/
+typedef struct OMX_TI_VIDEO_VC1VDEC_MbInfo {
+ /* MB address */
+ OMX_U8 mb_addr;
+ /* Error flag */
+ OMX_U8 error_flag;
+ /* First MB flag */
+ OMX_U8 first_mb_flag;
+ /* Picture bound */
+ OMX_U8 pic_bound_b;
+ /* Upper picture bound */
+ OMX_U8 pic_bound_u;
+ /* Right picture bound */
+ OMX_U8 pic_bound_r;
+ /* Left picture bound */
+ OMX_U8 pic_bound_l;
+ /* Availability of upper right MB */
+ OMX_U8 mb_ur_avail;
+ /* Availability of upper MB */
+ OMX_U8 mb_uu_avail;
+ /* Availability of upper left MB */
+ OMX_U8 mb_ul_avail;
+ /* Availability of left MB */
+ OMX_U8 mb_ll_avail;
+ /* Macroblock header format type */
+ OMX_U8 fmt_type;
+ /* Codec type */
+ OMX_U8 codec_type;
+ /* Indicates DC values of each Y block in current MB */
+ OMX_U8 dc_coef_q_y[4];
+ /* Indicates DC values of Cr block in current MB */
+ OMX_U8 dc_coef_q_cr;
+ /* Indicates DC values of Cb block in current MB */
+ OMX_U8 dc_coef_q_cb;
+ /* Block type of cr block */
+ OMX_U8 block_type_cr;
+ /* Block type of cb block */
+ OMX_U8 block_type_cb;
+ /* Block types of luma */
+ OMX_U8 block_type_y[4];
+ /* In decoding, if the current macroblock is the last macroblock in a slice,*/
+ /* ECD sets 1 to this field during executing the macroblock. Otherwise, ECD */
+ /* sets 0 to this field */
+ OMX_U8 end_of_slice;
+ /* 1 : allow skipping current MB if CBP = 0 */
+ OMX_U8 cond_skip_flag;
+ /* Skipped / non skipped MB */
+ OMX_U8 skip;
+ /* 1 indicates that overlap filtering is in use for the macroblock. */
+ OMX_U8 overlap;
+ /* 1 indicates that AC prediction is in use for the macroblock */
+ OMX_U8 acpred;
+ /* Denotes inter-prediction direction for the macroblock in B-picture */
+ OMX_U8 b_picture_direction;
+ /* Denotes the number of motion vectors. */
+ OMX_U8 mv_mode;
+ /* 1 indicates that the field transform is in use for the macroblock. */
+ OMX_U8 fieldtx;
+ /* 1 indicates that field inter-prediction is in use */
+ OMX_U8 mv_type;
+ /* Equals the reference frame distance */
+ OMX_U8 refdist;
+ /* 1 indicates that macroblock quantizer-scale (MQUANT) overflows */
+ OMX_U8 mquant_overflow;
+ /* Equals the quantizer-scale for the macroblock */
+ OMX_U8 quant;
+ /* 1 indicates that 0.5 shall be added to PQUANT in calculation of */
+ /* quantizer-scale. This field is valid for decoding only. */
+ OMX_U8 halfqp;
+ /* Equals the DC coefficient step size which is derived from MQUANT in the */
+ /* bit-stream */
+ OMX_U8 dc_step_size;
+ /* Denotes the coded sub-block pattern for cr block */
+ OMX_U8 cbp_cr;
+ /* Denotes the coded sub-block pattern for cb block */
+ OMX_U8 cbp_cb;
+ /* Denotes the coded sub-block pattern for luma blocks */
+ OMX_U8 cbp_y[3];
+ /* Denotes the backward reference field picture */
+ OMX_U8 mv_bw_ref_y[4];
+ /* Denotes the forward reference field picture */
+ OMX_U8 mv_fw_ref_y[3];
+ /* Unclipped forward motion vector for luma */
+ OMX_U8 mv_fw_y[4][4];
+ /* Unclipped backward motion vector for luma */
+ OMX_U8 mv_bw_y[1][1];
+ /* Unclipped backward motion vector for chroma */
+ OMX_U8 mv_bw_c[2];
+ /* Unclipped forward motion vector for chroma */
+ OMX_U8 mv_fw_c[2];
+ /* Clipped forward motion vector for luma */
+ OMX_U8 cmv_fw_y[4][4];
+ /* Clipped backward motion vector for luma */
+ OMX_U8 cmv_bw_y[4][4];
+ /* Clipped forward motion vector for chroma */
+ OMX_U8 cmv_fw_c[4][4];
+ /* Clipped backward motion vector for chroma */
+ OMX_U8 cmv_bw_c[4][4];
+
+}OMX_TI_VIDEO_VC1VDEC_MbInfo;
+
+/* ============================================================================= */
+/*
+@brief OMX_TI_VIDEO_PARAM_DEBLOCKINGQP : Structure to configure QP value for enhanced deblocking fliter
+ of MPEG4 video decoder.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nDeblockingQP : QP value for enhanced deblocking filter
+ *
+ */
+/* ============================================================================= */
+typedef struct OMX_TI_VIDEO_PARAM_DEBLOCKINGQP {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDeblockingQP;
+} OMX_TI_VIDEO_PARAM_DEBLOCKINGQP;
+
+/* ============================================================================= */
+/*
+@brief Extended parameters for VC1 standard
+*/
+/* ============================================================================= */
+/**
+ * VC1 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_TI_VIDEO_VC1PROFILETYPE {
+ OMX_VIDEO_VC1SimpleProfile = 0, /**< Simple Profile */
+ OMX_VIDEO_VC1MainProfile = 1, /**< Main Profile */
+ OMX_VIDEO_VC1AdvancedProfile = 3 /**< Advanced Profile */
+}OMX_TI_VIDEO_VC1PROFILETYPE;
+
+/**
+ * VC1 level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates.
+ */
+typedef enum OMX_TI_VIDEO_VC1LEVELTYPE {
+ OMX_VIDEO_VC1SPLOW = 0, /**< Simple Profile Level Low */
+ OMX_VIDEO_VC1SPMED = 2, /**< Simple Profile Level Medium */
+ OMX_VIDEO_VC1MPLOW = 0, /**< Main Profile Level Low */
+ OMX_VIDEO_VC1MPMED = 2, /**< Main Profile Level Medium */
+ OMX_VIDEO_VC1MPHIGH = 4, /**< Main Profile Level High */
+ OMX_VIDEO_VC1APL0 = 0, /**< Advanced Profile Level L0 */
+ OMX_VIDEO_VC1APL1 = 1, /**< Advanced Profile Level L1 */
+ OMX_VIDEO_VC1APL2 = 2, /**< Advanced Profile Level L2 */
+ OMX_VIDEO_VC1APL3 = 3, /**< Advanced Profile Level L3 */
+ OMX_VIDEO_VC1APL4 = 4, /**< Advanced Profile Level L4 */
+ OMX_VIDEO_VC1LEVEL_MAX = 0X7FFFFFFF
+}OMX_TI_VIDEO_VC1LEVELTYPE;
+
+/**
+ * @brief Specifies the type of interlace content for VC1
+ */
+typedef enum OMX_TI_VIDEO_VC1_INTERLACE_CODINGTYPE {
+ OMX_TI_Video_VC1Interlace_PICAFF = 0, /**< PicAFF type of interlace coding */
+ OMX_TI_Video_VC1Interlace_Fieldonly = 2, /**< Field only coding with fixed partiy scheme */
+ OMX_TI_Video_VC1Interlace_Fieldonly_MRF = OMX_TI_Video_VC1Interlace_Fieldonly, /**< Use Most recent field for refernece */
+ OMX_TI_Video_VC1Interlace_Fieldonly_ARF = 3, /**< codec decides the partiy of of the field to
+ * be used based upon content (adaptive) */
+ OMX_TI_Video_VC1Interlace_DEFAULT = OMX_TI_Video_VC1Interlace_Fieldonly_ARF, /**< Default : adaptive partiy for reference */
+ OMX_TI_Video_VC1Interlace_Fieldonly_SPF = 4, /**< Use same parity field for refernece */
+ OMX_TI_Video_VC1Interlace_MAX = 0X7FFFFFFF
+}OMX_TI_VIDEO_VC1_INTERLACE_CODINGTYPE;
+
+/**
+ * VC1 loop filter modes
+ *
+ * OMX_VIDEO_AVCLoopFilterEnable : Enable
+ * OMX_VIDEO_AVCLoopFilterDisable : Disable
+ */
+typedef enum OMX_VIDEO_VC1LOOPFILTERTYPE {
+ OMX_VIDEO_VC1LoopFilterEnable = 0,
+ OMX_VIDEO_VC1LoopFilterDisable,
+ OMX_VIDEO_VC1LoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_VC1LoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_VC1LoopFilterMax = 0x7FFFFFFF
+} OMX_VIDEO_VC1LOOPFILTERTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_VC1INTERLACECODING : to configure the interlace encoding related settings
+ @param eInterlaceCodingType to specify the settings of interlace content
+ @sa OMX_TI_VIDEO_VC1_INTERLACE_CODINGTYPE
+ @param bTopFieldFirst to speicfy the first field sent is top or bottom
+ @param bBottom_Field_Intra to specify codec that encode bottomfield also as intra or not
+*/
+/* ==========================================================================*/
+typedef struct OMX_TI_VIDEO_PARAM_VC1INTERLACECODING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_VC1_INTERLACE_CODINGTYPE eInterlaceCodingType;
+ OMX_BOOL bTopFieldFirst;
+ OMX_BOOL bBottomFieldIntra;
+} OMX_TI_VIDEO_PARAM_VC1INTERLACECODING;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_PARAM_VC1HRDBUFFERSETTING : to configure the HRD related params
+ @param nInitialBufferLevel Initial Buffer level for HRD compliance
+
+ @param nHRDBufferSize Hypothetical Reference Decoder Buffer Size
+
+ @param nTargetBitrate Target bitrate to encode with
+
+*/
+/* ==========================================================================*/
+typedef struct OMX_TI_VIDEO_PARAM_VC1HRDBUFFERSETTING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nInitialBufferLevel;
+ OMX_U32 nHRDBufferSize;
+ OMX_U32 nTargetBitrate;
+} OMX_TI_VIDEO_PARAM_VC1HRDBUFFERSETTING;
+
+/**
+ * VC1 intra Period Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Specifies internal of coding Intra frames
+ */
+typedef struct OMX_TI_VIDEO_CONFIG_VC1INTRAPERIOD {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+} OMX_TI_VIDEO_CONFIG_VC1INTRAPERIOD; // IDR is not supported in VC1
+
+/**
+ * VC1 Slice Mode modes
+ *
+ * OMX_VIDEO_SLICEMODE_VC1Default : Default slice coding mode is disabled
+ * OMX_VIDEO_SLICEMODE_VC1ROWSlice : Slices are controlled based upon number of Rows
+ * OMX_VIDEO_SLICEMODE_VC1OFFSET : Slices are controlled based upon user defined offset in unit of Rows
+ */
+typedef enum OMX_TI_VIDEO_VC1SLICEMODETYPE {
+ OMX_VIDEO_SLICEMODE_VC1Default = 0,
+ OMX_VIDEO_SLICEMODE_VC1ROWSlice,
+ OMX_VIDEO_SLICEMODE_VC1OFFSET,
+ OMX_VIDEO_SLICEMODE_VC1KhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_SLICEMODE_VC1VendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_SLICEMODE_VC1LevelMax = 0x7FFFFFFF
+} OMX_TI_VIDEO_VC1SLICEMODETYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_VIDEO_CONFIG_VC1SLICECODINGTYPE : to configure the Slice Settings
+ @param eSliceMode to specify the Slice mode
+ @sa OMX_TI_VIDEO_VC1SLICEMODETYPE
+ @param nSlicesize to specify the sliceSize
+*/
+/* ==========================================================================*/
+typedef struct OMX_VIDEO_CONFIG_VC1SLICECODINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_VC1SLICEMODETYPE eSliceMode;
+ OMX_U32 nSlicesize;
+} OMX_VIDEO_CONFIG_VC1SLICECODINGTYPE;
+
+/* ========================================================================== */
+/*!
+ @brief OMX_TI_VIDEO_CONFIG_VC1HRDBUFFERSETTING : to configure the HRD related params
+
+ @param nHRDBufferSize Hypothetical Reference Decoder Buffer Size
+
+ @param nEncodeBitrate Target bitrate to encode with
+
+*/
+/* ==========================================================================*/
+typedef struct OMX_TI_VIDEO_CONFIG_VC1HRDBUFFERSETTING {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nHRDBufferSize;
+ OMX_U32 nEncodeBitrate;
+} OMX_TI_VIDEO_CONFIG_VC1HRDBUFFERSETTING;
+
+/**
+ * VC1 params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eProfile : VC1 profile(s) to use
+ * eLevel : VC1 level(s) to use
+ * eLoopFilterMode : Enable/disable loop filter
+ */
+typedef struct OMX_TI_VIDEO_VC1_STD_PARAMS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TI_VIDEO_VC1PROFILETYPE eProfile;
+ OMX_TI_VIDEO_VC1LEVELTYPE eLevel;
+ OMX_VIDEO_VC1LOOPFILTERTYPE eLoopFilterMode;
+}OMX_TI_VIDEO_VC1_STD_PARAMS;
+
+/**
+ * GetConfigData params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nBufarray[100] : Array containing config data
+ * nBufSize : number of bytes of config data in the nBufarray
+ */
+typedef struct OMX_TI_VIDEO_GETCONFIGPARAMS {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nBufarray[100];
+ OMX_U32 nBufSize;
+}OMX_TI_VIDEO_GETCONFIGPARAMS;
+
+/**
+ * VC1 BitStreamFormat Type
+ */
+typedef enum OMX_VC1FORMATSTYPE {
+ OMX_VC1RAWStream = 0,
+ /**< bit-stream does not contain the RCV headers */
+ OMX_VC1RCVType1Stream = 1,
+ /**< bit-stream contain the RCV headers in Version 1 format */
+ OMX_VC1RCVType2Stream = 2,
+ /**< bit-stream contain the RCV headers in Version 2 format */
+ OMX_VC1StreamFormatDefault = OMX_VC1RCVType2Stream,
+ /**< Default stream format is RCV2 format */
+ OMX_VC1FormatCodingMax
+} OMX_VC1FORMATSTYPE;
+
+/**
+ * VC1 BitStream Format
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eVC1Format : The format of headers in the encoded bitstream
+ */
+typedef struct OMX_VC1BITSTREAMFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VC1FORMATSTYPE eVC1Format;
+} OMX_VC1BITSTREAMFORMATTYPE;
+
+#endif /* OMX_TI_VIDEO_H */
+
diff --git a/domx/omx_core/inc/OMX_Types.h b/domx/omx_core/inc/OMX_Types.h
new file mode 100644
index 0000000..2fda817
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Types.h
@@ -0,0 +1,364 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/*
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_Types.h - OpenMax IL version 1.1.2
+ * The OMX_Types header file contains the primitive type definitions used by
+ * the core, the application and the component. This file may need to be
+ * modified to be used on systems that do not have "char" set to 8 bits,
+ * "short" set to 16 bits and "long" set to 32 bits.
+ */
+
+#ifndef OMX_Types_h
+#define OMX_Types_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/** The OMX_API and OMX_APIENTRY are platform specific definitions used
+ * to declare OMX function prototypes. They are modified to meet the
+ * requirements for a particular platform */
+#ifdef __SYMBIAN32__
+# ifdef __OMX_EXPORTS
+# define OMX_API __declspec(dllexport)
+# else
+# ifdef _WIN32
+# define OMX_API __declspec(dllexport)
+# else
+# define OMX_API __declspec(dllimport)
+# endif
+# endif
+#else
+# ifdef _WIN32
+# ifdef __OMX_EXPORTS
+# define OMX_API __declspec(dllexport)
+# else
+# define OMX_API __declspec(dllimport)
+# endif
+# else
+# ifdef __OMX_EXPORTS
+# define OMX_API
+# else
+# define OMX_API extern
+# endif
+# endif
+#endif
+
+#ifndef OMX_APIENTRY
+#define OMX_APIENTRY
+#endif
+
+/** OMX_IN is used to identify inputs to an OMX function. This designation
+ will also be used in the case of a pointer that points to a parameter
+ that is used as an output. */
+#ifndef OMX_IN
+#define OMX_IN
+#endif
+
+/** OMX_OUT is used to identify outputs from an OMX function. This
+ designation will also be used in the case of a pointer that points
+ to a parameter that is used as an input. */
+#ifndef OMX_OUT
+#define OMX_OUT
+#endif
+
+
+/** OMX_INOUT is used to identify parameters that may be either inputs or
+ outputs from an OMX function at the same time. This designation will
+ also be used in the case of a pointer that points to a parameter that
+ is used both as an input and an output. */
+#ifndef OMX_INOUT
+#define OMX_INOUT
+#endif
+
+/** OMX_ALL is used to as a wildcard to select all entities of the same type
+ * when specifying the index, or referring to a object by an index. (i.e.
+ * use OMX_ALL to indicate all N channels). When used as a port index
+ * for a config or parameter this OMX_ALL denotes that the config or
+ * parameter applies to the entire component not just one port. */
+#define OMX_ALL 0xFFFFFFFF
+
+/** In the following we define groups that help building doxygen documentation */
+
+/** @defgroup core OpenMAX IL core
+ * Functions and structure related to the OMX IL core
+ */
+
+ /** @defgroup comp OpenMAX IL component
+ * Functions and structure related to the OMX IL component
+ */
+
+/** @defgroup rpm Resource and Policy Management
+ * Structures for resource and policy management of components
+ */
+
+/** @defgroup buf Buffer Management
+ * Buffer handling functions and structures
+ */
+
+/** @defgroup tun Tunneling
+ * @ingroup core comp
+ * Structures and functions to manage tunnels among component ports
+ */
+
+/** @defgroup cp Content Pipes
+ * @ingroup core
+ */
+
+ /** @defgroup metadata Metadata handling
+ *
+ */
+
+/** OMX_U8 is an 8 bit unsigned quantity that is byte aligned */
+typedef unsigned char OMX_U8;
+
+/** OMX_S8 is an 8 bit signed quantity that is byte aligned */
+typedef signed char OMX_S8;
+
+/** OMX_U16 is a 16 bit unsigned quantity that is 16 bit word aligned */
+typedef unsigned short OMX_U16;
+
+/** OMX_S16 is a 16 bit signed quantity that is 16 bit word aligned */
+typedef signed short OMX_S16;
+
+/** OMX_U32 is a 32 bit unsigned quantity that is 32 bit word aligned */
+typedef unsigned long OMX_U32;
+
+/** OMX_S32 is a 32 bit signed quantity that is 32 bit word aligned */
+typedef signed long OMX_S32;
+
+
+/* Users with compilers that cannot accept the "long long" designation should
+ define the OMX_SKIP64BIT macro. It should be noted that this may cause
+ some components to fail to compile if the component was written to require
+ 64 bit integral types. However, these components would NOT compile anyway
+ since the compiler does not support the way the component was written.
+*/
+#ifndef OMX_SKIP64BIT
+#ifdef __SYMBIAN32__
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long OMX_S64;
+
+#elif defined(WIN32)
+
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned __int64 OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed __int64 OMX_S64;
+
+#else /* WIN32 */
+
+/** OMX_U64 is a 64 bit unsigned quantity that is 64 bit word aligned */
+typedef unsigned long long OMX_U64;
+
+/** OMX_S64 is a 64 bit signed quantity that is 64 bit word aligned */
+typedef signed long long OMX_S64;
+
+#endif /* WIN32 */
+#endif
+
+
+/** The OMX_BOOL type is intended to be used to represent a true or a false
+ value when passing parameters to and from the OMX core and components. The
+ OMX_BOOL is a 32 bit quantity and is aligned on a 32 bit word boundary.
+ */
+typedef enum OMX_BOOL {
+ OMX_FALSE = 0,
+ OMX_TRUE = !OMX_FALSE,
+ OMX_BOOL_MAX = 0x7FFFFFFF
+} OMX_BOOL;
+
+/** The OMX_PTR type is intended to be used to pass pointers between the OMX
+ applications and the OMX Core and components. This is a 32 bit pointer and
+ is aligned on a 32 bit boundary.
+ */
+typedef void* OMX_PTR;
+
+/** The OMX_STRING type is intended to be used to pass "C" type strings between
+ the application and the core and component. The OMX_STRING type is a 32
+ bit pointer to a zero terminated string. The pointer is word aligned and
+ the string is byte aligned.
+ */
+typedef char* OMX_STRING;
+
+/** The OMX_BYTE type is intended to be used to pass arrays of bytes such as
+ buffers between the application and the component and core. The OMX_BYTE
+ type is a 32 bit pointer to a zero terminated string. The pointer is word
+ aligned and the string is byte aligned.
+ */
+typedef unsigned char* OMX_BYTE;
+
+/** OMX_UUIDTYPE is a very long unique identifier to uniquely identify
+ at runtime. This identifier should be generated by a component in a way
+ that guarantees that every instance of the identifier running on the system
+ is unique. */
+typedef unsigned char OMX_UUIDTYPE[128];
+
+/** The OMX_DIRTYPE enumeration is used to indicate if a port is an input or
+ an output port. This enumeration is common across all component types.
+ */
+typedef enum OMX_DIRTYPE
+{
+ OMX_DirInput, /**< Port is an input port */
+ OMX_DirOutput, /**< Port is an output port */
+ OMX_DirMax = 0x7FFFFFFF
+} OMX_DIRTYPE;
+
+/** The OMX_ENDIANTYPE enumeration is used to indicate the bit ordering
+ for numerical data (i.e. big endian, or little endian).
+ */
+typedef enum OMX_ENDIANTYPE
+{
+ OMX_EndianBig, /**< big endian */
+ OMX_EndianLittle, /**< little endian */
+ OMX_EndianMax = 0x7FFFFFFF
+} OMX_ENDIANTYPE;
+
+
+/** The OMX_NUMERICALDATATYPE enumeration is used to indicate if data
+ is signed or unsigned
+ */
+typedef enum OMX_NUMERICALDATATYPE
+{
+ OMX_NumericalDataSigned, /**< signed data */
+ OMX_NumericalDataUnsigned, /**< unsigned data */
+ OMX_NumercialDataMax = 0x7FFFFFFF
+} OMX_NUMERICALDATATYPE;
+
+
+/** Unsigned bounded value type */
+typedef struct OMX_BU32 {
+ OMX_U32 nValue; /**< actual value */
+ OMX_U32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
+ OMX_U32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
+} OMX_BU32;
+
+
+/** Signed bounded value type */
+typedef struct OMX_BS32 {
+ OMX_S32 nValue; /**< actual value */
+ OMX_S32 nMin; /**< minimum for value (i.e. nValue >= nMin) */
+ OMX_S32 nMax; /**< maximum for value (i.e. nValue <= nMax) */
+} OMX_BS32;
+
+
+/** Structure representing some time or duration in microseconds. This structure
+ * must be interpreted as a signed 64 bit value. The quantity is signed to accommodate
+ * negative deltas and preroll scenarios. The quantity is represented in microseconds
+ * to accomodate high resolution timestamps (e.g. DVD presentation timestamps based
+ * on a 90kHz clock) and to allow more accurate and synchronized delivery (e.g.
+ * individual audio samples delivered at 192 kHz). The quantity is 64 bit to
+ * accommodate a large dynamic range (signed 32 bit values would allow only for plus
+ * or minus 35 minutes).
+ *
+ * Implementations with limited precision may convert the signed 64 bit value to
+ * a signed 32 bit value internally but risk loss of precision.
+ */
+#ifndef OMX_SKIP64BIT
+typedef OMX_S64 OMX_TICKS;
+#else
+typedef struct OMX_TICKS
+{
+ OMX_U32 nLowPart; /** low bits of the signed 64 bit tick value */
+ OMX_U32 nHighPart; /** high bits of the signed 64 bit tick value */
+} OMX_TICKS;
+#endif
+#define OMX_TICKS_PER_SECOND 1000000
+
+/** Define the public interface for the OMX Handle. The core will not use
+ this value internally, but the application should only use this value.
+ */
+typedef void* OMX_HANDLETYPE;
+
+typedef struct OMX_MARKTYPE
+{
+ OMX_HANDLETYPE hMarkTargetComponent; /**< The component that will
+ generate a mark event upon
+ processing the mark. */
+ OMX_PTR pMarkData; /**< Application specific data associated with
+ the mark sent on a mark event to disambiguate
+ this mark from others. */
+} OMX_MARKTYPE;
+
+
+/** OMX_NATIVE_DEVICETYPE is used to map a OMX video port to the
+ * platform & operating specific object used to reference the display
+ * or can be used by a audio port for native audio rendering */
+typedef void* OMX_NATIVE_DEVICETYPE;
+
+/** OMX_NATIVE_WINDOWTYPE is used to map a OMX video port to the
+ * platform & operating specific object used to reference the window */
+typedef void* OMX_NATIVE_WINDOWTYPE;
+
+/** The OMX_VERSIONTYPE union is used to specify the version for
+ a structure or component. For a component, the version is entirely
+ specified by the component vendor. Components doing the same function
+ from different vendors may or may not have the same version. For
+ structures, the version shall be set by the entity that allocates the
+ structure. For structures specified in the OMX 1.1 specification, the
+ value of the version shall be set to 1.1.0.0 in all cases. Access to the
+ OMX_VERSIONTYPE can be by a single 32 bit access (e.g. by nVersion) or
+ by accessing one of the structure elements to, for example, check only
+ the Major revision.
+ */
+typedef union OMX_VERSIONTYPE
+{
+ struct
+ {
+ OMX_U8 nVersionMajor; /**< Major version accessor element */
+ OMX_U8 nVersionMinor; /**< Minor version accessor element */
+ OMX_U8 nRevision; /**< Revision version accessor element */
+ OMX_U8 nStep; /**< Step version accessor element */
+ } s;
+ OMX_U32 nVersion; /**< 32 bit value to make accessing the
+ version easily done in a single word
+ size copy/compare operation */
+} OMX_VERSIONTYPE;
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
diff --git a/domx/omx_core/inc/OMX_Video.h b/domx/omx_core/inc/OMX_Video.h
new file mode 100644
index 0000000..c44a5fe
--- /dev/null
+++ b/domx/omx_core/inc/OMX_Video.h
@@ -0,0 +1,1078 @@
+/* ------------------------------------------------------------------
+ * Copyright (C) 1998-2009 PacketVideo
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
+ * express or implied.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ * -------------------------------------------------------------------
+ */
+/**
+ * Copyright (c) 2008 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/**
+ * @file OMX_Video.h - OpenMax IL version 1.1.2
+ * The structures is needed by Video components to exchange parameters
+ * and configuration data with OMX components.
+ */
+#ifndef OMX_Video_h
+#define OMX_Video_h
+
+/** @defgroup video OpenMAX IL Video Domain
+ * @ingroup iv
+ * Structures for OpenMAX IL Video domain
+ * @{
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+
+/**
+ * Each OMX header must include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+
+#include <OMX_IVCommon.h>
+
+
+/**
+ * Enumeration used to define the possible video compression codings.
+ * NOTE: This essentially refers to file extensions. If the coding is
+ * being used to specify the ENCODE type, then additional work
+ * must be done to configure the exact flavor of the compression
+ * to be used. For decode cases where the user application can
+ * not differentiate between MPEG-4 and H.264 bit streams, it is
+ * up to the codec to handle this.
+ */
+typedef enum OMX_VIDEO_CODINGTYPE {
+ OMX_VIDEO_CodingUnused, /**< Value when coding is N/A */
+ OMX_VIDEO_CodingAutoDetect, /**< Autodetection of coding type */
+ OMX_VIDEO_CodingMPEG2, /**< AKA: H.262 */
+ OMX_VIDEO_CodingH263, /**< H.263 */
+ OMX_VIDEO_CodingMPEG4, /**< MPEG-4 */
+ OMX_VIDEO_CodingWMV, /**< all versions of Windows Media Video */
+ OMX_VIDEO_CodingRV, /**< all versions of Real Video */
+ OMX_VIDEO_CodingAVC, /**< H.264/AVC */
+ OMX_VIDEO_CodingMJPEG, /**< Motion JPEG */
+ OMX_VIDEO_CodingVPX, /**< Google VPX, formerly known as On2 VP8 */
+ OMX_VIDEO_CodingKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_CodingMax = 0x7FFFFFFF
+} OMX_VIDEO_CODINGTYPE;
+
+
+/**
+ * Data structure used to define a video path. The number of Video paths for
+ * input and output will vary by type of the Video component.
+ *
+ * Input (aka Source) : zero Inputs, one Output,
+ * Splitter : one Input, 2 or more Outputs,
+ * Processing Element : one Input, one output,
+ * Mixer : 2 or more inputs, one output,
+ * Output (aka Sink) : one Input, zero outputs.
+ *
+ * The PortDefinition structure is used to define all of the parameters
+ * necessary for the compliant component to setup an input or an output video
+ * path. If additional vendor specific data is required, it should be
+ * transmitted to the component using the CustomCommand function. Compliant
+ * components will prepopulate this structure with optimal values during the
+ * GetDefaultInitParams command.
+ *
+ * STRUCT MEMBERS:
+ * cMIMEType : MIME type of data for the port
+ * pNativeRender : Platform specific reference for a display if a
+ * sync, otherwise this field is 0
+ * nFrameWidth : Width of frame to be used on channel if
+ * uncompressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * nFrameHeight : Height of frame to be used on channel if
+ * uncompressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * nStride : Number of bytes per span of an image
+ * (i.e. indicates the number of bytes to get
+ * from span N to span N+1, where negative stride
+ * indicates the image is bottom up
+ * nSliceHeight : Height used when encoding in slices
+ * nBitrate : Bit rate of frame to be used on channel if
+ * compressed format is used. Use 0 for unknown,
+ * don't care or variable
+ * xFramerate : Frame rate to be used on channel if uncompressed
+ * format is used. Use 0 for unknown, don't care or
+ * variable. Units are Q16 frames per second.
+ * bFlagErrorConcealment : Turns on error concealment if it is supported by
+ * the OMX component
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_VIDEO_CodingUnused is
+ * specified, eColorFormat is used
+ * eColorFormat : Decompressed format used by this component
+ * pNativeWindow : Platform specific reference for a window object if a
+ * display sink , otherwise this field is 0x0.
+ */
+typedef struct OMX_VIDEO_PORTDEFINITIONTYPE {
+ OMX_STRING cMIMEType;
+ OMX_NATIVE_DEVICETYPE pNativeRender;
+ OMX_U32 nFrameWidth;
+ OMX_U32 nFrameHeight;
+ OMX_S32 nStride;
+ OMX_U32 nSliceHeight;
+ OMX_U32 nBitrate;
+ OMX_U32 xFramerate;
+ OMX_BOOL bFlagErrorConcealment;
+ OMX_VIDEO_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_NATIVE_WINDOWTYPE pNativeWindow;
+} OMX_VIDEO_PORTDEFINITIONTYPE;
+
+/**
+ * Port format parameter. This structure is used to enumerate the various
+ * data input/output format supported by the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Indicates which port to set
+ * nIndex : Indicates the enumeration index for the format from
+ * 0x0 to N-1
+ * eCompressionFormat : Compression format used in this instance of the
+ * component. When OMX_VIDEO_CodingUnused is specified,
+ * eColorFormat is used
+ * eColorFormat : Decompressed format used by this component
+ * xFrameRate : Indicates the video frame rate in Q16 format
+ */
+typedef struct OMX_VIDEO_PARAM_PORTFORMATTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_VIDEO_CODINGTYPE eCompressionFormat;
+ OMX_COLOR_FORMATTYPE eColorFormat;
+ OMX_U32 xFramerate;
+} OMX_VIDEO_PARAM_PORTFORMATTYPE;
+
+
+/**
+ * This is a structure for configuring video compression quantization
+ * parameter values. Codecs may support different QP values for different
+ * frame types.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nQpI : QP value to use for index frames
+ * nQpP : QP value to use for P frames
+ * nQpB : QP values to use for bidirectional frames
+ */
+typedef struct OMX_VIDEO_PARAM_QUANTIZATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nQpI;
+ OMX_U32 nQpP;
+ OMX_U32 nQpB;
+} OMX_VIDEO_PARAM_QUANTIZATIONTYPE;
+
+
+/**
+ * Structure for configuration of video fast update parameters.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * bEnableVFU : Enable/Disable video fast update
+ * nFirstGOB : Specifies the number of the first macroblock row
+ * nFirstMB : specifies the first MB relative to the specified first GOB
+ * nNumMBs : Specifies the number of MBs to be refreshed from nFirstGOB
+ * and nFirstMB
+ */
+typedef struct OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableVFU;
+ OMX_U32 nFirstGOB;
+ OMX_U32 nFirstMB;
+ OMX_U32 nNumMBs;
+} OMX_VIDEO_PARAM_VIDEOFASTUPDATETYPE;
+
+
+/**
+ * Enumeration of possible bitrate control types
+ */
+typedef enum OMX_VIDEO_CONTROLRATETYPE {
+ OMX_Video_ControlRateDisable,
+ OMX_Video_ControlRateVariable,
+ OMX_Video_ControlRateConstant,
+ OMX_Video_ControlRateVariableSkipFrames,
+ OMX_Video_ControlRateConstantSkipFrames,
+ OMX_Video_ControlRateKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_Video_ControlRateVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_Video_ControlRateMax = 0x7FFFFFFF
+} OMX_VIDEO_CONTROLRATETYPE;
+
+
+/**
+ * Structure for configuring bitrate mode of a codec.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : Port that this struct applies to
+ * eControlRate : Control rate type enum
+ * nTargetBitrate : Target bitrate to encode with
+ */
+typedef struct OMX_VIDEO_PARAM_BITRATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_CONTROLRATETYPE eControlRate;
+ OMX_U32 nTargetBitrate;
+} OMX_VIDEO_PARAM_BITRATETYPE;
+
+
+/**
+ * Enumeration of possible motion vector (MV) types
+ */
+typedef enum OMX_VIDEO_MOTIONVECTORTYPE {
+ OMX_Video_MotionVectorPixel,
+ OMX_Video_MotionVectorHalfPel,
+ OMX_Video_MotionVectorQuarterPel,
+ OMX_Video_MotionVectorEighthPel,
+ OMX_Video_MotionVectorKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_Video_MotionVectorVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_Video_MotionVectorMax = 0x7FFFFFFF
+} OMX_VIDEO_MOTIONVECTORTYPE;
+
+
+/**
+ * Structure for configuring the number of motion vectors used as well
+ * as their accuracy.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : port that this structure applies to
+ * eAccuracy : Enumerated MV accuracy
+ * bUnrestrictedMVs : Allow unrestricted MVs
+ * bFourMV : Allow use of 4 MVs
+ * sXSearchRange : Search range in horizontal direction for MVs
+ * sYSearchRange : Search range in vertical direction for MVs
+ */
+typedef struct OMX_VIDEO_PARAM_MOTIONVECTORTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_MOTIONVECTORTYPE eAccuracy;
+ OMX_BOOL bUnrestrictedMVs;
+ OMX_BOOL bFourMV;
+ OMX_S32 sXSearchRange;
+ OMX_S32 sYSearchRange;
+} OMX_VIDEO_PARAM_MOTIONVECTORTYPE;
+
+
+/**
+ * Enumeration of possible methods to use for Intra Refresh
+ */
+typedef enum OMX_VIDEO_INTRAREFRESHTYPE {
+ OMX_VIDEO_IntraRefreshCyclic,
+ OMX_VIDEO_IntraRefreshAdaptive,
+ OMX_VIDEO_IntraRefreshBoth,
+ OMX_VIDEO_IntraRefreshKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_IntraRefreshVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_IntraRefreshMax = 0x7FFFFFFF
+} OMX_VIDEO_INTRAREFRESHTYPE;
+
+
+/**
+ * Structure for configuring intra refresh mode
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eRefreshMode : Cyclic, Adaptive, or Both
+ * nAirMBs : Number of intra macroblocks to refresh in a frame when
+ * AIR is enabled
+ * nAirRef : Number of times a motion marked macroblock has to be
+ * intra coded
+ * nCirMBs : Number of consecutive macroblocks to be coded as "intra"
+ * when CIR is enabled
+ */
+typedef struct OMX_VIDEO_PARAM_INTRAREFRESHTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_INTRAREFRESHTYPE eRefreshMode;
+ OMX_U32 nAirMBs;
+ OMX_U32 nAirRef;
+ OMX_U32 nCirMBs;
+} OMX_VIDEO_PARAM_INTRAREFRESHTYPE;
+
+
+/**
+ * Structure for enabling various error correction methods for video
+ * compression.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * bEnableHEC : Enable/disable header extension codes (HEC)
+ * bEnableResync : Enable/disable resynchronization markers
+ * nResynchMarkerSpacing : Resynch markers interval (in bits) to be
+ * applied in the stream
+ * bEnableDataPartitioning : Enable/disable data partitioning
+ * bEnableRVLC : Enable/disable reversible variable length
+ * coding
+ */
+typedef struct OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableHEC;
+ OMX_BOOL bEnableResync;
+ OMX_U32 nResynchMarkerSpacing;
+ OMX_BOOL bEnableDataPartitioning;
+ OMX_BOOL bEnableRVLC;
+} OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE;
+
+
+/**
+ * Configuration of variable block-size motion compensation (VBSMC)
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * b16x16 : Enable inter block search 16x16
+ * b16x8 : Enable inter block search 16x8
+ * b8x16 : Enable inter block search 8x16
+ * b8x8 : Enable inter block search 8x8
+ * b8x4 : Enable inter block search 8x4
+ * b4x8 : Enable inter block search 4x8
+ * b4x4 : Enable inter block search 4x4
+ */
+typedef struct OMX_VIDEO_PARAM_VBSMCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL b16x16;
+ OMX_BOOL b16x8;
+ OMX_BOOL b8x16;
+ OMX_BOOL b8x8;
+ OMX_BOOL b8x4;
+ OMX_BOOL b4x8;
+ OMX_BOOL b4x4;
+} OMX_VIDEO_PARAM_VBSMCTYPE;
+
+
+/**
+ * H.263 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ *
+ * ENUMS:
+ * Baseline : Baseline Profile: H.263 (V1), no optional modes
+ * H320 Coding : H.320 Coding Efficiency Backward Compatibility
+ * Profile: H.263+ (V2), includes annexes I, J, L.4
+ * and T
+ * BackwardCompatible : Backward Compatibility Profile: H.263 (V1),
+ * includes annex F
+ * ISWV2 : Interactive Streaming Wireless Profile: H.263+
+ * (V2), includes annexes I, J, K and T
+ * ISWV3 : Interactive Streaming Wireless Profile: H.263++
+ * (V3), includes profile 3 and annexes V and W.6.3.8
+ * HighCompression : Conversational High Compression Profile: H.263++
+ * (V3), includes profiles 1 & 2 and annexes D and U
+ * Internet : Conversational Internet Profile: H.263++ (V3),
+ * includes profile 5 and annex K
+ * Interlace : Conversational Interlace Profile: H.263++ (V3),
+ * includes profile 5 and annex W.6.3.11
+ * HighLatency : High Latency Profile: H.263++ (V3), includes
+ * profile 6 and annexes O.1 and P.5
+ */
+typedef enum OMX_VIDEO_H263PROFILETYPE {
+ OMX_VIDEO_H263ProfileBaseline = 0x01,
+ OMX_VIDEO_H263ProfileH320Coding = 0x02,
+ OMX_VIDEO_H263ProfileBackwardCompatible = 0x04,
+ OMX_VIDEO_H263ProfileISWV2 = 0x08,
+ OMX_VIDEO_H263ProfileISWV3 = 0x10,
+ OMX_VIDEO_H263ProfileHighCompression = 0x20,
+ OMX_VIDEO_H263ProfileInternet = 0x40,
+ OMX_VIDEO_H263ProfileInterlace = 0x80,
+ OMX_VIDEO_H263ProfileHighLatency = 0x100,
+ OMX_VIDEO_H263ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_H263ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_H263ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_H263PROFILETYPE;
+
+
+/**
+ * H.263 level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates.
+ */
+typedef enum OMX_VIDEO_H263LEVELTYPE {
+ OMX_VIDEO_H263Level10 = 0x01,
+ OMX_VIDEO_H263Level20 = 0x02,
+ OMX_VIDEO_H263Level30 = 0x04,
+ OMX_VIDEO_H263Level40 = 0x08,
+ OMX_VIDEO_H263Level45 = 0x10,
+ OMX_VIDEO_H263Level50 = 0x20,
+ OMX_VIDEO_H263Level60 = 0x40,
+ OMX_VIDEO_H263Level70 = 0x80,
+ OMX_VIDEO_H263LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_H263LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_H263LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_H263LEVELTYPE;
+
+
+/**
+ * Specifies the picture type. These values should be OR'd to signal all
+ * pictures types which are allowed.
+ *
+ * ENUMS:
+ * Generic Picture Types: I, P and B
+ * H.263 Specific Picture Types: SI and SP
+ * H.264 Specific Picture Types: EI and EP
+ * MPEG-4 Specific Picture Types: S
+ */
+typedef enum OMX_VIDEO_PICTURETYPE {
+ OMX_VIDEO_PictureTypeI = 0x01,
+ OMX_VIDEO_PictureTypeP = 0x02,
+ OMX_VIDEO_PictureTypeB = 0x04,
+ OMX_VIDEO_PictureTypeSI = 0x08,
+ OMX_VIDEO_PictureTypeSP = 0x10,
+ OMX_VIDEO_PictureTypeEI = 0x11,
+ OMX_VIDEO_PictureTypeEP = 0x12,
+ OMX_VIDEO_PictureTypeS = 0x14,
+ OMX_VIDEO_PictureTypeKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_PictureTypeVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_PictureTypeMax = 0x7FFFFFFF
+} OMX_VIDEO_PICTURETYPE;
+
+
+/**
+ * H.263 Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * eProfile : H.263 profile(s) to use
+ * eLevel : H.263 level(s) to use
+ * bPLUSPTYPEAllowed : Indicating that it is allowed to use PLUSPTYPE
+ * (specified in the 1998 version of H.263) to
+ * indicate custom picture sizes or clock
+ * frequencies
+ * nAllowedPictureTypes : Specifies the picture types allowed in the
+ * bitstream
+ * bForceRoundingTypeToZero : value of the RTYPE bit (bit 6 of MPPTYPE) is
+ * not constrained. It is recommended to change
+ * the value of the RTYPE bit for each reference
+ * picture in error-free communication
+ * nPictureHeaderRepetition : Specifies the frequency of picture header
+ * repetition
+ * nGOBHeaderInterval : Specifies the interval of non-empty GOB
+ * headers in units of GOBs
+ */
+typedef struct OMX_VIDEO_PARAM_H263TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_VIDEO_H263PROFILETYPE eProfile;
+ OMX_VIDEO_H263LEVELTYPE eLevel;
+ OMX_BOOL bPLUSPTYPEAllowed;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_BOOL bForceRoundingTypeToZero;
+ OMX_U32 nPictureHeaderRepetition;
+ OMX_U32 nGOBHeaderInterval;
+} OMX_VIDEO_PARAM_H263TYPE;
+
+
+/**
+ * MPEG-2 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_VIDEO_MPEG2PROFILETYPE {
+ OMX_VIDEO_MPEG2ProfileSimple = 0, /**< Simple Profile */
+ OMX_VIDEO_MPEG2ProfileMain, /**< Main Profile */
+ OMX_VIDEO_MPEG2Profile422, /**< 4:2:2 Profile */
+ OMX_VIDEO_MPEG2ProfileSNR, /**< SNR Profile */
+ OMX_VIDEO_MPEG2ProfileSpatial, /**< Spatial Profile */
+ OMX_VIDEO_MPEG2ProfileHigh, /**< High Profile */
+ OMX_VIDEO_MPEG2ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG2ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG2ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG2PROFILETYPE;
+
+
+/**
+ * MPEG-2 level types, each level indicates support for various frame
+ * sizes, bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_MPEG2LEVELTYPE {
+ OMX_VIDEO_MPEG2LevelLL = 0, /**< Low Level */
+ OMX_VIDEO_MPEG2LevelML, /**< Main Level */
+ OMX_VIDEO_MPEG2LevelH14, /**< High 1440 */
+ OMX_VIDEO_MPEG2LevelHL, /**< High Level */
+ OMX_VIDEO_MPEG2LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG2LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG2LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG2LEVELTYPE;
+
+
+/**
+ * MPEG-2 params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * eProfile : MPEG-2 profile(s) to use
+ * eLevel : MPEG-2 levels(s) to use
+ */
+typedef struct OMX_VIDEO_PARAM_MPEG2TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_VIDEO_MPEG2PROFILETYPE eProfile;
+ OMX_VIDEO_MPEG2LEVELTYPE eLevel;
+} OMX_VIDEO_PARAM_MPEG2TYPE;
+
+
+/**
+ * MPEG-4 profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ *
+ * ENUMS:
+ * - Simple Profile, Levels 1-3
+ * - Simple Scalable Profile, Levels 1-2
+ * - Core Profile, Levels 1-2
+ * - Main Profile, Levels 2-4
+ * - N-bit Profile, Level 2
+ * - Scalable Texture Profile, Level 1
+ * - Simple Face Animation Profile, Levels 1-2
+ * - Simple Face and Body Animation (FBA) Profile, Levels 1-2
+ * - Basic Animated Texture Profile, Levels 1-2
+ * - Hybrid Profile, Levels 1-2
+ * - Advanced Real Time Simple Profiles, Levels 1-4
+ * - Core Scalable Profile, Levels 1-3
+ * - Advanced Coding Efficiency Profile, Levels 1-4
+ * - Advanced Core Profile, Levels 1-2
+ * - Advanced Scalable Texture, Levels 2-3
+ */
+typedef enum OMX_VIDEO_MPEG4PROFILETYPE {
+ OMX_VIDEO_MPEG4ProfileSimple = 0x01,
+ OMX_VIDEO_MPEG4ProfileSimpleScalable = 0x02,
+ OMX_VIDEO_MPEG4ProfileCore = 0x04,
+ OMX_VIDEO_MPEG4ProfileMain = 0x08,
+ OMX_VIDEO_MPEG4ProfileNbit = 0x10,
+ OMX_VIDEO_MPEG4ProfileScalableTexture = 0x20,
+ OMX_VIDEO_MPEG4ProfileSimpleFace = 0x40,
+ OMX_VIDEO_MPEG4ProfileSimpleFBA = 0x80,
+ OMX_VIDEO_MPEG4ProfileBasicAnimated = 0x100,
+ OMX_VIDEO_MPEG4ProfileHybrid = 0x200,
+ OMX_VIDEO_MPEG4ProfileAdvancedRealTime = 0x400,
+ OMX_VIDEO_MPEG4ProfileCoreScalable = 0x800,
+ OMX_VIDEO_MPEG4ProfileAdvancedCoding = 0x1000,
+ OMX_VIDEO_MPEG4ProfileAdvancedCore = 0x2000,
+ OMX_VIDEO_MPEG4ProfileAdvancedScalable = 0x4000,
+ OMX_VIDEO_MPEG4ProfileAdvancedSimple = 0x8000,
+ OMX_VIDEO_MPEG4ProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG4ProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG4ProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG4PROFILETYPE;
+
+
+/**
+ * MPEG-4 level types, each level indicates support for various frame
+ * sizes, bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_MPEG4LEVELTYPE {
+ OMX_VIDEO_MPEG4Level0 = 0x01, /**< Level 0 */
+ OMX_VIDEO_MPEG4Level0b = 0x02, /**< Level 0b */
+ OMX_VIDEO_MPEG4Level1 = 0x04, /**< Level 1 */
+ OMX_VIDEO_MPEG4Level2 = 0x08, /**< Level 2 */
+ OMX_VIDEO_MPEG4Level3 = 0x10, /**< Level 3 */
+ OMX_VIDEO_MPEG4Level4 = 0x20, /**< Level 4 */
+ OMX_VIDEO_MPEG4Level4a = 0x40, /**< Level 4a */
+ OMX_VIDEO_MPEG4Level5 = 0x80, /**< Level 5 */
+ OMX_VIDEO_MPEG4LevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_MPEG4LevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF
+} OMX_VIDEO_MPEG4LEVELTYPE;
+
+
+/**
+ * MPEG-4 configuration. This structure handles configuration options
+ * which are specific to MPEG4 algorithms
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSliceHeaderSpacing : Number of macroblocks between slice header (H263+
+ * Annex K). Put zero if not used
+ * bSVH : Enable Short Video Header mode
+ * bGov : Flag to enable GOV
+ * nPFrames : Number of P frames between each I frame (also called
+ * GOV period)
+ * nBFrames : Number of B frames between each I frame
+ * nIDCVLCThreshold : Value of intra DC VLC threshold
+ * bACPred : Flag to use ac prediction
+ * nMaxPacketSize : Maximum size of packet in bytes.
+ * nTimeIncRes : Used to pass VOP time increment resolution for MPEG4.
+ * Interpreted as described in MPEG4 standard.
+ * eProfile : MPEG-4 profile(s) to use.
+ * eLevel : MPEG-4 level(s) to use.
+ * nAllowedPictureTypes : Specifies the picture types allowed in the bitstream
+ * nHeaderExtension : Specifies the number of consecutive video packet
+ * headers within a VOP
+ * bReversibleVLC : Specifies whether reversible variable length coding
+ * is in use
+ */
+typedef struct OMX_VIDEO_PARAM_MPEG4TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSliceHeaderSpacing;
+ OMX_BOOL bSVH;
+ OMX_BOOL bGov;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_U32 nIDCVLCThreshold;
+ OMX_BOOL bACPred;
+ OMX_U32 nMaxPacketSize;
+ OMX_U32 nTimeIncRes;
+ OMX_VIDEO_MPEG4PROFILETYPE eProfile;
+ OMX_VIDEO_MPEG4LEVELTYPE eLevel;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_U32 nHeaderExtension;
+ OMX_BOOL bReversibleVLC;
+} OMX_VIDEO_PARAM_MPEG4TYPE;
+
+
+/**
+ * WMV Versions
+ */
+typedef enum OMX_VIDEO_WMVFORMATTYPE {
+ OMX_VIDEO_WMVFormatUnused = 0x01, /**< Format unused or unknown */
+ OMX_VIDEO_WMVFormat7 = 0x02, /**< Windows Media Video format 7 */
+ OMX_VIDEO_WMVFormat8 = 0x04, /**< Windows Media Video format 8 */
+ OMX_VIDEO_WMVFormat9 = 0x08, /**< Windows Media Video format 9 */
+ OMX_VIDEO_WMFFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_WMFFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_WMVFormatMax = 0x7FFFFFFF
+} OMX_VIDEO_WMVFORMATTYPE;
+
+
+/**
+ * WMV Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Version of WMV stream / data
+ */
+typedef struct OMX_VIDEO_PARAM_WMVTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_WMVFORMATTYPE eFormat;
+} OMX_VIDEO_PARAM_WMVTYPE;
+
+
+/**
+ * Real Video Version
+ */
+typedef enum OMX_VIDEO_RVFORMATTYPE {
+ OMX_VIDEO_RVFormatUnused = 0, /**< Format unused or unknown */
+ OMX_VIDEO_RVFormat8, /**< Real Video format 8 */
+ OMX_VIDEO_RVFormat9, /**< Real Video format 9 */
+ OMX_VIDEO_RVFormatG2, /**< Real Video Format G2 */
+ OMX_VIDEO_RVFormatKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_RVFormatVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_RVFormatMax = 0x7FFFFFFF
+} OMX_VIDEO_RVFORMATTYPE;
+
+
+/**
+ * Real Video Params
+ *
+ * STUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Version of RV stream / data
+ * nBitsPerPixel : Bits per pixel coded in the frame
+ * nPaddedWidth : Padded width in pixel of a video frame
+ * nPaddedHeight : Padded Height in pixels of a video frame
+ * nFrameRate : Rate of video in frames per second
+ * nBitstreamFlags : Flags which internal information about the bitstream
+ * nBitstreamVersion : Bitstream version
+ * nMaxEncodeFrameSize: Max encoded frame size
+ * bEnablePostFilter : Turn on/off post filter
+ * bEnableTemporalInterpolation : Turn on/off temporal interpolation
+ * bEnableLatencyMode : When enabled, the decoder does not display a decoded
+ * frame until it has detected that no enhancement layer
+ * frames or dependent B frames will be coming. This
+ * detection usually occurs when a subsequent non-B
+ * frame is encountered
+ */
+typedef struct OMX_VIDEO_PARAM_RVTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_VIDEO_RVFORMATTYPE eFormat;
+ OMX_U16 nBitsPerPixel;
+ OMX_U16 nPaddedWidth;
+ OMX_U16 nPaddedHeight;
+ OMX_U32 nFrameRate;
+ OMX_U32 nBitstreamFlags;
+ OMX_U32 nBitstreamVersion;
+ OMX_U32 nMaxEncodeFrameSize;
+ OMX_BOOL bEnablePostFilter;
+ OMX_BOOL bEnableTemporalInterpolation;
+ OMX_BOOL bEnableLatencyMode;
+} OMX_VIDEO_PARAM_RVTYPE;
+
+
+/**
+ * AVC profile types, each profile indicates support for various
+ * performance bounds and different annexes.
+ */
+typedef enum OMX_VIDEO_AVCPROFILETYPE {
+ OMX_VIDEO_AVCProfileBaseline = 0x01, /**< Baseline profile */
+ OMX_VIDEO_AVCProfileMain = 0x02, /**< Main profile */
+ OMX_VIDEO_AVCProfileExtended = 0x04, /**< Extended profile */
+ OMX_VIDEO_AVCProfileHigh = 0x08, /**< High profile */
+ OMX_VIDEO_AVCProfileHigh10 = 0x10, /**< High 10 profile */
+ OMX_VIDEO_AVCProfileHigh422 = 0x20, /**< High 4:2:2 profile */
+ OMX_VIDEO_AVCProfileHigh444 = 0x40, /**< High 4:4:4 profile */
+ OMX_VIDEO_AVCProfileKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_AVCProfileVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_AVCProfileMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCPROFILETYPE;
+
+
+/**
+ * AVC level types, each level indicates support for various frame sizes,
+ * bit rates, decoder frame rates. No need
+ */
+typedef enum OMX_VIDEO_AVCLEVELTYPE {
+ OMX_VIDEO_AVCLevel1 = 0x01, /**< Level 1 */
+ OMX_VIDEO_AVCLevel1b = 0x02, /**< Level 1b */
+ OMX_VIDEO_AVCLevel11 = 0x04, /**< Level 1.1 */
+ OMX_VIDEO_AVCLevel12 = 0x08, /**< Level 1.2 */
+ OMX_VIDEO_AVCLevel13 = 0x10, /**< Level 1.3 */
+ OMX_VIDEO_AVCLevel2 = 0x20, /**< Level 2 */
+ OMX_VIDEO_AVCLevel21 = 0x40, /**< Level 2.1 */
+ OMX_VIDEO_AVCLevel22 = 0x80, /**< Level 2.2 */
+ OMX_VIDEO_AVCLevel3 = 0x100, /**< Level 3 */
+ OMX_VIDEO_AVCLevel31 = 0x200, /**< Level 3.1 */
+ OMX_VIDEO_AVCLevel32 = 0x400, /**< Level 3.2 */
+ OMX_VIDEO_AVCLevel4 = 0x800, /**< Level 4 */
+ OMX_VIDEO_AVCLevel41 = 0x1000, /**< Level 4.1 */
+ OMX_VIDEO_AVCLevel42 = 0x2000, /**< Level 4.2 */
+ OMX_VIDEO_AVCLevel5 = 0x4000, /**< Level 5 */
+ OMX_VIDEO_AVCLevel51 = 0x8000, /**< Level 5.1 */
+ OMX_VIDEO_AVCLevelKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_AVCLevelVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_AVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCLEVELTYPE;
+
+
+/**
+ * AVC loop filter modes
+ *
+ * OMX_VIDEO_AVCLoopFilterEnable : Enable
+ * OMX_VIDEO_AVCLoopFilterDisable : Disable
+ * OMX_VIDEO_AVCLoopFilterDisableSliceBoundary : Disabled on slice boundaries
+ */
+typedef enum OMX_VIDEO_AVCLOOPFILTERTYPE {
+ OMX_VIDEO_AVCLoopFilterEnable = 0,
+ OMX_VIDEO_AVCLoopFilterDisable,
+ OMX_VIDEO_AVCLoopFilterDisableSliceBoundary,
+ OMX_VIDEO_AVCLoopFilterKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_AVCLoopFilterVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_AVCLoopFilterMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCLOOPFILTERTYPE;
+
+
+/**
+ * AVC params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nSliceHeaderSpacing : Number of macroblocks between slice header, put
+ * zero if not used
+ * nPFrames : Number of P frames between each I frame
+ * nBFrames : Number of B frames between each I frame
+ * bUseHadamard : Enable/disable Hadamard transform
+ * nRefFrames : Max number of reference frames to use for inter
+ * motion search (1-16)
+ * nRefIdxTrailing : Pic param set ref frame index (index into ref
+ * frame buffer of trailing frames list), B frame
+ * support
+ * nRefIdxForward : Pic param set ref frame index (index into ref
+ * frame buffer of forward frames list), B frame
+ * support
+ * bEnableUEP : Enable/disable unequal error protection. This
+ * is only valid of data partitioning is enabled.
+ * bEnableFMO : Enable/disable flexible macroblock ordering
+ * bEnableASO : Enable/disable arbitrary slice ordering
+ * bEnableRS : Enable/disable sending of redundant slices
+ * eProfile : AVC profile(s) to use
+ * eLevel : AVC level(s) to use
+ * nAllowedPictureTypes : Specifies the picture types allowed in the
+ * bitstream
+ * bFrameMBsOnly : specifies that every coded picture of the
+ * coded video sequence is a coded frame
+ * containing only frame macroblocks
+ * bMBAFF : Enable/disable switching between frame and
+ * field macroblocks within a picture
+ * bEntropyCodingCABAC : Entropy decoding method to be applied for the
+ * syntax elements for which two descriptors appear
+ * in the syntax tables
+ * bWeightedPPrediction : Enable/disable weighted prediction shall not
+ * be applied to P and SP slices
+ * nWeightedBipredicitonMode : Default weighted prediction is applied to B
+ * slices
+ * bconstIpred : Enable/disable intra prediction
+ * bDirect8x8Inference : Specifies the method used in the derivation
+ * process for luma motion vectors for B_Skip,
+ * B_Direct_16x16 and B_Direct_8x8 as specified
+ * in subclause 8.4.1.2 of the AVC spec
+ * bDirectSpatialTemporal : Flag indicating spatial or temporal direct
+ * mode used in B slice coding (related to
+ * bDirect8x8Inference) . Spatial direct mode is
+ * more common and should be the default.
+ * nCabacInitIdx : Index used to init CABAC contexts
+ * eLoopFilterMode : Enable/disable loop filter
+ */
+typedef struct OMX_VIDEO_PARAM_AVCTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nSliceHeaderSpacing;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+ OMX_BOOL bUseHadamard;
+ OMX_U32 nRefFrames;
+ OMX_U32 nRefIdx10ActiveMinus1;
+ OMX_U32 nRefIdx11ActiveMinus1;
+ OMX_BOOL bEnableUEP;
+ OMX_BOOL bEnableFMO;
+ OMX_BOOL bEnableASO;
+ OMX_BOOL bEnableRS;
+ OMX_VIDEO_AVCPROFILETYPE eProfile;
+ OMX_VIDEO_AVCLEVELTYPE eLevel;
+ OMX_U32 nAllowedPictureTypes;
+ OMX_BOOL bFrameMBsOnly;
+ OMX_BOOL bMBAFF;
+ OMX_BOOL bEntropyCodingCABAC;
+ OMX_BOOL bWeightedPPrediction;
+ OMX_U32 nWeightedBipredicitonMode;
+ OMX_BOOL bconstIpred ;
+ OMX_BOOL bDirect8x8Inference;
+ OMX_BOOL bDirectSpatialTemporal;
+ OMX_U32 nCabacInitIdc;
+ OMX_VIDEO_AVCLOOPFILTERTYPE eLoopFilterMode;
+} OMX_VIDEO_PARAM_AVCTYPE;
+
+typedef struct OMX_VIDEO_PARAM_PROFILELEVELTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 eProfile; /**< type is OMX_VIDEO_AVCPROFILETYPE, OMX_VIDEO_H263PROFILETYPE,
+ or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
+ OMX_U32 eLevel; /**< type is OMX_VIDEO_AVCLEVELTYPE, OMX_VIDEO_H263LEVELTYPE,
+ or OMX_VIDEO_MPEG4PROFILETYPE depending on context */
+ OMX_U32 nProfileIndex; /**< Used to query for individual profile support information,
+ This parameter is valid only for
+ OMX_IndexParamVideoProfileLevelQuerySupported index,
+ For all other indices this parameter is to be ignored. */
+} OMX_VIDEO_PARAM_PROFILELEVELTYPE;
+
+/**
+ * Structure for dynamically configuring bitrate mode of a codec.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the struct in bytes
+ * nVersion : OMX spec version info
+ * nPortIndex : Port that this struct applies to
+ * nEncodeBitrate : Target average bitrate to be generated in bps
+ */
+typedef struct OMX_VIDEO_CONFIG_BITRATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nEncodeBitrate;
+} OMX_VIDEO_CONFIG_BITRATETYPE;
+
+/**
+ * Defines Encoder Frame Rate setting
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * xEncodeFramerate : Encoding framerate represented in Q16 format
+ */
+typedef struct OMX_CONFIG_FRAMERATETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 xEncodeFramerate; /* Q16 format */
+} OMX_CONFIG_FRAMERATETYPE;
+
+typedef struct OMX_CONFIG_INTRAREFRESHVOPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL IntraRefreshVOP;
+} OMX_CONFIG_INTRAREFRESHVOPTYPE;
+
+typedef struct OMX_CONFIG_MACROBLOCKERRORMAPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nErrMapSize; /* Size of the Error Map in bytes */
+ OMX_U8 ErrMap[1]; /* Error map hint */
+} OMX_CONFIG_MACROBLOCKERRORMAPTYPE;
+
+typedef struct OMX_CONFIG_MBERRORREPORTINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+} OMX_CONFIG_MBERRORREPORTINGTYPE;
+
+typedef struct OMX_PARAM_MACROBLOCKSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nMacroblocks;
+} OMX_PARAM_MACROBLOCKSTYPE;
+
+/**
+ * AVC Slice Mode modes
+ *
+ * OMX_VIDEO_SLICEMODE_AVCDefault : Normal frame encoding, one slice per frame
+ * OMX_VIDEO_SLICEMODE_AVCMBSlice : NAL mode, number of MBs per frame
+ * OMX_VIDEO_SLICEMODE_AVCByteSlice : NAL mode, number of bytes per frame
+ */
+typedef enum OMX_VIDEO_AVCSLICEMODETYPE {
+ OMX_VIDEO_SLICEMODE_AVCDefault = 0,
+ OMX_VIDEO_SLICEMODE_AVCMBSlice,
+ OMX_VIDEO_SLICEMODE_AVCByteSlice,
+ OMX_VIDEO_SLICEMODE_AVCKhronosExtensions = 0x6F000000, /**< Reserved region for introducing Khronos Standard Extensions */
+ OMX_VIDEO_SLICEMODE_AVCVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ OMX_VIDEO_SLICEMODE_AVCLevelMax = 0x7FFFFFFF
+} OMX_VIDEO_AVCSLICEMODETYPE;
+
+/**
+ * AVC FMO Slice Mode Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nNumSliceGroups : Specifies the number of slice groups
+ * nSliceGroupMapType : Specifies the type of slice groups
+ * eSliceMode : Specifies the type of slice
+ */
+typedef struct OMX_VIDEO_PARAM_AVCSLICEFMO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U8 nNumSliceGroups;
+ OMX_U8 nSliceGroupMapType;
+ OMX_VIDEO_AVCSLICEMODETYPE eSliceMode;
+} OMX_VIDEO_PARAM_AVCSLICEFMO;
+
+/**
+ * AVC IDR Period Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nIDRPeriod : Specifies periodicity of IDR frames
+ * nPFrames : Specifies internal of coding Intra frames
+ */
+typedef struct OMX_VIDEO_CONFIG_AVCINTRAPERIOD {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIDRPeriod;
+ OMX_U32 nPFrames;
+} OMX_VIDEO_CONFIG_AVCINTRAPERIOD;
+
+/**
+ * AVC NAL Size Configs
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nNaluBytes : Specifies the NAL unit size
+ */
+typedef struct OMX_VIDEO_CONFIG_NALSIZE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nNaluBytes;
+} OMX_VIDEO_CONFIG_NALSIZE;
+
+/** @} */
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif
+/* File EOF */
+
diff --git a/domx/omx_core/inc/OMX_VideoExt.h b/domx/omx_core/inc/OMX_VideoExt.h
new file mode 100755
index 0000000..416ea53
--- /dev/null
+++ b/domx/omx_core/inc/OMX_VideoExt.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright (c) 2010 The Khronos Group Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject
+ * to the following conditions:
+ * The above copyright notice and this permission notice shall be included
+ * in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ *
+ */
+
+/** OMX_VideoExt.h - OpenMax IL version 1.1.2
+ * The OMX_VideoExt header file contains extensions to the
+ * definitions used by both the application and the component to
+ * access video items.
+ */
+
+#ifndef OMX_VideoExt_h
+#define OMX_VideoExt_h
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Each OMX header shall include all required header files to allow the
+ * header to compile without errors. The includes below are required
+ * for this header file to compile successfully
+ */
+#include <OMX_Core.h>
+
+/** NALU Formats */
+typedef enum OMX_NALUFORMATSTYPE {
+ OMX_NaluFormatStartCodes = 1,
+ OMX_NaluFormatOneNaluPerBuffer = 2,
+ OMX_NaluFormatOneByteInterleaveLength = 4,
+ OMX_NaluFormatTwoByteInterleaveLength = 8,
+ OMX_NaluFormatFourByteInterleaveLength = 16,
+ OMX_NaluFormatCodingMax = 0x7FFFFFFF
+} OMX_NALUFORMATSTYPE;
+
+
+/** NAL Stream Format */
+typedef struct OMX_NALSTREAMFORMATTYPE{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_NALUFORMATSTYPE eNaluFormat;
+} OMX_NALSTREAMFORMATTYPE;
+
+
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* OMX_VideoExt_h */
+/* File EOF */
diff --git a/domx/omx_core/src/OMX_Core.c b/domx/omx_core/src/OMX_Core.c
new file mode 100644
index 0000000..6a4c527
--- /dev/null
+++ b/domx/omx_core/src/OMX_Core.c
@@ -0,0 +1,910 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <dlfcn.h> /* For dynamic loading */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <pthread.h>
+
+
+/* #include "OMX_RegLib.h" */
+#include "OMX_Component.h"
+#include "OMX_Core.h"
+#include "OMX_ComponentRegistry.h"
+
+#include "timm_osal_types.h"
+#include "timm_osal_error.h"
+#include "timm_osal_trace.h"
+#include "timm_osal_mutex.h"
+
+#ifdef CHECK_SECURE_STATE
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <fcntl.h>
+#endif
+
+/** size for the array of allocated components. Sets the maximum
+ * number of components that can be allocated at once */
+#define MAXCOMP (50)
+#define MAXNAMESIZE (128)
+#define EMPTY_STRING "\0"
+
+/** Determine the number of elements in an array */
+#define COUNTOF(x) (sizeof(x) / sizeof(x[0]))
+
+/** Array to hold the DLL pointers for each allocated component */
+static void *pModules[MAXCOMP] = { 0 };
+
+/** Array to hold the component handles for each allocated component */
+static void *pComponents[COUNTOF(pModules)] = { 0 };
+
+/* count for call OMX_Init() */
+int count = 0;
+pthread_mutex_t mutex;
+TIMM_OSAL_PTR pCoreInitMutex = NULL;
+
+int tableCount = 0;
+ComponentTable componentTable[MAX_TABLE_SIZE];
+char *sRoleArray[60][20];
+char compName[60][200];
+
+
+char *tComponentName[MAXCOMP][MAX_ROLES] =
+{
+ /*video and image components */
+ { "OMX.TI.DUCATI1.VIDEO.DECODER",
+ "video_decoder.mpeg4",
+ "video_decoder.avc",
+ "video_decoder.h263",
+ "video_decoder.wmv",
+ "video_decoder.mpeg2",
+ "video_decoder.svc",
+ "video_decoder.sorspk",
+ "video_decoder.mjpeg", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.DECODER.secure",
+ "video_decoder.mpeg4",
+ "video_decoder.avc",
+ "video_decoder.h263", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.H264E",
+ "video_encoder.avc", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.H264E.secure",
+ "video_encoder.avc", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.H264SVCE",
+ "video_encoder.svc", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.VC1E",
+ "video_encoder.wmv", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.MPEG4E",
+ "video_encoder.mpeg4",
+ "video_encoder.h263", NULL },
+ { "OMX.TI.DUCATI1.VIDEO.CAMERA", " camera.omx", NULL },
+#ifdef USE_ITTIAM_AAC
+ { "OMX.ITTIAM.AAC.decode", " audio_decoder.aac", NULL },
+ { "OMX.ITTIAM.BSAC.decode", " audio_decoder.aac", NULL },
+#endif
+ { "OMX.ITTIAM.WMA.decode", " audio_decoder.wma", NULL },
+ { "OMX.ITTIAM.WMALSL.decode", " audio_decoder.wmalsl", NULL },
+ { "OMX.ITTIAM.WMAPRO.decode", " audio_decoder.wmapro", NULL },
+ /* terminate the table */
+ { NULL, NULL },
+};
+
+//AD
+extern OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent);
+
+#define CORE_assert CORE_paramCheck
+#define CORE_require CORE_paramCheck
+#define CORE_ensure CORE_paramCheck
+
+#define CORE_paramCheck(C, V, S) do {\
+ if( !(C)) { eError = V;\
+ TIMM_OSAL_Error("failed check: " # C);\
+ TIMM_OSAL_Error(" - returning error: " # V);\
+ if( S ) { TIMM_OSAL_Error(" - %s", S); }\
+ goto EXIT; }\
+} while( 0 )
+
+/******************************Public*Routine******************************\
+* OMX_Init()
+*
+* Description:This method will initialize the OMX Core. It is the
+* responsibility of the application to call OMX_Init to ensure the proper
+* set up of core resources.
+*
+* Returns: OMX_NOERROR Successful
+*
+* Note
+*
+\**************************************************************************/
+OMX_ERRORTYPE OMX_Init()
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ TIMM_OSAL_ERRORTYPE eOsalError = TIMM_OSAL_ERR_NONE;
+
+ eOsalError = TIMM_OSAL_MutexObtain(pCoreInitMutex, TIMM_OSAL_SUSPEND);
+ CORE_assert(eOsalError == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources, "Mutex lock failed");
+
+ count++;
+
+ if( count == 1 ) {
+ pthread_mutex_init(&mutex, NULL);
+ eError = OMX_BuildComponentTable();
+ }
+
+ eOsalError = TIMM_OSAL_MutexRelease(pCoreInitMutex);
+ CORE_assert(eOsalError == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources, "Mutex release failed");
+EXIT:
+ return (eError);
+}
+
+/******************************Public*Routine******************************\
+* OMX_GetHandle
+*
+* Description: This method will create the handle of the COMPONENTTYPE
+* If the component is currently loaded, this method will reutrn the
+* hadle of existingcomponent or create a new instance of the component.
+* It will call the OMX_ComponentInit function and then the setcallback
+* method to initialize the callback functions
+* Parameters:
+* @param[out] pHandle Handle of the loaded components
+* @param[in] cComponentName Name of the component to load
+* @param[in] pAppData Used to identify the callbacks of component
+* @param[in] pCallBacks Application callbacks
+*
+* @retval OMX_ErrorUndefined
+* @retval OMX_ErrorInvalidComponentName
+* @retval OMX_ErrorInvalidComponent
+* @retval OMX_ErrorInsufficientResources
+* @retval OMX_NOERROR Successful
+*
+* Note
+*
+\**************************************************************************/
+
+OMX_ERRORTYPE OMX_GetHandle(OMX_HANDLETYPE *pHandle,
+ OMX_STRING cComponentName, OMX_PTR pAppData,
+ OMX_CALLBACKTYPE *pCallBacks)
+{
+ static const char prefix[] = "lib";
+ static const char postfix[] = ".so";
+
+ OMX_ERRORTYPE (*pComponentInit)(OMX_HANDLETYPE *);
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *componentType;
+ int i;
+ char buf[sizeof(prefix) + MAXNAMESIZE + sizeof(postfix)];
+ const char *pErr = dlerror();
+ char *dlError = NULL;
+#ifdef CHECK_SECURE_STATE
+ int secure_misc_drv_fd, ret;
+ OMX_U8 mode, enable=1;
+#endif
+ if( pthread_mutex_lock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex lock");
+ }
+
+ CORE_require(NULL != cComponentName, OMX_ErrorBadParameter, NULL);
+ CORE_require(NULL != pHandle, OMX_ErrorBadParameter, NULL);
+ CORE_require(NULL != pCallBacks, OMX_ErrorBadParameter, NULL);
+ CORE_require(count > 0, OMX_ErrorUndefined,
+ "OMX_GetHandle called without calling OMX_Init first");
+
+ /* Verify that the name is not too long and could cause a crash. Notice
+ * that the comparison is a greater than or equals. This is to make
+ * sure that there is room for the terminating NULL at the end of the
+ * name. */
+ CORE_require(strlen(cComponentName) < MAXNAMESIZE,
+ OMX_ErrorInvalidComponentName, NULL);
+
+ /* Locate the first empty slot for a component. If no slots
+ * are available, error out */
+ for( i = 0; i < (int)COUNTOF(pModules); i++ ) {
+ if( pModules[i] == NULL ) {
+ break;
+ }
+ }
+
+ CORE_assert(i != COUNTOF(pModules), OMX_ErrorInsufficientResources,
+ NULL);
+
+ /* load the component and check for an error. If filename is not an
+ * absolute path (i.e., it does not begin with a "/" ), then the
+ * file is searched for in the following locations:
+ *
+ * The LD_LIBRARY_PATH environment variable locations
+ * The library cache, /etc/ld.so.cache.
+ * /lib
+ * /usr/lib
+ *
+ * If there is an error, we can't go on, so set the error code and exit */
+ strcpy(buf, prefix); /* the lengths are defined herein or have been */
+ strcat(buf, cComponentName); /* checked already, so strcpy and strcat are */
+ strcat(buf, postfix); /* are safe to use in this context. */
+
+#ifdef CHECK_SECURE_STATE
+ //Dont return errors from misc driver to the user if any.
+ //Since this affects all usecases, secure and non-secure.
+ //Do log the errors though.
+ secure_misc_drv_fd = open("/dev/rproc_user", O_SYNC | O_RDONLY);
+ if( secure_misc_drv_fd < 0 ) {
+ TIMM_OSAL_Error("Can't open misc driver device 0x%x\n", errno);
+ } else {
+ ret = read(secure_misc_drv_fd, &mode, sizeof(mode));
+ if( ret != sizeof(mode)) {
+ TIMM_OSAL_Error("Can't read from the misc driver");
+ } else {
+ if( mode == enable && strstr(cComponentName, "secure") == NULL ) {
+ TIMM_OSAL_Error("non-secure component not supported in secure mode");
+ eError = OMX_ErrorComponentNotFound;
+ }
+ }
+ ret = close(secure_misc_drv_fd);
+ if( ret < 0 ) {
+ TIMM_OSAL_Error("Can't close the misc driver");
+ }
+ }
+ /* Don't allow non-secure usecases if we are in secure state.
+ * Else some of the memory regions will be unexpected firewalled.
+ * This provides a clean exit in case we are in secure mode. */
+ if( eError == OMX_ErrorComponentNotFound ) {
+ goto EXIT;
+ }
+#endif //CHECK_SECURE_STATE
+
+
+ //#if 0
+ pModules[i] = dlopen(buf, RTLD_LAZY | RTLD_GLOBAL);
+ if( pModules[i] == NULL ) {
+ dlError = (char *)dlerror();
+ TIMM_OSAL_Error("Failed because %s", dlError);
+ eError = OMX_ErrorComponentNotFound;
+ goto EXIT;
+ }
+
+ /* Get a function pointer to the "OMX_ComponentInit" function. If
+ * there is an error, we can't go on, so set the error code and exit */
+ pComponentInit = dlsym(pModules[i], "OMX_ComponentInit");
+ pErr = dlerror();
+ CORE_assert(((pErr == NULL) && (pComponentInit != NULL)),
+ OMX_ErrorInvalidComponent, NULL);
+ //#endif
+
+ /* We now can access the dll. So, we need to call the "OMX_ComponentInit"
+ * method to load up the "handle" (which is just a list of functions to
+ * call) and we should be all set.*/
+ *pHandle = malloc(sizeof(OMX_COMPONENTTYPE));
+ CORE_assert((*pHandle != NULL), OMX_ErrorInsufficientResources,
+ "Malloc of pHandle* failed");
+
+ pComponents[i] = *pHandle;
+ componentType = (OMX_COMPONENTTYPE *) *pHandle;
+ componentType->nSize = sizeof(OMX_COMPONENTTYPE);
+
+ componentType->nVersion.s.nVersionMajor = 1;
+ componentType->nVersion.s.nVersionMinor = 1;
+ componentType->nVersion.s.nRevision = 0;
+ componentType->nVersion.s.nStep = 0;
+
+ eError = (*pComponentInit)(*pHandle);
+ //eError = OMX_ComponentInit(*pHandle);
+ if( OMX_ErrorNone == eError ) {
+ eError =
+ (componentType->SetCallbacks)(*pHandle, pCallBacks,
+ pAppData);
+ CORE_assert(eError == OMX_ErrorNone, eError,
+ "Core: Error returned from component SetCallBack");
+ } else {
+ /* when the component fails to initialize, release the
+ component handle structure */
+ free(*pHandle);
+ /* mark the component handle as NULL to prevent the caller from
+ actually trying to access the component with it, should they
+ ignore the return code */
+ *pHandle = NULL;
+ pComponents[i] = NULL;
+ dlclose(pModules[i]);
+ goto EXIT;
+ }
+ eError = OMX_ErrorNone;
+EXIT:
+ if( pthread_mutex_unlock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex unlock");
+ }
+ return (eError);
+}
+
+/******************************Public*Routine******************************\
+* OMX_FreeHandle()
+*
+* Description:This method will unload the OMX component pointed by
+* OMX_HANDLETYPE. It is the responsibility of the calling method to ensure that
+* the Deinit method of the component has been called prior to unloading component
+*
+* Parameters:
+* @param[in] hComponent the component to unload
+*
+* Returns: OMX_NOERROR Successful
+*
+* Note
+*
+\**************************************************************************/
+OMX_ERRORTYPE OMX_FreeHandle(OMX_HANDLETYPE hComponent)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorUndefined;
+ OMX_COMPONENTTYPE *pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ int i;
+
+ if( pthread_mutex_lock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex lock");
+ }
+
+ CORE_require(pHandle != NULL, OMX_ErrorBadParameter, NULL);
+ CORE_require(count > 0, OMX_ErrorUndefined,
+ "OMX_FreeHandle called without calling OMX_Init first");
+
+ /* Locate the component handle in the array of handles */
+ for( i = 0; i < (int)COUNTOF(pModules); i++ ) {
+ if( pComponents[i] == hComponent ) {
+ break;
+ }
+ }
+
+ CORE_assert(i != COUNTOF(pModules), OMX_ErrorBadParameter, NULL);
+
+ eError = pHandle->ComponentDeInit(hComponent);
+ if( eError != OMX_ErrorNone ) {
+ TIMM_OSAL_Error("Error From ComponentDeInit..");
+ }
+
+ /* release the component and the component handle */
+ dlclose(pModules[i]);
+ pModules[i] = NULL;
+ free(pComponents[i]);
+
+ pComponents[i] = NULL;
+ eError = OMX_ErrorNone;
+
+EXIT:
+ /* The unload is now complete, so set the error code to pass and exit */
+ if( pthread_mutex_unlock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex unlock");
+ }
+
+ return (eError);
+}
+
+/******************************Public*Routine******************************\
+* OMX_DeInit()
+*
+* Description:This method will release the resources of the OMX Core. It is the
+* responsibility of the application to call OMX_DeInit to ensure the clean up of these
+* resources.
+*
+* Returns: OMX_NOERROR Successful
+*
+* Note
+*
+\**************************************************************************/
+OMX_ERRORTYPE OMX_Deinit()
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ TIMM_OSAL_ERRORTYPE eOsalError = TIMM_OSAL_ERR_NONE;
+
+ eOsalError = TIMM_OSAL_MutexObtain(pCoreInitMutex, TIMM_OSAL_SUSPEND);
+ if( eOsalError != TIMM_OSAL_ERR_NONE ) {
+ TIMM_OSAL_Error("Mutex lock failed");
+ }
+ /*Returning error none because of OMX spec limitation on error codes that
+ can be returned by OMX_Deinit */
+ CORE_assert(count > 0, OMX_ErrorNone,
+ "OMX_Deinit being called without a corresponding OMX_Init");
+ count--;
+
+ if( pthread_mutex_lock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex lock");
+ }
+
+ if( count == 0 ) {
+ if( pthread_mutex_unlock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex unlock");
+ }
+ if( pthread_mutex_destroy(&mutex) != 0 ) {
+ /*printf("%d :: Core: Error in Mutex destroy\n" ,__LINE__); */
+ }
+ } else {
+ if( pthread_mutex_unlock(&mutex) != 0 ) {
+ TIMM_OSAL_Error("Core: Error in Mutex unlock");
+ }
+ }
+
+EXIT:
+ eOsalError = TIMM_OSAL_MutexRelease(pCoreInitMutex);
+ if( eOsalError != TIMM_OSAL_ERR_NONE ) {
+ TIMM_OSAL_Error("Mutex release failed");
+ }
+ return (eError);
+}
+
+/*************************************************************************
+* OMX_SetupTunnel()
+*
+* Description: Setup the specified tunnel the two components
+*
+* Parameters:
+* @param[in] hOutput Handle of the component to be accessed
+* @param[in] nPortOutput Source port used in the tunnel
+* @param[in] hInput Component to setup the tunnel with.
+* @param[in] nPortInput Destination port used in the tunnel
+*
+* Returns: OMX_NOERROR Successful
+*
+* Note
+*
+**************************************************************************/
+/* OMX_SetupTunnel */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_SetupTunnel(OMX_IN OMX_HANDLETYPE
+ hOutput, OMX_IN OMX_U32 nPortOutput, OMX_IN OMX_HANDLETYPE hInput,
+ OMX_IN OMX_U32 nPortInput)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNotImplemented;
+ OMX_COMPONENTTYPE *pCompIn, *pCompOut;
+ OMX_TUNNELSETUPTYPE oTunnelSetup;
+
+ if( hOutput == NULL && hInput == NULL ) {
+ return (OMX_ErrorBadParameter);
+ }
+
+ oTunnelSetup.nTunnelFlags = 0;
+ oTunnelSetup.eSupplier = OMX_BufferSupplyUnspecified;
+
+ pCompOut = (OMX_COMPONENTTYPE *) hOutput;
+
+ if( hOutput ) {
+ eError =
+ pCompOut->ComponentTunnelRequest(hOutput, nPortOutput,
+ hInput, nPortInput, &oTunnelSetup);
+ }
+
+
+ if( eError == OMX_ErrorNone && hInput ) {
+ pCompIn = (OMX_COMPONENTTYPE *) hInput;
+ eError =
+ pCompIn->ComponentTunnelRequest(hInput, nPortInput,
+ hOutput, nPortOutput, &oTunnelSetup);
+ if( eError != OMX_ErrorNone && hOutput ) {
+ /* cancel tunnel request on output port since input port failed */
+ pCompOut->ComponentTunnelRequest(hOutput, nPortOutput,
+ NULL, 0, NULL);
+ }
+ }
+
+ return (eError);
+}
+
+/*************************************************************************
+* OMX_ComponentNameEnum()
+*
+* Description: This method will provide the name of the component at the given nIndex
+*
+* Parameters:
+* @param[out] cComponentName The name of the component at nIndex
+* @param[in] nNameLength The length of the component name
+* @param[in] nIndex The index number of the component
+*
+* Returns: OMX_NOERROR Successful
+*
+* Note
+*
+**************************************************************************/
+OMX_API OMX_ERRORTYPE OMX_APIENTRY OMX_ComponentNameEnum(OMX_OUT OMX_STRING
+ cComponentName, OMX_IN OMX_U32 nNameLength, OMX_IN OMX_U32 nIndex)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+
+ CORE_require(cComponentName != NULL, OMX_ErrorBadParameter, NULL);
+ CORE_require(count > 0, OMX_ErrorUndefined,
+ "OMX_GetHandle called without calling OMX_Init first");
+
+ if( nIndex >= (OMX_U32)tableCount ) {
+ eError = OMX_ErrorNoMore;
+ } else {
+ strcpy(cComponentName, componentTable[nIndex].name);
+ }
+EXIT:
+ return (eError);
+}
+
+/*************************************************************************
+* OMX_GetRolesOfComponent()
+*
+* Description: This method will query the component for its supported roles
+*
+* Parameters:
+* @param[in] cComponentName The name of the component to query
+* @param[in] pNumRoles The number of roles supported by the component
+* @param[in] roles The roles of the component
+*
+* Returns: OMX_NOERROR Successful
+* OMX_ErrorBadParameter Faliure due to a bad input parameter
+*
+* Note
+*
+**************************************************************************/
+OMX_API OMX_ERRORTYPE OMX_GetRolesOfComponent(OMX_IN OMX_STRING
+ cComponentName, OMX_INOUT OMX_U32 *pNumRoles, OMX_OUT OMX_U8 * *roles)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 i = 0;
+ OMX_U32 j = 0;
+ OMX_BOOL bFound = OMX_FALSE;
+
+ CORE_require(cComponentName != NULL, OMX_ErrorBadParameter, NULL);
+ CORE_require(pNumRoles != NULL, OMX_ErrorBadParameter, NULL);
+ CORE_require(strlen(cComponentName) < MAXNAMESIZE,
+ OMX_ErrorInvalidComponentName, NULL);
+ CORE_require(count > 0, OMX_ErrorUndefined,
+ "OMX_GetHandle called without calling OMX_Init first");
+
+ while( !bFound && i < (OMX_U32)tableCount ) {
+ if( strcmp(cComponentName, componentTable[i].name) == 0 ) {
+ bFound = OMX_TRUE;
+ } else {
+ i++;
+ }
+ }
+
+ if( roles == NULL ) {
+ *pNumRoles = componentTable[i].nRoles;
+ goto EXIT;
+ } else {
+ if( bFound && (*pNumRoles == componentTable[i].nRoles)) {
+ for( j = 0; j < componentTable[i].nRoles; j++ ) {
+ strcpy((OMX_STRING) roles[j],
+ componentTable[i].pRoleArray[j]);
+ }
+ }
+ }
+EXIT:
+ return (eError);
+}
+
+/*************************************************************************
+* OMX_GetComponentsOfRole()
+*
+* Description: This method will query the component for its supported roles
+*
+* Parameters:
+* @param[in] role The role name to query for
+* @param[in] pNumComps The number of components supporting the given role
+* @param[in] compNames The names of the components supporting the given role
+*
+* Returns: OMX_NOERROR Successful
+*
+* Note
+*
+**************************************************************************/
+OMX_API OMX_ERRORTYPE OMX_GetComponentsOfRole(OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 *pNumComps, OMX_INOUT OMX_U8 * *compNames)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 i = 0;
+ OMX_U32 j = 0;
+ OMX_U32 k = 0;
+
+ CORE_require(role != NULL, OMX_ErrorBadParameter, NULL);
+ CORE_require(pNumComps != NULL, OMX_ErrorBadParameter, NULL);
+ CORE_require(count > 0, OMX_ErrorUndefined,
+ "OMX_GetHandle called without calling OMX_Init first");
+
+ /* This implies that the componentTable is not filled */
+ CORE_assert(componentTable[i].pRoleArray[j] != NULL,
+ OMX_ErrorBadParameter, NULL);
+
+ for( i = 0; i < (OMX_U32)tableCount; i++ ) {
+ for( j = 0; j < componentTable[i].nRoles; j++ ) {
+ if( strcmp(componentTable[i].pRoleArray[j],
+ role) == 0 ) {
+ /* the first call to this function should only count the number
+ of roles so that for the second call compNames can be allocated
+ with the proper size for that number of roles */
+ if( compNames != NULL ) {
+ strncpy((OMX_STRING) (compNames[k]),
+ (OMX_STRING) componentTable[i].
+ name, MAXNAMESIZE);
+ }
+ k++;
+ }
+ }
+
+ *pNumComps = k;
+ }
+
+EXIT:
+ return (eError);
+}
+
+/***************************************
+PRINT TABLE FOR DEBUGGING PURPOSES ONLY
+***************************************/
+
+OMX_API OMX_ERRORTYPE OMX_PrintComponentTable()
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ int i = 0;
+ int j = 0;
+
+ TIMM_OSAL_Info
+ ("--------Component Table:: %d Components found-------------",
+ tableCount);
+
+ for( i = 0; i < tableCount; i++ ) {
+ TIMM_OSAL_Info("%i:: %s", i, componentTable[i].name);
+
+ for( j = 0; j < componentTable[i].nRoles; j++ ) {
+ TIMM_OSAL_Info(" %s",
+ componentTable[i].pRoleArray[j]);
+ }
+ }
+
+ TIMM_OSAL_Info
+ ("-----------------End Component Table ------------------");
+
+ return (eError);
+
+}
+
+OMX_ERRORTYPE OMX_BuildComponentTable()
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_CALLBACKTYPE sCallbacks;
+
+#ifndef STATIC_TABLE
+ OMX_HANDLETYPE hComp = 0;
+ OMX_U8 cRole[MAXNAMESIZE];
+ OMX_STRING tempName = NULL;
+ OMX_STRING temp = NULL;
+ static OMX_STRING namePrefix = "OMX";
+ static OMX_STRING filePrefix = "libOMX.";
+ static OMX_STRING suffix = ".so";
+#endif
+ int j = 0;
+ int numFiles = 0;
+ int i, k;
+ int componentfound = 0;
+
+ /* set up dummy call backs */
+ sCallbacks.EventHandler = ComponentTable_EventHandler;
+ sCallbacks.EmptyBufferDone = ComponentTable_EmptyBufferDone;
+ sCallbacks.FillBufferDone = ComponentTable_FillBufferDone;
+
+#ifndef STATIC_TABLE
+ /* allocate the name table */
+ /*
+ compName = (OMX_STRING *) malloc(MAX_TABLE_SIZE * sizeof(OMX_STRING));
+ sRoleArray = (OMX_STRING**) malloc(MAX_TABLE_SIZE * sizeof(OMX_STRING));
+ */
+
+ /* scan the target/lib directory and create a list of files in the directory */
+ numFiles = scandir(libdir, &namelist, 0, 0);
+ tableCount = 0;
+
+ while( numFiles-- ) {
+ /* check if the file is an OMX component */
+ if( strncmp(namelist[numFiles]->d_name, filePrefix,
+ strlen(filePrefix)) == 0 ) {
+
+ /* if the file is an OMX component, trim the prefix and suffix */
+ tempName = (OMX_STRING) malloc(sizeof(namelist[numFiles]->d_name) + 1); /* adding one ensures */
+ memset(tempName, 0x00, sizeof(namelist[numFiles]->d_name) + 1); /* that a null terminator will */
+ /* always be present */
+ /* copy only the name without the suffix */
+ strncpy(tempName, namelist[numFiles]->d_name,
+ strlen(namelist[numFiles]->d_name) -
+ strlen(suffix));
+ /* set a pointer to be after the lib prefix, i.e the beginning of the component name */
+ temp = strstr(tempName, namePrefix);
+
+ /* then copy the component name to the table */
+ /*
+ compName[tableCount]= (OMX_STRING) malloc(MAXNAMESIZE);
+ */
+ strncpy(compName[tableCount], temp, strlen(temp) + 1);
+ componentTable[tableCount].name =
+ compName[tableCount];
+
+ /* get the handle for the component and query for the roles of each component */
+ eError =
+ OMX_GetHandle(&hComp,
+ componentTable[tableCount].name, 0x0,
+ &sCallbacks);
+ if( eError == OMX_ErrorNone ) {
+ j = 0;
+
+ while( eError != OMX_ErrorNoMore ) {
+ eError =
+ ((OMX_COMPONENTTYPE *) hComp)->
+ ComponentRoleEnum(hComp, cRole,
+ j++);
+ if( eError == OMX_ErrorNotImplemented ) {
+ j = 1;
+ break;
+ }
+ }
+
+ nRoles = j - 1;
+ componentTable[tableCount].nRoles = nRoles;
+ /* sRoleArray[tableCount] = (OMX_STRING *) malloc(nRoles * sizeof(OMX_STRING)); */
+ if( nRoles > 0 ) {
+ /* sRoleArray[tableCount] = (OMX_STRING *) malloc(nRoles * sizeof(OMX_STRING)); */
+ for( j = 0; j < nRoles; j++ ) {
+ sRoleArray[tableCount][j] =
+ (OMX_STRING)
+ malloc(sizeof(OMX_U8) *
+ MAXNAMESIZE);
+ ((OMX_COMPONENTTYPE *)
+ hComp)->
+ ComponentRoleEnum(hComp,
+ (OMX_U8 *)
+ sRoleArray[tableCount][j],
+ j);
+ componentTable[tableCount].
+ pRoleArray[j] =
+ sRoleArray[tableCount][j];
+ }
+ } else {
+ /* sRoleArray[tableCount] = (OMX_STRING *) malloc(sizeof(OMX_STRING)); */
+ sRoleArray[tableCount][j] =
+ (OMX_STRING) malloc(sizeof(OMX_U8)
+ * MAXNAMESIZE);
+ strcpy(sRoleArray[tableCount][j],
+ EMPTY_STRING);
+ componentTable[tableCount].
+ pRoleArray[j] =
+ sRoleArray[tableCount][j];
+ }
+ }
+ if( hComp ) {
+ /* free the component handle */
+ eError = OMX_FreeHandle(hComp);
+ if( eError != OMX_ErrorNone ) {
+ goto EXIT;
+ }
+ }
+ /* increment the table counter index only if above was successful */
+ tableCount++;
+ if( tempName != NULL ) {
+ free(tempName);
+ }
+
+ }
+ }
+
+#endif
+
+ for( i = 0, numFiles = 0; i < MAXCOMP; i++ ) {
+ if( tComponentName[i][0] == NULL ) {
+ break;
+ }
+
+ for( j = 0; j < numFiles; j++ ) {
+ if( !strcmp(componentTable[j].name,
+ tComponentName[i][0])) {
+ componentfound = 1;
+ break;
+ }
+ }
+
+ if( componentfound == 1 ) {
+ continue;
+ }
+
+ if( j == numFiles ) { /* new component */
+ k = 1;
+
+ while( tComponentName[i][k] != NULL ) {
+ componentTable[numFiles].pRoleArray[k - 1] =
+ tComponentName[i][k];
+ k++;
+ }
+
+ componentTable[numFiles].nRoles = k - 1;
+ strcpy(compName[numFiles], tComponentName[i][0]);
+ componentTable[numFiles].name = compName[numFiles];
+ numFiles++;
+ }
+ }
+
+ tableCount = numFiles;
+
+ CORE_assert(eError == OMX_ErrorNone, eError,
+ "Could not build Component Table");
+EXIT:
+ return (eError);
+}
+
+OMX_ERRORTYPE ComponentTable_EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData)
+{
+ return (OMX_ErrorNotImplemented);
+}
+
+OMX_ERRORTYPE ComponentTable_EmptyBufferDone(OMX_OUT OMX_HANDLETYPE
+ hComponent, OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
+{
+ return (OMX_ErrorNotImplemented);
+}
+
+OMX_ERRORTYPE ComponentTable_FillBufferDone(OMX_OUT OMX_HANDLETYPE hComponent,
+ OMX_OUT OMX_PTR pAppData, OMX_OUT OMX_BUFFERHEADERTYPE *pBuffer)
+{
+ return (OMX_ErrorNotImplemented);
+}
+
+/*===============================================================*/
+/** @fn Core_Setup : This function is called when the the OMX Core library is
+ * loaded. It creates a mutex, which is used during OMX_Init()
+ */
+/*===============================================================*/
+void __attribute__ ((constructor)) Core_Setup(void)
+{
+ TIMM_OSAL_ERRORTYPE eError = TIMM_OSAL_ERR_NONE;
+
+ eError = TIMM_OSAL_MutexCreate(&pCoreInitMutex);
+ if( eError != TIMM_OSAL_ERR_NONE ) {
+ TIMM_OSAL_Error("Creation of default mutex failed");
+ }
+}
+
+/*===============================================================*/
+/** @fn Core_Destroy : This function is called when the the OMX Core library is
+ * unloaded. It destroys the mutex which was created by
+ * Core_Setup().
+ *
+ */
+/*===============================================================*/
+void __attribute__ ((destructor)) Core_Destroy(void)
+{
+ TIMM_OSAL_ERRORTYPE eError = TIMM_OSAL_ERR_NONE;
+
+ eError = TIMM_OSAL_MutexDelete(pCoreInitMutex);
+ if( eError != TIMM_OSAL_ERR_NONE ) {
+ TIMM_OSAL_Error("Destruction of default mutex failed");
+ }
+}
+
diff --git a/domx/omx_core/src/OMX_Core_Wrapper.c b/domx/omx_core/src/OMX_Core_Wrapper.c
new file mode 100755
index 0000000..6fbf3d7
--- /dev/null
+++ b/domx/omx_core/src/OMX_Core_Wrapper.c
@@ -0,0 +1,168 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifdef _Android
+
+/* #include "OMX_RegLib.h" */
+#include "OMX_Component.h"
+#include "OMX_Core.h"
+#include "OMX_ComponentRegistry.h"
+
+#include "OMX_Core_Wrapper.h"
+#include "timm_osal_trace.h"
+#undef LOG_TAG
+#define LOG_TAG "OMX_CORE"
+
+/** determine capabilities of a component before acually using it */
+extern OMX_BOOL TIOMXConfigParser(OMX_PTR aInputParameters,
+ OMX_PTR aOutputParameters);
+
+#endif
+
+
+#ifdef _Android
+#ifdef _FROYO
+OMX_BOOL TIOMXConfigParserRedirect(OMX_PTR aInputParameters,
+ OMX_PTR aOutputParameters)
+{
+ TIMM_OSAL_Entering("OMXConfigParserRedirect +\n");
+ OMX_BOOL Status = OMX_FALSE;
+
+ Status = TIOMXConfigParser(aInputParameters, aOutputParameters);
+
+ TIMM_OSAL_Exiting("OMXConfigParserRedirect -\n");
+ return Status;
+}
+#endif
+OMX_ERRORTYPE TIComponentTable_EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData)
+{
+ return OMX_ErrorNotImplemented;
+}
+
+OMX_ERRORTYPE TIComponentTable_EmptyBufferDone(OMX_OUT OMX_HANDLETYPE
+ hComponent, OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE * pBuffer)
+{
+ return OMX_ErrorNotImplemented;
+}
+
+OMX_ERRORTYPE TIComponentTable_FillBufferDone(OMX_OUT OMX_HANDLETYPE
+ hComponent, OMX_OUT OMX_PTR pAppData,
+ OMX_OUT OMX_BUFFERHEADERTYPE * pBuffer)
+{
+ return OMX_ErrorNotImplemented;
+}
+
+
+OMX_API OMX_ERRORTYPE TIOMX_Init(void)
+{
+ TIMM_OSAL_Entering("TIOMX_Init\n");
+
+ return OMX_Init();
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_Deinit(void)
+{
+ TIMM_OSAL_Entering("TIOMX_Deinit\n");
+
+ return OMX_Deinit();
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_ComponentNameEnum(OMX_OUT OMX_STRING
+ cComponentName, OMX_IN OMX_U32 nNameLength, OMX_IN OMX_U32 nIndex)
+{
+
+ TIMM_OSAL_Entering("TIOMX_ComponentNameEnum\n");
+
+ return OMX_ComponentNameEnum(cComponentName, nNameLength, nIndex);
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_GetHandle(OMX_OUT OMX_HANDLETYPE * pHandle,
+ OMX_IN OMX_STRING cComponentName,
+ OMX_IN OMX_PTR pAppData, OMX_IN OMX_CALLBACKTYPE * pCallBacks)
+{
+
+ TIMM_OSAL_Entering("TIOMX_GetHandle\n");
+
+ return OMX_GetHandle(pHandle, cComponentName, pAppData, pCallBacks);
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComponent)
+{
+ TIMM_OSAL_Entering("TIOMX_FreeHandle\n");
+
+ return OMX_FreeHandle(hComponent);
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_GetComponentsOfRole(OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32 * pNumComps, OMX_INOUT OMX_U8 ** compNames)
+{
+
+ TIMM_OSAL_Entering("TIOMX_GetComponentsOfRole\n");
+
+ return OMX_GetComponentsOfRole(role, pNumComps, compNames);
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_GetRolesOfComponent(OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32 * pNumRoles, OMX_OUT OMX_U8 ** roles)
+{
+
+ TIMM_OSAL_Entering("TIOMX_GetRolesOfComponent\n");
+
+ return OMX_GetRolesOfComponent(compName, pNumRoles, roles);
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_SetupTunnel(OMX_IN OMX_HANDLETYPE hOutput,
+ OMX_IN OMX_U32 nPortOutput,
+ OMX_IN OMX_HANDLETYPE hInput, OMX_IN OMX_U32 nPortInput)
+{
+
+ TIMM_OSAL_Entering("TIOMX_SetupTunnel\n");
+
+ return OMX_SetupTunnel(hOutput, nPortOutput, hInput, nPortInput);
+}
+
+OMX_API OMX_ERRORTYPE TIOMX_GetContentPipe(OMX_OUT OMX_HANDLETYPE * hPipe,
+ OMX_IN OMX_STRING szURI)
+{
+
+ TIMM_OSAL_Entering("TIOMX_GetContentPipe\n");
+
+ //return OMX_GetContentPipe(
+ // hPipe,
+ // szURI);
+ return 0;
+}
+#endif
diff --git a/domx/omx_proxy_component/Android.mk b/domx/omx_proxy_component/Android.mk
new file mode 100644
index 0000000..b30b42f
--- /dev/null
+++ b/domx/omx_proxy_component/Android.mk
@@ -0,0 +1,332 @@
+LOCAL_PATH:= $(call my-dir)
+
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 16 || echo 1),)
+ FRAMEWORKS_MEDIA_BASE := $(TOP)/frameworks/native/include/media/hardware
+else
+ifeq ($(shell test $(PLATFORM_SDK_VERSION) -ge 14 || echo 1),)
+ FRAMEWORKS_MEDIA_BASE := $(TOP)/frameworks/base/include/media/stagefright
+endif
+endif
+
+#
+# libOMX.TI.DUCATI1.VIDEO.DECODER
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ $(HARDWARE_TI_OMAP4_BASE)/../../libhardware/include \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc/ \
+ $(LOCAL_PATH)/../domx/plugins/inc/
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES -DUSE_ENHANCED_PORTRECONFIG
+LOCAL_CFLAGS += -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION -DENABLE_GRALLOC_BUFFERS
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_dec/src/omx_proxy_videodec.c \
+ omx_video_dec/src/omx_proxy_videodec_utils.c
+
+# Uncomment the below 2 lines to enable the run time
+# dump of NV12 buffers from Decoder/Camera
+# based on setprop control
+#LOCAL_CFLAGS += -DENABLE_RAW_BUFFERS_DUMP_UTILITY
+#LOCAL_SHARED_LIBRARIES += libcutils
+
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.DECODER
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.MISC.SAMPLE
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ $(LOCAL_PATH)/../domx/plugins/inc/
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx
+
+LOCAL_CFLAGS += -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES -DUSE_ENHANCED_PORTRECONFIG
+LOCAL_CFLAGS += -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_sample/src/omx_proxy_sample.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.MISC.SAMPLE
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+
+#
+# libOMX.TI.DUCATI1.VIDEO.CAMERA
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(HARDWARE_TI_OMAP4_BASE)/include/ \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ $(LOCAL_PATH)/../domx/plugins/inc/ \
+ $(LOCAL_PATH)/omx_camera/inc/
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libion_ti \
+ libdomx
+
+LOCAL_CFLAGS += -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES -DUSE_ENHANCED_PORTRECONFIG
+LOCAL_CFLAGS += -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_camera/src/omx_proxy_camera.c \
+ omx_camera/src/proxy_camera_android_glue.c
+
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.CAMERA
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.VIDEO.H264E
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ system/core/include/cutils \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc \
+ $(HARDWARE_TI_OMAP4_BASE)/camera/inc \
+ $(FRAMEWORKS_MEDIA_BASE) \
+ $(LOCAL_PATH)/../domx/plugins/inc/ \
+ $(LOCAL_PATH)/omx_video_enc/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware \
+ libcutils
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES
+LOCAL_CFLAGS += -DUSE_ENHANCED_PORTRECONFIG -DENABLE_GRALLOC_BUFFER -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_CFLAGS += -DANDROID_CUSTOM_OPAQUECOLORFORMAT
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.H264E
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.VIDEO.VC1E
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ system/core/include/cutils \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc \
+ $(HARDWARE_TI_OMAP4_BASE)/camera/inc \
+ $(FRAMEWORKS_MEDIA_BASE) \
+ $(LOCAL_PATH)/../domx/plugins/inc/ \
+ $(LOCAL_PATH)/omx_video_enc/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware \
+ libcutils
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES
+LOCAL_CFLAGS += -DUSE_ENHANCED_PORTRECONFIG -DENABLE_GRALLOC_BUFFER -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_CFLAGS += -DANDROID_CUSTOM_OPAQUECOLORFORMAT
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_enc/src/omx_vc1_enc/src/omx_proxy_vc1enc.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.VC1E
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.VIDEO.H264SVCE
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ system/core/include/cutils \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc \
+ $(HARDWARE_TI_OMAP4_BASE)/camera/inc \
+ $(FRAMEWORKS_MEDIA_BASE) \
+ $(LOCAL_PATH)/../domx/plugins/inc/ \
+ $(LOCAL_PATH)/omx_video_enc/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware \
+ libcutils
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES
+LOCAL_CFLAGS += -DUSE_ENHANCED_PORTRECONFIG -DENABLE_GRALLOC_BUFFER -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_CFLAGS += -DANDROID_CUSTOM_OPAQUECOLORFORMAT
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_enc/src/omx_h264svc_enc/src/omx_proxy_h264svcenc.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.H264SVCE
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.VIDEO.MPEG4E
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ system/core/include/cutils \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc \
+ $(HARDWARE_TI_OMAP4_BASE)/camera/inc \
+ $(FRAMEWORKS_MEDIA_BASE) \
+ $(LOCAL_PATH)/../domx/plugins/inc/ \
+ $(LOCAL_PATH)/omx_video_enc/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware \
+ libcutils
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES
+LOCAL_CFLAGS += -DUSE_ENHANCED_PORTRECONFIG -DENABLE_GRALLOC_BUFFER -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_CFLAGS += -DANDROID_CUSTOM_OPAQUECOLORFORMAT
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_enc/src/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.MPEG4E
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.VIDEO.DECODER.secure
+#
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ $(HARDWARE_TI_OMAP4_BASE)/../../libhardware/include \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc/ \
+ $(LOCAL_PATH)/../domx/plugins/inc/
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware \
+ libOMX.TI.DUCATI1.VIDEO.DECODER
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES -DUSE_ENHANCED_PORTRECONFIG
+LOCAL_CFLAGS += -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION -DENABLE_GRALLOC_BUFFERS
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_dec/src/omx_proxy_videodec_secure.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.DECODER.secure
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+#
+# libOMX.TI.DUCATI1.VIDEO.H264E.secure
+#
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES += \
+ $(LOCAL_PATH)/../omx_core/inc \
+ $(LOCAL_PATH)/../mm_osal/inc \
+ $(LOCAL_PATH)/../domx \
+ $(LOCAL_PATH)/../domx/omx_rpc/inc \
+ system/core/include/cutils \
+ $(HARDWARE_TI_OMAP4_BASE)/hwc \
+ $(HARDWARE_TI_OMAP4_BASE)/camera/inc \
+ $(FRAMEWORKS_MEDIA_BASE) \
+ $(LOCAL_PATH)/../domx/plugins/inc/ \
+ $(LOCAL_PATH)/omx_video_enc/inc
+
+LOCAL_SHARED_LIBRARIES := \
+ libmm_osal \
+ libc \
+ libOMX_Core \
+ liblog \
+ libdomx \
+ libhardware \
+ libcutils
+
+LOCAL_CFLAGS += -DLINUX -DTMS32060 -D_DB_TIOMAP -DSYSLINK_USE_SYSMGR -DSYSLINK_USE_LOADER
+LOCAL_CFLAGS += -D_Android -DSET_STRIDE_PADDING_FROM_PROXY -DANDROID_QUIRK_CHANGE_PORT_VALUES
+LOCAL_CFLAGS += -DUSE_ENHANCED_PORTRECONFIG -DENABLE_GRALLOC_BUFFER -DANDROID_QUIRK_LOCK_BUFFER -DUSE_ION
+LOCAL_CFLAGS += -DANDROID_CUSTOM_OPAQUECOLORFORMAT
+LOCAL_MODULE_TAGS:= optional
+
+LOCAL_SRC_FILES:= omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc_secure.c
+LOCAL_MODULE:= libOMX.TI.DUCATI1.VIDEO.H264E.secure
+include $(BUILD_HEAPTRACKED_SHARED_LIBRARY)
+
+FRAMEWORKS_MEDIA_BASE :=
diff --git a/domx/omx_proxy_component/Makefile b/domx/omx_proxy_component/Makefile
new file mode 100755
index 0000000..5293ae5
--- /dev/null
+++ b/domx/omx_proxy_component/Makefile
@@ -0,0 +1,88 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# SEP xx,2002 REF=ORG Swamy MC
+# Original version.
+# ----------------------------------------------------------------------------
+
+#PROJROOT = $(ROOTDIR)/src
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS = DEBUG
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME =
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+#TARGETTYPE = ST_LIB
+TARGETTYPE =
+
+# For shared object library, soname is filename.so.maj_ver
+SH_SONAME =
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+omx_sample \
+omx_video_dec \
+omx_h264_enc \
+omx_h264svc_enc \
+omx_mpeg4_enc \
+
+#video/omx_proxy_component/test
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES =
+
+# Search path for include files
+
+INCLUDES =
+
+# Libraries needed for linking.
+
+ST_LIBS =
+SH_LIBS =
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES =
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
+
diff --git a/domx/omx_proxy_component/omx_camera/inc/omx_proxy_camera.h b/domx/omx_proxy_component/omx_camera/inc/omx_proxy_camera.h
new file mode 100644
index 0000000..89b62e3
--- /dev/null
+++ b/domx/omx_proxy_component/omx_camera/inc/omx_proxy_camera.h
@@ -0,0 +1,107 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <dirent.h>
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <timm_osal_interfaces.h>
+#include <OMX_TI_IVCommon.h>
+#include <OMX_TI_Index.h>
+#include "omx_proxy_common.h"
+#include "timm_osal_mutex.h"
+#include "omx_rpc.h"
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.CAMERA"
+/*Needs to be specific for every configuration wrapper*/
+
+#undef LOG_TAG
+#define LOG_TAG "CameraHAL"
+
+#define DEFAULT_DCC 1
+
+#define LINUX_PAGE_SIZE (4 * 1024)
+
+#define _PROXY_OMX_INIT_PARAM(param,type) do { \
+ TIMM_OSAL_Memset((param), 0, sizeof (type)); \
+ (param)->nSize = sizeof (type); \
+ (param)->nVersion.s.nVersionMajor = 1; \
+ (param)->nVersion.s.nVersionMinor = 1; \
+ } while(0)
+
+/* VTC specific changes */
+#define MAX_NUM_INTERNAL_BUFFERS 4
+#define MAX_VTC_WIDTH 1920
+#define MAX_VTC_HEIGHT 1080
+#define BORDER_WIDTH 32
+#define BORDER_HEIGHT 32
+#define MAX_VTC_WIDTH_WITH_VNF (MAX_VTC_WIDTH + BORDER_WIDTH)
+#define MAX_VTC_HEIGHT_WITH_VNF (MAX_VTC_HEIGHT + BORDER_HEIGHT)
+#define PREVIEW_PORT 2
+
+typedef struct OMX_PROXY_CAM_PRIVATE
+{
+ MEMPLUGIN_BUFFER_ACCESSOR sInternalBuffers[MAX_NUM_INTERNAL_BUFFERS][2];
+ OMX_PTR gComponentBufferAllocation[PROXY_MAXNUMOFPORTS][MAX_NUM_INTERNAL_BUFFERS];
+}OMX_PROXY_CAM_PRIVATE;
+
+
+OMX_ERRORTYPE PROXY_ComponentDeInit(OMX_HANDLETYPE);
+OMX_ERRORTYPE __PROXY_SetConfig(OMX_HANDLETYPE, OMX_INDEXTYPE,
+ OMX_PTR, OMX_PTR);
+OMX_ERRORTYPE __PROXY_GetConfig(OMX_HANDLETYPE, OMX_INDEXTYPE,
+ OMX_PTR, OMX_PTR);
+OMX_ERRORTYPE __PROXY_SetParameter(OMX_IN OMX_HANDLETYPE, OMX_INDEXTYPE,
+ OMX_PTR, OMX_PTR, OMX_U32);
+OMX_ERRORTYPE __PROXY_GetParameter(OMX_IN OMX_HANDLETYPE, OMX_INDEXTYPE,
+ OMX_PTR, OMX_PTR);
+OMX_ERRORTYPE PROXY_SendCommand(OMX_HANDLETYPE, OMX_COMMANDTYPE,
+ OMX_U32,OMX_PTR);
+OMX_ERRORTYPE CameraMaptoTilerDuc(OMX_TI_CONFIG_SHAREDBUFFER *, OMX_PTR *);
+OMX_ERRORTYPE OMX_CameraVtcFreeMemory(OMX_IN OMX_HANDLETYPE hComponent);
+//COREID TARGET_CORE_ID = CORE_APPM3;
+
+extern RPC_OMX_ERRORTYPE RPC_RegisterBuffer(OMX_HANDLETYPE hRPCCtx, int fd1,
+ int fd2,
+ OMX_PTR *handle1, OMX_PTR *handle2,
+ PROXY_BUFFER_TYPE proxyBufferType);
+extern RPC_OMX_ERRORTYPE RPC_UnRegisterBuffer(OMX_HANDLETYPE, OMX_PTR, OMX_PTR,
+ PROXY_BUFFER_TYPE proxyBufferType);
diff --git a/domx/omx_proxy_component/omx_camera/src/omx_proxy_camera.c b/domx/omx_proxy_component/omx_camera/src/omx_proxy_camera.c
new file mode 100755
index 0000000..91adc12
--- /dev/null
+++ b/domx/omx_proxy_component/omx_camera/src/omx_proxy_camera.c
@@ -0,0 +1,591 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_camera.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Tunnel Proxy component.
+ ******************************************************************************
+ This is the proxy specific wrapper that passes the component name to the
+ generic proxy init() The proxy wrapper also does some runtime/static time
+ config on per proxy basis This is a thin wrapper that is called when
+ componentiit() of the proxy is called static OMX_ERRORTYPE PROXY_Wrapper_init
+ (OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy s get handle is called
+ ******************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 19-August-2009 B Ravi Kiran ravi.kiran@ti.com: Initial Version
+ *! 20-April-2012 Phanish phanish.hs@ti.com: updated wrt Slice processing
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include "omx_proxy_camera.h"
+
+#ifdef USE_ION
+#include <unistd.h>
+#include <ion_ti/ion.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <sys/eventfd.h>
+#include <fcntl.h>
+#include <errno.h>
+#endif
+
+/* Tiler heap resservation specific */
+#define OMAP_ION_HEAP_TILER_ALLOCATION_MASK (1<<4)
+
+/* Incase of multiple instance, making sure DCC is initialized only for
+ first instance */
+static OMX_S16 numofInstance = 0;
+TIMM_OSAL_PTR cam_mutex = NULL;
+
+/* ===========================================================================*/
+/**
+ * @name _OMX_CameraVtcFreeMemory
+ * @brief Allocated buffers are freed in this api
+ *
+ * @param
+ * @return OMX_ErrorNone = Successful
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE OMX_CameraVtcFreeMemory(OMX_IN OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_PROXY_CAM_PRIVATE* pCamPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_U32 i = 0;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ MEMPLUGIN_BUFFER_PARAMS delBuffer_params;
+ MEMPLUGIN_BUFFER_PROPERTIES delBuffer_prop;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pCompPrv->pCompProxyPrv;
+
+ MEMPLUGIN_BUFFER_PARAMS_INIT(delBuffer_params);
+
+ for(i=0; i < MAX_NUM_INTERNAL_BUFFERS; i++) {
+ if (pCamPrv->sInternalBuffers[i][0].pBufferHandle != NULL) {
+ eRPCError = RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pCamPrv->sInternalBuffers[i][0].pRegBufferHandle, NULL , IONPointers);
+ if (eRPCError != RPC_OMX_ErrorNone) {
+ DOMX_ERROR("%s: DOMX: Unexpected error occurred while Unregistering Y Buffer#%d: eRPCError = 0x%x", __func__, i, eRPCError);
+ }
+ delBuffer_prop.sBuffer_accessor.pBufferHandle = pCamPrv->sInternalBuffers[i][0].pBufferHandle;
+ MemPlugin_Free(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&delBuffer_params,&delBuffer_prop);
+ pCamPrv->sInternalBuffers[i][0].pRegBufferHandle = NULL;
+ pCamPrv->sInternalBuffers[i][0].pBufferHandle = NULL;
+ DOMX_DEBUG("%s: DOMX: #%d Y Memory freed; eRPCError = 0x%x", __func__, i, eRPCError);
+ }
+ if (pCamPrv->sInternalBuffers[i][1].pBufferHandle != NULL) {
+ eRPCError = RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pCamPrv->sInternalBuffers[i][1].pRegBufferHandle, NULL , IONPointers);
+ if (eRPCError != RPC_OMX_ErrorNone) {
+ DOMX_ERROR("%s: DOMX: Unexpected error occurred while Unregistering UV Buffer#%d: eRPCError = 0x%x", __func__, i, eRPCError);
+ }
+ delBuffer_prop.sBuffer_accessor.pBufferHandle = pCamPrv->sInternalBuffers[i][1].pBufferHandle;
+ MemPlugin_Free(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&delBuffer_params,&delBuffer_prop);
+ pCamPrv->sInternalBuffers[i][1].pRegBufferHandle = NULL;
+ pCamPrv->sInternalBuffers[i][1].pBufferHandle = NULL;
+ DOMX_DEBUG("%s: DOMX: #%d UV Memory freed; eRPCError = 0x%x", __func__, i, eRPCError);
+ }
+ }
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name _OMX_CameraVtcAllocateMemory
+ * @brief Allocate 2D buffers for intermediate output at the output of isp
+ *
+ * @param
+ * @return OMX_ErrorNone = Successful
+ */
+/* ===========================================================================*/
+static OMX_ERRORTYPE _OMX_CameraVtcAllocateMemory(OMX_IN OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone, eCompReturn = OMX_ErrorNone;
+ OMX_STATETYPE tState= OMX_StateInvalid;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_PROXY_CAM_PRIVATE* pCamPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_U32 i = 0;
+ OMX_CONFIG_RECTTYPE tFrameDim;
+ OMX_U32 nFrmWidth, nFrmHeight;
+ OMX_TI_PARAM_VTCSLICE tVtcConfig;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pCompPrv->pCompProxyPrv;
+
+ _PROXY_OMX_INIT_PARAM(&tFrameDim, OMX_CONFIG_RECTTYPE);
+ _PROXY_OMX_INIT_PARAM(&tVtcConfig, OMX_TI_PARAM_VTCSLICE);
+
+ /* Get the current state of the component */
+ eError = OMX_GetState(hComponent, &tState);
+ if(OMX_ErrorNone != eError)
+ {
+ DOMX_ERROR("%s: Error in fetching current state - %d", __func__, tState);
+ }
+ else
+ {
+ if (tState == OMX_StateLoaded) {
+ DOMX_DEBUG("%s: Current state returned is %d", __func__, tState);
+
+ if(OMX_GetParameter(hComponent, OMX_TI_IndexParamVtcSlice, &tVtcConfig) == OMX_ErrorNone) {
+ if (tVtcConfig.nSliceHeight != 0 ) {
+ OMX_CONFIG_BOOLEANTYPE tVstabParam;
+ OMX_PARAM_VIDEONOISEFILTERTYPE tVnfParam;
+ OMX_TI_PARAM_VTCSLICE *pVtcConfig = &tVtcConfig;
+
+ tFrameDim.nPortIndex = PREVIEW_PORT; //Preview Port
+ if(OMX_GetParameter(hComponent, OMX_TI_IndexParam2DBufferAllocDimension, &tFrameDim) == OMX_ErrorNone){
+ DOMX_DEBUG("Acquired OMX_TI_IndexParam2DBufferAllocDimension data. nWidth = %d, nHeight = %d.\n\n", tFrameDim.nWidth, tFrameDim.nHeight);
+ nFrmWidth = tFrameDim.nWidth;
+ nFrmHeight = tFrameDim.nHeight;
+ }else {
+ DOMX_DEBUG("%s: No OMX_TI_IndexParam2DBufferAllocDimension data.\n\n", __func__);
+ nFrmWidth = MAX_VTC_WIDTH_WITH_VNF;
+ nFrmHeight = MAX_VTC_HEIGHT_WITH_VNF;
+ }
+
+ _PROXY_OMX_INIT_PARAM(&tVnfParam, OMX_PARAM_VIDEONOISEFILTERTYPE);
+ _PROXY_OMX_INIT_PARAM(&tVstabParam, OMX_CONFIG_BOOLEANTYPE);
+ eError = OMX_GetParameter(hComponent, OMX_IndexParamFrameStabilisation, &tVstabParam);
+ if(eError != OMX_ErrorNone) {
+ DOMX_ERROR("OMX_GetParameter for OMX_IndexParamFrameStabilisation returned error %x", eError);
+ goto EXIT;
+ }
+ tVnfParam.nPortIndex = PREVIEW_PORT;
+ eError = OMX_GetParameter(hComponent, OMX_IndexParamVideoNoiseFilter, &tVnfParam);
+ if(eError != OMX_ErrorNone) {
+ DOMX_ERROR("OMX_GetParameter for OMX_IndexParamVideoNoiseFilter returned error %x", eError);
+ goto EXIT;
+ }
+ DOMX_DEBUG(" Acquired OMX_TI_IndexParamVtcSlice data. nSliceHeight = %d, bVstabOn = %d, Vnfmode = %d, nWidth = %d, nHeight = %d.\n\n", tVtcConfig.nSliceHeight, tVstabParam.bEnabled, tVnfParam.eMode, nFrmWidth, nFrmHeight);
+ if (tVstabParam.bEnabled == OMX_FALSE && tVnfParam.eMode != OMX_VideoNoiseFilterModeOff) {
+ eError = GLUE_CameraVtcAllocateMemory(hComponent,
+ pVtcConfig,
+ nFrmWidth,
+ nFrmHeight);
+ if(eError != OMX_ErrorNone) {
+ DOMX_ERROR("Allocate Memory for vtc config returned error %x", eError);
+ goto EXIT;
+ }
+ }
+ }
+ }
+ }
+ }
+EXIT:
+
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+static OMX_ERRORTYPE ComponentPrivateDeInit(OMX_IN OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone, eCompReturn = OMX_ErrorNone;
+ TIMM_OSAL_ERRORTYPE eOsalError = TIMM_OSAL_ERR_NONE;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_U32 i, j;
+ OMX_PROXY_CAM_PRIVATE* pCamPrv;
+ MEMPLUGIN_BUFFER_PARAMS delBuffer_params;
+ MEMPLUGIN_BUFFER_PROPERTIES delBuffer_prop;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+
+ MEMPLUGIN_BUFFER_PARAMS_INIT(delBuffer_params);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+
+ OMX_CameraVtcFreeMemory(hComponent);
+
+
+ if(pCompPrv->pCompProxyPrv != NULL) {
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pCompPrv->pCompProxyPrv;
+ for (i = 0; i < PROXY_MAXNUMOFPORTS; i++) {
+ for (j = 0; j < MAX_NUM_INTERNAL_BUFFERS; j++) {
+ if (pCamPrv->gComponentBufferAllocation[i][j]) {
+ delBuffer_prop.sBuffer_accessor.pBufferHandle = pCamPrv->gComponentBufferAllocation[i][j];
+ MemPlugin_Free(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&delBuffer_params,&delBuffer_prop);
+ }
+ pCamPrv->gComponentBufferAllocation[i][j] = NULL;
+ }
+ }
+
+ TIMM_OSAL_Free(pCompPrv->pCompProxyPrv);
+ pCompPrv->pCompProxyPrv = NULL;
+ pCamPrv = NULL;
+ }
+
+ eError = PROXY_ComponentDeInit(hComponent);
+
+ EXIT:
+ return eError;
+}
+
+static OMX_ERRORTYPE Camera_SendCommand(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_COMMANDTYPE eCmd,
+ OMX_IN OMX_U32 nParam, OMX_IN OMX_PTR pCmdData)
+
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone, eCompReturn;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_PROXY_CAM_PRIVATE *pCamPrv;
+ MEMPLUGIN_BUFFER_PARAMS delBuffer_params;
+ MEMPLUGIN_BUFFER_PROPERTIES delBuffer_prop;
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pCompPrv->pCompProxyPrv;
+
+ MEMPLUGIN_BUFFER_PARAMS_INIT(delBuffer_params);
+ if ((eCmd == OMX_CommandStateSet) &&
+ (nParam == (OMX_STATETYPE) OMX_StateIdle))
+ {
+ /* Allocate memory for Video VTC usecase, if applicable. */
+ eError = _OMX_CameraVtcAllocateMemory(hComponent);
+ if (eError != OMX_ErrorNone) {
+ DOMX_ERROR("DOMX: _OMX_CameraVtcAllocateMemory completed with error 0x%x\n", eError);
+ goto EXIT;
+ }
+ } else if (eCmd == OMX_CommandPortDisable) {
+ int i, j;
+ for (i = 0; i < PROXY_MAXNUMOFPORTS; i++) {
+ if ((i == nParam) || (nParam == OMX_ALL)) {
+ for (j = 0; j < MAX_NUM_INTERNAL_BUFFERS; j++) {
+ if (pCamPrv->gComponentBufferAllocation[i][j]) {
+ delBuffer_prop.sBuffer_accessor.pBufferHandle = pCamPrv->gComponentBufferAllocation[i][j];
+ MemPlugin_Free(pCompPrv->pMemPluginHandle, pCompPrv->nMemmgrClientDesc,
+ &delBuffer_params,&delBuffer_prop);
+ pCamPrv->gComponentBufferAllocation[i][j] = NULL;
+ }
+ }
+ }
+ }
+ }
+
+ if ((eCmd == OMX_CommandStateSet) &&
+ (nParam == (OMX_STATETYPE) OMX_StateLoaded))
+ {
+ /* Clean up resources for Video VTC usecase. */
+ OMX_CameraVtcFreeMemory(hComponent);
+ }
+
+ eError =
+ PROXY_SendCommand(hComponent,eCmd,nParam,pCmdData);
+
+EXIT:
+
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name CameraGetConfig()
+ * @brief For some specific indices, buffer allocated on A9 side
+ * needs to be mapped and sent to Ducati.
+ * @param
+ * @return OMX_ErrorNone = Successful
+ */
+/* ===========================================================================*/
+
+static OMX_ERRORTYPE CameraGetConfig(OMX_IN OMX_HANDLETYPE
+ hComponent, OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_TI_CONFIG_SHAREDBUFFER *pConfigSharedBuffer = NULL;
+ OMX_PTR pTempSharedBuff = NULL;
+ OMX_U32 status = 0;
+
+ switch (nParamIndex)
+ {
+ case OMX_TI_IndexConfigAAAskipBuffer:
+ case OMX_TI_IndexConfigCamCapabilities:
+ case OMX_TI_IndexConfigExifTags:
+ case OMX_TI_IndexConfigAlgoAreas:
+ case OMX_TI_IndexConfigGammaTable:
+ case OMX_TI_IndexConfigDynamicCameraDescriptor:
+ pConfigSharedBuffer =
+ (OMX_TI_CONFIG_SHAREDBUFFER *) pComponentParameterStructure;
+
+ pTempSharedBuff = pConfigSharedBuffer->pSharedBuff;
+
+ // TODO(XXX): Cache API is not yet available. Client needs to
+ // allocate tiler buffer directly and assign to pSharedBuff.
+ // Ptr allocated by MemMgr_Alloc in uncacheable so there
+ // would be no need to cache API
+
+ eError = __PROXY_GetConfig(hComponent,
+ nParamIndex,
+ pConfigSharedBuffer,
+ &(pConfigSharedBuffer->pSharedBuff));
+
+ PROXY_assert((eError == OMX_ErrorNone), eError,
+ "Error in GetConfig");
+
+ pConfigSharedBuffer->pSharedBuff = pTempSharedBuff;
+
+ goto EXIT;
+ break;
+ default:
+ break;
+ }
+
+ return __PROXY_GetConfig(hComponent,
+ nParamIndex,
+ pComponentParameterStructure,
+ NULL);
+
+ EXIT:
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name CameraSetConfig()
+ * @brief For some specific indices, buffer allocated on A9 side needs to
+ * be mapped and sent to Ducati.
+ * @param
+ * @return OMX_ErrorNone = Successful
+ */
+/* ===========================================================================*/
+
+
+static OMX_ERRORTYPE CameraSetConfig(OMX_IN OMX_HANDLETYPE
+ hComponent, OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_TI_CONFIG_SHAREDBUFFER *pConfigSharedBuffer = NULL;
+ OMX_PTR pTempSharedBuff = NULL;
+ OMX_U32 status = 0;
+
+ switch (nParamIndex)
+ {
+ case OMX_TI_IndexConfigAAAskipBuffer:
+ case OMX_TI_IndexConfigCamCapabilities:
+ case OMX_TI_IndexConfigExifTags:
+ case OMX_TI_IndexConfigAlgoAreas:
+ case OMX_TI_IndexConfigGammaTable:
+ case OMX_TI_IndexConfigDynamicCameraDescriptor:
+ pConfigSharedBuffer =
+ (OMX_TI_CONFIG_SHAREDBUFFER *)
+ pComponentParameterStructure;
+
+ pTempSharedBuff = pConfigSharedBuffer->pSharedBuff;
+
+ // TODO(XXX): Cache API is not yet available. Client needs to
+ // allocate tiler buffer directly and assign to pSharedBuff.
+ // Ptr allocated by MemMgr_Alloc in uncacheable so there
+ // would be no need to cache API
+
+ eError = __PROXY_SetConfig(hComponent,
+ nParamIndex,
+ pConfigSharedBuffer,
+ &(pConfigSharedBuffer->pSharedBuff));
+
+ PROXY_assert((eError == OMX_ErrorNone), eError,
+ "Error in GetConfig");
+
+ pConfigSharedBuffer->pSharedBuff = pTempSharedBuff;
+
+ goto EXIT;
+ break;
+ default:
+ break;
+ }
+
+ return __PROXY_SetConfig(hComponent,
+ nParamIndex,
+ pComponentParameterStructure,
+ NULL);
+
+ EXIT:
+ return eError;
+}
+
+static OMX_ERRORTYPE CameraSetParam(OMX_IN OMX_HANDLETYPE
+ hComponent, OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *)hComponent;
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *)hComp->pComponentPrivate;
+
+ switch (nParamIndex)
+ {
+ case OMX_TI_IndexParamComponentBufferAllocation:
+ eError = GLUE_CameraSetParam(hComponent,
+ nParamIndex,
+ pComponentParameterStructure);
+ goto EXIT;
+ break;
+ default:
+ break;
+ }
+ eError = __PROXY_SetParameter(hComponent,
+ nParamIndex,
+ pComponentParameterStructure,
+ NULL, 0);
+EXIT:
+ if (eError != OMX_ErrorNone) {
+ DOMX_ERROR(" CameraSetParam: Error in SetParam 0x%x", eError);
+ }
+ return eError;
+}
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_ERRORTYPE dcc_eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate;
+ OMX_U32 i = 0, j = 0;
+ OMX_PROXY_CAM_PRIVATE* pCamPrv;
+ MEMPLUGIN_ERRORTYPE eMemError = MEMPLUGIN_ERROR_NONE;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ TIMM_OSAL_ERRORTYPE eOsalError = TIMM_OSAL_ERR_NONE;
+ DOMX_ENTER("_____________________INSIDE CAMERA PROXY"
+ "WRAPPER__________________________\n");
+ pHandle->pComponentPrivate = (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+ if (pHandle->pComponentPrivate == NULL)
+ {
+ DOMX_ERROR(" ERROR IN ALLOCATING PROXY COMPONENT"
+ "PRIVATE STRUCTURE");
+ eError = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+ /*Copying component Name - this will be picked up in the proxy common */
+ assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH);
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ pComponentPrivate->pCompProxyPrv =
+ (OMX_PROXY_CAM_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(OMX_PROXY_CAM_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->pCompProxyPrv != NULL,
+ OMX_ErrorInsufficientResources,
+ "Could not allocate memory for proxy component private data structure");
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pComponentPrivate->pCompProxyPrv;
+ TIMM_OSAL_Memset(pComponentPrivate->pCompProxyPrv, 0,
+ sizeof(OMX_PROXY_CAM_PRIVATE));
+
+ pComponentPrivate->bMapBuffers = OMX_TRUE;
+ /*Calling Proxy Common Init() */
+ eError = OMX_ProxyCommonInit(hComponent);
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_ERROR("\Error in Initializing Proxy");
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ TIMM_OSAL_Free(pComponentPrivate);
+ TIMM_OSAL_Free(pComponentPrivate->pCompProxyPrv);
+ goto EXIT;
+ }
+
+ for (i = 0; i < PROXY_MAXNUMOFPORTS; i++) {
+ for (j = 0; j < MAX_NUM_INTERNAL_BUFFERS; j++) {
+ pCamPrv->gComponentBufferAllocation[i][j] = NULL;
+ }
+ }
+
+ pHandle->ComponentDeInit = ComponentPrivateDeInit;
+ pHandle->GetConfig = CameraGetConfig;
+ pHandle->SetConfig = CameraSetConfig;
+ pHandle->SendCommand = Camera_SendCommand;
+ pHandle->SetParameter = CameraSetParam;
+
+ EXIT:
+ return eError;
+}
+
+/*===============================================================*/
+/** @fn Cam_Setup : This function is called when the the OMX Camera library is
+ * loaded. It creates a mutex, which is used during DCC_Init()
+ */
+/*===============================================================*/
+void __attribute__ ((constructor)) Cam_Setup(void)
+{
+ TIMM_OSAL_ERRORTYPE eError = TIMM_OSAL_ERR_NONE;
+
+ eError = TIMM_OSAL_MutexCreate(&cam_mutex);
+ if (eError != TIMM_OSAL_ERR_NONE)
+ {
+ TIMM_OSAL_Error("Creation of default mutex failed");
+ }
+}
+
+
+/*===============================================================*/
+/** @fn Cam_Destroy : This function is called when the the OMX Camera library is
+ * unloaded. It destroys the mutex which was created by
+ * Core_Setup().
+ *
+ */
+/*===============================================================*/
+void __attribute__ ((destructor)) Cam_Destroy(void)
+{
+ TIMM_OSAL_ERRORTYPE eError = TIMM_OSAL_ERR_NONE;
+
+ eError = TIMM_OSAL_MutexDelete(cam_mutex);
+ if (eError != TIMM_OSAL_ERR_NONE)
+ {
+ TIMM_OSAL_Error("Destruction of default mutex failed");
+ }
+}
diff --git a/domx/omx_proxy_component/omx_camera/src/proxy_camera_android_glue.c b/domx/omx_proxy_component/omx_camera/src/proxy_camera_android_glue.c
new file mode 100644
index 0000000..4c98c0c
--- /dev/null
+++ b/domx/omx_proxy_component/omx_camera/src/proxy_camera_android_glue.c
@@ -0,0 +1,254 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+ /******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <dirent.h>
+#include <stdio.h>
+#include <string.h>
+#include <pthread.h>
+#include <sys/time.h>
+#include <stdlib.h>
+#include <errno.h>
+
+#include <timm_osal_interfaces.h>
+#include <OMX_TI_IVCommon.h>
+#include <OMX_TI_Index.h>
+#include "omx_proxy_common.h"
+#include "omx_proxy_camera.h"
+#include "timm_osal_mutex.h"
+#include "omx_rpc.h"
+//UTIL includes
+#include "memplugin_ion.h"
+
+#define MAX_NUM_INTERNAL_BUFFERS 4
+OMX_ERRORTYPE GLUE_CameraSetParam(OMX_IN OMX_HANDLETYPE
+ hComponent, OMX_IN OMX_INDEXTYPE nParamIndex,
+ OMX_INOUT OMX_PTR pComponentParameterStructure)
+ {
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ MEMPLUGIN_ERRORTYPE eMemError = MEMPLUGIN_ERROR_NONE;
+ MEMPLUGIN_BUFFER_PARAMS newBuffer_params,delBuffer_params;
+ MEMPLUGIN_BUFFER_PROPERTIES newBuffer_prop,delBuffer_prop;
+ OMX_S32 ret = 0;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_PROXY_CAM_PRIVATE* pCamPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *)hComponent;
+ OMX_U32 stride_Y = 0;
+ OMX_TI_PARAM_COMPONENTBUFALLOCTYPE *bufferalloc = NULL;
+ int size = 0;
+ MEMPLUGIN_ION_PARAMS *pIonParams;
+ MEMPLUGIN_OBJECT *pMemPluginHdl;
+
+ DOMX_ENTER("%s: ENTERING",__FUNCTION__);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *)hComp->pComponentPrivate;
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pCompPrv->pCompProxyPrv;
+ pMemPluginHdl = ((MEMPLUGIN_OBJECT *)pCompPrv->pMemPluginHandle);
+ pIonParams = ((MEMPLUGIN_ION_PARAMS *)pMemPluginHdl->pPluginExtendedInfo);
+ MEMPLUGIN_BUFFER_PARAMS_INIT(newBuffer_params);
+ MEMPLUGIN_BUFFER_PARAMS_INIT(delBuffer_params);
+ switch (nParamIndex)
+ {
+ case OMX_TI_IndexParamComponentBufferAllocation: {
+ OMX_U32 port = 0, index = 0;
+ int fd;
+ bufferalloc = (OMX_TI_PARAM_COMPONENTBUFALLOCTYPE *)
+ pComponentParameterStructure;
+
+ port = bufferalloc->nPortIndex;
+ index = bufferalloc->nIndex;
+
+ newBuffer_params.nWidth = bufferalloc->nAllocWidth * bufferalloc->nAllocLines;
+ newBuffer_params.eBuffer_type = TILER1D;
+ newBuffer_params.eTiler_format = MEMPLUGIN_TILER_FORMAT_PAGE;
+ if(pIonParams == NULL)
+ {
+ pIonParams = TIMM_OSAL_MallocExtn(sizeof(MEMPLUGIN_ION_PARAMS), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_EXT, NULL);
+ if(pIonParams == NULL)
+ {
+ DOMX_ERROR("%s:Error allocating pPluginExtendedInfo",__FUNCTION__);
+ goto EXIT;
+ }
+ pMemPluginHdl->pPluginExtendedInfo = pIonParams;
+ }
+ MEMPLUGIN_ION_PARAMS_INIT(pIonParams);
+ //override alloc_flags for tiler 1d non secure
+ pIonParams->alloc_flags = OMAP_ION_HEAP_TILER_MASK;
+
+ eMemError = MemPlugin_Alloc(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&newBuffer_params,&newBuffer_prop);
+ if(eMemError != MEMPLUGIN_ERROR_NONE)
+ {
+ DOMX_ERROR("%s:allocation failed size: %d",newBuffer_params.nWidth*newBuffer_params.nHeight);
+ eError = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
+ bufferalloc->pBuf[0] = (OMX_PTR)newBuffer_prop.sBuffer_accessor.bufferFd;
+ eError = __PROXY_SetParameter(hComponent,
+ OMX_TI_IndexParamComponentBufferAllocation,
+ bufferalloc, &bufferalloc->pBuf[0], 1);
+ if (eError != OMX_ErrorNone) {
+ MemPlugin_Free(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc, &newBuffer_params,&newBuffer_prop);
+ } else {
+ if (pCamPrv->gComponentBufferAllocation[port][index]) {
+ delBuffer_prop.sBuffer_accessor.pBufferHandle = pCamPrv->gComponentBufferAllocation[port][index];
+ MemPlugin_Free(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&delBuffer_params,&delBuffer_prop);
+ }
+ pCamPrv->gComponentBufferAllocation[port][index] = newBuffer_prop.sBuffer_accessor.pBufferHandle;
+ }
+ close (newBuffer_prop.sBuffer_accessor.bufferFd);
+ newBuffer_prop.sBuffer_accessor.bufferFd = -1;
+ }
+ goto EXIT;
+ break;
+ default:
+ break;
+ }
+EXIT:
+ pMemPluginHdl->pPluginExtendedInfo = NULL;
+ if (eError != OMX_ErrorNone) {
+ DOMX_ERROR("%s: Error 0x%x",__FUNCTION__, eError);
+ }
+ return eError;
+
+ }
+
+OMX_ERRORTYPE GLUE_CameraVtcAllocateMemory(OMX_IN OMX_HANDLETYPE hComponent, OMX_TI_PARAM_VTCSLICE *pVtcConfig,
+ OMX_U32 nFrmWidth, OMX_U32 nFrmHeight)
+{
+ OMX_U32 i;
+ OMX_ERRORTYPE eError = OMX_ErrorNone, eCompReturn = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_PROXY_CAM_PRIVATE* pCamPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ MEMPLUGIN_BUFFER_PARAMS newBuffer_params,delBuffer_params;
+ MEMPLUGIN_BUFFER_PROPERTIES newBuffer_prop,delBuffer_prop;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ MEMPLUGIN_ERRORTYPE eMemError = MEMPLUGIN_ERROR_NONE;
+ MEMPLUGIN_ION_PARAMS *pIonParams;
+ MEMPLUGIN_OBJECT *pMemPluginHdl;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pCamPrv = (OMX_PROXY_CAM_PRIVATE*)pCompPrv->pCompProxyPrv;
+ pMemPluginHdl = ((MEMPLUGIN_OBJECT *)pCompPrv->pMemPluginHandle);
+ pIonParams = ((MEMPLUGIN_ION_PARAMS *)pMemPluginHdl->pPluginExtendedInfo);
+
+ MEMPLUGIN_BUFFER_PARAMS_INIT(newBuffer_params);
+ MEMPLUGIN_BUFFER_PARAMS_INIT(delBuffer_params);
+ for(i=0; i < MAX_NUM_INTERNAL_BUFFERS; i++) {
+ pVtcConfig->nInternalBuffers = i;
+ newBuffer_params.nWidth = nFrmWidth;
+ newBuffer_params.nHeight = nFrmHeight;
+ newBuffer_params.eBuffer_type = TILER1D;
+ newBuffer_params.eTiler_format = MEMPLUGIN_TILER_FORMAT_8BIT;
+
+ if(pIonParams == NULL)
+ {
+ pIonParams = TIMM_OSAL_MallocExtn(sizeof(MEMPLUGIN_ION_PARAMS), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_EXT, NULL);
+ if(pIonParams == NULL)
+ {
+ DOMX_ERROR("%s:Error allocating pPluginExtendedInfo",__FUNCTION__);
+ goto EXIT;
+ }
+ pMemPluginHdl->pPluginExtendedInfo = pIonParams;
+ }
+ MEMPLUGIN_ION_PARAMS_INIT(pIonParams);
+ //override alloc_flags for tiler 1d non secure
+ pIonParams->alloc_flags = OMAP_ION_HEAP_TILER_MASK;
+ eMemError = MemPlugin_Alloc(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&newBuffer_params,&newBuffer_prop);
+ if(eMemError != MEMPLUGIN_ERROR_NONE)
+ {
+ DOMX_ERROR("%s:allocation failed size: %d",newBuffer_params.nWidth*newBuffer_params.nHeight);
+ eError = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, newBuffer_prop.sBuffer_accessor.bufferFd, -1,
+ &pCamPrv->sInternalBuffers[i][0].pRegBufferHandle, NULL, IONPointers);
+ PROXY_checkRpcError();
+ pVtcConfig->IonBufhdl[0] = (OMX_PTR)pCamPrv->sInternalBuffers[i][0].pRegBufferHandle;
+ pCamPrv->sInternalBuffers[i][0].pBufferHandle = newBuffer_prop.sBuffer_accessor.pBufferHandle;
+ close (newBuffer_prop.sBuffer_accessor.bufferFd);
+ newBuffer_prop.sBuffer_accessor.bufferFd = -1;
+ DOMX_DEBUG(" DOMX: ION Buffer#%d: Y: 0x%x, eError = 0x%x, eRPCError = 0x%x\n", i, pVtcConfig->IonBufhdl[0], eError, eRPCError);
+
+ MEMPLUGIN_BUFFER_PARAMS_INIT(newBuffer_params);
+ newBuffer_params.nWidth = nFrmWidth/2;
+ newBuffer_params.nHeight = nFrmHeight/2;
+ newBuffer_params.eBuffer_type = TILER1D;
+ newBuffer_params.eTiler_format = MEMPLUGIN_TILER_FORMAT_16BIT;
+ pIonParams->alloc_flags = OMAP_ION_HEAP_TILER_MASK;
+ eMemError = MemPlugin_Alloc(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&newBuffer_params,&newBuffer_prop);
+
+ if(eMemError != MEMPLUGIN_ERROR_NONE)
+ {
+ DOMX_ERROR("%s:allocation failed size: %d",newBuffer_params.nWidth*newBuffer_params.nHeight);
+ eError = OMX_ErrorInsufficientResources;
+ if (pCamPrv->sInternalBuffers[i][0].pRegBufferHandle != NULL) {
+ eRPCError = RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pCamPrv->sInternalBuffers[i][0].pRegBufferHandle, NULL , IONPointers);
+ PROXY_checkRpcError();
+ }
+ MEMPLUGIN_BUFFER_PARAMS_INIT(delBuffer_params);
+ delBuffer_prop.sBuffer_accessor.pBufferHandle = pCamPrv->sInternalBuffers[i][0].pBufferHandle;
+ MemPlugin_Free(pCompPrv->pMemPluginHandle,pCompPrv->nMemmgrClientDesc,&delBuffer_params,&delBuffer_prop );
+ pCamPrv->sInternalBuffers[i][0].pBufferHandle = NULL;
+ goto EXIT;
+ }
+
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, newBuffer_prop.sBuffer_accessor.bufferFd,-1,
+ &pCamPrv->sInternalBuffers[i][1].pRegBufferHandle, NULL, IONPointers);
+ PROXY_checkRpcError();
+ pVtcConfig->IonBufhdl[1] = pCamPrv->sInternalBuffers[i][1].pRegBufferHandle;
+ pCamPrv->sInternalBuffers[i][1].pBufferHandle = newBuffer_prop.sBuffer_accessor.pBufferHandle;
+ close (newBuffer_prop.sBuffer_accessor.bufferFd);
+ DOMX_DEBUG("DOMX: ION Buffer#%d: UV: 0x%x, eError: 0x%x eRPCError: 0x%x\n", i, pVtcConfig->IonBufhdl[1],eError,eRPCError);
+
+ eError = __PROXY_SetParameter(hComponent,
+ OMX_TI_IndexParamVtcSlice,
+ pVtcConfig,
+ pVtcConfig->IonBufhdl, 2);
+ if (eError != OMX_ErrorNone) {
+ DOMX_ERROR("DOMX: PROXY_SetParameter for OMX_TI_IndexParamVtcSlice completed with error 0x%x\n", eError);
+ OMX_CameraVtcFreeMemory(hComponent);
+ goto EXIT;
+ }
+ }
+EXIT:
+ pMemPluginHdl->pPluginExtendedInfo = NULL;
+ if (eError != OMX_ErrorNone) {
+ DOMX_ERROR("%s: Error 0x%x",__FUNCTION__, eError);
+ }
+ return eError;
+}
diff --git a/domx/omx_proxy_component/omx_sample/Makefile b/domx/omx_proxy_component/omx_sample/Makefile
new file mode 100755
index 0000000..eae40c6
--- /dev/null
+++ b/domx/omx_proxy_component/omx_sample/Makefile
@@ -0,0 +1,101 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libOMX.TI.DUCATI1.MISC.SAMPLE.so
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+src/omx_proxy_sample.c \
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc/inc \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal domx
+SH_LIBS = domx omx_core mm_osal
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
diff --git a/domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c b/domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c
new file mode 100755
index 0000000..b270186
--- /dev/null
+++ b/domx/omx_proxy_component/omx_sample/src/omx_proxy_sample.c
@@ -0,0 +1,109 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_sample.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Tunnel Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy s get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 19-August-2009 B Ravi Kiran ravi.kiran@ti.com: Initial Version
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+//change to ducati1 later
+#define COMPONENT_NAME "OMX.TI.DUCATI1.MISC.SAMPLE" // needs to be specific for every configuration wrapper
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ DOMX_DEBUG
+ ("_____________________INSISDE PROXY WRAPPER__________________________\n");
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+ if (pHandle->pComponentPrivate == NULL)
+ {
+ DOMX_DEBUG
+ (" ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+ eError = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+ // Copying component Name - this will be picked up in the proxy common
+ assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH);
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_DEBUG("\Error in Initializing Proxy");
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ TIMM_OSAL_Free(pComponentPrivate);
+ }
+
+
+ EXIT:
+ return eError;
+}
diff --git a/domx/omx_proxy_component/omx_video_dec/Makefile b/domx/omx_proxy_component/omx_video_dec/Makefile
new file mode 100755
index 0000000..b359dc1
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_dec/Makefile
@@ -0,0 +1,102 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libOMX.TI.DUCATI1.VIDEO.DECODER.so
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+src/omx_proxy_videodec.c \
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc/inc \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal domx
+SH_LIBS = domx omx_core mm_osal
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
diff --git a/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec.c b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec.c
new file mode 100755
index 0000000..cd82a7c
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec.c
@@ -0,0 +1,813 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_videodecoder.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Tunnel Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 20-August-2010 Sarthak Aggarwal sarthak@ti.com: Initial Version
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+#include <fcntl.h>
+#include <cutils/properties.h>
+#endif
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.DECODER"
+/* needs to be specific for every configuration wrapper */
+
+#ifdef USE_ENHANCED_PORTRECONFIG
+//Define port indices in video decoder proxy
+#define OMX_VIDEODECODER_INPUT_PORT 0
+#define OMX_VIDEODECODER_OUTPUT_PORT 1
+#endif
+
+#ifdef SET_STRIDE_PADDING_FROM_PROXY
+
+#define LINUX_PAGE_SIZE (4 * 1024)
+#define TOTAL_DEC_PORTS 2
+#define HAL_NV12_PADDED_PIXEL_FORMAT (OMX_TI_COLOR_FormatYUV420PackedSemiPlanar - OMX_COLOR_FormatVendorStartUnused)
+
+static OMX_ERRORTYPE RPC_UTIL_SetStrideAndPadding(OMX_COMPONENTTYPE * hRemoteComp, PROXY_COMPONENT_PRIVATE * pCompPrv);
+
+OMX_ERRORTYPE PROXY_VIDDEC_SendCommand(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_COMMANDTYPE eCmd,
+ OMX_IN OMX_U32 nParam, OMX_IN OMX_PTR pCmdData);
+
+OMX_ERRORTYPE PROXY_VIDDEC_EventHandler(OMX_HANDLETYPE hComponent,
+ OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2,
+ OMX_PTR pEventData);
+
+#endif //SET_STRIDE_PADDING_FROM_PROXY
+
+OMX_ERRORTYPE PROXY_VIDDEC_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType);
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+OMX_ERRORTYPE PROXY_VIDDEC_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+OMX_ERRORTYPE PROXY_VIDDEC_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+#endif
+
+#ifdef ANDROID_QUIRK_LOCK_BUFFER
+#include <hardware/gralloc.h>
+#include <hardware/hardware.h>
+#include "hal_public.h"
+
+OMX_ERRORTYPE PROXY_VIDDEC_FillThisBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE * pBufferHdr);
+OMX_ERRORTYPE PROXY_VIDDEC_FillBufferDone(OMX_HANDLETYPE hComponent,
+ OMX_U32 remoteBufHdr, OMX_U32 nfilledLen, OMX_U32 nOffset, OMX_U32 nFlags,
+ OMX_TICKS nTimeStamp, OMX_HANDLETYPE hMarkTargetComponent,
+ OMX_PTR pMarkData);
+
+#endif
+extern OMX_ERRORTYPE PrearrageEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+extern void DumpVideoFrame(DebugFrame_Dump *frameInfo);
+#endif
+
+OMX_ERRORTYPE OMX_ProxyViddecInit(OMX_HANDLETYPE hComponent);
+OMX_ERRORTYPE PROXY_VIDDEC_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+ eError = OMX_ProxyViddecInit(hComponent);
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+ if (eError == OMX_ErrorNone)
+ {
+ char value[PROPERTY_VALUE_MAX];
+ property_get("debug.video.dumpframe", value, "0:0");
+ /* -ve value for fromFrame would disable this automatically */
+ pComponentPrivate->debugframeInfo.fromFrame = atoi(strtok(value, ":"));
+ pComponentPrivate->debugframeInfo.toFrame = atoi(strtok(NULL, ":"));
+ pComponentPrivate->debugframeInfo.runningFrame = pComponentPrivate->debugframeInfo.fromFrame;
+ }
+#endif
+ EXIT:
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_DEBUG("Error in Initializing Proxy");
+ if (pComponentPrivate->cCompName != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if (pComponentPrivate != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return eError;
+}
+
+OMX_ERRORTYPE OMX_ProxyViddecInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_ENHANCEDPORTRECONFIG tParamStruct;
+
+#ifdef ANDROID_QUIRK_LOCK_BUFFER
+ OMX_U32 err;
+ hw_module_t const* module;
+#endif
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+ PROXY_assert(eError == OMX_ErrorNone, eError, "Proxy common init returned error");
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+ pHandle->SetParameter = PROXY_VIDDEC_SetParameter;
+ pHandle->GetParameter = PROXY_VIDDEC_GetParameter;
+#endif
+ pHandle->GetExtensionIndex = PROXY_VIDDEC_GetExtensionIndex;
+ pHandle->ComponentDeInit = PROXY_VIDDEC_ComponentDeInit;
+
+#ifdef SET_STRIDE_PADDING_FROM_PROXY
+ pHandle->SendCommand = PROXY_VIDDEC_SendCommand;
+ pComponentPrivate->proxyEventHandler = PROXY_VIDDEC_EventHandler;
+ pComponentPrivate->IsLoadedState = OMX_TRUE;
+#endif
+
+#ifdef ANDROID_QUIRK_LOCK_BUFFER
+ pComponentPrivate->proxyFillBufferDone = PROXY_VIDDEC_FillBufferDone;
+ pHandle->FillThisBuffer = PROXY_VIDDEC_FillThisBuffer;
+
+ err = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+ if (err == 0)
+ {
+ pComponentPrivate->grallocModule = (gralloc_module_t const *)module;
+ }
+ else
+ {
+ DOMX_ERROR("FATAL: gralloc api hw_get_module() returned error: Can't find \
+ %s module err = %x", GRALLOC_HARDWARE_MODULE_ID, err);
+ eError = OMX_ErrorInsufficientResources;
+ return eError;
+ }
+#endif
+
+#ifdef USE_ENHANCED_PORTRECONFIG
+ /*Initializing Structure */
+ tParamStruct.nSize = sizeof(OMX_TI_PARAM_ENHANCEDPORTRECONFIG);
+ tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamStruct.nVersion.s.nRevision = 0x0;
+ tParamStruct.nVersion.s.nStep = 0x0;
+ tParamStruct.nPortIndex = OMX_VIDEODECODER_OUTPUT_PORT;
+ tParamStruct.bUsePortReconfigForCrop = OMX_TRUE;
+ tParamStruct.bUsePortReconfigForPadding = OMX_TRUE;
+
+ eError = PROXY_SetParameter(hComponent,(OMX_INDEXTYPE)OMX_TI_IndexParamUseEnhancedPortReconfig,
+ &tParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy SetParameter for Enhanced port reconfig usage");
+#endif
+ /* This is required to handle WMV/VC-1 content */
+ pHandle->EmptyThisBuffer = PrearrageEmptyThisBuffer;
+
+ EXIT:
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_VIDDEC_GetExtensionIndex()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require(cParameterName != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(pIndexType != NULL, OMX_ErrorBadParameter, NULL);
+
+ DOMX_ENTER("hComponent = %p, cParameterName = %p", hComponent, cParameterName);
+
+#ifdef ENABLE_GRALLOC_BUFFERS
+ // Ensure that String length is not greater than Max allowed length
+ PROXY_require(strlen(cParameterName) <= 127, OMX_ErrorBadParameter, NULL);
+
+ if (strcmp(cParameterName, "OMX.google.android.index.getAndroidNativeBufferUsage") == 0)
+ {
+ *pIndexType = (OMX_INDEXTYPE) OMX_TI_IndexAndroidNativeBufferUsage;
+ }
+ else
+ {
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in PROXY_GetExtensionIndex");
+ }
+#else
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in PROXY_GetExtensionIndex");
+#endif
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_GetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParam = NULL;
+ OMX_TI_PARAMNATIVEBUFFERUSAGE *pUsage = NULL;
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_assert((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+#ifdef ENABLE_GRALLOC_BUFFERS
+ if( nParamIndex == OMX_TI_IndexAndroidNativeBufferUsage)
+ {
+ pUsage = (OMX_TI_PARAMNATIVEBUFFERUSAGE*)pParamStruct;
+ if(pCompPrv->proxyPortBuffers[pUsage->nPortIndex].proxyBufferType == GrallocPointers)
+ {
+ PROXY_CHK_VERSION(pParamStruct, OMX_TI_PARAMNATIVEBUFFERUSAGE);
+ pUsage->nUsage = GRALLOC_USAGE_HW_RENDER;
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+ pUsage->nUsage |= GRALLOC_USAGE_SW_READ_RARELY;
+#endif
+ goto EXIT;
+ }
+ }
+#endif
+ eError = PROXY_GetParameter(hComponent,nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy GetParameter");
+
+ if( nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ PROXY_CHK_VERSION(pParamStruct, OMX_PARAM_PORTDEFINITIONTYPE);
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+ if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ if(pCompPrv->proxyPortBuffers[pPortDef->nPortIndex].proxyBufferType == GrallocPointers)
+ {
+ pPortDef->format.video.eColorFormat = HAL_NV12_PADDED_PIXEL_FORMAT;
+ }
+ else
+ {
+ pPortDef->format.video.eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+ }
+ else if ( nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ PROXY_CHK_VERSION(pParamStruct, OMX_VIDEO_PARAM_PORTFORMATTYPE);
+ pPortParam = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+ if(pPortParam->eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ if(pCompPrv->proxyPortBuffers[pPortParam->nPortIndex].proxyBufferType == GrallocPointers)
+ {
+ pPortParam->eColorFormat = HAL_NV12_PADDED_PIXEL_FORMAT;
+ }
+ else
+ {
+ pPortParam->eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+ }
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_SetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParams = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ if(pPortDef->format.video.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
+ || pPortDef->format.video.eColorFormat == HAL_NV12_PADDED_PIXEL_FORMAT)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+ else if(nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ if(pPortParams->eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar
+ || pPortParams->eColorFormat == HAL_NV12_PADDED_PIXEL_FORMAT)
+ {
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+
+ eError = PROXY_SetParameter(hComponent, nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy SetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+#endif
+
+#ifdef SET_STRIDE_PADDING_FROM_PROXY
+/* ===========================================================================*/
+/**
+ * @name PROXY_VIDDEC_SendCommand()
+ * @brief
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_SendCommand(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_COMMANDTYPE eCmd,
+ OMX_IN OMX_U32 nParam, OMX_IN OMX_PTR pCmdData)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, eCmd = %d, nParam = %d, pCmdData = %p",
+ hComponent, pCompPrv, eCmd, nParam, pCmdData);
+
+ if(eCmd == OMX_CommandStateSet)
+ {
+ //Set appropriate stride before Loaded to Idle transition.
+ if((OMX_STATETYPE)nParam == OMX_StateIdle && pCompPrv->IsLoadedState == OMX_TRUE)
+ {
+ eError = RPC_UTIL_SetStrideAndPadding(hComponent, pCompPrv);
+ PROXY_require(eError == OMX_ErrorNone, eError,
+ "Stride and padding setting from proxy returned");
+ pCompPrv->IsLoadedState = OMX_FALSE;
+ }
+ }
+ else if(eCmd == OMX_CommandPortEnable)
+ {
+ if(nParam == OMX_ALL || nParam == OMX_VIDEODECODER_OUTPUT_PORT)
+ {
+ eError = RPC_UTIL_SetStrideAndPadding(hComponent, pCompPrv);
+ PROXY_require(eError == OMX_ErrorNone, eError,
+ "Stride and padding setting from proxy returned");
+ }
+ }
+
+ eError =
+ PROXY_SendCommand(hComponent, eCmd, nParam, pCmdData);
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_EventHandler()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_EventHandler(OMX_HANDLETYPE hComponent,
+ OMX_PTR pAppData, OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2,
+ OMX_PTR pEventData)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter,
+ "This is fatal error, processing cant proceed - please debug");
+
+ DOMX_ENTER
+ ("hComponent=%p, pCompPrv=%p, eEvent=%p, nData1=%p, nData2=%p, pEventData=%p",
+ hComponent, pCompPrv, eEvent, nData1, nData2, pEventData);
+
+ if((eEvent == OMX_EventCmdComplete) && ((OMX_COMMANDTYPE)nData1 == OMX_CommandStateSet))
+ {
+ if((OMX_STATETYPE)nData2 == OMX_StateLoaded)
+ {
+ pCompPrv->IsLoadedState = OMX_TRUE;
+ }
+ }
+ eError = PROXY_EventHandler(hComponent, pAppData, eEvent, nData1, nData2, pEventData);
+
+ EXIT:
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name RPC_UTIL_RPC_UTIL_SetStrideAndPadding()
+ * @brief Gets stride on this port. Used to set stride on OMX to tell whether buffer is 1D or 2D
+ * @param hRemoteComp [IN] : Remote component handle.
+ * @return OMX_ErrorNone = Successful
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE RPC_UTIL_SetStrideAndPadding(OMX_COMPONENTTYPE * hComponent,PROXY_COMPONENT_PRIVATE * pCompPrv)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+ OMX_CONFIG_RECTTYPE tParamStruct;
+ OMX_U32 nPortIndex = 0;
+
+ for(nPortIndex=0; nPortIndex < TOTAL_DEC_PORTS ;nPortIndex++ )
+ {
+ /*Initializing Structure */
+ sPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ sPortDef.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ sPortDef.nVersion.s.nRevision = 0x0;
+ sPortDef.nVersion.s.nStep = 0x0;
+ sPortDef.nPortIndex = nPortIndex;
+
+ eError = PROXY_GetParameter(hComponent,OMX_IndexParamPortDefinition,
+ &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy GetParameter for Port Def");
+
+ if (sPortDef.eDomain == OMX_PortDomainVideo && sPortDef.format.video.eCompressionFormat == OMX_VIDEO_CodingUnused)
+ {
+ if(pCompPrv->proxyPortBuffers[nPortIndex].IsBuffer2D == OMX_TRUE)
+ {
+ sPortDef.format.video.nStride = LINUX_PAGE_SIZE;
+ }
+ else
+ {
+ tParamStruct.nSize = sizeof(OMX_CONFIG_RECTTYPE);
+ tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamStruct.nVersion.s.nRevision = 0x0;
+ tParamStruct.nVersion.s.nStep = 0x0;
+ tParamStruct.nPortIndex = nPortIndex;
+
+ eError = PROXY_GetParameter(hComponent,(OMX_INDEXTYPE)OMX_TI_IndexParam2DBufferAllocDimension,
+ &tParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy GetParameter for 2D index");
+
+ sPortDef.format.video.nStride = tParamStruct.nWidth;
+ }
+ eError = PROXY_SetParameter(hComponent,OMX_IndexParamPortDefinition,
+ &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy SetParameter for Port Def");
+ }
+ }
+
+ EXIT:
+ return eError;
+}
+
+#endif
+
+#ifdef ANDROID_QUIRK_LOCK_BUFFER
+/* ===========================================================================*/
+/**
+ * @name PROXY_VIDDEC_FillThisBuffer()
+ * @brief Gets stride on this port. Used to set stride on OMX to tell whether buffer is 1D or 2D
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_FillThisBuffer(OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone, eCompReturn = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_U32 count = 0;
+ IMG_native_handle_t* grallocHandle;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+
+ PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ PROXY_CHK_VERSION(pBufferHdr, OMX_BUFFERHEADERTYPE);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ if(pCompPrv->proxyPortBuffers[OMX_VIDEODECODER_OUTPUT_PORT].proxyBufferType
+ == GrallocPointers)
+ {
+ /* Lock the Gralloc buffer till it gets rendered completely */
+ /* Extract the Gralloc handle from the Header and then call lock on that */
+ /* Note# There is no error check for the pBufferHdr here*/
+ grallocHandle = (IMG_native_handle_t*)pBufferHdr->pBuffer;
+
+ /*Initializing Structure */
+ sPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ sPortDef.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ sPortDef.nVersion.s.nRevision = 0x0;
+ sPortDef.nVersion.s.nStep = 0x0;
+ sPortDef.nPortIndex = OMX_VIDEODECODER_INPUT_PORT;
+ eError = PROXY_GetParameter(hComponent,OMX_IndexParamPortDefinition,
+ &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy GetParameter for Port Def");
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+ /* Get the Video frame crop window */
+ OMX_CONFIG_RECTTYPE rect;
+ rect.nSize = sizeof(rect);
+ rect.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ rect.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ rect.nVersion.s.nRevision = 0x0;
+ rect.nVersion.s.nStep = 0x0;
+ rect.nPortIndex = OMX_VIDEODECODER_OUTPUT_PORT;
+
+ eError = PROXY_GetConfig(hComponent, OMX_IndexConfigCommonOutputCrop, &rect);
+
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error while getting output crop");
+ pCompPrv->debugframeInfo.frame_width = rect.nWidth;
+ pCompPrv->debugframeInfo.frame_height = rect.nHeight;
+ pCompPrv->debugframeInfo.frame_xoffset = rect.nLeft;
+ pCompPrv->debugframeInfo.frame_yoffset = rect.nTop;
+ pCompPrv->debugframeInfo.decoded_height = sPortDef.format.video.nFrameHeight;
+#endif
+ pCompPrv->grallocModule->lock((gralloc_module_t const *) pCompPrv->grallocModule,
+ (buffer_handle_t)grallocHandle, GRALLOC_USAGE_HW_RENDER,
+ 0,0,sPortDef.format.video.nFrameWidth, sPortDef.format.video.nFrameHeight,NULL);
+ }
+
+ eError = PROXY_FillThisBuffer(hComponent, pBufferHdr);
+
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy FillThisBuffer");
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_VIDDEC_FillBufferDone()
+ * @brief Gets stride on this port. Used to set stride on OMX to tell whether buffer is 1D or 2D
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE PROXY_VIDDEC_FillBufferDone(OMX_HANDLETYPE hComponent,
+ OMX_U32 remoteBufHdr, OMX_U32 nfilledLen, OMX_U32 nOffset, OMX_U32 nFlags,
+ OMX_TICKS nTimeStamp, OMX_HANDLETYPE hMarkTargetComponent,
+ OMX_PTR pMarkData)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone, eCompReturn = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_U32 count = 0;
+ IMG_native_handle_t* grallocHandle;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter,
+ "This is fatal error, processing cant proceed - please debug");
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ /* Lock the Gralloc buffer till it gets rendered completely */
+ /* Extract the Gralloc handle from the Header and then call lock on that */
+ /* Note# There is no error check for the pBufferHdr here*/
+
+ if(pCompPrv->proxyPortBuffers[OMX_VIDEODECODER_OUTPUT_PORT].proxyBufferType
+ == GrallocPointers) {
+ for (count = 0; count < pCompPrv->nTotalBuffers; ++count)
+ {
+ if (pCompPrv->tBufList[count].pBufHeaderRemote == remoteBufHdr)
+ {
+ grallocHandle = (IMG_native_handle_t*)(pCompPrv->tBufList[count].pBufHeader)->pBuffer;
+ break;
+ }
+ }
+
+ PROXY_assert((count != pCompPrv->nTotalBuffers),
+ OMX_ErrorBadParameter,
+ "Received invalid-buffer header from OMX component");
+ pCompPrv->grallocModule->unlock((gralloc_module_t const *) pCompPrv->grallocModule, (buffer_handle_t)grallocHandle);
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+ DOMX_DEBUG("frm[%u] to[%u] run[%u]", pCompPrv->debugframeInfo.fromFrame, pCompPrv->debugframeInfo.toFrame, pCompPrv->debugframeInfo.runningFrame);
+ /* Fill buffer Done successed, hence start dumping if requested */
+ OMX_BUFFERHEADERTYPE *pBufHdr = pCompPrv->tBufList[count].pBufHeader;
+ if ((pCompPrv->debugframeInfo.fromFrame == 0) && (pCompPrv->debugframeInfo.runningFrame <= pCompPrv->debugframeInfo.toFrame))
+ {
+ /* Lock the buffer for SW read usage and then access it */
+ pCompPrv->grallocModule->lock((gralloc_module_t const*) pCompPrv->grallocModule,
+ (buffer_handle_t)grallocHandle,
+ GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_SW_READ_RARELY,
+ pCompPrv->debugframeInfo.frame_xoffset,
+ pCompPrv->debugframeInfo.frame_yoffset,
+ pCompPrv->debugframeInfo.frame_width,
+ pCompPrv->debugframeInfo.frame_height,
+ (void*)pCompPrv->debugframeInfo.y_uv);
+
+ DumpVideoFrame(&pCompPrv->debugframeInfo);
+
+ pCompPrv->grallocModule->unlock((gralloc_module_t const *) pCompPrv->grallocModule,
+ (buffer_handle_t)grallocHandle);
+ pCompPrv->debugframeInfo.runningFrame++;
+ }
+ else if (pCompPrv->debugframeInfo.fromFrame > 0)
+ {
+ pCompPrv->debugframeInfo.fromFrame--;
+ }
+#endif
+ }
+
+ eError = PROXY_FillBufferDone(hComponent,remoteBufHdr, nfilledLen, nOffset, nFlags,
+ nTimeStamp, hMarkTargetComponent, pMarkData);
+
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in PROXY FillBufferDone");
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+#endif
+
+OMX_ERRORTYPE PROXY_VIDDEC_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ DOMX_ENTER("PROXY_VIDDEC_ComponentDeinit called with hComp %x",hComponent);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter,
+ "This is fatal error, processing cant proceed - please debug");
+
+ //decoder specific config will be included here in following patches
+
+ eError = PROXY_ComponentDeInit(hComponent);
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
diff --git a/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c
new file mode 100644
index 0000000..7d5396a
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_secure.c
@@ -0,0 +1,153 @@
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include <sys/ioctl.h>
+#include <errno.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.DECODER.secure"
+
+extern OMX_U32 DUCATI_IN_SECURE_MODE;
+extern OMX_U32 SECURE_COMPONENTS_RUNNING;
+
+extern OMX_ERRORTYPE OMX_ProxyViddecInit(OMX_HANDLETYPE hComponent);
+OMX_ERRORTYPE PROXY_VIDDEC_Secure_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ const OMX_U8 enable = 1, disable = 0;
+ OMX_U8 mode;
+ int ret;
+
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ pComponentPrivate->secure_misc_drv_fd = open("/dev/rproc_user", O_SYNC | O_RDWR);
+ if (pComponentPrivate->secure_misc_drv_fd < 0)
+ {
+ DOMX_ERROR("Can't open rproc_user device 0x%x\n", errno);
+ eError = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
+
+ ret = write(pComponentPrivate->secure_misc_drv_fd, &enable, sizeof(enable));
+ if(ret != 1)
+ {
+ DOMX_ERROR("errno from setting secure mode = %x",errno);
+ ret = write(pComponentPrivate->secure_misc_drv_fd, &disable, sizeof(disable));
+ if (ret < 0)
+ {
+ DOMX_ERROR("Setting unsecure mode failed");
+ }
+
+ ret = close(pComponentPrivate->secure_misc_drv_fd);
+ if (ret < 0)
+ {
+ DOMX_ERROR("Can't close the driver");
+ }
+ eError = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
+
+ ret = read(pComponentPrivate->secure_misc_drv_fd, &mode, sizeof(mode));
+ PROXY_assert(mode == enable, OMX_ErrorUndefined,"ERROR: We are not in secure mode");
+ DOMX_DEBUG("secure mode recieved from Misc driver for secure playback = 0x%x\n", mode);
+
+ eError = OMX_ProxyViddecInit(hComponent);
+ pHandle->ComponentDeInit = PROXY_VIDDEC_Secure_ComponentDeInit;
+ pComponentPrivate->bMapBuffers = OMX_FALSE;
+ EXIT:
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_DEBUG("Error in Initializing Proxy");
+ if (pComponentPrivate->cCompName != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if (pComponentPrivate != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return eError;
+}
+
+OMX_ERRORTYPE PROXY_VIDDEC_Secure_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ int ret;
+ const OMX_U8 disable = 0;
+ int secure_misc_drv_fd;
+
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ secure_misc_drv_fd = pComponentPrivate->secure_misc_drv_fd;
+
+ eError = PROXY_ComponentDeInit(hComponent);
+ if(eError != OMX_ErrorNone)
+ {
+ DOMX_ERROR("Proxy common deinit returned error = %x",eError);
+ }
+ pComponentPrivate = NULL;
+
+ ret = write(secure_misc_drv_fd, &disable, sizeof(disable));
+ if (ret < 0)
+ {
+ DOMX_ERROR("Setting unsecure mode failed");
+ }
+
+ ret = close(secure_misc_drv_fd);
+ if (ret < 0)
+ {
+ DOMX_ERROR("Can't close the driver");
+ }
+
+ return eError;
+}
+
diff --git a/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_utils.c b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_utils.c
new file mode 100755
index 0000000..cb3ba5b
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_dec/src/omx_proxy_videodec_utils.c
@@ -0,0 +1,319 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ *! 21-Oct-2011 Rajesh vandanapu sarthav@ti.com: Initial Version
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+#include <fcntl.h>
+#include <cutils/properties.h>
+#include <stdlib.h>
+#include <errno.h>
+#endif
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.DECODER"
+/* needs to be specific for every configuration wrapper */
+
+/* DEFINITIONS for parsing the config information & sequence header for WMV*/
+#define VIDDEC_GetUnalignedDword( pb, dw ) \
+ (dw) = ((OMX_U32) *(pb + 3) << 24) + \
+ ((OMX_U32) *(pb + 2) << 16) + \
+ ((OMX_U16) *(pb + 1) << 8) + *pb;
+
+#define VIDDEC_GetUnalignedDwordEx( pb, dw ) VIDDEC_GetUnalignedDword( pb, dw ); (pb) += sizeof(OMX_U32);
+#define VIDDEC_LoadDWORD( dw, p ) VIDDEC_GetUnalignedDwordEx( p, dw )
+#define VIDDEC_MAKEFOURCC(ch0, ch1, ch2, ch3) \
+ ((OMX_U32)(OMX_U8)(ch0) | ((OMX_U32)(OMX_U8)(ch1) << 8) | \
+ ((OMX_U32)(OMX_U8)(ch2) << 16) | ((OMX_U32)(OMX_U8)(ch3) << 24 ))
+
+#define VIDDEC_FOURCC(ch0, ch1, ch2, ch3) VIDDEC_MAKEFOURCC(ch0, ch1, ch2, ch3)
+
+#define FOURCC_WMV3 VIDDEC_FOURCC('W','M','V','3')
+#define FOURCC_WMV2 VIDDEC_FOURCC('W','M','V','2')
+#define FOURCC_WMV1 VIDDEC_FOURCC('W','M','V','1')
+#define FOURCC_WVC1 VIDDEC_FOURCC('W','V','C','1')
+
+#define CSD_POSITION 51 /*Codec Specific Data position on the "stream propierties object"(ASF spec)*/
+
+typedef struct VIDDEC_WMV_RCV_struct {
+ OMX_U32 nNumFrames : 24;
+ OMX_U32 nFrameType : 8;
+ OMX_U32 nID : 32;
+ OMX_U32 nStructData : 32; //STRUCT_C
+ OMX_U32 nVertSize; //STRUCT_A-1
+ OMX_U32 nHorizSize; //STRUCT_A-2
+ OMX_U32 nID2 : 32;
+ OMX_U32 nSequenceHdr : 32; //STRUCT_B
+} VIDDEC_WMV_RCV_struct;
+
+typedef struct VIDDEC_WMV_VC1_struct {
+ OMX_U32 nNumFrames : 24;
+ OMX_U32 nFrameType : 8;
+ OMX_U32 nID : 32;
+ OMX_U32 nStructData : 32; //STRUCT_C
+ OMX_U32 nVertSize; //STRUCT_A-1
+ OMX_U32 nHorizSize; //STRUCT_A-2
+ OMX_U32 nID2 : 32;
+ OMX_U32 nSequenceHdr : 32; //STRUCT_B
+} VIDDEC_WMV_VC1_struct;
+
+
+OMX_ERRORTYPE PrearrageEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_U8* pBuffer = NULL;
+ OMX_U8* pData = NULL;
+ OMX_U32 nValue = 0;
+ OMX_U32 nWidth = 0;
+ OMX_U32 nHeight = 0;
+ OMX_U32 nActualCompression = 0;
+ OMX_U8* pCSD = NULL;
+ OMX_U32 nSize_CSD = 0;
+ DOMX_ENTER("");
+
+ PROXY_assert(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+
+ if (pBufferHdr->nFlags & OMX_BUFFERFLAG_CODECCONFIG){
+ PROXY_assert(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ /* Get component role */
+ OMX_PARAM_COMPONENTROLETYPE compRole;
+ compRole.nSize = sizeof(OMX_PARAM_COMPONENTROLETYPE);
+ compRole.nVersion.s.nVersionMajor = 1;
+ compRole.nVersion.s.nVersionMinor = 1; //Ducati OMX version
+ compRole.nVersion.s.nRevision = 0;
+ compRole.nVersion.s.nStep = 0;
+
+ eError = PROXY_GetParameter(hComp, OMX_IndexParamStandardComponentRole, &compRole);
+ if(eError != OMX_ErrorNone){
+ DOMX_ERROR("Error getting OMX_IndexParamStandardComponentRole");
+ }
+
+ if(!strcmp((char *)(compRole.cRole), "video_decoder.wmv")){
+ pBuffer = pBufferHdr->pBuffer;
+
+ VIDDEC_WMV_RCV_struct sStructRCV;
+
+ DOMX_DEBUG("nFlags: %x", pBufferHdr->nFlags);
+
+ pData = pBufferHdr->pBuffer + 15; /*Position to Width & Height*/
+ VIDDEC_LoadDWORD(nValue, pData);
+ nWidth = nValue;
+ VIDDEC_LoadDWORD(nValue, pData);
+ nHeight = nValue;
+
+ pData += 4; /*Position to compression type*/
+ VIDDEC_LoadDWORD(nValue, pData);
+ nActualCompression = nValue;
+
+ /*Seting pCSD to proper position*/
+ pCSD = pBufferHdr->pBuffer;
+ pCSD += CSD_POSITION;
+ nSize_CSD = pBufferHdr->nFilledLen - CSD_POSITION;
+
+ if(nActualCompression == FOURCC_WMV3){
+
+ //From VC-1 spec: Table 265: Sequence Layer Data Structure
+ sStructRCV.nNumFrames = 0xFFFFFF; /*Infinite frame number*/
+ sStructRCV.nFrameType = 0xc5; /*0x85 is the value given by ASF to rcv converter*/
+ sStructRCV.nID = 0x04; /*WMV3*/
+ sStructRCV.nStructData = 0x018a3106; /*0x06318a01zero fill 0x018a3106*/
+ sStructRCV.nVertSize = nHeight;
+ sStructRCV.nHorizSize = nWidth;
+ sStructRCV.nID2 = 0x0c; /* Fix value */
+ sStructRCV.nSequenceHdr = 0x00002a9f; /* This value is not provided by parser, so giving a value from a video*/
+
+ DOMX_DEBUG("initial: nStructData: %x", sStructRCV.nStructData);
+ DOMX_DEBUG("pCSD = %x", (OMX_U32)*pCSD);
+
+ sStructRCV.nStructData = (OMX_U32)pCSD[0] << 0 |
+ pCSD[1] << 8 |
+ pCSD[2] << 16 |
+ pCSD[3] << 24;
+
+ DOMX_DEBUG("FINAL: nStructData: %x", sStructRCV.nStructData);
+
+ //Copy RCV structure to actual buffer
+ assert(pBufferHdr->nFilledLen < pBufferHdr->nAllocLen);
+ pBufferHdr->nFilledLen = sizeof(VIDDEC_WMV_RCV_struct);
+ TIMM_OSAL_Memcpy(pBufferHdr->pBuffer, (OMX_U8*)(&sStructRCV),
+ pBufferHdr->nFilledLen);
+
+ }
+ else if (nActualCompression == FOURCC_WVC1){
+ DOMX_DEBUG("VC-1 Advance Profile prearrange");
+ pBufferHdr->nOffset = pBufferHdr->nOffset+52;
+ pBufferHdr->nFilledLen= pBufferHdr->nFilledLen-52;
+ }
+ }
+ }
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+
+ return PROXY_EmptyThisBuffer(hComponent, pBufferHdr);
+}
+
+#ifdef ENABLE_RAW_BUFFERS_DUMP_UTILITY
+/**
+* Usage#
+* By default this feature is kept disabled to avoid security leaks.
+*
+* (1) Uncomment the below 2 lines from Android.mk
+* #LOCAL_CFLAGS += -DENABLE_RAW_BUFFERS_DUMP_UTILITY
+* #LOCAL_SHARED_LIBRARIES += libcutils
+* And rebuild the omx proxy common component
+*
+* (2) Before start playback, make sure that "data" folder has r/w
+* permissions. For this, execute the below
+* mount -o rw,remount -t ext3 /dev/block/mmcblk0p1 /data/
+* chmod 777 /data/
+*
+* (3) Set the property for number of frames to dump
+* eg: setprop debug.video.dumpframe 10:20
+* would dump frames from 10 to 20.
+*
+* (4) Pull the frames to PC over adb
+* adb pull /data/frame_10.txt
+*
+* (5) Analyse on PC tools.
+*/
+
+/*
+* Method to convert NV12 to YUV420p for PC analysis
+*/
+static void convertNV12ToYuv420(DebugFrame_Dump *frameInfo, void *dst)
+{
+ int stride = 4096; /* ARM Page size = 4k */
+ uint32_t ybuf_offset = frameInfo->frame_yoffset * stride + frameInfo->frame_xoffset;
+ uint8_t* p1y = (uint8_t*)frameInfo->y_uv[0] + ybuf_offset;
+ uint8_t* p2y = (uint8_t*) dst;
+ int i, j, j1;
+ int width = frameInfo->frame_width;
+ int height = frameInfo->frame_height;
+
+ DOMX_DEBUG("Coverting NV-12 to YUV420p Width[%d], Height[%d] and Stride[%d] offset[%d]",
+ width, height, stride, ybuf_offset);
+
+ /* copy y-buffer, almost bytewise copy, except for stride jumps.*/
+ for(i=0;i<height;i++)
+ {
+ /* copy whole row of Y pixels. source and desination will point to new row each time.*/
+ memcpy(p2y+i*width, p1y+i*stride, width);
+ }
+
+ /** copy uv buffers
+ * rearrange from packed planar [uvuvuv] to planar [uuu][vvvv] packages pixel wise
+ * calculate the offset for UV buffer
+ */
+
+ uint32_t UV_offset = frameInfo->frame_xoffset
+ + (frameInfo->decoded_height
+ + frameInfo->frame_yoffset / 2)
+ * stride;
+
+ const uint8_t* p1uv = (uint8_t*)frameInfo->y_uv[0] + UV_offset;
+
+ uint8_t* p2u = ((uint8_t*) dst + (width * height));
+ uint8_t* p2v = ((uint8_t*) p2u + ((width/2) * (height/2)));
+ for(i=0;(i < height/2);i++)
+ {
+ for(j=0,j1=0;(j< width/2);j++,j1+=2)
+ {
+ p2u[j] = p1uv[j1];
+ p2v[j] = p1uv[j1+1];
+ }
+ p1uv+=stride;
+ p2u+=width/2;
+ p2v+=width/2;
+ }
+}
+
+void DumpVideoFrame(DebugFrame_Dump *frameInfo)
+{
+ /* First convert the frame to 420p and then write to SD Card */
+ OMX_U32 framesize = (frameInfo->frame_width *
+ frameInfo->frame_height * 3) / 2;
+ OMX_U8* localbuffer = malloc(framesize);
+ if (localbuffer == NULL)
+ {
+ DOMX_ERROR("NO HEAP");
+ goto EXIT;
+ }
+ convertNV12ToYuv420(frameInfo, localbuffer);
+ int filedes = -1;
+ char framenumber[100];
+ sprintf(framenumber, "/data/frame_%ld.txt", frameInfo->runningFrame);
+ DOMX_ERROR("file path %s",framenumber);
+ filedes = open(framenumber, O_CREAT | O_WRONLY | O_SYNC | O_TRUNC, 0777);
+ if(filedes < 0)
+ {
+ DOMX_ERROR("\n!!!!!!!!!Error in file open!!!!!!!! [%d][%s]\n", filedes, strerror(errno));
+ goto EXIT;
+ }
+ int ret = write (filedes, (void*)localbuffer, framesize);
+ if (ret < (int)framesize)
+ {
+ DOMX_ERROR("File Write Failed");
+ }
+EXIT:
+ if (localbuffer)
+ {
+ free(localbuffer);
+ localbuffer = NULL;
+ }
+ if (filedes > 0)
+ {
+ close(filedes);
+ }
+}
+
+#endif
diff --git a/domx/omx_proxy_component/omx_video_enc/inc/omx_proxy_video_encoder.h b/domx/omx_proxy_component/omx_video_enc/inc/omx_proxy_video_encoder.h
new file mode 100644
index 0000000..4fbd98d
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/inc/omx_proxy_video_encoder.h
@@ -0,0 +1,97 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+/**
+ * @file omx_proxy_video_encoder.h
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\omx_video_enc\inc
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ * 5 October 2012: Vidhoon Viswanathan vidhoon@ti.com Initial version
+ *================================================================*/
+
+ /******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+//C includes
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include <stdlib.h>
+#include <cutils/properties.h>
+//TIMMOSAL and OMX includes
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+#include <MetadataBufferType.h>
+//GRALLOC includes
+#ifdef ENABLE_GRALLOC_BUFFER
+#include "native_handle.h"
+#include <hal_public.h>
+#include <VideoMetadata.h>
+#endif
+
+#define OMX_ENC_NUM_INTERNAL_BUF (8)
+/**
+ * struct OMX_PROXY_ENCODER_PRIVATE: this struct contains all data elements specific
+ * to PROXY ENCODER components.
+ *
+ * @param hBufPipe: handle to local buffer pipe
+ * @param bAndroidOpaqueFormat: boolean that indicates if AndroidOpaqueFormat is set
+ * @param hCC: context handle
+ * @param gralloc_handle: handles of local gralloc buffers allocated
+ * @param nCurBufIndex: current buffer index
+ * @param mAllocDev: Local gralloc client
+ *
+ * */
+typedef struct OMX_PROXY_ENCODER_PRIVATE
+{
+ OMX_PTR hBufPipe;
+ OMX_BOOL bAndroidOpaqueFormat;
+ OMX_PTR hCC;
+ IMG_native_handle_t* gralloc_handle[OMX_ENC_NUM_INTERNAL_BUF];
+ OMX_S32 nCurBufIndex;
+ alloc_device_t* mAllocDev;
+}OMX_PROXY_ENCODER_PRIVATE;
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/Makefile b/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/Makefile
new file mode 100755
index 0000000..a9b6db7
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/Makefile
@@ -0,0 +1,101 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libOMX.TI.DUCATI1.VIDEO.H264E.so
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+src/omx_proxy_h264enc.c \
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc/inc \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal domx
+SH_LIBS = domx omx_core mm_osal
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc.c b/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc.c
new file mode 100755
index 0000000..638ed0c
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc.c
@@ -0,0 +1,1113 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_h264enc.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ * 26-August-2011 Abhishek Ranka : Support for color conv at encoder
+ * input port
+ *
+ *! 20-August-2010 Sarthak Aggarwal sarthak@ti.com: Initial Version
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+#include "omx_proxy_video_encoder.h"
+
+#include <MetadataBufferType.h>
+#ifdef ENABLE_GRALLOC_BUFFER
+#include "native_handle.h"
+#include <hal_public.h>
+#include <VideoMetadata.h>
+#endif
+
+#include <stdlib.h>
+#include <cutils/properties.h>
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.H264E"
+/* needs to be specific for every configuration wrapper */
+
+#define OMX_H264E_INPUT_PORT 0
+#define LINUX_PAGE_SIZE 4096
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+OMX_ERRORTYPE LOCAL_PROXY_H264E_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+OMX_ERRORTYPE LOCAL_PROXY_H264E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+#endif
+
+
+#define OMX_INIT_STRUCT(_s_, _name_) \
+ memset(&(_s_), 0x0, sizeof(_name_)); \
+ (_s_).nSize = sizeof(_name_); \
+ (_s_).nVersion.s.nVersionMajor = 0x1; \
+ (_s_).nVersion.s.nVersionMinor = 0x1; \
+ (_s_).nVersion.s.nRevision = 0x0; \
+ (_s_).nVersion.s.nStep = 0x0
+
+
+/* Params needed for Dynamic Frame Rate Control*/
+#define FRAME_RATE_THRESHOLD 1 /* Change in Frame rate to configure the encoder */
+OMX_U32 nFrameRateThreshold = 0;/* Frame Rate threshold for every frame rate update */
+OMX_U32 nPortFrameRate = 0; /* Port FPS initially set to the Encoder */
+OMX_U32 nFrameCounter = 0; /* Number of input frames recieved since last framerate calculation */
+OMX_TICKS nVideoTime = 0; /* Video duration since last framerate calculation */
+OMX_TICKS nLastFrameRateUpdateTime = 0; /*Time stamp at last frame rate update */
+OMX_U16 nBFrames = 0; /* Number of B Frames in H264 Encoder */
+
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+/* Opaque color format requires below quirks to be enabled
+ * ENABLE_GRALLOC_BUFFER
+ * ANDROID_QUIRCK_CHANGE_PORT_VALUES
+ */
+#define OMX_H264VE_NUM_INTERNAL_BUF (8)
+#define HAL_PIXEL_FORMAT_TI_NV12 (0x100)
+
+#define COLORCONVERT_MAX_SUB_BUFFERS (3)
+
+#define COLORCONVERT_BUFTYPE_VIRTUAL (0x0)
+#define COLORCONVERT_BUFTYPE_ION (0x1)
+#define COLORCONVERT_BUFTYPE_GRALLOCOPAQUE (0x2)
+
+int COLORCONVERT_open(void **hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC, void *pSrc[],
+ void *pDst[], int nWidth,
+ int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType);
+int COLORCONVERT_close(void *hCC,PROXY_COMPONENT_PRIVATE *pCompPrv);
+static int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride);
+static OMX_ERRORTYPE LOCAL_PROXY_H264E_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE ** ppBufferHdr, OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes);
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264E_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264E_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+extern RPC_OMX_ERRORTYPE RPC_RegisterBuffer(OMX_HANDLETYPE hRPCCtx, int fd1, int fd2,
+ OMX_PTR *handle1, OMX_PTR *handle2,
+ PROXY_BUFFER_TYPE proxyBufferType);
+extern RPC_OMX_ERRORTYPE RPC_UnRegisterBuffer(OMX_HANDLETYPE hRPCCtx, OMX_PTR handle1,
+ OMX_PTR handle2, PROXY_BUFFER_TYPE proxyBufferType);
+#endif
+
+
+OMX_ERRORTYPE LOCAL_PROXY_H264E_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType);
+
+OMX_ERRORTYPE LOCAL_PROXY_H264E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+static OMX_ERRORTYPE OMX_ConfigureDynamicFrameRate( OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 nTargetFrameRate = 0; /* Target Frame Rate to be provided to Encoder */
+ OMX_U32 nCurrentFrameRate = 0; /* Current Frame Rate currently set in Encoder */
+ OMX_CONFIG_FRAMERATETYPE tFrameRate;
+ OMX_COMPONENTTYPE *pHandle;
+ if (hComponent == NULL){
+ DOMX_ERROR("Component is invalid/ not present ");
+ return OMX_ErrorBadParameter;
+ }
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ /* Initialise the OMX structures */
+ OMX_INIT_STRUCT(tFrameRate,OMX_CONFIG_FRAMERATETYPE);
+
+ /* Intialise nLastFrameRateUpdateTime for the 1st frame */
+ if((!nFrameCounter) && (!nLastFrameRateUpdateTime)){
+ nLastFrameRateUpdateTime = pBufferHdr-> nTimeStamp;
+ }
+
+ /* Increment the Frame Counter and Calculate Frame Rate*/
+ nFrameCounter++;
+ nVideoTime = pBufferHdr->nTimeStamp - nLastFrameRateUpdateTime;
+
+ if(nVideoTime < 0) {
+ return OMX_ErrorBadParameter;
+ }
+
+ /*Get Port Frame Rate if not read yet*/
+ if(!nFrameRateThreshold) {
+ tFrameRate.nPortIndex = OMX_H264E_INPUT_PORT; /* As per ducati support-set for input port */
+
+ /* Read Current FrameRate */
+ eError = pHandle->GetConfig(hComponent,OMX_IndexConfigVideoFramerate,&tFrameRate);
+ if (eError != OMX_ErrorNone)
+ DOMX_ERROR ("pHandle->GetConfig OMX_IndexConfigVideoFramerate eError :0x%x \n",eError);
+ nFrameRateThreshold = tFrameRate.xEncodeFramerate >>16;
+ nPortFrameRate = nFrameRateThreshold;
+ DOMX_DEBUG(" Port Frame Rate is %d ", nPortFrameRate);
+ }
+ nCurrentFrameRate = nFrameRateThreshold;
+
+ /* If Number of frames is less than the Threshold
+ * Frame Rate udpate is not necessary
+ */
+ if(nFrameCounter < nFrameRateThreshold){
+ DOMX_EXIT(" Threshold not reached, no update necessary");
+ return OMX_ErrorNone;
+ }
+
+ /*Calculate the new target Frame Rate*/
+ if (nVideoTime != 0)
+ nTargetFrameRate = nFrameCounter * 1000000 / nVideoTime;
+
+ /* For 1080p record, max FPS supported by Codec for profile 4.1 is 30.
+ * When Dynamic Frame Rate is enabled, there might be scenario when FPS
+ * calculated is more than 30. Hence adding the check so that Dynamic Frame
+ * Rate set is never greater than the port FPS initially set.
+ */
+ if(nTargetFrameRate > nPortFrameRate){
+ DOMX_DEBUG("Frame Rate Calculated is more than initial port set Frame Rate");
+ nTargetFrameRate = nPortFrameRate;
+ }
+
+ /* Difference in Frame Rate is more than Threshold - Only then update Frame Rate*/
+ if((( (OMX_S32)nTargetFrameRate) -((OMX_S32) nCurrentFrameRate) >= FRAME_RATE_THRESHOLD) ||
+ (((OMX_S32) nCurrentFrameRate) - ( (OMX_S32)nTargetFrameRate) >= FRAME_RATE_THRESHOLD)) {
+
+ /* Now Send the new Frame Rate */
+ tFrameRate.nPortIndex = OMX_H264E_INPUT_PORT; /* As per ducati support-set for input port */
+ tFrameRate.xEncodeFramerate = (OMX_U32)(nTargetFrameRate * (1 << 16));
+ eError = pHandle->SetConfig(hComponent,OMX_IndexConfigVideoFramerate,&tFrameRate);
+ if(eError != OMX_ErrorNone){
+ DOMX_ERROR(" Error while configuring Dynamic Frame Rate,Error info = %d",eError);
+ return eError;
+ } else {
+ DOMX_DEBUG("Dynamic Frame Rate configuration successful \n");
+ }
+ nFrameRateThreshold = nTargetFrameRate; /*Update the threshold */
+ }
+
+ /* reset all params */
+ nFrameCounter = 0 ;
+ nVideoTime = 0;
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE ComponentPrivateEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ PROXY_assert(hComponent != NULL, OMX_ErrorInsufficientResources,"Null component handle received in EmptyThisBuffer");
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ PROXY_assert(pCompPrv != NULL, OMX_ErrorInsufficientResources,"Pointer to Null component private structure received in EmptyThisBuffer");
+ if(pCompPrv->proxyPortBuffers[0].proxyBufferType == EncoderMetadataPointers) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ if(pTempBuffer == NULL) {
+ eError = OMX_ErrorBadParameter;
+ DOMX_ERROR("Null meta data buffer supplied - Cannot find metadata type");
+ goto EXIT;
+ }
+ nMetadataBufferType = *pTempBuffer;
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource) {
+ eError = OMX_ConfigureDynamicFrameRate(hComponent, pBufferHdr);
+ if( eError != OMX_ErrorNone)
+ DOMX_ERROR(" Error while configuring FrameRate Dynamically.Error info = %d - Non Fatal Error",eError);
+ }
+ }
+
+ DOMX_DEBUG("Redirection from ComponentPricateEmptyThisBuffer to PROXY_EmptyThisBuffer");
+EXIT:
+ if( eError != OMX_ErrorNone) {
+ DOMX_EXIT("%s: exiting with error 0x%x - Non Fatal",__FUNCTION__,eError);
+ } else {
+ DOMX_EXIT("%s: dynamic frame rate config successful",__FUNCTION__);
+ }
+ return LOCAL_PROXY_H264E_EmptyThisBuffer (hComponent,pBufferHdr);
+}
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_ENHANCEDPORTRECONFIG tParamStruct;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+ char value[OMX_MAX_STRINGNAME_SIZE];
+ OMX_U32 mEnableVFR = 1; /* Flag used to enable/disable VFR for Encoder */
+ property_get("debug.vfr.enable", value, "1");
+ mEnableVFR = atoi(value);
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pComponentPrivate->pCompProxyPrv =
+ (OMX_PROXY_ENCODER_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(OMX_PROXY_ENCODER_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->pCompProxyPrv != NULL,
+ OMX_ErrorInsufficientResources,
+ " Could not allocate proxy component private");
+
+ TIMM_OSAL_Memset(pComponentPrivate->pCompProxyPrv, 0,
+ sizeof(OMX_PROXY_ENCODER_PRIVATE));
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pComponentPrivate->pCompProxyPrv;
+
+ /* Create Pipe of for encoder input buffers */
+ eOSALStatus = TIMM_OSAL_CreatePipe(&pProxy->hBufPipe, sizeof(OMX_U32),
+ OMX_H264VE_NUM_INTERNAL_BUF, 1);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources,
+ "Pipe creation failed");
+#endif
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+ pHandle->SetParameter = LOCAL_PROXY_H264E_SetParameter;
+ pHandle->GetParameter = LOCAL_PROXY_H264E_GetParameter;
+#endif
+ pComponentPrivate->IsLoadedState = OMX_TRUE;
+ pHandle->EmptyThisBuffer = LOCAL_PROXY_H264E_EmptyThisBuffer;
+ pHandle->GetExtensionIndex = LOCAL_PROXY_H264E_GetExtensionIndex;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pHandle->ComponentDeInit = LOCAL_PROXY_H264E_ComponentDeInit;
+ pHandle->FreeBuffer = LOCAL_PROXY_H264E_FreeBuffer;
+ pHandle->AllocateBuffer = LOCAL_PROXY_H264E_AllocateBuffer;
+#endif
+
+ if(mEnableVFR)
+ pHandle->EmptyThisBuffer = ComponentPrivateEmptyThisBuffer;
+
+ EXIT:
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_DEBUG("Error in Initializing Proxy");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if(pProxy->hBufPipe != NULL)
+ {
+ TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+ }
+
+ if(pComponentPrivate->pCompProxyPrv != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->pCompProxyPrv);
+ pComponentPrivate->pCompProxyPrv = NULL;
+ pProxy = NULL;
+ }
+#endif
+ if (pComponentPrivate->cCompName != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if (pComponentPrivate != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return eError;
+}
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_H264E_GetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264E_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParam = NULL;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_assert((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ eError = PROXY_GetParameter(hComponent,nParamIndex, pParamStruct);
+
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if(pProxy->bAndroidOpaqueFormat == OMX_TRUE)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ }
+ else
+#endif
+ {
+ pPortDef->format.video.eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+
+ if(pPortDef->nPortIndex == OMX_H264E_INPUT_PORT)
+ {
+ if(pCompPrv->proxyPortBuffers[OMX_H264E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers)
+ {
+ pPortDef->nBufferSize = sizeof(video_metadata_t);
+ }
+ }
+ }
+ else if (nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ pPortParam = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if((eError == OMX_ErrorNone) &&
+ (pPortParam->eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar))
+ {
+ pPortParam->eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if ((eError == OMX_ErrorNoMore) &&
+ (pPortParam->nIndex == 1))
+ {
+ /* HACK:Remote OMX-H264E supports only 1 color format (index 0). The
+ * OMX_COLOR_FormatAndroidOpaque is supported only at the proxy.
+ * Call GetParameter() to fill in defaults for parameters and
+ * override color format and index for the additional
+ * OMX_COLOR_FormatAndroidOpaque support*/
+ pPortParam->nIndex = 0;
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+ pPortParam->nIndex = 1;
+ pPortParam->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ eError = OMX_ErrorNone;
+ }
+#endif
+ }
+ else if (nParamIndex == OMX_TI_IndexComponentHandle)
+ {
+ OMX_TI_COMPONENT_HANDLE * pCompHandle = pParamStruct;
+ pCompHandle->pHandle = hComponent;
+ eError = OMX_ErrorNone;
+ }
+
+ PROXY_assert((eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore),
+ eError," Error in Proxy GetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_H264E_SetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParams = NULL;
+ OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS* pStoreMetaData = NULL;
+ OMX_TI_PARAM_BUFFERPREANNOUNCE tParamSetNPA;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if(pPortDef->format.video.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ {
+ if(COLORCONVERT_open(&pProxy->hCC,pCompPrv) != 0)
+ {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ }
+ else if(nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ pPortParams = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if(pPortParams->eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if(pPortParams->eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ {
+ if(COLORCONVERT_open(&pProxy->hCC,pCompPrv) != 0)
+ {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ }
+ else if(nParamIndex == (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers)
+ {
+ pStoreMetaData = (OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *) pParamStruct;
+
+ DOMX_DEBUG("Moving to Metadatamode");
+ if (pStoreMetaData->nPortIndex == OMX_H264E_INPUT_PORT && pStoreMetaData->bStoreMetaData == OMX_TRUE)
+ {
+ tParamSetNPA.nSize = sizeof(OMX_TI_PARAM_BUFFERPREANNOUNCE);
+ tParamSetNPA.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamSetNPA.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamSetNPA.nVersion.s.nRevision = 0x0;
+ tParamSetNPA.nVersion.s.nStep = 0x0;
+ tParamSetNPA.nPortIndex = OMX_H264E_INPUT_PORT;
+ tParamSetNPA.bEnabled = OMX_FALSE;
+ //Call NPA on OMX encoder on ducati.
+ PROXY_SetParameter(hComponent,OMX_TI_IndexParamBufferPreAnnouncement, &tParamSetNPA);
+ pCompPrv->proxyPortBuffers[pStoreMetaData->nPortIndex].proxyBufferType = EncoderMetadataPointers;
+ DOMX_DEBUG("Moving to Metadatamode done");
+
+ /*Initializing Structure */
+ sPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ sPortDef.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ sPortDef.nVersion.s.nRevision = 0x0;
+ sPortDef.nVersion.s.nStep = 0x0;
+ sPortDef.nPortIndex = OMX_H264E_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent,OMX_IndexParamPortDefinition, &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy GetParameter for Port Def");
+
+ sPortDef.format.video.nStride = LINUX_PAGE_SIZE;
+
+ eError = PROXY_SetParameter(hComponent,OMX_IndexParamPortDefinition, &sPortDef);
+
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy SetParameter for Port Def");
+ }
+ goto EXIT;
+ }
+
+ eError = PROXY_SetParameter(hComponent, nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy SetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+#endif
+
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_GetExtensionIndex()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264E_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+ PROXY_require(cParameterName != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(pIndexType != NULL, OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER("%s hComponent = %p, pCompPrv = %p, cParameterName = %s",
+ __FUNCTION__,hComponent, pCompPrv, cParameterName);
+
+ // Check for NULL Parameters
+ PROXY_require((cParameterName != NULL && pIndexType != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ // Ensure that String length is not greater than Max allowed length
+ PROXY_require(strlen(cParameterName) <= 127, OMX_ErrorBadParameter, NULL);
+
+ if(strcmp(cParameterName, "OMX.google.android.index.storeMetaDataInBuffers") == 0)
+ {
+ // If Index type is 2D Buffer Allocated Dimension
+ *pIndexType = (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers;
+ goto EXIT;
+ }
+
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+
+ EXIT:
+ DOMX_EXIT("%s eError: %d",__FUNCTION__, eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_H264E_EmptyThisBuffer()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PTR pBufferOrig = NULL;
+ OMX_U32 nStride = 0, nNumLines = 0;
+ OMX_PARAM_PORTDEFINITIONTYPE tParamStruct;
+ OMX_U32 nFilledLen, nAllocLen;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 nBufIndex = 0, nSize=0, nRet=0;
+#endif
+#ifdef ENABLE_GRALLOC_BUFFER
+ OMX_PTR pAuxBuf0 = NULL, pAuxBuf1 = NULL;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ OMX_ERRORTYPE eCompReturn = OMX_ErrorNone;
+ IMG_native_handle_t* pGrallocHandle=NULL;
+#endif
+
+ PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ PROXY_CHK_VERSION(pBufferHdr, OMX_BUFFERHEADERTYPE);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ tParamStruct.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamStruct.nVersion.s.nRevision = 0x0;
+ tParamStruct.nVersion.s.nStep = 0x0;
+ tParamStruct.nPortIndex = OMX_H264E_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &tParamStruct);
+ PROXY_require(eError == OMX_ErrorNone, OMX_ErrorBadParameter, "Error is Get Parameter for port def");
+ nFilledLen = pBufferHdr->nFilledLen;
+ nAllocLen = pBufferHdr->nAllocLen;
+ if(nFilledLen != 0)
+ {
+ pBufferHdr->nFilledLen = tParamStruct.nBufferSize;
+ }
+ pBufferHdr->nAllocLen = tParamStruct.nBufferSize;
+
+ DOMX_DEBUG
+ ("%s hComponent=%p, pCompPrv=%p, nFilledLen=%d, nOffset=%d, nFlags=%08x",
+ __FUNCTION__,hComponent, pCompPrv, pBufferHdr->nFilledLen,
+ pBufferHdr->nOffset, pBufferHdr->nFlags);
+
+ if( pCompPrv->proxyPortBuffers[OMX_H264E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers )
+ {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ DOMX_DEBUG("Passing meta data to encoder");
+
+ pBufferOrig = pBufferHdr->pBuffer;
+
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ nMetadataBufferType = *pTempBuffer;
+
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource)
+ {
+#ifdef ENABLE_GRALLOC_BUFFER
+ video_metadata_t* pVideoMetadataBuffer;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeCameraSource");
+
+ pVideoMetadataBuffer = (video_metadata_t*) ((OMX_U32 *)(pBufferHdr->pBuffer));
+ pGrallocHandle = (IMG_native_handle_t*) (pVideoMetadataBuffer->handle);
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x",pGrallocHandle );
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while( (unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+
+ pBufferHdr->nOffset = pVideoMetadataBuffer->offset;
+#endif
+ }
+ else if(nMetadataBufferType == kMetadataBufferTypeGrallocSource)
+ {
+#ifdef ENABLE_GRALLOC_BUFFER
+ buffer_handle_t tBufHandle;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeGrallocSource");
+
+ pTempBuffer++;
+ tBufHandle = *((buffer_handle_t *)pTempBuffer);
+ pGrallocHandle = (IMG_native_handle_t*) tBufHandle;
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x",pGrallocHandle );
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while( (unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if (pProxy->bAndroidOpaqueFormat && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12)
+ {
+ /* Dequeue NV12 buffer for encoder */
+ eOSALStatus = TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)(&nSize),
+ TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, NULL);
+
+ if(nFilledLen != 0)
+ {
+ /* Get NV12 data after colorconv*/
+ nRet = COLORCONVERT_PlatformOpaqueToNV12(pProxy->hCC, (void **) &pGrallocHandle, (void **) &pProxy->gralloc_handle[nBufIndex],
+ pGrallocHandle->iWidth,
+ pGrallocHandle->iHeight,
+ 4096, COLORCONVERT_BUFTYPE_GRALLOCOPAQUE,
+ COLORCONVERT_BUFTYPE_GRALLOCOPAQUE );
+
+ if(nRet != 0)
+ {
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(0, OMX_ErrorBadParameter, "Color conversion routine failed");
+ }
+ }
+
+ /* Update pBufferHdr with NV12 buffers for OMX component */
+ pBufferHdr->pBuffer= (OMX_U8 *)(pProxy->gralloc_handle[nBufIndex]->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = (OMX_PTR)(pProxy->gralloc_handle[nBufIndex]->fd[1]);
+ }
+#endif
+#endif
+ }
+ else
+ {
+ DOMX_ERROR("MetadataBufferType is unknow. Returning 'OMX_ErrorBadParameter'");
+ eError = OMX_ErrorBadParameter;
+ goto EXIT; //need to restore lenght fields in pBufferHdr
+ }
+#ifdef ENABLE_GRALLOC_BUFFER
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, pBufferHdr->pBuffer,-1,
+ &pAuxBuf0, &pAuxBuf1,
+ GrallocPointers);
+ PROXY_checkRpcError();
+ if (pAuxBuf0)
+ pBufferHdr->pBuffer = pAuxBuf0;
+ if (pAuxBuf1)
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = pAuxBuf1;
+#endif
+ }
+
+ eError = PROXY_EmptyThisBuffer(hComponent, pBufferHdr);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if (pProxy->bAndroidOpaqueFormat
+#ifdef ENABLE_GRALLOC_BUFFER
+&& pGrallocHandle != NULL && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12
+#endif
+)
+ {
+ /*Write buffer to end of pipe for re-circulation for future ETB()*/
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+ }
+#endif
+
+EXIT:
+ if( pBufferHdr!=NULL && pCompPrv!=NULL)
+ {
+ if(pCompPrv->proxyPortBuffers[pBufferHdr->nInputPortIndex].proxyBufferType == EncoderMetadataPointers)
+ {
+ pBufferHdr->pBuffer = pBufferOrig;
+ pBufferHdr->nFilledLen = nFilledLen;
+ pBufferHdr->nAllocLen = nAllocLen;
+#ifdef ENABLE_GRALLOC_BUFFER
+ RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pAuxBuf0, pAuxBuf1, GrallocPointers);
+#endif
+ }
+ }
+ return eError;
+}
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+static OMX_ERRORTYPE LOCAL_PROXY_H264E_AllocateBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE ** ppBufferHdr, OMX_U32 nPortIndex,
+ OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ int err, nStride;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+
+ eError = PROXY_AllocateBuffer(hComponent, ppBufferHdr, nPortIndex,
+ pAppPrivate, nSizeBytes);
+EXIT:
+ return eError;
+}
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264E_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_U32 nBufIndex, nSize, nCount=0;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if((nPortIndex == OMX_H264E_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat) && (pProxy->gralloc_handle[0] != NULL))
+ {
+ pProxy->nCurBufIndex--;
+ PROXY_require(pProxy->nCurBufIndex >=0,
+ OMX_ErrorBadParameter, "Buffer index underflow");
+
+ if(pProxy->gralloc_handle[pProxy->nCurBufIndex])
+ {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[pProxy->nCurBufIndex]));
+ pProxy->gralloc_handle[pProxy->nCurBufIndex] = NULL;
+ }
+
+ /*Clear the Bufindex pipe by dummy reads*/
+ TIMM_OSAL_GetPipeReadyMessageCount(pProxy->hBufPipe, (TIMM_OSAL_U32 *)&nCount);
+ if(nCount)
+ {
+ TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)&nSize, TIMM_OSAL_NO_SUSPEND);
+ }
+ }
+
+ eError = PROXY_FreeBuffer(hComponent, nPortIndex, pBufferHdr);
+
+EXIT:
+ return eError;
+}
+
+int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride)
+{
+ OMX_CONFIG_RECTTYPE tParam;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 err;
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ tParam.nSize = sizeof(OMX_CONFIG_RECTTYPE);
+ tParam.nVersion.s.nVersionMajor = 1;
+ tParam.nVersion.s.nVersionMinor = 1;
+ tParam.nVersion.s.nRevision = 0;
+ tParam.nVersion.s.nStep = 0;
+ tParam.nPortIndex = OMX_H264E_INPUT_PORT;
+ eError = PROXY_GetParameter(hComponent, (OMX_INDEXTYPE)OMX_TI_IndexParam2DBufferAllocDimension, &tParam);
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy GetParameter");
+ err = pProxy->mAllocDev->alloc(pProxy->mAllocDev, (int) tParam.nWidth, (int) tParam.nHeight, (int) HAL_PIXEL_FORMAT_TI_NV12, (int) GRALLOC_USAGE_HW_RENDER, (const struct native_handle_t * *)(&(pProxy->gralloc_handle[pProxy->nCurBufIndex])), (int *) &nStride);
+ PROXY_assert(!err, err, " Error in allocating Gralloc buffers");
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &pProxy->nCurBufIndex, sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+
+EXIT:
+ return eError;
+}
+OMX_ERRORTYPE LOCAL_PROXY_H264E_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 i;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if(pProxy->hBufPipe != NULL)
+ {
+ eOSALStatus = TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+
+ if(eOSALStatus != TIMM_OSAL_ERR_NONE)
+ {
+ DOMX_ERROR("Pipe deletion failed");
+ }
+ }
+
+ if(pProxy->bAndroidOpaqueFormat == OMX_TRUE)
+ {
+ /* Cleanup internal buffers in pipe if not freed on FreeBuffer */
+ for(i=0; i<OMX_H264VE_NUM_INTERNAL_BUF; i++)
+ {
+ if(pProxy->gralloc_handle[i])
+ {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[i]));
+ pProxy->gralloc_handle[i] = NULL;
+ }
+ }
+
+
+ COLORCONVERT_close(pProxy->hCC,pCompPrv);
+ pProxy->bAndroidOpaqueFormat = OMX_FALSE;
+
+ if(pCompPrv->pCompProxyPrv != NULL)
+ {
+ TIMM_OSAL_Free(pCompPrv->pCompProxyPrv);
+ pCompPrv->pCompProxyPrv = NULL;
+ }
+ }
+
+ eError = PROXY_ComponentDeInit(hComponent);
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+int COLORCONVERT_open(void **hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ int nErr = -1;
+ hw_module_t const* module = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ nErr = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+
+ if (nErr == 0)
+ {
+ *hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
+ }
+ else
+ {
+ DOMX_ERROR("FATAL: gralloc api hw_get_module() returned error: Can't find \
+ %s module err = %x", GRALLOC_HARDWARE_MODULE_ID, nErr);
+ }
+
+ gralloc_open(module, &(pProxy->mAllocDev));
+
+ return nErr;
+}
+
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC,
+ void *pSrc[COLORCONVERT_MAX_SUB_BUFFERS],
+ void *pDst[COLORCONVERT_MAX_SUB_BUFFERS],
+ int nWidth, int nHeight, int nStride,
+ int nSrcBufType,int nDstBufType)
+{
+ IMG_gralloc_module_public_t const* module = hCC;
+ int nErr = -1;
+
+ if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_VIRTUAL))
+ {
+ nErr = module->Blit(module, pSrc[0], pDst, HAL_PIXEL_FORMAT_TI_NV12);
+ }
+ else if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE ))
+ {
+ nErr = module->Blit2(module, pSrc[0], pDst[0], nWidth, nHeight, 0, 0);
+ }
+
+ return nErr;
+}
+
+int COLORCONVERT_close(void *hCC,PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ if(pProxy && pProxy->mAllocDev)
+ {
+ gralloc_close(pProxy->mAllocDev);
+ }
+ return 0;
+}
+#endif
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc_secure.c b/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc_secure.c
new file mode 100755
index 0000000..558e170
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_h264_enc/src/omx_proxy_h264enc_secure.c
@@ -0,0 +1,1115 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_h264enc_secure.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ This is secure encoder implementation to perform additional handling and internally maps to the
+ existing h264 encoder
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ * 16-Oct-2012 Prasanna Kumar M.R. : Support for secure h264 encoder
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+#include "omx_proxy_video_encoder.h"
+
+#include <MetadataBufferType.h>
+#ifdef ENABLE_GRALLOC_BUFFER
+#include "native_handle.h"
+#include <hal_public.h>
+#include <VideoMetadata.h>
+#endif
+
+#include <stdlib.h>
+#include <cutils/properties.h>
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.H264E.secure"
+/* needs to be specific for every configuration wrapper */
+
+#define OMX_H264ESECURE_INPUT_PORT 0
+#define LINUX_PAGE_SIZE 4096
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+#endif
+
+
+#define OMX_INIT_STRUCT(_s_, _name_) \
+ memset(&(_s_), 0x0, sizeof(_name_)); \
+ (_s_).nSize = sizeof(_name_); \
+ (_s_).nVersion.s.nVersionMajor = 0x1; \
+ (_s_).nVersion.s.nVersionMinor = 0x1; \
+ (_s_).nVersion.s.nRevision = 0x0; \
+ (_s_).nVersion.s.nStep = 0x0
+
+
+/* Params needed for Dynamic Frame Rate Control*/
+#define FRAME_RATE_THRESHOLD 1 /* Change in Frame rate to configure the encoder */
+OMX_U32 nFrameRateThreshold = 0;/* Frame Rate threshold for every frame rate update */
+OMX_U32 nPortFrameRate = 0; /* Port FPS initially set to the Encoder */
+OMX_U32 nFrameCounter = 0; /* Number of input frames recieved since last framerate calculation */
+OMX_TICKS nVideoTime = 0; /* Video duration since last framerate calculation */
+OMX_TICKS nLastFrameRateUpdateTime = 0; /*Time stamp at last frame rate update */
+OMX_U16 nBFrames = 0; /* Number of B Frames in H264 Encoder */
+
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+/* Opaque color format requires below quirks to be enabled
+ * ENABLE_GRALLOC_BUFFER
+ * ANDROID_QUIRCK_CHANGE_PORT_VALUES
+ */
+#define OMX_H264VE_NUM_INTERNAL_BUF (8)
+#define HAL_PIXEL_FORMAT_TI_NV12 (0x100)
+
+#define COLORCONVERT_MAX_SUB_BUFFERS (3)
+
+#define COLORCONVERT_BUFTYPE_VIRTUAL (0x0)
+#define COLORCONVERT_BUFTYPE_ION (0x1)
+#define COLORCONVERT_BUFTYPE_GRALLOCOPAQUE (0x2)
+
+int COLORCONVERT_open(void **hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC, void *pSrc[],
+ void *pDst[], int nWidth,
+ int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType);
+int COLORCONVERT_close(void *hCC,PROXY_COMPONENT_PRIVATE *pCompPrv);
+static int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride);
+static OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE ** ppBufferHdr, OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes);
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+extern RPC_OMX_ERRORTYPE RPC_RegisterBuffer(OMX_HANDLETYPE hRPCCtx, int fd1, int fd2,
+ OMX_PTR *handle1, OMX_PTR *handle2,
+ PROXY_BUFFER_TYPE proxyBufferType);
+extern RPC_OMX_ERRORTYPE RPC_UnRegisterBuffer(OMX_HANDLETYPE hRPCCtx, OMX_PTR handle1,
+ OMX_PTR handle2, PROXY_BUFFER_TYPE proxyBufferType);
+#endif
+
+
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType);
+
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+static OMX_ERRORTYPE OMX_ConfigureDynamicFrameRate( OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 nTargetFrameRate = 0; /* Target Frame Rate to be provided to Encoder */
+ OMX_U32 nCurrentFrameRate = 0; /* Current Frame Rate currently set in Encoder */
+ OMX_CONFIG_FRAMERATETYPE tFrameRate;
+ OMX_COMPONENTTYPE *pHandle;
+ if (hComponent == NULL){
+ DOMX_ERROR("Component is invalid/ not present ");
+ return OMX_ErrorBadParameter;
+ }
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ /* Initialise the OMX structures */
+ OMX_INIT_STRUCT(tFrameRate,OMX_CONFIG_FRAMERATETYPE);
+
+ /* Intialise nLastFrameRateUpdateTime for the 1st frame */
+ if((!nFrameCounter) && (!nLastFrameRateUpdateTime)){
+ nLastFrameRateUpdateTime = pBufferHdr-> nTimeStamp;
+ }
+
+ /* Increment the Frame Counter and Calculate Frame Rate*/
+ nFrameCounter++;
+ nVideoTime = pBufferHdr->nTimeStamp - nLastFrameRateUpdateTime;
+
+ if(nVideoTime < 0) {
+ return OMX_ErrorBadParameter;
+ }
+
+ /*Get Port Frame Rate if not read yet*/
+ if(!nFrameRateThreshold) {
+ tFrameRate.nPortIndex = OMX_H264ESECURE_INPUT_PORT; /* As per ducati support-set for input port */
+
+ /* Read Current FrameRate */
+ eError = pHandle->GetConfig(hComponent,OMX_IndexConfigVideoFramerate,&tFrameRate);
+ if (eError != OMX_ErrorNone)
+ DOMX_ERROR ("pHandle->GetConfig OMX_IndexConfigVideoFramerate eError :0x%x \n",eError);
+ nFrameRateThreshold = tFrameRate.xEncodeFramerate >>16;
+ nPortFrameRate = nFrameRateThreshold;
+ DOMX_DEBUG(" Port Frame Rate is %d ", nPortFrameRate);
+ }
+ nCurrentFrameRate = nFrameRateThreshold;
+
+ /* If Number of frames is less than the Threshold
+ * Frame Rate udpate is not necessary
+ */
+ if(nFrameCounter < nFrameRateThreshold){
+ DOMX_EXIT(" Threshold not reached, no update necessary");
+ return OMX_ErrorNone;
+ }
+
+ /*Calculate the new target Frame Rate*/
+ if (nVideoTime != 0)
+ nTargetFrameRate = nFrameCounter * 1000000 / nVideoTime;
+
+ /* For 1080p record, max FPS supported by Codec for profile 4.1 is 30.
+ * When Dynamic Frame Rate is enabled, there might be scenario when FPS
+ * calculated is more than 30. Hence adding the check so that Dynamic Frame
+ * Rate set is never greater than the port FPS initially set.
+ */
+ if(nTargetFrameRate > nPortFrameRate){
+ DOMX_DEBUG("Frame Rate Calculated is more than initial port set Frame Rate");
+ nTargetFrameRate = nPortFrameRate;
+ }
+
+ /* Difference in Frame Rate is more than Threshold - Only then update Frame Rate*/
+ if((( (OMX_S32)nTargetFrameRate) -((OMX_S32) nCurrentFrameRate) >= FRAME_RATE_THRESHOLD) ||
+ (((OMX_S32) nCurrentFrameRate) - ( (OMX_S32)nTargetFrameRate) >= FRAME_RATE_THRESHOLD)) {
+
+ /* Now Send the new Frame Rate */
+ tFrameRate.nPortIndex = OMX_H264ESECURE_INPUT_PORT; /* As per ducati support-set for input port */
+ tFrameRate.xEncodeFramerate = (OMX_U32)(nTargetFrameRate * (1 << 16));
+ eError = pHandle->SetConfig(hComponent,OMX_IndexConfigVideoFramerate,&tFrameRate);
+ if(eError != OMX_ErrorNone){
+ DOMX_ERROR(" Error while configuring Dynamic Frame Rate,Error info = %d",eError);
+ return eError;
+ } else {
+ DOMX_DEBUG("Dynamic Frame Rate configuration successful \n");
+ }
+ nFrameRateThreshold = nTargetFrameRate; /*Update the threshold */
+ }
+
+ /* reset all params */
+ nFrameCounter = 0 ;
+ nVideoTime = 0;
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE ComponentPrivateEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ PROXY_assert(hComponent != NULL, OMX_ErrorInsufficientResources,"Null component handle received in EmptyThisBuffer");
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ PROXY_assert(pCompPrv != NULL, OMX_ErrorInsufficientResources,"Pointer to Null component private structure received in EmptyThisBuffer");
+ if(pCompPrv->proxyPortBuffers[0].proxyBufferType == EncoderMetadataPointers) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ if(pTempBuffer == NULL) {
+ eError = OMX_ErrorBadParameter;
+ DOMX_ERROR("Null meta data buffer supplied - Cannot find metadata type");
+ goto EXIT;
+ }
+ nMetadataBufferType = *pTempBuffer;
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource) {
+ eError = OMX_ConfigureDynamicFrameRate(hComponent, pBufferHdr);
+ if( eError != OMX_ErrorNone)
+ DOMX_ERROR(" Error while configuring FrameRate Dynamically.Error info = %d - Non Fatal Error",eError);
+ }
+ }
+
+ DOMX_DEBUG("Redirection from ComponentPricateEmptyThisBuffer to PROXY_EmptyThisBuffer");
+EXIT:
+ if( eError != OMX_ErrorNone) {
+ DOMX_EXIT("%s: exiting with error 0x%x - Non Fatal",__FUNCTION__,eError);
+ } else {
+ DOMX_EXIT("%s: dynamic frame rate config successful",__FUNCTION__);
+ }
+ return LOCAL_PROXY_H264ESECURE_EmptyThisBuffer (hComponent,pBufferHdr);
+}
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_ENHANCEDPORTRECONFIG tParamStruct;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+ char value[OMX_MAX_STRINGNAME_SIZE];
+ OMX_U32 mEnableVFR = 1; /* Flag used to enable/disable VFR for Encoder */
+ property_get("debug.vfr.enable", value, "1");
+ mEnableVFR = atoi(value);
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pComponentPrivate->pCompProxyPrv =
+ (OMX_PROXY_ENCODER_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(OMX_PROXY_ENCODER_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->pCompProxyPrv != NULL,
+ OMX_ErrorInsufficientResources,
+ " Could not allocate proxy component private");
+
+ TIMM_OSAL_Memset(pComponentPrivate->pCompProxyPrv, 0,
+ sizeof(OMX_PROXY_ENCODER_PRIVATE));
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pComponentPrivate->pCompProxyPrv;
+
+ /* Create Pipe of for encoder input buffers */
+ eOSALStatus = TIMM_OSAL_CreatePipe(&pProxy->hBufPipe, sizeof(OMX_U32),
+ OMX_H264VE_NUM_INTERNAL_BUF, 1);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources,
+ "Pipe creation failed");
+#endif
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+ pHandle->SetParameter = LOCAL_PROXY_H264ESECURE_SetParameter;
+ pHandle->GetParameter = LOCAL_PROXY_H264ESECURE_GetParameter;
+#endif
+ pComponentPrivate->IsLoadedState = OMX_TRUE;
+ pHandle->EmptyThisBuffer = LOCAL_PROXY_H264ESECURE_EmptyThisBuffer;
+ pHandle->GetExtensionIndex = LOCAL_PROXY_H264ESECURE_GetExtensionIndex;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pHandle->ComponentDeInit = LOCAL_PROXY_H264ESECURE_ComponentDeInit;
+ pHandle->FreeBuffer = LOCAL_PROXY_H264ESECURE_FreeBuffer;
+ pHandle->AllocateBuffer = LOCAL_PROXY_H264ESECURE_AllocateBuffer;
+#endif
+
+ if(mEnableVFR)
+ pHandle->EmptyThisBuffer = ComponentPrivateEmptyThisBuffer;
+
+ /* In Secure component pass only the Handle for protected buffer */
+ pComponentPrivate->bMapBuffers = OMX_FALSE;
+
+ EXIT:
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_DEBUG("Error in Initializing Proxy");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if(pProxy->hBufPipe != NULL)
+ {
+ TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+ }
+
+ if(pComponentPrivate->pCompProxyPrv != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->pCompProxyPrv);
+ pComponentPrivate->pCompProxyPrv = NULL;
+ pProxy = NULL;
+ }
+#endif
+ if (pComponentPrivate->cCompName != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if (pComponentPrivate != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return eError;
+}
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+/* ===========================================================================*/
+/**
+ * @name LOCAL_PROXY_H264ESECURE_GetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParam = NULL;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_assert((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ eError = PROXY_GetParameter(hComponent,nParamIndex, pParamStruct);
+
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if(pProxy->bAndroidOpaqueFormat == OMX_TRUE)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ }
+ else
+#endif
+ {
+ pPortDef->format.video.eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+
+ if(pPortDef->nPortIndex == OMX_H264ESECURE_INPUT_PORT)
+ {
+ if(pCompPrv->proxyPortBuffers[OMX_H264ESECURE_INPUT_PORT].proxyBufferType == EncoderMetadataPointers)
+ {
+ pPortDef->nBufferSize = sizeof(video_metadata_t);
+ }
+ }
+ }
+ else if (nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ pPortParam = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if((eError == OMX_ErrorNone) &&
+ (pPortParam->eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar))
+ {
+ pPortParam->eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if ((eError == OMX_ErrorNoMore) &&
+ (pPortParam->nIndex == 1))
+ {
+ /* HACK:Remote OMX-H264ESECURE supports only 1 color format (index 0). The
+ * OMX_COLOR_FormatAndroidOpaque is supported only at the proxy.
+ * Call GetParameter() to fill in defaults for parameters and
+ * override color format and index for the additional
+ * OMX_COLOR_FormatAndroidOpaque support*/
+ pPortParam->nIndex = 0;
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+ pPortParam->nIndex = 1;
+ pPortParam->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ eError = OMX_ErrorNone;
+ }
+#endif
+ }
+ else if (nParamIndex == OMX_TI_IndexComponentHandle)
+ {
+ OMX_TI_COMPONENT_HANDLE * pCompHandle = pParamStruct;
+ pCompHandle->pHandle = hComponent;
+ eError = OMX_ErrorNone;
+ }
+
+ PROXY_assert((eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore),
+ eError," Error in Proxy GetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name LOCAL_PROXY_H264ESECURE_SetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParams = NULL;
+ OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS* pStoreMetaData = NULL;
+ OMX_TI_PARAM_BUFFERPREANNOUNCE tParamSetNPA;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if(pPortDef->format.video.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ {
+ if(COLORCONVERT_open(&pProxy->hCC,pCompPrv) != 0)
+ {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ }
+ else if(nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ pPortParams = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if(pPortParams->eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if(pPortParams->eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ {
+ if(COLORCONVERT_open(&pProxy->hCC,pCompPrv) != 0)
+ {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ }
+ else if(nParamIndex == (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers)
+ {
+ pStoreMetaData = (OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *) pParamStruct;
+
+ DOMX_DEBUG("Moving to Metadatamode");
+ if (pStoreMetaData->nPortIndex == OMX_H264ESECURE_INPUT_PORT && pStoreMetaData->bStoreMetaData == OMX_TRUE)
+ {
+ tParamSetNPA.nSize = sizeof(OMX_TI_PARAM_BUFFERPREANNOUNCE);
+ tParamSetNPA.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamSetNPA.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamSetNPA.nVersion.s.nRevision = 0x0;
+ tParamSetNPA.nVersion.s.nStep = 0x0;
+ tParamSetNPA.nPortIndex = OMX_H264ESECURE_INPUT_PORT;
+ tParamSetNPA.bEnabled = OMX_FALSE;
+ //Call NPA on OMX encoder on ducati.
+ PROXY_SetParameter(hComponent,OMX_TI_IndexParamBufferPreAnnouncement, &tParamSetNPA);
+ pCompPrv->proxyPortBuffers[pStoreMetaData->nPortIndex].proxyBufferType = EncoderMetadataPointers;
+ DOMX_DEBUG("Moving to Metadatamode done");
+
+ /*Initializing Structure */
+ sPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ sPortDef.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ sPortDef.nVersion.s.nRevision = 0x0;
+ sPortDef.nVersion.s.nStep = 0x0;
+ sPortDef.nPortIndex = OMX_H264ESECURE_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent,OMX_IndexParamPortDefinition, &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy GetParameter for Port Def");
+
+ sPortDef.format.video.nStride = LINUX_PAGE_SIZE;
+
+ eError = PROXY_SetParameter(hComponent,OMX_IndexParamPortDefinition, &sPortDef);
+
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy SetParameter for Port Def");
+ }
+ goto EXIT;
+ }
+
+ eError = PROXY_SetParameter(hComponent, nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy SetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+#endif
+
+
+/* ===========================================================================*/
+/**
+ * @name LOCAL_PROXY_GetExtensionIndex()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+ PROXY_require(cParameterName != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(pIndexType != NULL, OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER("%s hComponent = %p, pCompPrv = %p, cParameterName = %s",
+ __FUNCTION__,hComponent, pCompPrv, cParameterName);
+
+ // Check for NULL Parameters
+ PROXY_require((cParameterName != NULL && pIndexType != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ // Ensure that String length is not greater than Max allowed length
+ PROXY_require(strlen(cParameterName) <= 127, OMX_ErrorBadParameter, NULL);
+
+ if(strcmp(cParameterName, "OMX.google.android.index.storeMetaDataInBuffers") == 0)
+ {
+ // If Index type is 2D Buffer Allocated Dimension
+ *pIndexType = (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers;
+ goto EXIT;
+ }
+
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+
+ EXIT:
+ DOMX_EXIT("%s eError: %d",__FUNCTION__, eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name LOCAL_PROXY_H264ESECURE_EmptyThisBuffer()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PTR pBufferOrig = NULL;
+ OMX_U32 nStride = 0, nNumLines = 0;
+ OMX_PARAM_PORTDEFINITIONTYPE tParamStruct;
+ OMX_U32 nFilledLen, nAllocLen;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 nBufIndex = 0, nSize=0, nRet=0;
+#endif
+#ifdef ENABLE_GRALLOC_BUFFER
+ OMX_PTR pAuxBuf0 = NULL, pAuxBuf1 = NULL;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ OMX_ERRORTYPE eCompReturn = OMX_ErrorNone;
+ IMG_native_handle_t* pGrallocHandle=NULL;
+#endif
+
+ PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ PROXY_CHK_VERSION(pBufferHdr, OMX_BUFFERHEADERTYPE);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ tParamStruct.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamStruct.nVersion.s.nRevision = 0x0;
+ tParamStruct.nVersion.s.nStep = 0x0;
+ tParamStruct.nPortIndex = OMX_H264ESECURE_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &tParamStruct);
+ PROXY_require(eError == OMX_ErrorNone, OMX_ErrorBadParameter, "Error is Get Parameter for port def");
+ nFilledLen = pBufferHdr->nFilledLen;
+ nAllocLen = pBufferHdr->nAllocLen;
+ if(nFilledLen != 0)
+ {
+ pBufferHdr->nFilledLen = tParamStruct.nBufferSize;
+ }
+ pBufferHdr->nAllocLen = tParamStruct.nBufferSize;
+
+ DOMX_DEBUG
+ ("%s hComponent=%p, pCompPrv=%p, nFilledLen=%d, nOffset=%d, nFlags=%08x",
+ __FUNCTION__,hComponent, pCompPrv, pBufferHdr->nFilledLen,
+ pBufferHdr->nOffset, pBufferHdr->nFlags);
+
+ if( pCompPrv->proxyPortBuffers[OMX_H264ESECURE_INPUT_PORT].proxyBufferType == EncoderMetadataPointers )
+ {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ DOMX_DEBUG("Passing meta data to encoder");
+
+ pBufferOrig = pBufferHdr->pBuffer;
+
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ nMetadataBufferType = *pTempBuffer;
+
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource)
+ {
+#ifdef ENABLE_GRALLOC_BUFFER
+ video_metadata_t* pVideoMetadataBuffer;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeCameraSource");
+
+ pVideoMetadataBuffer = (video_metadata_t*) ((OMX_U32 *)(pBufferHdr->pBuffer));
+ pGrallocHandle = (IMG_native_handle_t*) (pVideoMetadataBuffer->handle);
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x",pGrallocHandle );
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while( (unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+
+ pBufferHdr->nOffset = pVideoMetadataBuffer->offset;
+#endif
+ }
+ else if(nMetadataBufferType == kMetadataBufferTypeGrallocSource)
+ {
+#ifdef ENABLE_GRALLOC_BUFFER
+ buffer_handle_t tBufHandle;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeGrallocSource");
+
+ pTempBuffer++;
+ tBufHandle = *((buffer_handle_t *)pTempBuffer);
+ pGrallocHandle = (IMG_native_handle_t*) tBufHandle;
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x",pGrallocHandle );
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while( (unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if (pProxy->bAndroidOpaqueFormat && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12)
+ {
+ /* Dequeue NV12 buffer for encoder */
+ eOSALStatus = TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)(&nSize),
+ TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, NULL);
+
+ if(nFilledLen != 0)
+ {
+ /* Get NV12 data after colorconv*/
+ nRet = COLORCONVERT_PlatformOpaqueToNV12(pProxy->hCC, (void **) &pGrallocHandle, (void **) &pProxy->gralloc_handle[nBufIndex],
+ pGrallocHandle->iWidth,
+ pGrallocHandle->iHeight,
+ 4096, COLORCONVERT_BUFTYPE_GRALLOCOPAQUE,
+ COLORCONVERT_BUFTYPE_GRALLOCOPAQUE );
+
+ if(nRet != 0)
+ {
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(0, OMX_ErrorBadParameter, "Color conversion routine failed");
+ }
+ }
+
+ /* Update pBufferHdr with NV12 buffers for OMX component */
+ pBufferHdr->pBuffer= (OMX_U8 *)(pProxy->gralloc_handle[nBufIndex]->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = (OMX_PTR)(pProxy->gralloc_handle[nBufIndex]->fd[1]);
+ }
+#endif
+#endif
+ }
+ else
+ {
+ DOMX_ERROR("MetadataBufferType is unknow. Returning 'OMX_ErrorBadParameter'");
+ eError = OMX_ErrorBadParameter;
+ goto EXIT; //need to restore lenght fields in pBufferHdr
+ }
+#ifdef ENABLE_GRALLOC_BUFFER
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, pBufferHdr->pBuffer,-1,
+ &pAuxBuf0, &pAuxBuf1,
+ GrallocPointers);
+ PROXY_checkRpcError();
+ if (pAuxBuf0)
+ pBufferHdr->pBuffer = pAuxBuf0;
+ if (pAuxBuf1)
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = pAuxBuf1;
+#endif
+ }
+
+ eError = PROXY_EmptyThisBuffer(hComponent, pBufferHdr);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if (pProxy->bAndroidOpaqueFormat
+#ifdef ENABLE_GRALLOC_BUFFER
+&& pGrallocHandle != NULL && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12
+#endif
+)
+ {
+ /*Write buffer to end of pipe for re-circulation for future ETB()*/
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+ }
+#endif
+
+EXIT:
+ if( pBufferHdr!=NULL && pCompPrv!=NULL)
+ {
+ if(pCompPrv->proxyPortBuffers[pBufferHdr->nInputPortIndex].proxyBufferType == EncoderMetadataPointers)
+ {
+ pBufferHdr->pBuffer = pBufferOrig;
+ pBufferHdr->nFilledLen = nFilledLen;
+ pBufferHdr->nAllocLen = nAllocLen;
+#ifdef ENABLE_GRALLOC_BUFFER
+ RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pAuxBuf0, pAuxBuf1, GrallocPointers);
+#endif
+ }
+ }
+ return eError;
+}
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+static OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_AllocateBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE ** ppBufferHdr, OMX_U32 nPortIndex,
+ OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ int err, nStride;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+
+ eError = PROXY_AllocateBuffer(hComponent, ppBufferHdr, nPortIndex,
+ pAppPrivate, nSizeBytes);
+EXIT:
+ return eError;
+}
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_U32 nBufIndex, nSize, nCount=0;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if((nPortIndex == OMX_H264ESECURE_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat) && (pProxy->gralloc_handle[0] != NULL))
+ {
+ pProxy->nCurBufIndex--;
+ PROXY_require(pProxy->nCurBufIndex >=0,
+ OMX_ErrorBadParameter, "Buffer index underflow");
+
+ if(pProxy->gralloc_handle[pProxy->nCurBufIndex])
+ {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[pProxy->nCurBufIndex]));
+ pProxy->gralloc_handle[pProxy->nCurBufIndex] = NULL;
+ }
+
+ /*Clear the Bufindex pipe by dummy reads*/
+ TIMM_OSAL_GetPipeReadyMessageCount(pProxy->hBufPipe, (TIMM_OSAL_U32 *)&nCount);
+ if(nCount)
+ {
+ TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)&nSize, TIMM_OSAL_NO_SUSPEND);
+ }
+ }
+
+ eError = PROXY_FreeBuffer(hComponent, nPortIndex, pBufferHdr);
+
+EXIT:
+ return eError;
+}
+
+int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride)
+{
+ OMX_CONFIG_RECTTYPE tParam;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 err;
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ tParam.nSize = sizeof(OMX_CONFIG_RECTTYPE);
+ tParam.nVersion.s.nVersionMajor = 1;
+ tParam.nVersion.s.nVersionMinor = 1;
+ tParam.nVersion.s.nRevision = 0;
+ tParam.nVersion.s.nStep = 0;
+ tParam.nPortIndex = OMX_H264ESECURE_INPUT_PORT;
+ eError = PROXY_GetParameter(hComponent, (OMX_INDEXTYPE)OMX_TI_IndexParam2DBufferAllocDimension, &tParam);
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy GetParameter");
+ err = pProxy->mAllocDev->alloc(pProxy->mAllocDev, (int) tParam.nWidth, (int) tParam.nHeight, (int) HAL_PIXEL_FORMAT_TI_NV12, (int) GRALLOC_USAGE_HW_RENDER, (const struct native_handle_t * *)(&(pProxy->gralloc_handle[pProxy->nCurBufIndex])), (int *) &nStride);
+ PROXY_assert(!err, err, " Error in allocating Gralloc buffers");
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &pProxy->nCurBufIndex, sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+
+EXIT:
+ return eError;
+}
+OMX_ERRORTYPE LOCAL_PROXY_H264ESECURE_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 i;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if(pProxy->hBufPipe != NULL)
+ {
+ eOSALStatus = TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+
+ if(eOSALStatus != TIMM_OSAL_ERR_NONE)
+ {
+ DOMX_ERROR("Pipe deletion failed");
+ }
+ }
+
+ if(pProxy->bAndroidOpaqueFormat == OMX_TRUE)
+ {
+ /* Cleanup internal buffers in pipe if not freed on FreeBuffer */
+ for(i=0; i<OMX_H264VE_NUM_INTERNAL_BUF; i++)
+ {
+ if(pProxy->gralloc_handle[i])
+ {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[i]));
+ pProxy->gralloc_handle[i] = NULL;
+ }
+ }
+
+
+ COLORCONVERT_close(pProxy->hCC,pCompPrv);
+ pProxy->bAndroidOpaqueFormat = OMX_FALSE;
+
+ if(pCompPrv->pCompProxyPrv != NULL)
+ {
+ TIMM_OSAL_Free(pCompPrv->pCompProxyPrv);
+ pCompPrv->pCompProxyPrv = NULL;
+ }
+ }
+
+ eError = PROXY_ComponentDeInit(hComponent);
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+int COLORCONVERT_open(void **hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ int nErr = -1;
+ hw_module_t const* module = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ nErr = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+
+ if (nErr == 0)
+ {
+ *hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
+ }
+ else
+ {
+ DOMX_ERROR("FATAL: gralloc api hw_get_module() returned error: Can't find \
+ %s module err = %x", GRALLOC_HARDWARE_MODULE_ID, nErr);
+ }
+
+ gralloc_open(module, &(pProxy->mAllocDev));
+
+ return nErr;
+}
+
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC,
+ void *pSrc[COLORCONVERT_MAX_SUB_BUFFERS],
+ void *pDst[COLORCONVERT_MAX_SUB_BUFFERS],
+ int nWidth, int nHeight, int nStride,
+ int nSrcBufType,int nDstBufType)
+{
+ IMG_gralloc_module_public_t const* module = hCC;
+ int nErr = -1;
+
+ if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_VIRTUAL))
+ {
+ nErr = module->Blit(module, pSrc[0], pDst, HAL_PIXEL_FORMAT_TI_NV12);
+ }
+ else if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE ))
+ {
+ nErr = module->Blit2(module, pSrc[0], pDst[0], nWidth, nHeight, 0, 0);
+ }
+
+ return nErr;
+}
+
+int COLORCONVERT_close(void *hCC,PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ if(pProxy && pProxy->mAllocDev)
+ {
+ gralloc_close(pProxy->mAllocDev);
+ }
+ return 0;
+}
+#endif
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/Makefile b/domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/Makefile
new file mode 100755
index 0000000..8b6dca5
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/Makefile
@@ -0,0 +1,101 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libOMX.TI.DUCATI1.VIDEO.H264SVCE.so
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+src/omx_proxy_h264svcenc.c \
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc/inc \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal domx
+SH_LIBS = domx omx_core mm_osal
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/src/omx_proxy_h264svcenc.c b/domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/src/omx_proxy_h264svcenc.c
new file mode 100644
index 0000000..05a05f4
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_h264svc_enc/src/omx_proxy_h264svcenc.c
@@ -0,0 +1,1067 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_h264svcenc.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ * ! Revision History
+ * ! ============================
+ * 02-September-2012 Saurabh Chandra : Initial Version
+ *
+ * ================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+#include "omx_proxy_video_encoder.h"
+
+#include <MetadataBufferType.h>
+#ifdef ENABLE_GRALLOC_BUFFER
+#include "native_handle.h"
+#include <hal_public.h>
+#include <VideoMetadata.h>
+#endif
+
+#include <stdlib.h>
+#include <cutils/properties.h>
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.H264SVCE"
+/* needs to be specific for every configuration wrapper */
+
+#define OMX_H264SVCE_INPUT_PORT 0
+#define LINUX_PAGE_SIZE 4096
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+#endif
+
+
+#define OMX_INIT_STRUCT(_s_, _name_) \
+ memset(&(_s_), 0x0, sizeof(_name_)); \
+ (_s_).nSize = sizeof(_name_); \
+ (_s_).nVersion.s.nVersionMajor = 0x1; \
+ (_s_).nVersion.s.nVersionMinor = 0x1; \
+ (_s_).nVersion.s.nRevision = 0x0; \
+ (_s_).nVersion.s.nStep = 0x0
+
+
+/* Params needed for Dynamic Frame Rate Control*/
+#define FRAME_RATE_THRESHOLD 1 /* Change in Frame rate to configure the encoder */
+OMX_U32 nFrameRateThreshold = 0; /* Frame Rate threshold for every frame rate update */
+OMX_U32 nPortFrameRate = 0; /* Port FPS initially set to the Encoder */
+OMX_U32 nFrameCounter = 0; /* Number of input frames recieved since last framerate calculation */
+OMX_TICKS nVideoTime = 0; /* Video duration since last framerate calculation */
+OMX_TICKS nLastFrameRateUpdateTime = 0; /*Time stamp at last frame rate update */
+OMX_U16 nBFrames = 0; /* Number of B Frames in H264SVC Encoder */
+
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+/* Opaque color format requires below quirks to be enabled
+ * ENABLE_GRALLOC_BUFFER
+ * ANDROID_QUIRCK_CHANGE_PORT_VALUES
+ */
+#define OMX_H264SVCVE_NUM_INTERNAL_BUF (8)
+#define HAL_PIXEL_FORMAT_TI_NV12 (0x100)
+
+#define COLORCONVERT_MAX_SUB_BUFFERS (3)
+
+#define COLORCONVERT_BUFTYPE_VIRTUAL (0x0)
+#define COLORCONVERT_BUFTYPE_ION (0x1)
+#define COLORCONVERT_BUFTYPE_GRALLOCOPAQUE (0x2)
+
+int COLORCONVERT_open(void * *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC, void *pSrc[],
+ void *pDst[], int nWidth,
+ int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType);
+int COLORCONVERT_close(void *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+static int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride);
+static OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE * *ppBufferHdr, OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes);
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr);
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+extern RPC_OMX_ERRORTYPE RPC_RegisterBuffer(OMX_HANDLETYPE hRPCCtx, int fd1, int fd2,
+ OMX_PTR *handle1, OMX_PTR *handle2,
+ PROXY_BUFFER_TYPE proxyBufferType);
+extern RPC_OMX_ERRORTYPE RPC_UnRegisterBuffer(OMX_HANDLETYPE hRPCCtx, OMX_PTR handle1,
+ OMX_PTR handle2, PROXY_BUFFER_TYPE proxyBufferType);
+#endif
+
+
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType);
+
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr);
+
+static OMX_ERRORTYPE OMX_ConfigureDynamicFrameRate(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 nTargetFrameRate = 0; /* Target Frame Rate to be provided to Encoder */
+ OMX_U32 nCurrentFrameRate = 0; /* Current Frame Rate currently set in Encoder */
+ OMX_CONFIG_FRAMERATETYPE tFrameRate;
+ OMX_COMPONENTTYPE *pHandle;
+
+ if( hComponent == NULL ) {
+ DOMX_ERROR("Component is invalid/ not present ");
+ return (OMX_ErrorBadParameter);
+ }
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ /* Initialise the OMX structures */
+ OMX_INIT_STRUCT(tFrameRate, OMX_CONFIG_FRAMERATETYPE);
+
+ /* Intialise nLastFrameRateUpdateTime for the 1st frame */
+ if((!nFrameCounter) && (!nLastFrameRateUpdateTime)) {
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ }
+
+ /* Increment the Frame Counter and Calculate Frame Rate*/
+ nFrameCounter++;
+ nVideoTime = pBufferHdr->nTimeStamp - nLastFrameRateUpdateTime;
+
+ if( nVideoTime < 0 ) {
+ return (OMX_ErrorBadParameter);
+ }
+
+ /*Get Port Frame Rate if not read yet*/
+ if( !nFrameRateThreshold ) {
+ tFrameRate.nPortIndex = OMX_H264SVCE_INPUT_PORT; /* As per ducati support-set for input port */
+
+ /* Read Current FrameRate */
+ eError = pHandle->GetConfig(hComponent, OMX_IndexConfigVideoFramerate, &tFrameRate);
+ if( eError != OMX_ErrorNone ) {
+ DOMX_ERROR("pHandle->GetConfig OMX_IndexConfigVideoFramerate eError :0x%x \n", eError);
+ }
+ nFrameRateThreshold = tFrameRate.xEncodeFramerate >> 16;
+ nPortFrameRate = nFrameRateThreshold;
+ DOMX_DEBUG(" Port Frame Rate is %d ", nPortFrameRate);
+ }
+ nCurrentFrameRate = nFrameRateThreshold;
+
+ /* If Number of frames is less than the Threshold
+ * Frame Rate udpate is not necessary
+ */
+ if( nFrameCounter < nFrameRateThreshold ) {
+ DOMX_EXIT(" Threshold not reached, no update necessary");
+ return (OMX_ErrorNone);
+ }
+
+ /*Calculate the new target Frame Rate*/
+ if( nVideoTime != 0 ) {
+ nTargetFrameRate = nFrameCounter * 1000000 / nVideoTime;
+ }
+
+ /* For 1080p record, max FPS supported by Codec for profile 4.1 is 30.
+ * When Dynamic Frame Rate is enabled, there might be scenario when FPS
+ * calculated is more than 30. Hence adding the check so that Dynamic Frame
+ * Rate set is never greater than the port FPS initially set.
+ */
+ if( nTargetFrameRate > nPortFrameRate ) {
+ DOMX_DEBUG("Frame Rate Calculated is more than initial port set Frame Rate");
+ nTargetFrameRate = nPortFrameRate;
+ }
+
+ /* Difference in Frame Rate is more than Threshold - Only then update Frame Rate*/
+ if((((OMX_S32)nTargetFrameRate) - ((OMX_S32) nCurrentFrameRate) >= FRAME_RATE_THRESHOLD) ||
+ (((OMX_S32) nCurrentFrameRate) - ((OMX_S32)nTargetFrameRate) >= FRAME_RATE_THRESHOLD)) {
+
+ /* Now Send the new Frame Rate */
+ tFrameRate.nPortIndex = OMX_H264SVCE_INPUT_PORT; /* As per ducati support-set for input port */
+ tFrameRate.xEncodeFramerate = (OMX_U32)(nTargetFrameRate * (1 << 16));
+ eError = pHandle->SetConfig(hComponent, OMX_IndexConfigVideoFramerate, &tFrameRate);
+ if( eError != OMX_ErrorNone ) {
+ DOMX_ERROR(" Error while configuring Dynamic Frame Rate,Error info = %d", eError);
+ return (eError);
+ } else {
+ DOMX_DEBUG("Dynamic Frame Rate configuration successful \n");
+ }
+ nFrameRateThreshold = nTargetFrameRate; /*Update the threshold */
+ }
+
+ /* reset all params */
+ nFrameCounter = 0;
+ nVideoTime = 0;
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ return (OMX_ErrorNone);
+}
+
+static OMX_ERRORTYPE ComponentPrivateEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+
+ PROXY_assert(hComponent != NULL, OMX_ErrorInsufficientResources, "Null component handle received in EmptyThisBuffer");
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ PROXY_assert(pCompPrv != NULL, OMX_ErrorInsufficientResources, "Pointer to Null component private structure received in EmptyThisBuffer");
+ if( pCompPrv->proxyPortBuffers[0].proxyBufferType == EncoderMetadataPointers ) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ if( pTempBuffer == NULL ) {
+ eError = OMX_ErrorBadParameter;
+ DOMX_ERROR("Null meta data buffer supplied - Cannot find metadata type");
+ goto EXIT;
+ }
+ nMetadataBufferType = *pTempBuffer;
+ if( nMetadataBufferType == kMetadataBufferTypeCameraSource ) {
+ eError = OMX_ConfigureDynamicFrameRate(hComponent, pBufferHdr);
+ if( eError != OMX_ErrorNone ) {
+ DOMX_ERROR(" Error while configuring FrameRate Dynamically.Error info = %d - Non Fatal Error", eError);
+ }
+ }
+ }
+
+ DOMX_DEBUG("Redirection from ComponentPricateEmptyThisBuffer to PROXY_EmptyThisBuffer");
+EXIT:
+ if( eError != OMX_ErrorNone ) {
+ DOMX_EXIT("%s: exiting with error 0x%x - Non Fatal", __FUNCTION__, eError);
+ } else {
+ DOMX_EXIT("%s: dynamic frame rate config successful", __FUNCTION__);
+ }
+ return (LOCAL_PROXY_H264SVCE_EmptyThisBuffer(hComponent, pBufferHdr));
+}
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_ENHANCEDPORTRECONFIG tParamStruct;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+ char value[OMX_MAX_STRINGNAME_SIZE];
+ OMX_U32 mEnableVFR = 1; /* Flag used to enable/disable VFR for Encoder */
+ property_get("debug.vfr.enable", value, " 1");
+ mEnableVFR = atoi(value);
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pComponentPrivate->pCompProxyPrv =
+ (OMX_PROXY_ENCODER_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(OMX_PROXY_ENCODER_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->pCompProxyPrv != NULL,
+ OMX_ErrorInsufficientResources,
+ " Could not allocate proxy component private");
+
+ TIMM_OSAL_Memset(pComponentPrivate->pCompProxyPrv, 0,
+ sizeof(OMX_PROXY_ENCODER_PRIVATE));
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pComponentPrivate->pCompProxyPrv;
+
+ /* Create Pipe of for encoder input buffers */
+ eOSALStatus = TIMM_OSAL_CreatePipe(&pProxy->hBufPipe, sizeof(OMX_U32),
+ OMX_H264SVCVE_NUM_INTERNAL_BUF, 1);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources,
+ "Pipe creation failed");
+#endif
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+ pHandle->SetParameter = LOCAL_PROXY_H264SVCE_SetParameter;
+ pHandle->GetParameter = LOCAL_PROXY_H264SVCE_GetParameter;
+#endif
+ pComponentPrivate->IsLoadedState = OMX_TRUE;
+ pHandle->EmptyThisBuffer = LOCAL_PROXY_H264SVCE_EmptyThisBuffer;
+ pHandle->GetExtensionIndex = LOCAL_PROXY_H264SVCE_GetExtensionIndex;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pHandle->ComponentDeInit = LOCAL_PROXY_H264SVCE_ComponentDeInit;
+ pHandle->FreeBuffer = LOCAL_PROXY_H264SVCE_FreeBuffer;
+ pHandle->AllocateBuffer = LOCAL_PROXY_H264SVCE_AllocateBuffer;
+#endif
+
+ if( mEnableVFR ) {
+ pHandle->EmptyThisBuffer = ComponentPrivateEmptyThisBuffer;
+ }
+
+EXIT:
+ if( eError != OMX_ErrorNone ) {
+ DOMX_DEBUG("Error in Initializing Proxy");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->hBufPipe != NULL ) {
+ TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+ }
+
+ if( pComponentPrivate->pCompProxyPrv != NULL ) {
+ TIMM_OSAL_Free(pComponentPrivate->pCompProxyPrv);
+ pComponentPrivate->pCompProxyPrv = NULL;
+ pProxy = NULL;
+ }
+#endif
+ if( pComponentPrivate->cCompName != NULL ) {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if( pComponentPrivate != NULL ) {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return (eError);
+}
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_H264SVCE_GetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE *pPortParam = NULL;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_assert((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+
+ if( nParamIndex == OMX_IndexParamPortDefinition ) {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if( pPortDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar ) {
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->bAndroidOpaqueFormat == OMX_TRUE ) {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ } else
+#endif
+ {
+ pPortDef->format.video.eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+
+ if( pPortDef->nPortIndex == OMX_H264SVCE_INPUT_PORT ) {
+ if( pCompPrv->proxyPortBuffers[OMX_H264SVCE_INPUT_PORT].proxyBufferType == EncoderMetadataPointers ) {
+ pPortDef->nBufferSize = sizeof(video_metadata_t);
+ }
+ }
+ } else if( nParamIndex == OMX_IndexParamVideoPortFormat ) {
+ pPortParam = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if((eError == OMX_ErrorNone) &&
+ (pPortParam->eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)) {
+ pPortParam->eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if((eError == OMX_ErrorNoMore) &&
+ (pPortParam->nIndex == 1)) {
+ /* HACK:Remote OMX-H264SVCE supports only 1 color format (index 0). The
+ * OMX_COLOR_FormatAndroidOpaque is supported only at the proxy.
+ * Call GetParameter() to fill in defaults for parameters and
+ * override color format and index for the additional
+ * OMX_COLOR_FormatAndroidOpaque support*/
+ pPortParam->nIndex = 0;
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+ pPortParam->nIndex = 1;
+ pPortParam->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ eError = OMX_ErrorNone;
+ }
+#endif
+ } else if( nParamIndex == OMX_TI_IndexComponentHandle ) {
+ OMX_TI_COMPONENT_HANDLE *pCompHandle = pParamStruct;
+ pCompHandle->pHandle = hComponent;
+ eError = OMX_ErrorNone;
+ }
+
+ PROXY_assert((eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore),
+ eError, " Error in Proxy GetParameter");
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_H264SVCE_SetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE *pPortParams = NULL;
+ OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *pStoreMetaData = NULL;
+ OMX_TI_PARAM_BUFFERPREANNOUNCE tParamSetNPA;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ if( nParamIndex == OMX_IndexParamPortDefinition ) {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if( pPortDef->format.video.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar ) {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if( pPortDef->format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque ) {
+ if( COLORCONVERT_open(&pProxy->hCC, pCompPrv) != 0 ) {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ } else if( nParamIndex == OMX_IndexParamVideoPortFormat ) {
+ pPortParams = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if( pPortParams->eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar ) {
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if( pPortParams->eColorFormat == OMX_COLOR_FormatAndroidOpaque ) {
+ if( COLORCONVERT_open(&pProxy->hCC, pCompPrv) != 0 ) {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ } else if( nParamIndex == (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers ) {
+ pStoreMetaData = (OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *) pParamStruct;
+
+ DOMX_DEBUG("Moving to Metadatamode");
+ if( pStoreMetaData->nPortIndex == OMX_H264SVCE_INPUT_PORT && pStoreMetaData->bStoreMetaData == OMX_TRUE ) {
+ tParamSetNPA.nSize = sizeof(OMX_TI_PARAM_BUFFERPREANNOUNCE);
+ tParamSetNPA.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamSetNPA.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamSetNPA.nVersion.s.nRevision = 0x0;
+ tParamSetNPA.nVersion.s.nStep = 0x0;
+ tParamSetNPA.nPortIndex = OMX_H264SVCE_INPUT_PORT;
+ tParamSetNPA.bEnabled = OMX_FALSE;
+ //Call NPA on OMX encoder on ducati.
+ PROXY_SetParameter(hComponent, OMX_TI_IndexParamBufferPreAnnouncement, &tParamSetNPA);
+ pCompPrv->proxyPortBuffers[pStoreMetaData->nPortIndex].proxyBufferType = EncoderMetadataPointers;
+ DOMX_DEBUG("Moving to Metadatamode done");
+
+ /*Initializing Structure */
+ sPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ sPortDef.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ sPortDef.nVersion.s.nRevision = 0x0;
+ sPortDef.nVersion.s.nStep = 0x0;
+ sPortDef.nPortIndex = OMX_H264SVCE_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy GetParameter for Port Def");
+
+ sPortDef.format.video.nStride = LINUX_PAGE_SIZE;
+
+ eError = PROXY_SetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);
+
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy SetParameter for Port Def");
+ }
+ goto EXIT;
+ }
+
+ eError = PROXY_SetParameter(hComponent, nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError, " Error in Proxy SetParameter");
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return (eError);
+}
+
+#endif
+
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_GetExtensionIndex()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+ PROXY_require(cParameterName != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(pIndexType != NULL, OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER("%s hComponent = %p, pCompPrv = %p, cParameterName = %s",
+ __FUNCTION__, hComponent, pCompPrv, cParameterName);
+
+ // Check for NULL Parameters
+ PROXY_require((cParameterName != NULL && pIndexType != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ // Ensure that String length is not greater than Max allowed length
+ PROXY_require(strlen(cParameterName) <= 127, OMX_ErrorBadParameter, NULL);
+
+ if( strcmp(cParameterName, "OMX.google.android.index.storeMetaDataInBuffers") == 0 ) {
+ // If Index type is 2D Buffer Allocated Dimension
+ *pIndexType = (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers;
+ goto EXIT;
+ }
+
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+
+EXIT:
+ DOMX_EXIT("%s eError: %d", __FUNCTION__, eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_H264SVCE_EmptyThisBuffer()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PTR pBufferOrig = NULL;
+ OMX_U32 nStride = 0, nNumLines = 0;
+ OMX_PARAM_PORTDEFINITIONTYPE tParamStruct;
+ OMX_U32 nFilledLen, nAllocLen;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 nBufIndex = 0, nSize=0, nRet=0;
+#endif
+#ifdef ENABLE_GRALLOC_BUFFER
+ OMX_PTR pAuxBuf0 = NULL, pAuxBuf1 = NULL;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ OMX_ERRORTYPE eCompReturn = OMX_ErrorNone;
+ IMG_native_handle_t *pGrallocHandle=NULL;
+#endif
+
+ PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ PROXY_CHK_VERSION(pBufferHdr, OMX_BUFFERHEADERTYPE);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ tParamStruct.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamStruct.nVersion.s.nRevision = 0x0;
+ tParamStruct.nVersion.s.nStep = 0x0;
+ tParamStruct.nPortIndex = OMX_H264SVCE_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &tParamStruct);
+ PROXY_require(eError == OMX_ErrorNone, OMX_ErrorBadParameter, "Error is Get Parameter for port def");
+ nFilledLen = pBufferHdr->nFilledLen;
+ nAllocLen = pBufferHdr->nAllocLen;
+ if( nFilledLen != 0 ) {
+ pBufferHdr->nFilledLen = tParamStruct.nBufferSize;
+ }
+ pBufferHdr->nAllocLen = tParamStruct.nBufferSize;
+
+ DOMX_DEBUG
+ ("%s hComponent=%p, pCompPrv=%p, nFilledLen=%d, nOffset=%d, nFlags=%08x",
+ __FUNCTION__, hComponent, pCompPrv, pBufferHdr->nFilledLen,
+ pBufferHdr->nOffset, pBufferHdr->nFlags);
+
+ if( pCompPrv->proxyPortBuffers[OMX_H264SVCE_INPUT_PORT].proxyBufferType == EncoderMetadataPointers ) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ DOMX_DEBUG("Passing meta data to encoder");
+
+ pBufferOrig = pBufferHdr->pBuffer;
+
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ nMetadataBufferType = *pTempBuffer;
+
+ if( nMetadataBufferType == kMetadataBufferTypeCameraSource ) {
+#ifdef ENABLE_GRALLOC_BUFFER
+ video_metadata_t *pVideoMetadataBuffer;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeCameraSource");
+
+ pVideoMetadataBuffer = (video_metadata_t *) ((OMX_U32 *)(pBufferHdr->pBuffer));
+ pGrallocHandle = (IMG_native_handle_t *) (pVideoMetadataBuffer->handle);
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x", pGrallocHandle);
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while((unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+
+ pBufferHdr->nOffset = pVideoMetadataBuffer->offset;
+#endif
+ } else if( nMetadataBufferType == kMetadataBufferTypeGrallocSource ) {
+#ifdef ENABLE_GRALLOC_BUFFER
+ buffer_handle_t tBufHandle;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeGrallocSource");
+
+ pTempBuffer++;
+ tBufHandle = *((buffer_handle_t *)pTempBuffer);
+ pGrallocHandle = (IMG_native_handle_t *) tBufHandle;
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x", pGrallocHandle);
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while((unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->bAndroidOpaqueFormat && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 ) {
+ /* Dequeue NV12 buffer for encoder */
+ eOSALStatus = TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)(&nSize),
+ TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, NULL);
+
+ if( nFilledLen != 0 ) {
+ /* Get NV12 data after colorconv*/
+ nRet = COLORCONVERT_PlatformOpaqueToNV12(pProxy->hCC, (void * *) &pGrallocHandle, (void * *) &pProxy->gralloc_handle[nBufIndex],
+ pGrallocHandle->iWidth,
+ pGrallocHandle->iHeight,
+ 4096, COLORCONVERT_BUFTYPE_GRALLOCOPAQUE,
+ COLORCONVERT_BUFTYPE_GRALLOCOPAQUE);
+
+ if( nRet != 0 ) {
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(0, OMX_ErrorBadParameter, "Color conversion routine failed");
+ }
+ }
+
+ /* Update pBufferHdr with NV12 buffers for OMX component */
+ pBufferHdr->pBuffer= (OMX_U8 *)(pProxy->gralloc_handle[nBufIndex]->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = (OMX_PTR)(pProxy->gralloc_handle[nBufIndex]->fd[1]);
+ }
+#endif
+#endif
+ } else {
+ DOMX_ERROR("MetadataBufferType is unknow. Returning 'OMX_ErrorBadParameter'");
+ eError = OMX_ErrorBadParameter;
+ goto EXIT; //need to restore lenght fields in pBufferHdr
+ }
+#ifdef ENABLE_GRALLOC_BUFFER
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, pBufferHdr->pBuffer, -1,
+ &pAuxBuf0, &pAuxBuf1,
+ GrallocPointers);
+ PROXY_checkRpcError();
+ if( pAuxBuf0 ) {
+ pBufferHdr->pBuffer = pAuxBuf0;
+ }
+ if( pAuxBuf1 ) {
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = pAuxBuf1;
+ }
+#endif
+ }
+
+ eError = PROXY_EmptyThisBuffer(hComponent, pBufferHdr);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->bAndroidOpaqueFormat
+#ifdef ENABLE_GRALLOC_BUFFER
+ && pGrallocHandle != NULL && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12
+#endif
+ ) {
+ /*Write buffer to end of pipe for re-circulation for future ETB()*/
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+ }
+#endif
+
+EXIT:
+ if( pBufferHdr != NULL && pCompPrv != NULL ) {
+ if( pCompPrv->proxyPortBuffers[pBufferHdr->nInputPortIndex].proxyBufferType == EncoderMetadataPointers ) {
+ pBufferHdr->pBuffer = pBufferOrig;
+ pBufferHdr->nFilledLen = nFilledLen;
+ pBufferHdr->nAllocLen = nAllocLen;
+#ifdef ENABLE_GRALLOC_BUFFER
+ RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pAuxBuf0, pAuxBuf1, GrallocPointers);
+#endif
+ }
+ }
+ return (eError);
+}
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+static OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_AllocateBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * *ppBufferHdr, OMX_U32 nPortIndex,
+ OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ int err, nStride;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+
+ eError = PROXY_AllocateBuffer(hComponent, ppBufferHdr, nPortIndex,
+ pAppPrivate, nSizeBytes);
+EXIT:
+ return (eError);
+}
+
+static OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_U32 nBufIndex, nSize, nCount=0;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if((nPortIndex == OMX_H264SVCE_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat) && (pProxy->gralloc_handle[0] != NULL)) {
+ pProxy->nCurBufIndex--;
+ PROXY_require(pProxy->nCurBufIndex >= 0,
+ OMX_ErrorBadParameter, "Buffer index underflow");
+
+ if( pProxy->gralloc_handle[pProxy->nCurBufIndex] ) {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[pProxy->nCurBufIndex]));
+ pProxy->gralloc_handle[pProxy->nCurBufIndex] = NULL;
+ }
+
+ /*Clear the Bufindex pipe by dummy reads*/
+ TIMM_OSAL_GetPipeReadyMessageCount(pProxy->hBufPipe, (TIMM_OSAL_U32 *)&nCount);
+ if( nCount ) {
+ TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)&nSize, TIMM_OSAL_NO_SUSPEND);
+ }
+ }
+
+ eError = PROXY_FreeBuffer(hComponent, nPortIndex, pBufferHdr);
+
+EXIT:
+ return (eError);
+}
+
+int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride)
+{
+ OMX_CONFIG_RECTTYPE tParam;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 err;
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ tParam.nSize = sizeof(OMX_CONFIG_RECTTYPE);
+ tParam.nVersion.s.nVersionMajor = 1;
+ tParam.nVersion.s.nVersionMinor = 1;
+ tParam.nVersion.s.nRevision = 0;
+ tParam.nVersion.s.nStep = 0;
+ tParam.nPortIndex = OMX_H264SVCE_INPUT_PORT;
+ eError = PROXY_GetParameter(hComponent, (OMX_INDEXTYPE)OMX_TI_IndexParam2DBufferAllocDimension, &tParam);
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy GetParameter");
+ err = pProxy->mAllocDev->alloc(pProxy->mAllocDev, (int) tParam.nWidth, (int) tParam.nHeight, (int) HAL_PIXEL_FORMAT_TI_NV12, (int) GRALLOC_USAGE_HW_RENDER, (const struct native_handle_t * *)(&(pProxy->gralloc_handle[pProxy->nCurBufIndex])), (int *) &nStride);
+ PROXY_assert(!err, err, " Error in allocating Gralloc buffers");
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &pProxy->nCurBufIndex, sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+
+EXIT:
+ return (eError);
+}
+
+OMX_ERRORTYPE LOCAL_PROXY_H264SVCE_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 i;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if( pProxy->hBufPipe != NULL ) {
+ eOSALStatus = TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+
+ if( eOSALStatus != TIMM_OSAL_ERR_NONE ) {
+ DOMX_ERROR("Pipe deletion failed");
+ }
+ }
+
+ if( pProxy->bAndroidOpaqueFormat == OMX_TRUE ) {
+ /* Cleanup internal buffers in pipe if not freed on FreeBuffer */
+ for( i=0; i < OMX_H264SVCVE_NUM_INTERNAL_BUF; i++ ) {
+ if( pProxy->gralloc_handle[i] ) {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[i]));
+ pProxy->gralloc_handle[i] = NULL;
+ }
+ }
+
+ COLORCONVERT_close(pProxy->hCC, pCompPrv);
+ pProxy->bAndroidOpaqueFormat = OMX_FALSE;
+
+ if( pCompPrv->pCompProxyPrv != NULL ) {
+ TIMM_OSAL_Free(pCompPrv->pCompProxyPrv);
+ pCompPrv->pCompProxyPrv = NULL;
+ }
+ }
+
+ eError = PROXY_ComponentDeInit(hComponent);
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return (eError);
+}
+
+int COLORCONVERT_open(void * *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ int nErr = -1;
+ hw_module_t const *module = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ nErr = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+
+ if( nErr == 0 ) {
+ *hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
+ } else {
+ DOMX_ERROR("FATAL: gralloc api hw_get_module() returned error: Can't find \
+ %s module err = %x", GRALLOC_HARDWARE_MODULE_ID, nErr);
+ }
+
+ gralloc_open(module, &(pProxy->mAllocDev));
+
+ return (nErr);
+}
+
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC,
+ void *pSrc[COLORCONVERT_MAX_SUB_BUFFERS],
+ void *pDst[COLORCONVERT_MAX_SUB_BUFFERS],
+ int nWidth, int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType)
+{
+ IMG_gralloc_module_public_t const *module = hCC;
+ int nErr = -1;
+
+ if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_VIRTUAL)) {
+ nErr = module->Blit(module, pSrc[0], pDst, HAL_PIXEL_FORMAT_TI_NV12);
+ } else if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE)) {
+ nErr = module->Blit2(module, pSrc[0], pDst[0], nWidth, nHeight, 0, 0);
+ }
+
+ return (nErr);
+}
+
+int COLORCONVERT_close(void *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ if( pProxy && pProxy->mAllocDev ) {
+ gralloc_close(pProxy->mAllocDev);
+ }
+ return (0);
+}
+
+#endif
+
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/Makefile b/domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/Makefile
new file mode 100644
index 0000000..8dbb806
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/Makefile
@@ -0,0 +1,101 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libOMX.TI.DUCATI1.VIDEO.MPEG4E.so
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+src/omx_proxy_mpeg4enc.c \
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc/inc \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal domx
+SH_LIBS = domx omx_core mm_osal
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c b/domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c
new file mode 100755
index 0000000..ea3377f
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_mpeg4_enc/src/omx_proxy_mpeg4enc.c
@@ -0,0 +1,1076 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_mpeg4enc.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ *! Revision History
+ *! ============================
+ * 31-August-2011 Lakshman N : Support for color conv at encoder
+ * input port
+ *
+ *! 20-August-2010 Sarthak Aggarwal sarthak@ti.com: Initial Version
+ *================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+#include "omx_proxy_video_encoder.h"
+
+#include <MetadataBufferType.h>
+#ifdef ENABLE_GRALLOC_BUFFER
+#include "native_handle.h"
+#include <hal_public.h>
+#include <VideoMetadata.h>
+#endif
+
+#include <stdlib.h>
+#include <cutils/properties.h>
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.MPEG4E"
+/* needs to be specific for every configuration wrapper */
+
+#define OMX_MPEG4E_INPUT_PORT 0
+#define LINUX_PAGE_SIZE 4096
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+/* Opaque color format requires below quirks to be enabled
+ * ENABLE_GRALLOC_BUFFER
+ * ANDROID_QUIRK_CHANGE_PORT_VALUES
+ */
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+#endif
+
+
+#define OMX_INIT_STRUCT(_s_, _name_) \
+ memset(&(_s_), 0x0, sizeof(_name_)); \
+ (_s_).nSize = sizeof(_name_); \
+ (_s_).nVersion.s.nVersionMajor = 0x1; \
+ (_s_).nVersion.s.nVersionMinor = 0x1; \
+ (_s_).nVersion.s.nRevision = 0x0; \
+ (_s_).nVersion.s.nStep = 0x0
+
+
+/* Params needed for Dynamic Frame Rate Control*/
+#define FRAME_RATE_THRESHOLD 1 /* Change in Frame rate to configure the encoder */
+OMX_U32 nFrameRateThreshold = 0;/* Frame Rate threshold for every frame rate update */
+OMX_U32 nPortFrameRate = 0; /* Port FPS initially set to the Encoder */
+OMX_U32 nFrameCounter = 0; /* Number of input frames recieved since last framerate calculation */
+OMX_TICKS nVideoTime = 0; /* Video duration since last framerate calculation */
+OMX_TICKS nLastFrameRateUpdateTime = 0; /*Time stamp at last frame rate update */
+OMX_U16 nBFrames = 0; /* Number of B Frames in H264 Encoder */
+
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+#define OMX_MPEG4E_NUM_INTERNAL_BUF (8)
+#define HAL_PIXEL_FORMAT_TI_NV12 (0x100)
+
+#define COLORCONVERT_MAX_SUB_BUFFERS (3)
+
+#define COLORCONVERT_BUFTYPE_VIRTUAL (0x0)
+#define COLORCONVERT_BUFTYPE_ION (0x1)
+#define COLORCONVERT_BUFTYPE_GRALLOCOPAQUE (0x2)
+
+int COLORCONVERT_open(void **hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC, void *pSrc[],
+ void *pDst[], int nWidth,
+ int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType);
+int COLORCONVERT_close(void *hCC,PROXY_COMPONENT_PRIVATE *pCompPrv);
+
+static OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE ** ppBufferHdr, OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes);
+
+static OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+static OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+extern RPC_OMX_ERRORTYPE RPC_RegisterBuffer(OMX_HANDLETYPE hRPCCtx, int fd1, int fd2,
+ OMX_PTR *handle1, OMX_PTR *handle2,
+ PROXY_BUFFER_TYPE proxyBufferType);
+extern RPC_OMX_ERRORTYPE RPC_UnRegisterBuffer(OMX_HANDLETYPE hRPCCtx, OMX_PTR handle1,
+ OMX_PTR handle2, PROXY_BUFFER_TYPE proxyBufferType);
+#endif
+
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType);
+
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr);
+
+static OMX_ERRORTYPE OMX_ConfigureDynamicFrameRate( OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 nTargetFrameRate = 0; /* Target Frame Rate to be provided to Encoder */
+ OMX_U32 nCurrentFrameRate = 0; /* Current Frame Rate currently set in Encoder */
+ OMX_CONFIG_FRAMERATETYPE tFrameRate;
+ OMX_COMPONENTTYPE *pHandle;
+ if (hComponent == NULL){
+ DOMX_ERROR("Component is invalid/ not present ");
+ return OMX_ErrorBadParameter;
+ }
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ /* Initialise the OMX structures */
+ OMX_INIT_STRUCT(tFrameRate,OMX_CONFIG_FRAMERATETYPE);
+
+ /* Intialise nLastFrameRateUpdateTime for the 1st frame */
+ if((!nFrameCounter) && (!nLastFrameRateUpdateTime)){
+ nLastFrameRateUpdateTime = pBufferHdr-> nTimeStamp;
+ }
+
+ /* Increment the Frame Counter and Calculate Frame Rate*/
+ nFrameCounter++;
+ nVideoTime = pBufferHdr->nTimeStamp - nLastFrameRateUpdateTime;
+
+ if(nVideoTime < 0) {
+ return OMX_ErrorBadParameter;
+ }
+
+ /*Get Port Frame Rate if not read yet*/
+ if(!nFrameRateThreshold) {
+ tFrameRate.nPortIndex = OMX_MPEG4E_INPUT_PORT; /* As per ducati support-set for input port */
+
+ /* Read Current FrameRate */
+ eError = pHandle->GetConfig(hComponent,OMX_IndexConfigVideoFramerate,&tFrameRate);
+ if (eError != OMX_ErrorNone)
+ DOMX_ERROR ("pHandle->GetConfig OMX_IndexConfigVideoFramerate eError :0x%x \n",eError);
+ nFrameRateThreshold = tFrameRate.xEncodeFramerate >>16;
+ nPortFrameRate = nFrameRateThreshold;
+ DOMX_DEBUG(" Port Frame Rate is %d ", nPortFrameRate);
+ }
+ nCurrentFrameRate = nFrameRateThreshold;
+
+ /* If Number of frames is less than the Threshold
+ * Frame Rate udpate is not necessary
+ */
+ if(nFrameCounter < nFrameRateThreshold){
+ DOMX_EXIT(" Threshold not reached, no update necessary");
+ return OMX_ErrorNone;
+ }
+
+ /*Calculate the new target Frame Rate*/
+ if (nVideoTime != 0)
+ nTargetFrameRate = nFrameCounter * 1000000 / nVideoTime;
+
+ /* For 1080p record, max FPS supported by Codec for profile 4.1 is 30.
+ * When Dynamic Frame Rate is enabled, there might be scenario when FPS
+ * calculated is more than 30. Hence adding the check so that Dynamic Frame
+ * Rate set is never greater than the port FPS initially set.
+ */
+ if(nTargetFrameRate > nPortFrameRate){
+ DOMX_DEBUG("Frame Rate Calculated is more than initial port set Frame Rate");
+ nTargetFrameRate = nPortFrameRate;
+ }
+
+ /* Difference in Frame Rate is more than Threshold - Only then update Frame Rate*/
+ if((( (OMX_S32)nTargetFrameRate) -((OMX_S32) nCurrentFrameRate) >= FRAME_RATE_THRESHOLD) ||
+ (((OMX_S32) nCurrentFrameRate) - ( (OMX_S32)nTargetFrameRate) >= FRAME_RATE_THRESHOLD)) {
+
+ /* Now Send the new Frame Rate */
+ tFrameRate.nPortIndex = OMX_MPEG4E_INPUT_PORT; /* As per ducati support-set for input port */
+ tFrameRate.xEncodeFramerate = (OMX_U32)(nTargetFrameRate * (1 << 16));
+ eError = pHandle->SetConfig(hComponent,OMX_IndexConfigVideoFramerate,&tFrameRate);
+ if(eError != OMX_ErrorNone){
+ DOMX_ERROR(" Error while configuring Dynamic Frame Rate,Error info = %d",eError);
+ return eError;
+ } else {
+ DOMX_DEBUG("Dynamic Frame Rate configuration successful \n");
+ }
+ nFrameRateThreshold = nTargetFrameRate; /*Update the threshold */
+ }
+
+ /* reset all params */
+ nFrameCounter = 0 ;
+ nVideoTime = 0;
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ return OMX_ErrorNone;
+}
+
+static OMX_ERRORTYPE ComponentPrivateEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ PROXY_assert(hComponent != NULL, OMX_ErrorInsufficientResources,"Null component handle received in EmptyThisBuffer");
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ PROXY_assert(pCompPrv != NULL, OMX_ErrorInsufficientResources,"Pointer to Null component private structure received in EmptyThisBuffer");
+ if(pCompPrv->proxyPortBuffers[0].proxyBufferType == EncoderMetadataPointers) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ if(pTempBuffer == NULL) {
+ eError = OMX_ErrorBadParameter;
+ DOMX_ERROR("Null meta data buffer supplied - Cannot find metadata type");
+ goto EXIT;
+ }
+ nMetadataBufferType = *pTempBuffer;
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource) {
+ eError = OMX_ConfigureDynamicFrameRate(hComponent, pBufferHdr);
+ if( eError != OMX_ErrorNone)
+ DOMX_ERROR(" Error while configuring FrameRate Dynamically.Error info = %d - Non Fatal Error",eError);
+ }
+ }
+ DOMX_DEBUG("Redirection from ComponentPricateEmptyThisBuffer to PROXY_EmptyThisBuffer");
+EXIT:
+ if( eError != OMX_ErrorNone) {
+ DOMX_EXIT("%s: exiting with error 0x%x - Non Fatal",__FUNCTION__,eError);
+ } else {
+ DOMX_EXIT("%s: dynamic frame rate config successful",__FUNCTION__);
+ }
+ return LOCAL_PROXY_MPEG4E_EmptyThisBuffer(hComponent,pBufferHdr);
+}
+
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_ENHANCEDPORTRECONFIG tParamStruct;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+ char value[OMX_MAX_STRINGNAME_SIZE];
+ OMX_U32 mEnableVFR = 1; /* Flag used to enable/disable VFR for Encoder */
+ property_get("debug.vfr.enable", value, "1");
+ mEnableVFR = atoi(value);
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pComponentPrivate->pCompProxyPrv =
+ (OMX_PROXY_ENCODER_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(OMX_PROXY_ENCODER_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->pCompProxyPrv != NULL,
+ OMX_ErrorInsufficientResources,
+ " Could not allocate proxy component private");
+
+ TIMM_OSAL_Memset(pComponentPrivate->pCompProxyPrv, 0,
+ sizeof(OMX_PROXY_ENCODER_PRIVATE));
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pComponentPrivate->pCompProxyPrv;
+
+ /* Create Pipe of for encoder input buffers */
+ eOSALStatus = TIMM_OSAL_CreatePipe(&pProxy->hBufPipe, sizeof(OMX_U32),
+ OMX_MPEG4E_NUM_INTERNAL_BUF, 1);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources,
+ "Pipe creation failed");
+
+#endif
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+ pHandle->SetParameter = LOCAL_PROXY_MPEG4E_SetParameter;
+ pHandle->GetParameter = LOCAL_PROXY_MPEG4E_GetParameter;
+#endif
+ pHandle->ComponentDeInit = LOCAL_PROXY_MPEG4E_ComponentDeInit;
+ pHandle->FreeBuffer = LOCAL_PROXY_MPEG4E_FreeBuffer;
+ pHandle->AllocateBuffer = LOCAL_PROXY_MPEG4E_AllocateBuffer;
+
+ pComponentPrivate->IsLoadedState = OMX_TRUE;
+ pHandle->EmptyThisBuffer = LOCAL_PROXY_MPEG4E_EmptyThisBuffer;
+ pHandle->GetExtensionIndex = LOCAL_PROXY_MPEG4E_GetExtensionIndex;
+
+ if(mEnableVFR)
+ pHandle->EmptyThisBuffer = ComponentPrivateEmptyThisBuffer;
+
+ EXIT:
+ if (eError != OMX_ErrorNone)
+ {
+ DOMX_DEBUG("Error in Initializing Proxy");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if(pProxy->hBufPipe != NULL)
+ {
+ TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+ }
+
+ if(pComponentPrivate->pCompProxyPrv != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->pCompProxyPrv);
+ pComponentPrivate->pCompProxyPrv = NULL;
+ pProxy = NULL;
+ }
+#endif
+ if (pComponentPrivate->cCompName != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if (pComponentPrivate != NULL)
+ {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return eError;
+}
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_MPEG4E_GetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParam = NULL;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_assert((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ eError = PROXY_GetParameter(hComponent,nParamIndex, pParamStruct);
+
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if(pProxy->bAndroidOpaqueFormat == OMX_TRUE)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ }
+ else
+#endif
+ {
+ pPortDef->format.video.eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+ if(pPortDef->nPortIndex == OMX_MPEG4E_INPUT_PORT)
+ {
+ if(pCompPrv->proxyPortBuffers[OMX_MPEG4E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers)
+ {
+ pPortDef->nBufferSize = sizeof(video_metadata_t);
+ }
+ }
+ }
+ else if (nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ pPortParam = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if((eError == OMX_ErrorNone) &&
+ (pPortParam->eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar))
+ {
+ pPortParam->eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if ((eError == OMX_ErrorNoMore) && (pPortParam->nIndex == 1))
+ {
+ /* HACK:Remote OMX-MPEG4E supports only 1 color format (index 0). The
+ * OMX_COLOR_FormatAndroidOpaque is supported only at the proxy.
+ * Call GetParameter() to fill in defaults for parameters and
+ * override color format and index for the additional
+ * OMX_COLOR_FormatAndroidOpaque support*/
+ pPortParam->nIndex = 0;
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+ pPortParam->nIndex = 1;
+ pPortParam->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ eError = OMX_ErrorNone;
+ }
+#endif
+ }
+
+ PROXY_assert((eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore),
+ eError," Error in Proxy GetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_MPEG4E_SetParameter()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE* pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE* pPortParams = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+ OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS* pStoreMetaData = (OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *) pParamStruct;
+ OMX_TI_PARAM_BUFFERPREANNOUNCE tParamSetNPA;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ if(nParamIndex == OMX_IndexParamPortDefinition)
+ {
+ if(pPortDef->format.video.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if(pPortDef->format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ {
+ if(COLORCONVERT_open(&pProxy->hCC,pCompPrv) != 0)
+ {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ }
+ else if(nParamIndex == OMX_IndexParamVideoPortFormat)
+ {
+ if(pPortParams->eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar)
+ {
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if(pPortParams->eColorFormat == OMX_COLOR_FormatAndroidOpaque)
+ {
+ if(COLORCONVERT_open(&pProxy->hCC,pCompPrv) != 0)
+ {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ }
+ else if(nParamIndex == (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers)
+ {
+ DOMX_DEBUG("Moving to Metadatamode");
+ if (pStoreMetaData->nPortIndex == OMX_MPEG4E_INPUT_PORT && pStoreMetaData->bStoreMetaData == OMX_TRUE)
+ {
+ tParamSetNPA.nSize = sizeof(OMX_TI_PARAM_BUFFERPREANNOUNCE);
+ tParamSetNPA.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamSetNPA.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamSetNPA.nVersion.s.nRevision = 0x0;
+ tParamSetNPA.nVersion.s.nStep = 0x0;
+ tParamSetNPA.nPortIndex = OMX_MPEG4E_INPUT_PORT;
+ tParamSetNPA.bEnabled = OMX_FALSE;
+ //Call NPA on OMX encoder on ducati.
+ PROXY_SetParameter(hComponent,OMX_TI_IndexParamBufferPreAnnouncement, &tParamSetNPA);
+ pCompPrv->proxyPortBuffers[pStoreMetaData->nPortIndex].proxyBufferType = EncoderMetadataPointers;
+ DOMX_DEBUG("Moving to Metadatamode done");
+
+ /*Initializing Structure */
+ sPortDef.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ sPortDef.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ sPortDef.nVersion.s.nRevision = 0x0;
+ sPortDef.nVersion.s.nStep = 0x0;
+ sPortDef.nPortIndex = OMX_MPEG4E_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent,OMX_IndexParamPortDefinition, &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy GetParameter for Port Def");
+
+ sPortDef.format.video.nStride = LINUX_PAGE_SIZE;
+
+ eError = PROXY_SetParameter(hComponent,OMX_IndexParamPortDefinition, &sPortDef);
+
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy SetParameter for Port Def");
+ }
+ goto EXIT;
+ }
+
+ eError = PROXY_SetParameter(hComponent, nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError," Error in Proxy SetParameter");
+
+ EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+#endif
+
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_GetExtensionIndex()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE * pIndexType)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+ PROXY_require(cParameterName != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(pIndexType != NULL, OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER("%s hComponent = %p, pCompPrv = %p, cParameterName = %s",
+ __FUNCTION__,hComponent, pCompPrv, cParameterName);
+
+ // Check for NULL Parameters
+ PROXY_require((cParameterName != NULL && pIndexType != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ // Ensure that String length is not greater than Max allowed length
+ PROXY_require(strlen(cParameterName) <= 127, OMX_ErrorBadParameter, NULL);
+
+ if(strcmp(cParameterName, "OMX.google.android.index.storeMetaDataInBuffers") == 0)
+ {
+ // If Index type is 2D Buffer Allocated Dimension
+ *pIndexType = (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers;
+ goto EXIT;
+ }
+
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+
+ EXIT:
+ DOMX_EXIT("%s eError: %d",__FUNCTION__, eError);
+ return eError;
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_MPEG4E_EmptyThisBuffer()
+ * @brief
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PTR pBufferOrig = NULL;
+ OMX_U32 nStride = 0, nNumLines = 0;
+ OMX_PARAM_PORTDEFINITIONTYPE tParamStruct;
+ OMX_U32 nFilledLen, nAllocLen;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 nBufIndex = 0, nSize=0, nRet=0;
+#endif
+#ifdef ENABLE_GRALLOC_BUFFER
+ OMX_PTR pAuxBuf0 = NULL, pAuxBuf1 = NULL;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ OMX_ERRORTYPE eCompReturn = OMX_ErrorNone;
+#endif
+
+ PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ PROXY_CHK_VERSION(pBufferHdr, OMX_BUFFERHEADERTYPE);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ tParamStruct.nSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
+ tParamStruct.nVersion.s.nVersionMajor = OMX_VER_MAJOR;
+ tParamStruct.nVersion.s.nVersionMinor = OMX_VER_MINOR;
+ tParamStruct.nVersion.s.nRevision = 0x0;
+ tParamStruct.nVersion.s.nStep = 0x0;
+ tParamStruct.nPortIndex = OMX_MPEG4E_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &tParamStruct);
+ PROXY_require(eError == OMX_ErrorNone, OMX_ErrorBadParameter, "Error is Get Parameter for port def");
+ nFilledLen = pBufferHdr->nFilledLen;
+ nAllocLen = pBufferHdr->nAllocLen;
+ if(nFilledLen != 0)
+ {
+ pBufferHdr->nFilledLen = tParamStruct.nBufferSize;
+ }
+ pBufferHdr->nAllocLen = tParamStruct.nBufferSize;
+
+ DOMX_DEBUG
+ ("%s hComponent=%p, pCompPrv=%p, nFilledLen=%d, nOffset=%d, nFlags=%08x",
+ __FUNCTION__,hComponent, pCompPrv, pBufferHdr->nFilledLen,
+ pBufferHdr->nOffset, pBufferHdr->nFlags);
+
+ if( pCompPrv->proxyPortBuffers[OMX_MPEG4E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers
+ && nFilledLen != 0)
+ {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ DOMX_DEBUG("Passing meta data to encoder");
+
+ pBufferOrig = pBufferHdr->pBuffer;
+
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ nMetadataBufferType = *pTempBuffer;
+
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource)
+ {
+#ifdef ENABLE_GRALLOC_BUFFER
+ IMG_native_handle_t* pGrallocHandle;
+ video_metadata_t* pVideoMetadataBuffer;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeCameraSource");
+
+ pVideoMetadataBuffer = (video_metadata_t*) ((OMX_U32 *)(pBufferHdr->pBuffer));
+ pGrallocHandle = (IMG_native_handle_t*) (pVideoMetadataBuffer->handle);
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x",pGrallocHandle );
+
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+
+ pBufferHdr->nOffset = pVideoMetadataBuffer->offset;
+#endif
+ }
+ else if(nMetadataBufferType == kMetadataBufferTypeGrallocSource)
+ {
+#ifdef ENABLE_GRALLOC_BUFFER
+ IMG_native_handle_t* pGrallocHandle;
+ buffer_handle_t tBufHandle;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeGrallocSource");
+
+ pTempBuffer++;
+ tBufHandle = *((buffer_handle_t *)pTempBuffer);
+ pGrallocHandle = (IMG_native_handle_t*) tBufHandle;
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x",pGrallocHandle );
+
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if (pProxy->bAndroidOpaqueFormat)
+ {
+ DOMX_DEBUG(" ++TIMM_OSAL_ReadFromPipe() ");
+ /* Dequeue NV12 buffer for encoder */
+ eOSALStatus = TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)(&nSize),
+ TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, NULL);
+
+ /* Get NV12 data after colorconv*/
+ nRet = COLORCONVERT_PlatformOpaqueToNV12(pProxy->hCC, (void **) &pGrallocHandle, (void **) &pProxy->gralloc_handle[nBufIndex],
+ pGrallocHandle->iWidth,
+ pGrallocHandle->iHeight,
+ 4096, COLORCONVERT_BUFTYPE_GRALLOCOPAQUE,
+ COLORCONVERT_BUFTYPE_GRALLOCOPAQUE );
+ if(nRet != 0)
+ {
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(0, OMX_ErrorBadParameter, "Color conversion routine failed");
+ }
+ DOMX_DEBUG(" --COLORCONVERT_PlatformOpaqueToNV12() ");
+
+ /* Update pBufferHdr with NV12 buffers for OMX component */
+ pBufferHdr->pBuffer= (OMX_U8 *)(pProxy->gralloc_handle[nBufIndex]->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = (OMX_PTR)(pProxy->gralloc_handle[nBufIndex]->fd[1]);
+ }
+#endif
+#endif
+ }
+ else
+ {
+ return OMX_ErrorBadParameter;
+ }
+#ifdef ENABLE_GRALLOC_BUFFER
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, pBufferHdr->pBuffer,-1,
+ &pAuxBuf0, &pAuxBuf1,
+ GrallocPointers);
+ PROXY_checkRpcError();
+ if (pAuxBuf0)
+ pBufferHdr->pBuffer = pAuxBuf0;
+ if (pAuxBuf1)
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = pAuxBuf1;
+#endif
+ }
+
+ eError = PROXY_EmptyThisBuffer(hComponent, pBufferHdr);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if (pProxy->bAndroidOpaqueFormat)
+ {
+ /*Write buffer to end of pipe for re-circulation for future ETB()*/
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+ }
+#endif
+
+EXIT:
+ if( pBufferHdr!=NULL && pCompPrv!=NULL)
+ {
+ if(pCompPrv->proxyPortBuffers[pBufferHdr->nInputPortIndex].proxyBufferType == EncoderMetadataPointers)
+ {
+ pBufferHdr->pBuffer = pBufferOrig;
+ pBufferHdr->nFilledLen = nFilledLen;
+ pBufferHdr->nAllocLen = nAllocLen;
+#ifdef ENABLE_GRALLOC_BUFFER
+ RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pAuxBuf0, pAuxBuf1, GrallocPointers);
+#endif
+ }
+ }
+ return eError;
+}
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+static OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_AllocateBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE ** ppBufferHdr, OMX_U32 nPortIndex,
+ OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_CONFIG_RECTTYPE tParamRect;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ DOMX_DEBUG(" ++LOCAL_PROXY_MPEG4E_AllocateBuffer");
+ int err, nStride;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if((nPortIndex == OMX_MPEG4E_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat))
+ {
+ tParamRect.nSize = sizeof(OMX_CONFIG_RECTTYPE);
+ tParamRect.nVersion.s.nVersionMajor = 1;
+ tParamRect.nVersion.s.nVersionMinor = 1;
+ tParamRect.nVersion.s.nRevision = 0;
+ tParamRect.nVersion.s.nStep = 0;
+ tParamRect.nPortIndex = nPortIndex;
+
+ eError = PROXY_GetParameter(hComponent, (OMX_INDEXTYPE)OMX_TI_IndexParam2DBufferAllocDimension, &tParamRect);
+ PROXY_assert(eError == OMX_ErrorNone, eError," Error in Proxy GetParameter from 2d index in allocate buffer");
+
+ err = pProxy->mAllocDev->alloc(pProxy->mAllocDev,(int) tParamRect.nWidth,(int) tParamRect.nHeight,
+ (int) HAL_PIXEL_FORMAT_TI_NV12,(int) GRALLOC_USAGE_HW_RENDER,
+ (const struct native_handle_t **)(&(pProxy->gralloc_handle[pProxy->nCurBufIndex])), &nStride);
+ }
+
+ eError = PROXY_AllocateBuffer(hComponent, ppBufferHdr, nPortIndex,
+ pAppPrivate, nSizeBytes);
+EXIT:
+ if((nPortIndex == OMX_MPEG4E_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat))
+ {
+ if(eError != OMX_ErrorNone)
+ {
+ err = pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[pProxy->nCurBufIndex]));
+ }
+ else
+ {
+ /*Populate buffer to pipe*/
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &pProxy->nCurBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ pProxy->nCurBufIndex++;
+ }
+ }
+ DOMX_DEBUG(" --LOCAL_PROXY_MPEG4E_AllocateBuffer");
+ return eError;
+}
+
+static OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE * pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_U32 nBufIndex, nSize, nCount=0;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if((nPortIndex == OMX_MPEG4E_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat))
+ {
+ pProxy->nCurBufIndex--;
+ PROXY_require(pProxy->nCurBufIndex >=0,
+ OMX_ErrorBadParameter, "Buffer index underflow");
+
+ if(pProxy->gralloc_handle[pProxy->nCurBufIndex])
+ {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[pProxy->nCurBufIndex]));
+ pProxy->gralloc_handle[pProxy->nCurBufIndex] = NULL;
+ }
+
+ /*Clear the Bufindex pipe by dummy reads*/
+ TIMM_OSAL_GetPipeReadyMessageCount(pProxy->hBufPipe, (TIMM_OSAL_U32 *)&nCount);
+ if(nCount)
+ {
+ TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)&nSize, TIMM_OSAL_NO_SUSPEND);
+ }
+ }
+
+ eError = PROXY_FreeBuffer(hComponent, nPortIndex, pBufferHdr);
+
+EXIT:
+ return eError;
+}
+
+OMX_ERRORTYPE LOCAL_PROXY_MPEG4E_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 i;
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if(pProxy->hBufPipe != NULL)
+ {
+ eOSALStatus = TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+
+ if(eOSALStatus != TIMM_OSAL_ERR_NONE)
+ {
+ DOMX_ERROR("Pipe deletion failed");
+ }
+ }
+
+ if(pProxy->bAndroidOpaqueFormat == OMX_TRUE)
+ {
+ /* Cleanup internal buffers in pipe if not freed on FreeBuffer */
+ for(i=0; i<OMX_MPEG4E_NUM_INTERNAL_BUF; i++)
+ {
+ if(pProxy->gralloc_handle[i])
+ {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[i]));
+ pProxy->gralloc_handle[i] = NULL;
+ }
+ }
+
+ COLORCONVERT_close(pProxy->hCC,pCompPrv);
+ pProxy->bAndroidOpaqueFormat = OMX_FALSE;
+
+ if(pCompPrv->pCompProxyPrv != NULL)
+ {
+ TIMM_OSAL_Free(pCompPrv->pCompProxyPrv);
+ pCompPrv->pCompProxyPrv = NULL;
+ }
+ }
+
+ eError = PROXY_ComponentDeInit(hComponent);
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return eError;
+}
+
+int COLORCONVERT_open(void **hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ int nErr = -1;
+ hw_module_t const* module = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ nErr = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+
+ if (nErr == 0)
+ {
+ *hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
+ }
+ else
+ {
+ DOMX_ERROR("FATAL: gralloc api hw_get_module() returned error: Can't find \
+ %s module err = %x", GRALLOC_HARDWARE_MODULE_ID, nErr);
+ }
+
+ gralloc_open(module, &(pProxy->mAllocDev));
+
+ return nErr;
+}
+
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC,
+ void *pSrc[COLORCONVERT_MAX_SUB_BUFFERS],
+ void *pDst[COLORCONVERT_MAX_SUB_BUFFERS],
+ int nWidth, int nHeight, int nStride,
+ int nSrcBufType,int nDstBufType)
+{
+ IMG_gralloc_module_public_t const* module = hCC;
+ int nErr = -1;
+
+ if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_VIRTUAL))
+ {
+ nErr = module->Blit(module, pSrc[0], pDst, HAL_PIXEL_FORMAT_TI_NV12);
+
+ }
+ else if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE ))
+ {
+ nErr = module->Blit2(module, pSrc[0], pDst[0], nWidth, nHeight, 0, 0);
+ }
+
+ return nErr;
+}
+
+int COLORCONVERT_close(void *hCC,PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ if(pProxy && pProxy->mAllocDev)
+ {
+ gralloc_close(pProxy->mAllocDev);
+ }
+ return 0;
+}
+#endif
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/Makefile b/domx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/Makefile
new file mode 100755
index 0000000..2687d74
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/Makefile
@@ -0,0 +1,102 @@
+# ======================================================================
+# Copyright (C) 2010 Texas Instruments Incorporated
+#
+# All rights reserved. Property of Texas Instruments Incorporated.
+# Restricted rights to use, duplicate or disclose this code are
+# granted through contract.
+#
+# The program may not be used without the written permission
+# of Texas Instruments Incorporated or against the terms and conditions
+# stipulated in the agreement under which this program has been
+# supplied.
+# ====================================================================
+#
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = libOMX.TI.DUCATI1.VIDEO.VC1E.so
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = SH_LIB
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = lib
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = lib
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+src/omx_proxy_vc1enc.c \
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/domx/omx_rpc/inc \
+
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#mm_osal domx
+SH_LIBS = domx omx_core mm_osal
+#pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/mm_osal \
+ $(PROJROOT)/domx \
+ $(PROJROOT)/omx_core
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
diff --git a/domx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/src/omx_proxy_vc1enc.c b/domx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/src/omx_proxy_vc1enc.c
new file mode 100755
index 0000000..478139d
--- /dev/null
+++ b/domx/omx_proxy_component/omx_video_enc/src/omx_vc1_enc/src/omx_proxy_vc1enc.c
@@ -0,0 +1,1172 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/**
+ * @file omx_proxy_vc1enc.c
+ * This file contains methods that provides the functionality for
+ * the OpenMAX1.1 DOMX Framework Proxy component.
+ *********************************************************************************************
+ This is the proxy specific wrapper that passes the component name to the generic proxy init()
+ The proxy wrapper also does some runtime/static time onfig on per proxy basis
+ This is a thin wrapper that is called when componentiit() of the proxy is called
+ static OMX_ERRORTYPE PROXY_Wrapper_init(OMX_HANDLETYPE hComponent, OMX_PTR pAppData);
+ this layer gets called first whenever a proxy's get handle is called
+ ************************************************************************************************
+ * @path WTSD_DucatiMMSW\omx\omx_il_1_x\omx_proxy_component\src
+ *
+ * @rev 1.0
+ */
+
+/*==============================================================
+ * ! Revision History
+ * ! ============================
+ *
+ * ! 20-JUNE-2012 : x0078587@ti.com Initial Version
+ * ================================================================*/
+
+/******************************************************************
+ * INCLUDE FILES
+ ******************************************************************/
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+#include "omx_proxy_common.h"
+#include <timm_osal_interfaces.h>
+#include "OMX_TI_IVCommon.h"
+#include "OMX_TI_Video.h"
+#include "OMX_TI_Index.h"
+#include "omx_proxy_video_encoder.h"
+
+#include <MetadataBufferType.h>
+#ifdef ENABLE_GRALLOC_BUFFER
+#include "native_handle.h"
+#include <hal_public.h>
+#include <VideoMetadata.h>
+#endif
+
+#include <stdlib.h>
+#include <cutils/properties.h>
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.VIDEO.VC1E"
+/* needs to be specific for every configuration wrapper */
+
+#define OMX_VC1E_INPUT_PORT 0
+#define LINUX_PAGE_SIZE 4096
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct);
+
+#endif
+
+
+#define OMX_INIT_STRUCT(_s_, _name_) \
+ memset(&(_s_), 0x0, sizeof(_name_)); \
+ (_s_).nSize = sizeof(_name_); \
+ (_s_).nVersion.s.nVersionMajor = 0x1; \
+ (_s_).nVersion.s.nVersionMinor = 0x1; \
+ (_s_).nVersion.s.nRevision = 0x0; \
+ (_s_).nVersion.s.nStep = 0x0
+
+
+/* Params needed for Dynamic Frame Rate Control*/
+#define FRAME_RATE_THRESHOLD 1 /* Change in Frame rate to configure the encoder */
+OMX_U32 nFrameRateThreshold = 0; /* Frame Rate threshold for every frame rate update */
+OMX_U32 nPortFrameRate = 0; /* Port FPS initially set to the Encoder */
+OMX_U32 nFrameCounter = 0; /* Number of input frames recieved since last framerate calculation */
+OMX_TICKS nVideoTime = 0; /* Video duration since last framerate calculation */
+OMX_TICKS nLastFrameRateUpdateTime = 0; /*Time stamp at last frame rate update */
+
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+/* Opaque color format requires below quirks to be enabled
+ * ENABLE_GRALLOC_BUFFER
+ * ANDROID_QUIRCK_CHANGE_PORT_VALUES
+ */
+#define OMX_VC1VE_NUM_INTERNAL_BUF (8)
+#define HAL_PIXEL_FORMAT_TI_NV12 (0x100)
+
+#define COLORCONVERT_MAX_SUB_BUFFERS (3)
+
+#define COLORCONVERT_BUFTYPE_VIRTUAL (0x0)
+#define COLORCONVERT_BUFTYPE_ION (0x1)
+#define COLORCONVERT_BUFTYPE_GRALLOCOPAQUE (0x2)
+
+int COLORCONVERT_open(void * *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC, void *pSrc[],
+ void *pDst[], int nWidth,
+ int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType);
+int COLORCONVERT_close(void *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv);
+static int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride);
+static OMX_ERRORTYPE LOCAL_PROXY_VC1E_AllocateBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_INOUT OMX_BUFFERHEADERTYPE * *ppBufferHdr, OMX_IN OMX_U32 nPortIndex,
+ OMX_IN OMX_PTR pAppPrivate, OMX_IN OMX_U32 nSizeBytes);
+
+static OMX_ERRORTYPE LOCAL_PROXY_VC1E_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr);
+
+static OMX_ERRORTYPE LOCAL_PROXY_VC1E_ComponentDeInit(OMX_HANDLETYPE hComponent);
+
+RPC_OMX_ERRORTYPE RPC_RegisterBuffer(OMX_HANDLETYPE hRPCCtx, int fd,
+ OMX_PTR *handle1, OMX_PTR *handle2,
+ PROXY_BUFFER_TYPE proxyBufferType);
+RPC_OMX_ERRORTYPE RPC_UnRegisterBuffer(OMX_HANDLETYPE hRPCCtx, OMX_PTR handle);
+#endif
+
+
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType);
+
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr);
+
+/* ===========================================================================*/
+/**
+ * @name OMX_ConfigureDynamicFrameRate()
+ * @brief This function is used to dynamically change
+ the frame rate of the encoder to obtain target frame rate.
+ * @param hComponent : pointer to the OMX Component.
+ * @param pBufferHdr : buffer header to be configured.
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+static OMX_ERRORTYPE OMX_ConfigureDynamicFrameRate(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U32 nTargetFrameRate = 0; /* Target Frame Rate to be provided to Encoder */
+ OMX_U32 nCurrentFrameRate = 0; /* Current Frame Rate currently set in Encoder */
+ OMX_CONFIG_FRAMERATETYPE tFrameRate;
+ OMX_COMPONENTTYPE *pHandle;
+
+ DOMX_ENTER("%s hComponent = %p, pBufferHdr = %p", __FUNCTION__, hComponent, pBufferHdr);
+
+ if( hComponent == NULL ) {
+ DOMX_ERROR("Component is invalid/ not present ");
+ eError = OMX_ErrorBadParameter;
+ goto EXIT;
+ }
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+
+ /* Initialise the OMX structures */
+ OMX_INIT_STRUCT(tFrameRate, OMX_CONFIG_FRAMERATETYPE);
+
+ /* Intialise nLastFrameRateUpdateTime for the 1st frame */
+ if((!nFrameCounter) && (!nLastFrameRateUpdateTime)) {
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ }
+
+ /* Increment the Frame Counter and Calculate Frame Rate*/
+ nFrameCounter++;
+ nVideoTime = pBufferHdr->nTimeStamp - nLastFrameRateUpdateTime;
+
+ if( nVideoTime < 0 ) {
+ eError = OMX_ErrorBadParameter;
+ goto EXIT;
+ }
+
+ /*Get Port Frame Rate if not read yet*/
+ if( !nFrameRateThreshold ) {
+ tFrameRate.nPortIndex = OMX_VC1E_INPUT_PORT; /* As per ducati support-set for input port */
+
+ /* Read Current FrameRate */
+ eError = pHandle->GetConfig(hComponent, OMX_IndexConfigVideoFramerate, &tFrameRate);
+ if( eError != OMX_ErrorNone ) {
+ DOMX_ERROR("pHandle->GetConfig OMX_IndexConfigVideoFramerate eError :0x%x \n", eError);
+ }
+ nFrameRateThreshold = tFrameRate.xEncodeFramerate >> 16;
+ nPortFrameRate = nFrameRateThreshold;
+ DOMX_DEBUG(" Port Frame Rate is %d ", nPortFrameRate);
+ }
+ nCurrentFrameRate = nFrameRateThreshold;
+
+ /* If Number of frames is less than the Threshold
+ * Frame Rate udpate is not necessary
+ */
+ if( nFrameCounter < nFrameRateThreshold ) {
+ DOMX_EXIT(" Threshold not reached, no update necessary");
+ eError = OMX_ErrorNone;
+ goto EXIT;
+ }
+
+ /*Calculate the new target Frame Rate*/
+ if( nVideoTime != 0 ) {
+ nTargetFrameRate = nFrameCounter * OMX_TICKS_PER_SECOND / nVideoTime;
+ }
+
+ /* For 1080p record, max FPS supported by Codec for advanced profile is 30.
+ * When Dynamic Frame Rate is enabled, there might be scenario when FPS
+ * calculated is more than 30. Hence adding the check so that Dynamic Frame
+ * Rate set is never greater than the port FPS initially set.
+ */
+ if( nTargetFrameRate > nPortFrameRate ) {
+ DOMX_DEBUG("Frame Rate Calculated is more than initial port set Frame Rate");
+ nTargetFrameRate = nPortFrameRate;
+ }
+
+ /* Difference in Frame Rate is more than Threshold - Only then update Frame Rate*/
+ if((((OMX_S32)nTargetFrameRate) - ((OMX_S32) nCurrentFrameRate) >= FRAME_RATE_THRESHOLD) ||
+ (((OMX_S32) nCurrentFrameRate) - ((OMX_S32)nTargetFrameRate) >= FRAME_RATE_THRESHOLD)) {
+
+ /* Now Send the new Frame Rate */
+ tFrameRate.nPortIndex = OMX_VC1E_INPUT_PORT; /* As per ducati support-set for input port */
+ tFrameRate.xEncodeFramerate = (OMX_U32)(nTargetFrameRate * (1 << 16));
+ eError = pHandle->SetConfig(hComponent, OMX_IndexConfigVideoFramerate, &tFrameRate);
+ if( eError != OMX_ErrorNone ) {
+ DOMX_ERROR(" Error while configuring Dynamic Frame Rate,Error info = %d", eError);
+ goto EXIT;
+ } else {
+ DOMX_DEBUG("Dynamic Frame Rate configuration successful \n");
+ }
+ nFrameRateThreshold = nTargetFrameRate; /*Update the threshold */
+ }
+
+ /* reset all params */
+ nFrameCounter = 0;
+ nVideoTime = 0;
+ nLastFrameRateUpdateTime = pBufferHdr->nTimeStamp;
+ eError = OMX_ErrorNone;
+
+EXIT:
+ DOMX_EXIT("%s eError: %d", __FUNCTION__, eError);
+ return (eError);
+}
+
+static OMX_ERRORTYPE ComponentPrivateEmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ PROXY_assert(hComponent != NULL, OMX_ErrorInsufficientResources,"Null component handle received in EmptyThisBuffer");
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ PROXY_assert(pCompPrv != NULL, OMX_ErrorInsufficientResources,"Pointer to Null component private structure received in EmptyThisBuffer");
+ if(pCompPrv->proxyPortBuffers[0].proxyBufferType == EncoderMetadataPointers) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ if(pTempBuffer == NULL) {
+ eError = OMX_ErrorBadParameter;
+ DOMX_ERROR("Null meta data buffer supplied - Cannot find metadata type");
+ goto EXIT;
+ }
+ nMetadataBufferType = *pTempBuffer;
+ if(nMetadataBufferType == kMetadataBufferTypeCameraSource) {
+ eError = OMX_ConfigureDynamicFrameRate(hComponent, pBufferHdr);
+ if( eError != OMX_ErrorNone)
+ DOMX_ERROR(" Error while configuring FrameRate Dynamically.Error info = %d - Non Fatal Error",eError);
+ }
+ }
+
+ DOMX_DEBUG("Redirection from ComponentPricateEmptyThisBuffer to PROXY_EmptyThisBuffer");
+EXIT:
+ if( eError != OMX_ErrorNone) {
+ DOMX_EXIT("%s: exiting with error 0x%x - Non Fatal",__FUNCTION__,eError);
+ } else {
+ DOMX_EXIT("%s: dynamic frame rate config successful",__FUNCTION__);
+ }
+ return (LOCAL_PROXY_VC1E_EmptyThisBuffer(hComponent, pBufferHdr));
+}
+
+/* ===========================================================================*/
+/**
+ * @name OMX_ComponentInit()
+ * @brief This function is used to
+ * Initializes the Component Specific Datastructures
+ * @param hComponent : pointer to the OMX Component.
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE OMX_ComponentInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *pHandle = NULL;
+ PROXY_COMPONENT_PRIVATE *pComponentPrivate = NULL;
+
+ pHandle = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_TI_PARAM_ENHANCEDPORTRECONFIG tParamStruct;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+ char value[OMX_MAX_STRINGNAME_SIZE];
+ OMX_U32 mEnableVFR = 1; /* Flag used to enable/disable VFR for Encoder */
+ property_get("debug.vfr.enable", value, " 1");
+ mEnableVFR = atoi(value);
+
+ DOMX_ENTER("");
+
+ DOMX_DEBUG("Component name provided is %s", COMPONENT_NAME);
+
+ pHandle->pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(PROXY_COMPONENT_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pHandle->pComponentPrivate != NULL,
+ OMX_ErrorInsufficientResources,
+ "ERROR IN ALLOCATING PROXY COMPONENT PRIVATE STRUCTURE");
+
+ pComponentPrivate =
+ (PROXY_COMPONENT_PRIVATE *) pHandle->pComponentPrivate;
+
+ TIMM_OSAL_Memset(pComponentPrivate, 0,
+ sizeof(PROXY_COMPONENT_PRIVATE));
+
+ pComponentPrivate->cCompName =
+ TIMM_OSAL_Malloc(MAX_COMPONENT_NAME_LENGTH * sizeof(OMX_U8),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->cCompName != NULL,
+ OMX_ErrorInsufficientResources,
+ " Error in Allocating space for proxy component table");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pComponentPrivate->pCompProxyPrv =
+ (OMX_PROXY_ENCODER_PRIVATE *)
+ TIMM_OSAL_Malloc(sizeof(OMX_PROXY_ENCODER_PRIVATE), TIMM_OSAL_TRUE,
+ 0, TIMMOSAL_MEM_SEGMENT_INT);
+
+ PROXY_assert(pComponentPrivate->pCompProxyPrv != NULL,
+ OMX_ErrorInsufficientResources,
+ " Could not allocate proxy component private");
+
+ TIMM_OSAL_Memset(pComponentPrivate->pCompProxyPrv, 0,
+ sizeof(OMX_PROXY_ENCODER_PRIVATE));
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pComponentPrivate->pCompProxyPrv;
+
+ /* Create Pipe of for encoder input buffers */
+ eOSALStatus = TIMM_OSAL_CreatePipe(&pProxy->hBufPipe, sizeof(OMX_U32),
+ OMX_VC1VE_NUM_INTERNAL_BUF, 1);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE,
+ OMX_ErrorInsufficientResources,
+ "Pipe creation failed");
+#endif
+
+ // Copying component Name - this will be picked up in the proxy common
+ PROXY_assert(strlen(COMPONENT_NAME) + 1 < MAX_COMPONENT_NAME_LENGTH,
+ OMX_ErrorInvalidComponentName,
+ "Length of component name is longer than the max allowed");
+ TIMM_OSAL_Memcpy(pComponentPrivate->cCompName, COMPONENT_NAME,
+ strlen(COMPONENT_NAME) + 1);
+
+ eError = OMX_ProxyCommonInit(hComponent); // Calling Proxy Common Init()
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+ pHandle->SetParameter = LOCAL_PROXY_VC1E_SetParameter;
+ pHandle->GetParameter = LOCAL_PROXY_VC1E_GetParameter;
+#endif
+ pComponentPrivate->IsLoadedState = OMX_TRUE;
+ pHandle->EmptyThisBuffer = LOCAL_PROXY_VC1E_EmptyThisBuffer;
+ pHandle->GetExtensionIndex = LOCAL_PROXY_VC1E_GetExtensionIndex;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pHandle->ComponentDeInit = LOCAL_PROXY_VC1E_ComponentDeInit;
+ pHandle->FreeBuffer = LOCAL_PROXY_VC1E_FreeBuffer;
+ pHandle->AllocateBuffer = LOCAL_PROXY_VC1E_AllocateBuffer;
+#endif
+
+ if( mEnableVFR ) {
+ pHandle->EmptyThisBuffer = ComponentPrivateEmptyThisBuffer;
+ }
+
+EXIT:
+ if( eError != OMX_ErrorNone ) {
+ DOMX_DEBUG("Error in Initializing Proxy");
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->hBufPipe != NULL ) {
+ TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+ }
+
+ if( pComponentPrivate->pCompProxyPrv != NULL ) {
+ TIMM_OSAL_Free(pComponentPrivate->pCompProxyPrv);
+ pComponentPrivate->pCompProxyPrv = NULL;
+ pProxy = NULL;
+ }
+#endif
+ if( pComponentPrivate->cCompName != NULL ) {
+ TIMM_OSAL_Free(pComponentPrivate->cCompName);
+ pComponentPrivate->cCompName = NULL;
+ }
+ if( pComponentPrivate != NULL ) {
+ TIMM_OSAL_Free(pComponentPrivate);
+ pComponentPrivate = NULL;
+ }
+ }
+ return (eError);
+}
+
+#ifdef ANDROID_QUIRK_CHANGE_PORT_VALUES
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_VC1E_GetParameter()
+ * @brief This fuction sends the parameter stucture to the component to
+ * get the values of requested parameter by application.
+ * @param [in] hComponent : pointer to the OMX Component.
+ * @param [in] nParamIndex : Index of the parameter to get
+ * @param [in] pParamStruct: pointer to the paramter structure
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_GetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_INOUT OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE *pPortParam = NULL;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_assert((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+
+ if( nParamIndex == OMX_IndexParamPortDefinition ) {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if( pPortDef->format.video.eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar ) {
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->bAndroidOpaqueFormat == OMX_TRUE ) {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ } else
+#endif
+ {
+ pPortDef->format.video.eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+ }
+
+ if( pPortDef->nPortIndex == OMX_VC1E_INPUT_PORT ) {
+ if( pCompPrv->proxyPortBuffers[OMX_VC1E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers ) {
+ pPortDef->nBufferSize = sizeof(video_metadata_t);
+ }
+ }
+ } else if( nParamIndex == OMX_IndexParamVideoPortFormat ) {
+ pPortParam = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if((eError == OMX_ErrorNone) &&
+ (pPortParam->eColorFormat == OMX_COLOR_FormatYUV420PackedSemiPlanar)) {
+ pPortParam->eColorFormat = OMX_TI_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if((eError == OMX_ErrorNoMore) &&
+ (pPortParam->nIndex == 1)) {
+ /* HACK:Remote OMX-VC1E supports only 1 color format (index 0). The
+ * OMX_COLOR_FormatAndroidOpaque is supported only at the proxy.
+ * Call GetParameter() to fill in defaults for parameters and
+ * override color format and index for the additional
+ * OMX_COLOR_FormatAndroidOpaque support*/
+ pPortParam->nIndex = 0;
+ eError = PROXY_GetParameter(hComponent, nParamIndex, pParamStruct);
+ pPortParam->nIndex = 1;
+ pPortParam->eColorFormat = OMX_COLOR_FormatAndroidOpaque;
+ eError = OMX_ErrorNone;
+ }
+#endif
+ } else if( nParamIndex == OMX_TI_IndexComponentHandle ) {
+ OMX_TI_COMPONENT_HANDLE *pCompHandle = pParamStruct;
+ pCompHandle->pHandle = hComponent;
+ eError = OMX_ErrorNone;
+ }
+
+ PROXY_assert((eError == OMX_ErrorNone) || (eError == OMX_ErrorNoMore),
+ eError, " Error in Proxy GetParameter");
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_VC1E_SetParameter()
+ * @brief This fuction sends the parameter stucture to the component to
+ * set the values as as requested by application.
+ * @param [in] hComponent : pointer to the OMX Component.
+ * @param [in] nIndex : Index of the parameter to be set
+ * @param [in] pParamStruct: pointer to the parameter structure to be set
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_SetParameter(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_INDEXTYPE nParamIndex, OMX_IN OMX_PTR pParamStruct)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
+ OMX_VIDEO_PARAM_PORTFORMATTYPE *pPortParams = NULL;
+ OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *pStoreMetaData = NULL;
+ OMX_TI_PARAM_BUFFERPREANNOUNCE tParamSetNPA;
+ OMX_PARAM_PORTDEFINITIONTYPE sPortDef;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+#endif
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nParamIndex = %d, pParamStruct = %p",
+ hComponent, pCompPrv, nParamIndex, pParamStruct);
+
+ PROXY_require((pParamStruct != NULL), OMX_ErrorBadParameter, NULL);
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ if( nParamIndex == OMX_IndexParamPortDefinition ) {
+ pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pParamStruct;
+
+ if( pPortDef->format.video.eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar ) {
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if( pPortDef->format.video.eColorFormat == OMX_COLOR_FormatAndroidOpaque ) {
+ if( COLORCONVERT_open(&pProxy->hCC, pCompPrv) != 0 ) {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortDef->format.video.eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ } else if( nParamIndex == OMX_IndexParamVideoPortFormat ) {
+ pPortParams = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pParamStruct;
+
+ if( pPortParams->eColorFormat == OMX_TI_COLOR_FormatYUV420PackedSemiPlanar ) {
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ else if( pPortParams->eColorFormat == OMX_COLOR_FormatAndroidOpaque ) {
+ if( COLORCONVERT_open(&pProxy->hCC, pCompPrv) != 0 ) {
+ PROXY_assert(0, OMX_ErrorInsufficientResources,
+ "Failed to open Color converting service");
+ }
+ pProxy->bAndroidOpaqueFormat = OMX_TRUE;
+ pPortParams->eColorFormat = OMX_COLOR_FormatYUV420PackedSemiPlanar;
+ }
+#endif
+ } else if( nParamIndex == (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers ) {
+ pStoreMetaData = (OMX_VIDEO_STOREMETADATAINBUFFERSPARAMS *) pParamStruct;
+
+ DOMX_DEBUG("Moving to Metadatamode");
+ if( pStoreMetaData->nPortIndex == OMX_VC1E_INPUT_PORT && pStoreMetaData->bStoreMetaData == OMX_TRUE ) {
+ OMX_INIT_STRUCT(tParamSetNPA, OMX_TI_PARAM_BUFFERPREANNOUNCE);
+ tParamSetNPA.nPortIndex = OMX_VC1E_INPUT_PORT;
+ tParamSetNPA.bEnabled = OMX_FALSE;
+ //Call NPA on OMX encoder on ducati.
+ PROXY_SetParameter(hComponent, OMX_TI_IndexParamBufferPreAnnouncement, &tParamSetNPA);
+ pCompPrv->proxyPortBuffers[pStoreMetaData->nPortIndex].proxyBufferType = EncoderMetadataPointers;
+ DOMX_DEBUG("Moving to Metadatamode done");
+
+ /*Initializing Structure */
+ OMX_INIT_STRUCT(sPortDef, OMX_PARAM_PORTDEFINITIONTYPE);
+ sPortDef.nPortIndex = OMX_VC1E_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy GetParameter for Port Def");
+
+ sPortDef.format.video.nStride = LINUX_PAGE_SIZE;
+
+ eError = PROXY_SetParameter(hComponent, OMX_IndexParamPortDefinition, &sPortDef);
+
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy SetParameter for Port Def");
+ }
+ goto EXIT;
+ }
+
+ eError = PROXY_SetParameter(hComponent, nParamIndex, pParamStruct);
+ PROXY_assert(eError == OMX_ErrorNone,
+ eError, " Error in Proxy SetParameter");
+
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return (eError);
+}
+
+#endif
+
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_GetExtensionIndex()
+ * @brief This function is used to return the
+ * extended index value based on a string parameter
+ * @param [in] hComponent : pointer to the OMX Component.
+ * @param [in] cParameterName : Name of Parameter
+ * @param [out] pIndexType : Index Type to be returned
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_GetExtensionIndex(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_STRING cParameterName, OMX_OUT OMX_INDEXTYPE *pIndexType)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = hComponent;
+
+ PROXY_require((hComp->pComponentPrivate != NULL),
+ OMX_ErrorBadParameter, NULL);
+ PROXY_require(cParameterName != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(pIndexType != NULL, OMX_ErrorBadParameter, NULL);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+
+ DOMX_ENTER("%s hComponent = %p, pCompPrv = %p, cParameterName = %s",
+ __FUNCTION__, hComponent, pCompPrv, cParameterName);
+
+ // Check for NULL Parameters
+ PROXY_require((cParameterName != NULL && pIndexType != NULL),
+ OMX_ErrorBadParameter, NULL);
+
+ // Ensure that String length is not greater than Max allowed length
+ PROXY_require(strlen(cParameterName) <= 127, OMX_ErrorBadParameter, NULL);
+
+ if( strcmp(cParameterName, "OMX.google.android.index.storeMetaDataInBuffers") == 0 ) {
+ // If Index type is 2D Buffer Allocated Dimension
+ *pIndexType = (OMX_INDEXTYPE) OMX_TI_IndexEncoderStoreMetadatInBuffers;
+ goto EXIT;
+ }
+
+ eError = PROXY_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+
+EXIT:
+ DOMX_EXIT("%s eError: %d", __FUNCTION__, eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_VC1E_EmptyThisBuffer()
+ * @brief This function is used to send the input frame to the OMX encoder
+ * component for processing.
+ * @param hComponent : pointer to the OMX Component.
+ * @param pBufferHdr : header of buffer to be read.
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_EmptyThisBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PTR pBufferOrig = NULL;
+ OMX_U32 nStride = 0, nNumLines = 0;
+ OMX_PARAM_PORTDEFINITIONTYPE tParamStruct;
+ OMX_U32 nFilledLen, nAllocLen;
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 nBufIndex = 0, nSize=0, nRet=0;
+#endif
+#ifdef ENABLE_GRALLOC_BUFFER
+ OMX_PTR pAuxBuf0 = NULL, pAuxBuf1 = NULL;
+ RPC_OMX_ERRORTYPE eRPCError = RPC_OMX_ErrorNone;
+ OMX_ERRORTYPE eCompReturn = OMX_ErrorNone;
+ IMG_native_handle_t *pGrallocHandle=NULL;
+#endif
+
+ DOMX_ENTER("%s hComponent = %p, pBufferHdr = %p", __FUNCTION__, hComponent, pBufferHdr);
+
+ PROXY_require(pBufferHdr != NULL, OMX_ErrorBadParameter, NULL);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ PROXY_CHK_VERSION(pBufferHdr, OMX_BUFFERHEADERTYPE);
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+#endif
+
+ OMX_INIT_STRUCT(tParamStruct, OMX_PARAM_PORTDEFINITIONTYPE);
+ tParamStruct.nPortIndex = OMX_VC1E_INPUT_PORT;
+
+ eError = PROXY_GetParameter(hComponent, OMX_IndexParamPortDefinition, &tParamStruct);
+ PROXY_require(eError == OMX_ErrorNone, OMX_ErrorBadParameter, "Error is Get Parameter for port def");
+ nFilledLen = pBufferHdr->nFilledLen;
+ nAllocLen = pBufferHdr->nAllocLen;
+ if( nFilledLen != 0 ) {
+ pBufferHdr->nFilledLen = tParamStruct.nBufferSize;
+ }
+ pBufferHdr->nAllocLen = tParamStruct.nBufferSize;
+
+ DOMX_DEBUG
+ ("%s hComponent=%p, pCompPrv=%p, nFilledLen=%d, nOffset=%d, nFlags=%08x",
+ __FUNCTION__, hComponent, pCompPrv, pBufferHdr->nFilledLen,
+ pBufferHdr->nOffset, pBufferHdr->nFlags);
+
+ if( pCompPrv->proxyPortBuffers[OMX_VC1E_INPUT_PORT].proxyBufferType == EncoderMetadataPointers ) {
+ OMX_U32 *pTempBuffer;
+ OMX_U32 nMetadataBufferType;
+ DOMX_DEBUG("Passing meta data to encoder");
+
+ pBufferOrig = pBufferHdr->pBuffer;
+
+ pTempBuffer = (OMX_U32 *) (pBufferHdr->pBuffer);
+ nMetadataBufferType = *pTempBuffer;
+
+ if( nMetadataBufferType == kMetadataBufferTypeCameraSource ) {
+#ifdef ENABLE_GRALLOC_BUFFER
+ video_metadata_t *pVideoMetadataBuffer;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeCameraSource");
+
+ pVideoMetadataBuffer = (video_metadata_t *) ((OMX_U32 *)(pBufferHdr->pBuffer));
+ pGrallocHandle = (IMG_native_handle_t *) (pVideoMetadataBuffer->handle);
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x", pGrallocHandle);
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while((unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+
+ pBufferHdr->nOffset = pVideoMetadataBuffer->offset;
+#endif
+ } else if( nMetadataBufferType == kMetadataBufferTypeGrallocSource ) {
+#ifdef ENABLE_GRALLOC_BUFFER
+ buffer_handle_t tBufHandle;
+ DOMX_DEBUG("MetadataBufferType is kMetadataBufferTypeGrallocSource");
+
+ pTempBuffer++;
+ tBufHandle = *((buffer_handle_t *)pTempBuffer);
+ pGrallocHandle = (IMG_native_handle_t *) tBufHandle;
+ DOMX_DEBUG("Grallloc buffer recieved in metadata buffer 0x%x", pGrallocHandle);
+ if( pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 && pProxy->gralloc_handle[0] == NULL ) {
+ DOMX_DEBUG("Allocating NV12 buffers internally within DOMX actual count: %d", pCompPrv->nAllocatedBuffers);
+ pProxy->nCurBufIndex = 0;
+
+ while((unsigned) pProxy->nCurBufIndex < pCompPrv->nAllocatedBuffers ) {
+ eError = COLORCONVERT_AllocateBuffer(hComponent, nStride);
+ PROXY_require(eError == OMX_ErrorNone, eError, "Error allocating buffers for color conversion");
+ pProxy->nCurBufIndex++;
+ }
+ }
+
+ pBufferHdr->pBuffer = (OMX_U8 *)(pGrallocHandle->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->
+ pAuxBuf1 = (OMX_PTR) pGrallocHandle->fd[1];
+ DOMX_DEBUG("%s Gralloc=0x%x, Y-fd=%d, UV-fd=%d", __FUNCTION__, pGrallocHandle,
+ pGrallocHandle->fd[0], pGrallocHandle->fd[1]);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->bAndroidOpaqueFormat && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12 ) {
+ /* Dequeue NV12 buffer for encoder */
+ eOSALStatus = TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)(&nSize),
+ TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, NULL);
+
+ if( nFilledLen != 0 ) {
+ /* Get NV12 data after colorconv*/
+ nRet = COLORCONVERT_PlatformOpaqueToNV12(pProxy->hCC, (void * *) &pGrallocHandle, (void * *) &pProxy->gralloc_handle[nBufIndex],
+ pGrallocHandle->iWidth,
+ pGrallocHandle->iHeight,
+ 4096, COLORCONVERT_BUFTYPE_GRALLOCOPAQUE,
+ COLORCONVERT_BUFTYPE_GRALLOCOPAQUE);
+
+ if( nRet != 0 ) {
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(0, OMX_ErrorBadParameter, "Color conversion routine failed");
+ }
+ }
+
+ /* Update pBufferHdr with NV12 buffers for OMX component */
+ pBufferHdr->pBuffer= (OMX_U8 *)(pProxy->gralloc_handle[nBufIndex]->fd[0]);
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = (OMX_PTR)(pProxy->gralloc_handle[nBufIndex]->fd[1]);
+ }
+#endif
+#endif
+ } else {
+ DOMX_ERROR("MetadataBufferType is unknow. Returning 'OMX_ErrorBadParameter'");
+ eError = OMX_ErrorBadParameter;
+ goto EXIT; //need to restore lenght fields in pBufferHdr
+ }
+#ifdef ENABLE_GRALLOC_BUFFER
+ eRPCError = RPC_RegisterBuffer(pCompPrv->hRemoteComp, pBufferHdr->pBuffer,
+ &pAuxBuf0, &pAuxBuf1,
+ GrallocPointers);
+ PROXY_checkRpcError();
+ if( pAuxBuf0 ) {
+ pBufferHdr->pBuffer = pAuxBuf0;
+ }
+ if( pAuxBuf1 ) {
+ ((OMX_TI_PLATFORMPRIVATE *) pBufferHdr->pPlatformPrivate)->pAuxBuf1 = pAuxBuf1;
+ }
+#endif
+ }
+
+ eError = PROXY_EmptyThisBuffer(hComponent, pBufferHdr);
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+ if( pProxy->bAndroidOpaqueFormat
+#ifdef ENABLE_GRALLOC_BUFFER
+ && pGrallocHandle != NULL && pGrallocHandle->iFormat != HAL_PIXEL_FORMAT_TI_NV12
+#endif
+ ) {
+ /*Write buffer to end of pipe for re-circulation for future ETB()*/
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &nBufIndex,
+ sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+ }
+#endif
+
+EXIT:
+ if( pBufferHdr != NULL && pCompPrv->proxyPortBuffers[pBufferHdr->nInputPortIndex].proxyBufferType == EncoderMetadataPointers ) {
+ pBufferHdr->pBuffer = pBufferOrig;
+ pBufferHdr->nFilledLen = nFilledLen;
+ pBufferHdr->nAllocLen = nAllocLen;
+#ifdef ENABLE_GRALLOC_BUFFER
+ RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pAuxBuf0);
+ RPC_UnRegisterBuffer(pCompPrv->hRemoteComp, pAuxBuf1);
+#endif
+ }
+ DOMX_EXIT("%s eError: %d", __FUNCTION__, eError);
+ return (eError);
+}
+
+#ifdef ANDROID_CUSTOM_OPAQUECOLORFORMAT
+/* ===========================================================================*/
+/**
+ * @name LOCAL_PROXY_VC1E_AllocateBuffer()
+ * @brief
+ * @param hComponent : pointer to the OMX Component.
+ * @param nPortIndex : port where buffer need to be allocated.
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+static OMX_ERRORTYPE LOCAL_PROXY_VC1E_AllocateBuffer(OMX_HANDLETYPE hComponent,
+ OMX_BUFFERHEADERTYPE * *ppBufferHdr, OMX_U32 nPortIndex,
+ OMX_PTR pAppPrivate, OMX_U32 nSizeBytes)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ int err, nStride;
+
+ DOMX_ENTER
+ ("hComponent = %p, pCompPrv = %p, nPortIndex = %d, pAppPrivate = %p ,nSizeBytes = %d",
+ hComponent, pCompPrv, nPortIndex, pAppPrivate, nSizeBytes);
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+
+ eError = PROXY_AllocateBuffer(hComponent, ppBufferHdr, nPortIndex,
+ pAppPrivate, nSizeBytes);
+EXIT:
+ DOMX_EXIT("%s eError: %d", __FUNCTION__, eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name LOCAL_PROXY_VC1E_FreeBuffer()
+ * @brief This function is used to free all the buffers that were allocated
+ * and sent to component though use_buffer call.
+ * @param hComponent : pointer to the OMX Component.
+ * @param nPortIndex : Port where buffer needs to be freed
+ * @param pBufferHdr : Buffer header
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+static OMX_ERRORTYPE LOCAL_PROXY_VC1E_FreeBuffer(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_U32 nPortIndex, OMX_IN OMX_BUFFERHEADERTYPE *pBufferHdr)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_U32 nBufIndex, nSize, nCount=0;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ DOMX_ENTER("%s hComponent = %p, nPortIndex = %d, pBufferHdr = %p",
+ __FUNCTION__, hComponent, nPortIndex, pBufferHdr);
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if((nPortIndex == OMX_VC1E_INPUT_PORT) &&
+ (pProxy->bAndroidOpaqueFormat) && (pProxy->gralloc_handle[0] != NULL)) {
+ pProxy->nCurBufIndex--;
+ PROXY_require(pProxy->nCurBufIndex >= 0,
+ OMX_ErrorBadParameter, "Buffer index underflow");
+
+ if( pProxy->gralloc_handle[pProxy->nCurBufIndex] ) {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[pProxy->nCurBufIndex]));
+ pProxy->gralloc_handle[pProxy->nCurBufIndex] = NULL;
+ }
+
+ /*Clear the Bufindex pipe by dummy reads*/
+ TIMM_OSAL_GetPipeReadyMessageCount(pProxy->hBufPipe, (TIMM_OSAL_U32 *)&nCount);
+ if( nCount ) {
+ TIMM_OSAL_ReadFromPipe(pProxy->hBufPipe, &nBufIndex,
+ sizeof(OMX_PTR), (TIMM_OSAL_U32 *)&nSize, TIMM_OSAL_NO_SUSPEND);
+ }
+ }
+
+ eError = PROXY_FreeBuffer(hComponent, nPortIndex, pBufferHdr);
+
+EXIT:
+ DOMX_EXIT("%s eError: %d", __FUNCTION__, eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name COLORCONVERT_AllocateBuffer()
+ * @brief Allocating gralloc buffers for color conversion
+ * @param hComponent : pointer to the OMX Component.
+ * @param nStride : Stride of the frame.
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+int COLORCONVERT_AllocateBuffer(OMX_HANDLETYPE hComponent, OMX_U32 nStride)
+{
+ OMX_CONFIG_RECTTYPE tParam;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 err;
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ OMX_INIT_STRUCT(tParam, OMX_CONFIG_RECTTYPE);
+ tParam.nPortIndex = OMX_VC1E_INPUT_PORT;
+ eError = PROXY_GetParameter(hComponent, (OMX_INDEXTYPE)OMX_TI_IndexParam2DBufferAllocDimension, &tParam);
+ PROXY_assert(eError == OMX_ErrorNone, eError, " Error in Proxy GetParameter");
+ err = pProxy->mAllocDev->alloc(pProxy->mAllocDev, (int) tParam.nWidth, (int) tParam.nHeight,
+ (int) HAL_PIXEL_FORMAT_TI_NV12, (int) GRALLOC_USAGE_HW_RENDER,
+ (const struct native_handle_t * *)(&(pProxy->gralloc_handle[pProxy->nCurBufIndex])), (int *) &nStride);
+ PROXY_assert(!err, err, " Error in allocating Gralloc buffers");
+ eOSALStatus = TIMM_OSAL_WriteToPipe(pProxy->hBufPipe, (void *) &pProxy->nCurBufIndex, sizeof(OMX_U32), TIMM_OSAL_SUSPEND);
+ PROXY_assert(eOSALStatus == TIMM_OSAL_ERR_NONE, OMX_ErrorBadParameter, "Pipe write failed");
+
+EXIT:
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name PROXY_VC1E_ComponentDeInit()
+ * @brief This function is used as a proxy to deinitalize the component which
+ * means to free any resources allocated at component
+ * @param hComponent : pointer to the OMX Component.
+ * @return OMX_ErrorNone = Successful
+ *
+ */
+/* ===========================================================================*/
+OMX_ERRORTYPE LOCAL_PROXY_VC1E_ComponentDeInit(OMX_HANDLETYPE hComponent)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ PROXY_COMPONENT_PRIVATE *pCompPrv;
+ OMX_COMPONENTTYPE *hComp = (OMX_COMPONENTTYPE *) hComponent;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+ TIMM_OSAL_ERRORTYPE eOSALStatus = TIMM_OSAL_ERR_NONE;
+ OMX_U32 i;
+
+ DOMX_ENTER("%s hComponent = %p", __FUNCTION__, hComponent);
+
+ PROXY_require(hComp->pComponentPrivate != NULL, OMX_ErrorBadParameter,
+ NULL);
+ pCompPrv = (PROXY_COMPONENT_PRIVATE *) hComp->pComponentPrivate;
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+
+ if( pProxy->hBufPipe != NULL ) {
+ eOSALStatus = TIMM_OSAL_DeletePipe(pProxy->hBufPipe);
+ pProxy->hBufPipe = NULL;
+
+ if( eOSALStatus != TIMM_OSAL_ERR_NONE ) {
+ DOMX_ERROR("Pipe deletion failed");
+ }
+ }
+
+ if( pProxy->bAndroidOpaqueFormat == OMX_TRUE ) {
+ /* Cleanup internal buffers in pipe if not freed on FreeBuffer */
+ for( i=0; i < OMX_VC1VE_NUM_INTERNAL_BUF; i++ ) {
+ if( pProxy->gralloc_handle[i] ) {
+ pProxy->mAllocDev->free(pProxy->mAllocDev, (buffer_handle_t)(pProxy->gralloc_handle[i]));
+ pProxy->gralloc_handle[i] = NULL;
+ }
+ }
+
+ COLORCONVERT_close(pProxy->hCC, pCompPrv);
+ pProxy->bAndroidOpaqueFormat = OMX_FALSE;
+
+ if( pCompPrv->pCompProxyPrv != NULL ) {
+ TIMM_OSAL_Free(pCompPrv->pCompProxyPrv);
+ pCompPrv->pCompProxyPrv = NULL;
+ }
+ }
+
+ eError = PROXY_ComponentDeInit(hComponent);
+EXIT:
+ DOMX_EXIT("eError: %d", eError);
+ return (eError);
+}
+
+/* ===========================================================================*/
+/**
+ * @name COLORCONVERT_open()
+ * @brief This function opens the color conversion module.
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+int COLORCONVERT_open(void * *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ int nErr = -1;
+ hw_module_t const *module = NULL;
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ nErr = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+
+ if( nErr == 0 ) {
+ *hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
+ } else {
+ DOMX_ERROR("FATAL: gralloc api hw_get_module() returned error: Can't find \
+ %s module err = %x", GRALLOC_HARDWARE_MODULE_ID, nErr);
+ }
+
+ gralloc_open(module, &(pProxy->mAllocDev));
+
+ return (nErr);
+}
+
+/* ===========================================================================*/
+/**
+ * @name COLORCONVERT_PlatformOpaqueToNV12()
+ * @brief This function is used to get NV12 data after color conversion
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+int COLORCONVERT_PlatformOpaqueToNV12(void *hCC,
+ void *pSrc[COLORCONVERT_MAX_SUB_BUFFERS],
+ void *pDst[COLORCONVERT_MAX_SUB_BUFFERS],
+ int nWidth, int nHeight, int nStride,
+ int nSrcBufType, int nDstBufType)
+{
+ IMG_gralloc_module_public_t const *module = hCC;
+ int nErr = -1;
+
+ if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_VIRTUAL)) {
+ nErr = module->Blit(module, pSrc[0], pDst, HAL_PIXEL_FORMAT_TI_NV12);
+ } else if((nSrcBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE) && (nDstBufType == COLORCONVERT_BUFTYPE_GRALLOCOPAQUE)) {
+ nErr = module->Blit2(module, pSrc[0], pDst[0], nWidth, nHeight, 0, 0);
+ }
+
+ return (nErr);
+}
+
+/* ===========================================================================*/
+/**
+ * @name COLORCONVERT_open()
+ * @brief This function closes the color conversion module.
+ * @param void
+ * @return OMX_ErrorNone = Successful
+ * @sa TBD
+ *
+ */
+/* ===========================================================================*/
+int COLORCONVERT_close(void *hCC, PROXY_COMPONENT_PRIVATE *pCompPrv)
+{
+ OMX_PROXY_ENCODER_PRIVATE *pProxy = NULL;
+
+ pProxy = (OMX_PROXY_ENCODER_PRIVATE *) pCompPrv->pCompProxyPrv;
+ if( pProxy && pProxy->mAllocDev ) {
+ gralloc_close(pProxy->mAllocDev);
+ }
+ return (0);
+}
+
+#endif
diff --git a/domx/test/Makefile b/domx/test/Makefile
new file mode 100644
index 0000000..78c6f31
--- /dev/null
+++ b/domx/test/Makefile
@@ -0,0 +1,95 @@
+#
+# Copyright (C) Texas Instruments - http://www.ti.com/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME =
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE =
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE =
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE =
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = sample_proxy \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+
+
+
+
+# Search path for include files
+
+INCLUDES =
+
+# Libraries needed for linking.
+
+#ST_LIBS = omx_core omx_proxy_component mmplatform mm_osal domx
+#SH_LIBS = pthread rt utils procmgr ipc rcm notify
+#SH_LIBS += sysmgr sysmemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/target/lib
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
+
diff --git a/domx/test/sample_proxy/Makefile b/domx/test/sample_proxy/Makefile
new file mode 100644
index 0000000..02a3619
--- /dev/null
+++ b/domx/test/sample_proxy/Makefile
@@ -0,0 +1,98 @@
+#
+# Copyright (C) Texas Instruments - http://www.ti.com/
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# ----------------------------------------------------------------------------
+# Revision History
+#
+#
+# REF=ORG
+# Original version.
+# ----------------------------------------------------------------------------
+
+
+
+include $(PROJROOT)/make/start.mk
+
+# Do not change above "include" line(s)
+
+# Arguments to tools, will move to make system once finalized.
+
+CFLAGS =
+CDEFS =
+ifeq ($(BUILD),udeb)
+CDEFS += DEBUG
+endif
+CDEFS +=
+
+EXEC_ARGS =
+ST_LIB_ARGS =
+SH_LIB_ARGS =
+
+# Define this macro if target runs in kernel mode
+#__KERNEL__ = 1
+
+# Target name and extension
+# static library (ST_LIB): filename.a
+# shared library soname (SH_LIB): filename.so.maj_ver.min_ver
+# executable (EXEC) : filename.out
+
+TARGETNAME = sampletest
+
+
+# TARGETTYPE must be EXEC, ST_LIB or SH_LIB in upper case.
+
+TARGETTYPE = EXEC
+
+# install directory relative to the HOSTTARGET directory
+HOSTRELEASE = binaries
+
+# install directory relative to the root filesystem
+ROOTFSRELEASE = binaries
+
+# Folders in which gmake will run before building current target
+
+SUBMODULES = \
+
+# Filename must not begin with '.', '/' or '\'
+
+SOURCES = \
+test_sample_proxy.c
+
+
+
+# Search path for include files
+
+INCLUDES = \
+ $(PROJROOT)/omx_core/inc \
+ $(PROJROOT)/mm_osal/inc \
+ $(MEMMGRROOT)
+
+# Libraries needed for linking.
+
+ST_LIBS =
+#omx_core omx_proxy_component domx mm_osal
+SH_LIBS = pthread dl omx_core OMX.TI.DUCATI1.MISC.SAMPLE domx mm_osal timemmgr
+
+
+# Search path for library (and linker command) files.
+# Current folder and target folder are included by default.
+
+LIBINCLUDES = $(PROJROOT)/target/lib
+
+
+# Do not change below "include" line(s)
+
+include $(PROJROOT)/make/build.mk
+
diff --git a/domx/test/sample_proxy/test_sample_proxy.c b/domx/test/sample_proxy/test_sample_proxy.c
new file mode 100755
index 0000000..59830a9
--- /dev/null
+++ b/domx/test/sample_proxy/test_sample_proxy.c
@@ -0,0 +1,1222 @@
+/*
+ * Copyright (c) 2010, Texas Instruments Incorporated
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *
+ * * Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * * Neither the name of Texas Instruments Incorporated nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+ * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+ * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+ * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
+ * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#define COMPONENT_NAME "OMX.TI.DUCATI1.MISC.SAMPLE" // needs to be specific for every configuration wrapper
+#define OMX_SAMPLE_USEBUF OMX_TRUE
+
+/****************************************************************
+* INCLUDE FILES
+****************************************************************/
+/* ----- system and platform files ----------------------------*/
+#include <stdint.h>
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+/*-------program files ----------------------------------------*/
+#include <OMX_Core.h>
+#include <OMX_Component.h>
+#include "timm_osal_interfaces.h"
+
+
+#define OMX_SAMPLE_TILER_TEST
+
+#ifdef OMX_SAMPLE_TILER_TEST
+
+#include "memmgr.h"
+
+#endif
+
+
+#define OMX_SAMPLE_INPUT_PORT 0
+#define OMX_SAMPLE_OUTPUT_PORT 1
+
+#ifdef OMX_SAMPLE_TILER_TEST
+
+
+#define OMX_SAMPLE_IN_2DYHEIGHT 4
+#define OMX_SAMPLE_IN_2DYWIDTH 8
+#define OMX_SAMPLE_IN_2DUVHEIGHT 2
+#define OMX_SAMPLE_IN_2DUVWIDTH 4
+/*
+ #define STRIDE_8BIT (16 * 1024)
+ #define STRIDE_16BIT (32 * 1024)
+*/
+#define OMX_SAMPLE_IN_HEIGHT 6
+#define OMX_SAMPLE_IN_WIDTH 8
+
+#define STRIDE_LINUX (4 * 1024)
+
+#define OMX_SAMPLE_BUFFER_SIZE 48
+
+
+void Test_Util_Memcpy_1Dto2D(TIMM_OSAL_PTR pDst2D, TIMM_OSAL_PTR pSrc1D,
+ TIMM_OSAL_U32 nSize1D, TIMM_OSAL_U32 nHeight2D, TIMM_OSAL_U32 nWidth2D,
+ TIMM_OSAL_U32 nStride2D)
+{
+ TIMM_OSAL_U8 *pInBuffer;
+ TIMM_OSAL_U8 *pOutBuffer;
+ TIMM_OSAL_U32 nSizeLeft, i;
+
+ nSizeLeft = nSize1D;
+ pInBuffer = (TIMM_OSAL_U8 *) pSrc1D;
+ pOutBuffer = (TIMM_OSAL_U8 *) pDst2D;
+ //The lower limit is copied. If nSize1D < H*W then 1Dsize is copied else H*W is copied
+ for (i = 0; i < nHeight2D; i++)
+ {
+ if (nSizeLeft >= nWidth2D)
+ {
+ TIMM_OSAL_Memcpy(pOutBuffer, pInBuffer, nWidth2D);
+ } else
+ {
+ TIMM_OSAL_Memcpy(pOutBuffer, pInBuffer, nSizeLeft);
+ break;
+ }
+ nSizeLeft -= nWidth2D;
+ pInBuffer =
+ (TIMM_OSAL_U8 *) ((TIMM_OSAL_U32) pInBuffer + nWidth2D);
+ pOutBuffer =
+ (TIMM_OSAL_U8 *) ((TIMM_OSAL_U32) pOutBuffer + nStride2D);
+ }
+}
+
+#endif
+
+
+/****************************************************************
+* EXTERNAL REFERENCES NOTE : only use if not found in header file
+****************************************************************/
+/*--------data declarations -----------------------------------*/
+/*--------function prototypes ---------------------------------*/
+
+/****************************************************************
+* PRIVATE DECLARATIONS Defined and used only here
+****************************************************************/
+/*--------function declarations -------------------------------*/
+
+/*--------data declarations -----------------------------------*/
+#define NUM_DOMAINS 0x4
+#define OMX_NOPORT 0xfffffffe
+
+//#define INPUT_FILE "../../omx/omx_il_1_x/omx_base/test/patterns/chikita.mp3"
+#define INPUT_FILE "sample_input.mp3"
+#define NON_TUN_OUTPUT_FILE "nt_output.mp3"
+
+static int gTest = 1;
+
+#define TIMM_OSAL_MallocaBuffer(_size, bContigous, nBlockAlignment) \
+ TIMM_OSAL_Malloc (_size, TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_EXT)
+
+#define OMX_TEST_BUFFERS_OF_TRAFFIC 20
+
+#define OMX_TEST_BAIL_IF_ERROR(_eError) \
+ if(OMX_ErrorNone != (eError = _eError)){ \
+ goto OMX_TEST_BAIL; \
+ }
+
+#define OMX_TEST_SET_ERROR_BAIL(_eCode, _desc) \
+{ \
+ eError = _eCode; \
+ printf(_desc);\
+ goto OMX_TEST_BAIL; \
+}
+
+#define OMX_TEST_INIT_STRUCT(_s_, _name_) \
+ memset(&(_s_), 0x0, sizeof(_name_)); \
+ (_s_).nSize = sizeof(_name_); \
+ (_s_).nVersion.s.nVersionMajor = 0x1; \
+ (_s_).nVersion.s.nVersionMinor = 0x1; \
+ (_s_).nVersion.s.nRevision = 0x0; \
+ (_s_).nVersion.s.nStep = 0x0
+
+#define BUFFER_LIST_CLEAR_ENTRY(_pL, _pB)\
+ _pB = _pL->pBufHdr; \
+ _pL->pBufHdr = NULL; \
+ _pL = _pL->pNextBuf;
+
+#define BUFFER_LIST_SET_ENTRY(_pL, _pB) \
+{ \
+ BufferList *_pT = _pL; \
+ while(_pT && _pT->pBufHdr){ \
+ _pT = _pT->pNextBuf; \
+ } \
+ if(_pT) \
+ _pT->pBufHdr = _pB; \
+}
+
+#define BUFFERLIST_CLEAR_ENTRY(_pL, _pB)\
+ _pB = _pL->pBufHdr; \
+ _pL->pBufHdr = NULL; \
+ _pL = _pL->pNextBuf;
+
+typedef struct _BufferList BufferList;
+
+struct _BufferList
+{
+ OMX_BUFFERHEADERTYPE *pBufHdr;
+ OMX_BUFFERHEADERTYPE *pOrigBufHdr;
+ BufferList *pNextBuf;
+};
+
+typedef struct SampleCompTestCtxt
+{
+ OMX_HANDLETYPE hComp;
+ OMX_STATETYPE eState;
+ OMX_U32 nPorts;
+ OMX_HANDLETYPE hStateSetEvent;
+ OMX_HANDLETYPE hPortDisableEvent;
+ OMX_HANDLETYPE hPortEnableEvent;
+ OMX_STRING inFilePath;
+ OMX_STRING outFilePath;
+ FILE *pOutputFile;
+ FILE *pInputfile;
+ OMX_BOOL bEOS;
+ BufferList *pInBufferList;
+ BufferList *pOutBufferList;
+ OMX_BOOL bClientAllocBuf;
+ OMX_U32 nBufDoneCalls;
+ OMX_PORT_PARAM_TYPE sPortParam[NUM_DOMAINS];
+} SampleCompTestCtxt;
+
+//this test compiles only for ducati SYS
+typedef struct TestCtxt
+{
+ OMX_HANDLETYPE hComp;
+ OMX_STATETYPE eState;
+ OMX_U32 nPorts;
+ OMX_HANDLETYPE hStateSetEvent;
+ OMX_HANDLETYPE hPortDisableEvent;
+ OMX_HANDLETYPE hPortEnableEvent;
+ OMX_STRING inFilePath;
+ OMX_STRING outFilePath;
+ FILE *pOutputFile;
+ FILE *pInputfile;
+ OMX_BOOL bEOS;
+ BufferList *pInBufferList;
+ BufferList *pOutBufferList;
+ OMX_BOOL bClientAllocBuf;
+ OMX_U32 nBufDoneCalls;
+ //OMX_PORT_PARAM_TYPE sPortParam[NUM_DOMAINS];
+} TestCtxt;
+
+
+static OMX_U32 nInBufCount = 0;
+static OMX_U32 nOutBufCount = 0;
+
+
+//Semaphore_Handle EBDSem;
+//Semaphore_Params EBDsemParams;
+
+//Semaphore_Handle FBDSem;
+//Semaphore_Params FBDsemParams;
+/*========================================================*/
+/* @ fn OMX_TEST_ErrorToString :: ERROR to STRING */
+/*========================================================*/
+OMX_STRING OMX_TEST_ErrorToString(OMX_ERRORTYPE eError)
+{
+
+ OMX_STRING errorString;
+
+ switch (eError)
+ {
+
+ case OMX_ErrorNone:
+ errorString = "ErrorNone";
+ break;
+ case OMX_ErrorInsufficientResources:
+ errorString = "ErrorInsufficientResources";
+ break;
+ case OMX_ErrorUndefined:
+ errorString = "ErrorUndefined";
+ break;
+ case OMX_ErrorInvalidComponentName:
+ errorString = "ErrorInvalidComponentName";
+ break;
+ case OMX_ErrorComponentNotFound:
+ errorString = "ErrorComponentNotFound";
+ break;
+ case OMX_ErrorInvalidComponent:
+ errorString = "ErrorInvalidComponent";
+ break;
+ case OMX_ErrorBadParameter:
+ errorString = "ErrorBadParameter";
+ break;
+ case OMX_ErrorNotImplemented:
+ errorString = "ErrorNotImplemented";
+ break;
+ case OMX_ErrorUnderflow:
+ errorString = "ErrorUnderflow";
+ break;
+ case OMX_ErrorOverflow:
+ errorString = "ErrorOverflow";
+ break;
+ case OMX_ErrorHardware:
+ errorString = "ErrorHardware";
+ break;
+ case OMX_ErrorInvalidState:
+ errorString = "ErrorInvalidState";
+ break;
+ case OMX_ErrorStreamCorrupt:
+ errorString = "ErrorStreamCorrupt";
+ break;
+ case OMX_ErrorPortsNotCompatible:
+ errorString = "ErrorPortsNotCompatible";
+ break;
+ case OMX_ErrorResourcesLost:
+ errorString = "ErrorResourcesLost";
+ break;
+ case OMX_ErrorNoMore:
+ errorString = "ErrorNoMore";
+ break;
+ case OMX_ErrorVersionMismatch:
+ errorString = "ErrorVersionMismatch";
+ break;
+ case OMX_ErrorNotReady:
+ errorString = "ErrorNotReady";
+ break;
+ case OMX_ErrorTimeout:
+ errorString = "ErrorTimeout";
+ break;
+ case OMX_ErrorSameState:
+ errorString = "ErrorSameState";
+ break;
+ case OMX_ErrorResourcesPreempted:
+ errorString = "ErrorResourcesPreempted";
+ break;
+ case OMX_ErrorPortUnresponsiveDuringAllocation:
+ errorString = "ErrorPortUnresponsiveDuringAllocation";
+ break;
+ case OMX_ErrorPortUnresponsiveDuringDeallocation:
+ errorString = "ErrorPortUnresponsiveDuringDeallocation";
+ break;
+ case OMX_ErrorPortUnresponsiveDuringStop:
+ errorString = "ErrorPortUnresponsiveDuringStop";
+ break;
+ case OMX_ErrorIncorrectStateTransition:
+ errorString = "ErrorIncorrectStateTransition";
+ break;
+ case OMX_ErrorIncorrectStateOperation:
+ errorString = "ErrorIncorrectStateOperation";
+ break;
+ case OMX_ErrorUnsupportedSetting:
+ errorString = "ErrorUnsupportedSetting";
+ break;
+ case OMX_ErrorUnsupportedIndex:
+ errorString = "ErrorUnsupportedIndex";
+ break;
+ case OMX_ErrorBadPortIndex:
+ errorString = "ErrorBadPortIndex";
+ break;
+ case OMX_ErrorPortUnpopulated:
+ errorString = "ErrorPortUnpopulated";
+ break;
+ case OMX_ErrorComponentSuspended:
+ errorString = "ErrorComponentSuspended";
+ break;
+ case OMX_ErrorDynamicResourcesUnavailable:
+ errorString = "ErrorDynamicResourcesUnavailable";
+ break;
+ case OMX_ErrorMbErrorsInFrame:
+ errorString = "ErrorMbErrorsInFrame";
+ break;
+ case OMX_ErrorFormatNotDetected:
+ errorString = "ErrorFormatNotDetected";
+ break;
+ case OMX_ErrorContentPipeOpenFailed:
+ errorString = "ErrorContentPipeOpenFailed";
+ break;
+ case OMX_ErrorContentPipeCreationFailed:
+ errorString = "ErrorContentPipeCreationFailed";
+ break;
+ case OMX_ErrorSeperateTablesUsed:
+ errorString = "ErrorSeperateTablesUsed";
+ break;
+ case OMX_ErrorTunnelingUnsupported:
+ errorString = "ErrorTunnelingUnsupported";
+ break;
+ default:
+ errorString = "<unknown>";
+ break;
+ }
+ return errorString;
+}
+
+/*========================================================*/
+/* @ fn OMX_TEST_StateToString :: STATE to STRING */
+/*========================================================*/
+OMX_STRING OMX_TEST_StateToString(OMX_STATETYPE eState)
+{
+ OMX_STRING StateString;
+
+ switch (eState)
+ {
+ case OMX_StateInvalid:
+ StateString = "Invalid";
+ break;
+ case OMX_StateLoaded:
+ StateString = "Loaded";
+ break;
+ case OMX_StateIdle:
+ StateString = "Idle";
+ break;
+ case OMX_StateExecuting:
+ StateString = "Executing";
+ break;
+ case OMX_StatePause:
+ StateString = "Pause";
+ break;
+ case OMX_StateWaitForResources:
+ StateString = "WaitForResources ";
+ break;
+ default:
+ StateString = "<unknown>";
+ break;
+ }
+
+ return StateString;
+}
+
+/* Application callback Functions */
+/*========================================================*/
+/* @ fn SampleTest_EventHandler :: Application callback */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData,
+ OMX_IN OMX_EVENTTYPE eEvent,
+ OMX_IN OMX_U32 nData1, OMX_IN OMX_U32 nData2, OMX_IN OMX_PTR pEventData)
+{
+ SampleCompTestCtxt *pContext;
+
+ printf("\n___________ ENTERED CLIENT CALLBACK:%s", __FUNCTION__);
+
+ if (pAppData == NULL)
+ return OMX_ErrorNone;
+
+ pContext = (SampleCompTestCtxt *) pAppData;
+
+ switch (eEvent)
+ {
+ case OMX_EventCmdComplete:
+ printf("\n OMX_EventCmdComplete case: \n");
+ if (OMX_CommandStateSet == nData1)
+ {
+ printf(" Component Transitioned to %s state \n",
+ OMX_TEST_StateToString((OMX_STATETYPE) nData2));
+ pContext->eState = (OMX_STATETYPE) nData2;
+ TIMM_OSAL_SemaphoreRelease(pContext->hStateSetEvent);
+ } else if (OMX_CommandFlush == nData1)
+ {
+ /* Nothing to do over here */
+ } else if (OMX_CommandPortDisable == nData1)
+ {
+ /* Nothing to do over here */
+ TIMM_OSAL_SemaphoreRelease(pContext->
+ hPortDisableEvent);
+ } else if (OMX_CommandPortEnable == nData1)
+ {
+ /* Nothing to do over here */
+ } else if (OMX_CommandMarkBuffer == nData1)
+ {
+ /* Nothing to do over here */
+ }
+ break;
+
+ case OMX_EventError:
+ printf("\nOMX EVENT ERROR!!!!!! \n");
+ break;
+
+ case OMX_EventMark:
+ break;
+
+ case OMX_EventPortSettingsChanged:
+ break;
+
+ case OMX_EventBufferFlag:
+ break;
+
+ case OMX_EventResourcesAcquired:
+ break;
+
+ case OMX_EventComponentResumed:
+ break;
+
+ case OMX_EventDynamicResourcesAvailable:
+ break;
+
+ case OMX_EventPortFormatDetected:
+ break;
+
+ default:
+ break;
+ }
+
+ goto OMX_TEST_BAIL;
+ OMX_TEST_BAIL:
+ return OMX_ErrorNone;
+}
+
+/*========================================================*/
+/* @ fn SampleTest_EmptyBufferDone :: Application callback */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_EmptyBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE * pBuffer)
+{
+ SampleCompTestCtxt *pContext;
+
+ printf("\n___________ ENTERED CLIENT CALLBACK:%s", __FUNCTION__);
+
+ if (pAppData == NULL)
+ return OMX_ErrorNone;
+
+ pContext = (SampleCompTestCtxt *) pAppData;
+ pContext->nBufDoneCalls++;
+
+ BUFFER_LIST_SET_ENTRY(pContext->pInBufferList, pBuffer);
+ //Semaphore_post(EBDSem);
+
+ goto OMX_TEST_BAIL;
+ OMX_TEST_BAIL:
+ printf("\nEBD done\n");
+ return OMX_ErrorNone;
+}
+
+/*========================================================*/
+/* @ fn SampleTest_FillBufferDone :: Application callback */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_FillBufferDone(OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_PTR pAppData, OMX_IN OMX_BUFFERHEADERTYPE * pBuffHeader)
+{
+ SampleCompTestCtxt *pContext;
+
+ printf("\n___________ ENTERED CLIENT CALLBACK:%s", __FUNCTION__);
+
+ if (pAppData == NULL)
+ return OMX_ErrorNone;
+
+ pContext = (SampleCompTestCtxt *) pAppData;
+ pContext->nBufDoneCalls++;
+
+ if (pContext->pOutputFile && gTest)
+ {
+ printf(" writing to output file :: buffer cnt : %d\n",
+ nOutBufCount);
+ nOutBufCount++;
+ fwrite(pBuffHeader->pBuffer, 1, pBuffHeader->nFilledLen,
+ pContext->pOutputFile);
+ }
+
+ BUFFER_LIST_SET_ENTRY(pContext->pOutBufferList, pBuffHeader);
+ //Semaphore_post(FBDSem);
+
+ goto OMX_TEST_BAIL;
+ OMX_TEST_BAIL:
+ printf("\nFBD done\n");
+ return OMX_ErrorNone;
+}
+
+
+static void SampleTest_ReadInputFile(SampleCompTestCtxt * pContext,
+ OMX_PTR pData, OMX_U32 nBytes, FILE * fp)
+{
+ OMX_U32 nReadSize = 0;
+
+ printf("\nIn read i/p file\n");
+ if (pData == NULL)
+ printf("\npData is NULL\n");
+ else
+ printf("\npData = %x\n", pData);
+ printf("\nnBytes = %d\n", nBytes);
+ if (fp == NULL)
+ printf("\nfp is NULL\n");
+ else
+ printf("\nfp = %x\n", fp);
+ nReadSize = fread(pData, 1, nBytes, fp);
+ if (nReadSize != nBytes)
+ {
+ pContext->bEOS = OMX_TRUE;
+ }
+
+ printf(" Reading from file :: Buffer cont : %d \n", nInBufCount);
+ nInBufCount++;
+}
+
+/*========================================================*/
+/* @ fn SampleTest_WriteInBuffers :: Reads a buffer from a file and send to Comp */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_WriteInBuffers(SampleCompTestCtxt * pContext)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ BufferList *pList;
+ OMX_BUFFERHEADERTYPE *pBufHeader;
+#ifdef OMX_SAMPLE_TILER_TEST
+ OMX_U8 *pTmpBuffer = NULL, *pOrigTmpBuffer = NULL;
+#endif
+ pList = pContext->pInBufferList;
+ while (pList && pList->pBufHdr)
+ {
+ BUFFERLIST_CLEAR_ENTRY(pList, pBufHeader);
+ printf("\nAbout to read from input file\n");
+#if defined(OMX_SAMPLE_TILER_TEST)
+
+ //OMX_SAMPLE_BUFFER_SIZE is the total amt of data to be sent in the buffer
+ pTmpBuffer =
+ TIMM_OSAL_Malloc(OMX_SAMPLE_BUFFER_SIZE, 0, 0, 0);
+ if (pTmpBuffer == NULL)
+ OMX_TEST_SET_ERROR_BAIL
+ (OMX_ErrorInsufficientResources,
+ "malloc failed \n");
+ pOrigTmpBuffer = pTmpBuffer;
+
+ SampleTest_ReadInputFile(pContext, pTmpBuffer,
+ OMX_SAMPLE_BUFFER_SIZE, pContext->pInputfile);
+
+ Test_Util_Memcpy_1Dto2D(pBufHeader->pBuffer, pTmpBuffer,
+ OMX_SAMPLE_BUFFER_SIZE, OMX_SAMPLE_IN_HEIGHT,
+ OMX_SAMPLE_IN_WIDTH, STRIDE_LINUX);
+ pBufHeader->nFilledLen = OMX_SAMPLE_BUFFER_SIZE;
+
+ printf("\nBefore ETB pBufHeader->nInputPortIndex = %d\n",
+ pBufHeader->nInputPortIndex);
+
+ TIMM_OSAL_Free(pOrigTmpBuffer);
+
+#else
+ SampleTest_ReadInputFile(pContext, pBufHeader->pBuffer,
+ pBufHeader->nAllocLen, pContext->pInputfile);
+ pBufHeader->nFilledLen = pBufHeader->nAllocLen;
+
+#endif
+ if (pContext->bEOS == OMX_TRUE)
+ {
+ pBufHeader->nFlags |= OMX_BUFFERFLAG_EOS;
+ }
+
+ eError = OMX_EmptyThisBuffer(pContext->hComp, pBufHeader);
+
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ }
+
+ OMX_TEST_BAIL:
+ return eError;
+
+}
+
+/*========================================================*/
+/* @ fn SampleTest_ReadOutBuffers :: Send out buffers */
+/*========================================================*/
+
+OMX_ERRORTYPE SampleTest_ReadOutBuffers(SampleCompTestCtxt * pContext)
+{
+
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ BufferList *pList;
+ OMX_BUFFERHEADERTYPE *pBufHeader;
+
+ pList = pContext->pOutBufferList;
+ while (pList && pList->pBufHdr)
+ {
+ printf("\nAbout to do FTB\n");
+
+ BUFFERLIST_CLEAR_ENTRY(pList, pBufHeader);
+
+ eError = OMX_FillThisBuffer(pContext->hComp, pBufHeader);
+
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ if (pBufHeader->nFlags == OMX_BUFFERFLAG_EOS)
+ {
+ pContext->nBufDoneCalls = OMX_TEST_BUFFERS_OF_TRAFFIC;
+ }
+ }
+
+ OMX_TEST_BAIL:
+ return eError;
+
+}
+
+
+
+/*========================================================*/
+/* @ fn SampleTest_AllocateBuffers :: Allocates the Resources on the available ports */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_AllocateBuffers(SampleCompTestCtxt * pContext,
+ OMX_PARAM_PORTDEFINITIONTYPE * pPortDef)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U8 *pBuffer = NULL;
+ BufferList *pBufferList;
+ BufferList *pTemp;
+ OMX_BUFFERHEADERTYPE *pBufferHdr;
+ OMX_U32 i = 100;
+ OMX_COMPONENTTYPE *pComp;
+
+#ifdef OMX_SAMPLE_TILER_TEST
+ MemAllocBlock *pBlock = NULL;
+ OMX_U32 nNumBlocks = 1;
+
+/*For i/p port allocate 2D packed buffer, for o/p port allocate 1D buffer.
+Ideally client should get this from GetParams but this is just a sample test so
+values are hardcoded*/
+
+ if (pPortDef->nPortIndex == OMX_SAMPLE_INPUT_PORT)
+ {
+ nNumBlocks = 2;
+ pBlock =
+ TIMM_OSAL_Malloc(sizeof(MemAllocBlock) * nNumBlocks, 0, 0,
+ 0);
+ TIMM_OSAL_Memset(pBlock, 0, sizeof(MemAllocBlock) * nNumBlocks);
+ pBlock[0].dim.area.width = OMX_SAMPLE_IN_2DYWIDTH;
+ pBlock[0].dim.area.height = OMX_SAMPLE_IN_2DYHEIGHT;
+ pBlock[0].pixelFormat = PIXEL_FMT_8BIT;
+ pBlock[1].dim.area.width = OMX_SAMPLE_IN_2DUVWIDTH;
+ pBlock[1].dim.area.height = OMX_SAMPLE_IN_2DUVHEIGHT;
+ pBlock[1].pixelFormat = PIXEL_FMT_16BIT;
+ } else
+ {
+ nNumBlocks = 1;
+ pBlock =
+ TIMM_OSAL_Malloc(sizeof(MemAllocBlock) * nNumBlocks, 0, 0,
+ 0);
+ TIMM_OSAL_Memset(pBlock, 0, sizeof(MemAllocBlock) * nNumBlocks);
+ pBlock[0].dim.len = OMX_SAMPLE_BUFFER_SIZE;
+ pBlock[0].pixelFormat = PIXEL_FMT_PAGE;
+ }
+#endif
+
+ for (i = 0; i < pPortDef->nBufferCountActual; i++)
+ {
+ pBufferList =
+ (BufferList *) TIMM_OSAL_Malloc(sizeof(BufferList),
+ TIMM_OSAL_TRUE, 0, TIMMOSAL_MEM_SEGMENT_INT);
+ if (!pBufferList)
+ {
+ OMX_TEST_SET_ERROR_BAIL
+ (OMX_ErrorInsufficientResources,
+ "malloc failed \n");
+ }
+
+ if (pContext->bClientAllocBuf)
+ {
+
+#ifdef OMX_SAMPLE_TILER_TEST
+/*For i/p port allocate 2D packed buffer, for o/p port allocate 1D buffer.
+Ideally client should get this from GetParams but this is just a sample test so
+values are hardcoded*/
+ pBuffer = MemMgr_Alloc(pBlock, nNumBlocks);
+ printf("\nMemMgr allocated buffer = 0x%x\n", pBuffer);
+#else
+ pBuffer =
+ (OMX_U8 *) TIMM_OSAL_MallocaBuffer(pPortDef->
+ nBufferSize, pPortDef->bBuffersContiguous,
+ pPortDef->nBufferAlignment);
+
+#endif
+
+ if (!pBufferList)
+ {
+ OMX_TEST_SET_ERROR_BAIL
+ (OMX_ErrorInsufficientResources,
+ "malloc failed \n");
+ }
+
+ printf("\nCalling UseBuf on port %d\n",
+ pPortDef->nPortIndex);
+ eError =
+ OMX_UseBuffer(pContext->hComp, &pBufferHdr,
+ pPortDef->nPortIndex, 0, pPortDef->nBufferSize,
+ pBuffer);
+
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ } else
+ {
+
+ pComp = (OMX_COMPONENTTYPE *) pContext->hComp;
+ printf("\nCalling allocate buffer\n");
+ eError =
+ OMX_AllocateBuffer(pContext->hComp, &pBufferHdr,
+ pPortDef->nPortIndex, 0, pPortDef->nBufferSize);
+
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ }
+ printf("\npBufferHdr->nOutputPortIndex = %d\n",
+ pBufferHdr->nOutputPortIndex);
+ printf("\npBufferHdr->nInputPortIndex = %d\n",
+ pBufferHdr->nInputPortIndex);
+ pBufferList->pNextBuf = NULL;
+ pBufferList->pBufHdr = pBufferHdr;
+ pBufferList->pOrigBufHdr = pBufferHdr;
+
+ if (pPortDef->eDir == OMX_DirInput)
+ {
+ printf("\npBufferHdr->nOutputPortIndex = %d\n",
+ pBufferHdr->nOutputPortIndex);
+ printf("\npBufferHdr->nInputPortIndex = %d\n",
+ pBufferHdr->nInputPortIndex);
+ pBufferHdr->nOutputPortIndex = OMX_NOPORT;
+ if (pContext->pInBufferList == NULL)
+ {
+ pContext->pInBufferList = pBufferList;
+ } else
+ {
+ pTemp = pContext->pInBufferList;
+ while (pTemp->pNextBuf)
+ pTemp = pTemp->pNextBuf;
+ pTemp->pNextBuf = pBufferList;
+ }
+ } else
+ {
+ pBufferHdr->nInputPortIndex = OMX_NOPORT;
+ printf("\npBufferHdr->nOutputPortIndex = %d\n",
+ pBufferHdr->nOutputPortIndex);
+ printf("\npBufferHdr->nInputPortIndex = %d\n",
+ pBufferHdr->nInputPortIndex);
+ if (pContext->pOutBufferList == NULL)
+ {
+ pContext->pOutBufferList = pBufferList;
+ } else
+ {
+ pTemp = pContext->pOutBufferList;
+ while (pTemp->pNextBuf)
+ pTemp = pTemp->pNextBuf;
+ pTemp->pNextBuf = pBufferList;
+ }
+ }
+ }
+
+ OMX_TEST_BAIL:
+#ifdef OMX_SAMPLE_TILER_TEST
+ if (pBlock != NULL)
+ TIMM_OSAL_Free(pBlock);
+#endif
+ if (eError != OMX_ErrorNone)
+ {
+ if (pBufferList)
+ {
+ TIMM_OSAL_Free(pBufferList);
+ }
+ }
+
+ return eError;
+}
+
+/*========================================================*/
+/* @ fn SampleTest_DeInitBuffers :: Destroy the resources */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_DeInitBuffers(SampleCompTestCtxt * pContext)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_U8 *pBuffer;
+ BufferList *pBufferList;
+ BufferList *pTemp;
+
+ OMX_U32 nRetVal = 0;
+
+ pTemp = pContext->pInBufferList;
+
+ while (pTemp)
+ {
+ pBufferList = (BufferList *) pTemp;
+ pBuffer = (OMX_U8 *) pTemp->pOrigBufHdr->pBuffer;
+
+ printf("\nCalling Free Buffer on port no. %d\n",
+ pTemp->pOrigBufHdr->nInputPortIndex);
+
+ eError =
+ OMX_FreeBuffer(pContext->hComp,
+ pTemp->pOrigBufHdr->nInputPortIndex, pTemp->pOrigBufHdr);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ if (pContext->bClientAllocBuf)
+ {
+
+#ifdef OMX_SAMPLE_TILER_TEST
+ nRetVal = MemMgr_Free(pBuffer);
+ if (nRetVal)
+ {
+ printf("\nError in MemMgr free\n");
+ }
+#else
+ TIMM_OSAL_Free(pBuffer);
+#endif
+ }
+
+ pTemp = pTemp->pNextBuf;
+ if (pBufferList)
+ TIMM_OSAL_Free(pBufferList);
+ }
+
+ pContext->pInBufferList = NULL;
+
+ pTemp = pContext->pOutBufferList;
+ while (pTemp)
+ {
+ pBufferList = (BufferList *) pTemp;
+ pBuffer = (OMX_U8 *) pTemp->pOrigBufHdr->pBuffer;
+ printf("\nCalling Free Buffer on port no. %d\n",
+ pTemp->pOrigBufHdr->nOutputPortIndex);
+
+ eError =
+ OMX_FreeBuffer(pContext->hComp,
+ pTemp->pOrigBufHdr->nOutputPortIndex, pTemp->pOrigBufHdr);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ if (pContext->bClientAllocBuf)
+ {
+#ifdef OMX_SAMPLE_TILER_TEST
+ nRetVal = MemMgr_Free(pBuffer);
+ if (nRetVal)
+ {
+ printf("\nError in MemMgr free\n");
+ }
+#else
+ TIMM_OSAL_Free(pBuffer);
+#endif
+ }
+
+ pTemp = pTemp->pNextBuf;
+ if (pBufferList)
+ TIMM_OSAL_Free(pBufferList);
+
+ }
+
+ pContext->pOutBufferList = NULL;
+
+ OMX_TEST_BAIL:
+ return eError;
+}
+
+/*========================================================*/
+/* @ fn SampleTest_TransitionWait :: Waits for the transition to be completed ,
+ * incase of loaded to idle Allocates the Resources and while idle to loaded
+ * destroys the resources */
+/*========================================================*/
+OMX_ERRORTYPE SampleTest_TransitionWait(OMX_STATETYPE eToState,
+ SampleCompTestCtxt * pContext)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_PARAM_PORTDEFINITIONTYPE tPortDef;
+ OMX_U32 i, j;
+
+ eError = OMX_SendCommand(pContext->hComp, OMX_CommandStateSet,
+ eToState, NULL);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ if ((eToState == OMX_StateIdle) &&
+ (pContext->eState == OMX_StateLoaded))
+ {
+ for (i = 0; i < NUM_DOMAINS; i++)
+ {
+ for (j = pContext->sPortParam[i].nStartPortNumber;
+ j < pContext->sPortParam[i].nStartPortNumber
+ + pContext->sPortParam[i].nPorts; j++)
+ {
+
+ OMX_TEST_INIT_STRUCT(tPortDef,
+ OMX_PARAM_PORTDEFINITIONTYPE);
+ tPortDef.nPortIndex = j;
+//printf("\nCalling GetParam before UseBuf on port %d\n",j);
+ eError = OMX_GetParameter(pContext->hComp,
+ OMX_IndexParamPortDefinition,
+ (OMX_PTR) & tPortDef);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+// if(tPortDef.bEnabled)//AD
+ eError =
+ SampleTest_AllocateBuffers(pContext,
+ &tPortDef);
+
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ }
+ }
+ } else if ((eToState == OMX_StateLoaded) &&
+ (pContext->eState == OMX_StateIdle))
+ {
+
+ eError = SampleTest_DeInitBuffers(pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ }
+ printf("\nWaiting for state set event\n");
+ TIMM_OSAL_SemaphoreObtain(pContext->hStateSetEvent,
+ TIMM_OSAL_SUSPEND);
+ printf("\nState set event recd.\n");
+
+ if (pContext->eState != eToState)
+ OMX_TEST_SET_ERROR_BAIL(OMX_ErrorUndefined,
+ " InComplete Transition \n");
+
+ OMX_TEST_BAIL:
+ return eError;
+}
+
+
+/*========================================================*/
+/* @ fn OMX_Sample_UT0001 :: Initializes, move to Idle and then to executing, process
+* buffers and then destroy the component by moving back to idle, loaded, invalid */
+/*========================================================*/
+void main(void)
+{
+ OMX_ERRORTYPE eError = OMX_ErrorNone;
+ OMX_HANDLETYPE hComp = NULL;
+ OMX_CALLBACKTYPE oCallbacks;
+ SampleCompTestCtxt *pContext;
+ SampleCompTestCtxt oAppData;
+
+ int ch1, ch2;
+ int pass;
+ int while_pass = 0, loc_diff = 0;
+
+
+ pContext = &oAppData;
+ printf(" Entering : %s \n", __FUNCTION__);
+ memset(pContext, 0x0, sizeof(SampleCompTestCtxt));
+
+ oCallbacks.EventHandler = SampleTest_EventHandler;
+ oCallbacks.EmptyBufferDone = SampleTest_EmptyBufferDone;
+ oCallbacks.FillBufferDone = SampleTest_FillBufferDone;
+ printf("\nCalling sem create\n");
+ /* Initialize Events to Track callbacks */
+ TIMM_OSAL_SemaphoreCreate(&pContext->hStateSetEvent, 0);
+ TIMM_OSAL_SemaphoreCreate(&pContext->hPortDisableEvent, 0);
+ //TIMM_OSAL_MutexObtain(pContext->hStateSetEvent, TIMM_OSAL_SUSPEND);
+ printf("\nSem created\n");
+
+
+ pContext->pInputfile = fopen(INPUT_FILE, "rb");
+ if (NULL == pContext->pInputfile)
+ {
+ eError = OMX_ErrorInsufficientResources;
+ //goto OMX_TEST_BAIL;
+ }
+ printf("\nInput file opened\n");
+ pContext->pOutputFile = fopen(NON_TUN_OUTPUT_FILE, "wb");
+ if (NULL == pContext->pOutputFile)
+ {
+ eError = OMX_ErrorInsufficientResources;
+ //goto OMX_TEST_BAIL;
+ }
+
+
+ /* Initialize OpenMAX */
+ printf("\nInitialize OpenMAX\n");
+ eError = OMX_Init();
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ /* Load a component */
+ printf("\nLoad a component\n");
+ eError =
+ OMX_GetHandle(&hComp, (OMX_STRING) "OMX.TI.DUCATI1.MISC.SAMPLE",
+ pContext, &oCallbacks);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ pContext->hComp = hComp;
+printf ("\neError = 0x%x\n", eError);
+if(hComp)
+ printf("\nhComp = 0x%x\n", hComp);
+ /* Verify that the component is in Loaded state */
+ printf("\nVerify that the component is in Loaded state\n");
+
+ eError = OMX_GetState(pContext->hComp, &pContext->eState);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ if (OMX_StateLoaded != pContext->eState)
+ {
+ OMX_TEST_SET_ERROR_BAIL(OMX_ErrorUndefined,
+ "not in loaded state \n");
+ }
+
+ /* detect all Audio ports on the component */
+ OMX_TEST_INIT_STRUCT(pContext->sPortParam[0], OMX_PORT_PARAM_TYPE);
+ eError = OMX_GetParameter(hComp, OMX_IndexParamAudioInit,
+ (OMX_PTR) & pContext->sPortParam[0]);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ /* detect all video ports on the component */
+ OMX_TEST_INIT_STRUCT(pContext->sPortParam[1], OMX_PORT_PARAM_TYPE);
+ eError = OMX_GetParameter(hComp, OMX_IndexParamVideoInit,
+ (OMX_PTR) & pContext->sPortParam[1]);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ /* detect all image ports on the component */
+ OMX_TEST_INIT_STRUCT(pContext->sPortParam[2], OMX_PORT_PARAM_TYPE);
+ eError = OMX_GetParameter(hComp, OMX_IndexParamImageInit,
+ (OMX_PTR) & pContext->sPortParam[2]);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ /* detect all other ports on the component */
+ OMX_TEST_INIT_STRUCT(pContext->sPortParam[3], OMX_PORT_PARAM_TYPE);
+ eError = OMX_GetParameter(hComp, OMX_IndexParamOtherInit,
+ (OMX_PTR) & pContext->sPortParam[3]);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ pContext->nPorts = pContext->sPortParam[0].nPorts +
+ pContext->sPortParam[1].nPorts +
+ pContext->sPortParam[2].nPorts + pContext->sPortParam[3].nPorts;
+
+
+ pContext->bClientAllocBuf = OMX_SAMPLE_USEBUF;
+ if (pContext->bClientAllocBuf == OMX_TRUE)
+ {
+ printf(" Client does Allocation of buffers \n");
+ } else
+ {
+ printf(" Component does Allocation of buffers \n");
+ }
+
+ /* Transition to Idle state */
+
+ eError = SampleTest_TransitionWait(OMX_StateIdle, pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ /* Transition to Executing state */
+ eError = SampleTest_TransitionWait(OMX_StateExecuting, pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ printf("\nAbout to start processing buffers\n");
+
+
+ /* process buffers */
+
+ while (pContext->nBufDoneCalls < OMX_TEST_BUFFERS_OF_TRAFFIC)
+ {
+
+ eError = SampleTest_WriteInBuffers(pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ eError = SampleTest_ReadOutBuffers(pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+ while_pass++;
+ //printf("\n WHILE PROCESS LOOP COUNT: BufDoneCount = %d %d",
+ // while_pass, pContext->nBufDoneCalls);
+
+ //printf("\n Waiting on Sample component to respond");
+
+ }
+
+
+ gTest = 0;
+
+ /* Transition back to Idle state */
+ eError = SampleTest_TransitionWait(OMX_StateIdle, pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+ /* Trasnition back to Loaded state */
+ eError = SampleTest_TransitionWait(OMX_StateLoaded, pContext);
+ OMX_TEST_BAIL_IF_ERROR(eError);
+
+
+ OMX_TEST_BAIL:
+
+ fclose(pContext->pInputfile);
+ fclose(pContext->pOutputFile);
+
+ if (eError == OMX_ErrorNone)
+ {
+ eError = OMX_FreeHandle(pContext->hComp);
+ eError = OMX_Deinit();
+ } else
+ {
+ SampleTest_TransitionWait(OMX_StateInvalid, pContext);
+ SampleTest_DeInitBuffers(pContext);
+
+ OMX_FreeHandle(pContext->hComp);
+ OMX_Deinit();
+ }
+
+ TIMM_OSAL_SemaphoreDelete(pContext->hStateSetEvent);
+ TIMM_OSAL_SemaphoreDelete(pContext->hPortDisableEvent);
+
+ /* emit the Test Result */
+ if (OMX_ErrorNone != eError)
+ {
+ printf(" TestCase Failed and returned an error:: %s \n",
+ OMX_TEST_ErrorToString(eError));
+ } else
+ {
+ printf
+ ("\nTest case has ended, now comparing input and output files\n");
+ pContext->pInputfile = fopen(INPUT_FILE, "rb");
+ if (NULL == pContext->pInputfile)
+ {
+ printf("\n Error in opening INPUT_FILE");
+ eError = OMX_ErrorInsufficientResources;
+ }
+
+ pContext->pOutputFile = fopen(NON_TUN_OUTPUT_FILE, "rb");
+ if (NULL == pContext->pOutputFile)
+ {
+ printf("\n Error in opening NON_TUN_OUTPUT_FILE");
+ eError = OMX_ErrorInsufficientResources;
+ }
+ pass = 1;
+ while (1)
+ {
+ if (eError != OMX_ErrorNone)
+ {
+ pass = 0;
+ break;
+ }
+ ch1 = fgetc(pContext->pInputfile);
+ ch2 = fgetc(pContext->pOutputFile);
+ loc_diff++;
+ if (ch1 == EOF || ch2 == EOF)
+ {
+ break;
+ }
+ if (ch1 != ch2)
+ {
+ pass = 0;
+ printf("\n \n");
+ printf
+ ("\n FILE SIZE = 320 KB - NUMBER OF ITERATIONS = 20 (10 for INPUT AND 10 FOR OUTPUT buffers\n");
+ printf
+ ("\n ################### LOCATION OF DIFFERENCE: %d ################### \n",
+ loc_diff);
+ break;
+ }
+ }
+ fclose(pContext->pInputfile);
+ fclose(pContext->pOutputFile);
+ if (pass == 1)
+ printf(" Test Case has Passed\n");
+ else
+ {
+ printf("\nTest case has failed. (EOF not reached)\n");
+ eError = OMX_ErrorUndefined;
+ }
+ }
+
+ if (eError == OMX_ErrorNone)
+ {
+ printf(" Test Case has Passed :) \n");
+ } else
+ {
+ printf("\nTest case has failed.(OMX Error)\n");
+ }
+}
+