summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Android.mk17
-rw-r--r--libc2dcolorconvert/C2DColorConverter.cpp21
-rw-r--r--libc2dcolorconvert/C2DColorConverter.h9
-rwxr-xr-xlibstagefrighthw/Android.mk2
-rw-r--r--libstagefrighthw/QComOMXMetadata.h2
-rwxr-xr-xmm-core/Android.mk11
-rw-r--r--mm-core/inc/OMX_Audio.h1
-rw-r--r--mm-core/inc/OMX_CoreExt.h132
-rw-r--r--mm-core/inc/OMX_IndexExt.h170
-rw-r--r--mm-core/inc/OMX_QCOMExtns.h207
-rw-r--r--mm-core/inc/QCMediaDefs.h56
-rw-r--r--mm-core/inc/QCMetaData.h81
-rw-r--r--mm-core/inc/QOMX_AudioExtensions.h1022
-rw-r--r--mm-core/inc/QOMX_AudioIndexExtensions.h158
-rw-r--r--mm-core/inc/QOMX_CoreExtensions.h328
-rw-r--r--mm-core/inc/QOMX_FileFormatExtensions.h292
-rw-r--r--mm-core/inc/QOMX_IVCommonExtensions.h799
-rw-r--r--mm-core/inc/QOMX_SourceExtensions.h314
-rw-r--r--mm-core/inc/QOMX_StreamingExtensions.h972
-rw-r--r--mm-core/inc/QOMX_VideoExtensions.h1161
-rw-r--r--mm-core/inc/drmplay_version.h4
-rw-r--r--mm-core/inc/qc_omx_common.h4
-rw-r--r--mm-core/inc/qc_omx_component.h4
-rw-r--r--mm-core/inc/qc_omx_msg.h33
-rw-r--r--mm-core/omxcore/Android.mk94
-rw-r--r--mm-core/omxcore/inc/OMX_Audio.h1311
-rw-r--r--mm-core/omxcore/inc/OMX_Component.h579
-rw-r--r--mm-core/omxcore/inc/OMX_ContentPipe.h195
-rw-r--r--mm-core/omxcore/inc/OMX_Core.h1431
-rw-r--r--mm-core/omxcore/inc/OMX_IVCommon.h920
-rw-r--r--mm-core/omxcore/inc/OMX_Image.h328
-rw-r--r--mm-core/omxcore/inc/OMX_Index.h258
-rw-r--r--mm-core/omxcore/inc/OMX_Other.h337
-rw-r--r--mm-core/omxcore/inc/OMX_QCOMExtns.h689
-rw-r--r--mm-core/omxcore/inc/OMX_Types.h347
-rw-r--r--mm-core/omxcore/inc/OMX_Video.h1060
-rw-r--r--mm-core/omxcore/inc/QOMX_AudioExtensions.h181
-rw-r--r--mm-core/omxcore/inc/QOMX_AudioIndexExtensions.h77
-rw-r--r--mm-core/omxcore/inc/qc_omx_common.h65
-rw-r--r--mm-core/omxcore/inc/qc_omx_component.h183
-rw-r--r--mm-core/omxcore/inc/qc_omx_msg.h58
-rw-r--r--mm-core/omxcore/src/7630/qc_registry_table.c (renamed from mm-core/src/7630/qc_registry_table.c)150
-rw-r--r--mm-core/omxcore/src/7630/qc_registry_table_android.c (renamed from mm-core/src/7630/qc_registry_table_android.c)169
-rw-r--r--mm-core/omxcore/src/common/omx_core_cmp.cpp407
-rw-r--r--mm-core/omxcore/src/common/omx_core_cmp.h160
-rw-r--r--mm-core/omxcore/src/common/qc_omx_core.c847
-rw-r--r--mm-core/omxcore/src/common/qc_omx_core.h72
-rw-r--r--mm-core/src/7627A/qc_registry_table.c36
-rw-r--r--mm-core/src/7627A/qc_registry_table_android.c36
-rw-r--r--mm-core/src/8226/qc_registry_table.c447
-rw-r--r--mm-core/src/8226/qc_registry_table_android.c495
-rw-r--r--mm-core/src/8610/qc_registry_table.c432
-rw-r--r--mm-core/src/8610/qc_registry_table_android.c463
-rw-r--r--mm-core/src/8660/qc_registry_table.c4
-rw-r--r--mm-core/src/8660/qc_registry_table_android.c4
-rw-r--r--mm-core/src/8960/qc_registry_table.c4
-rw-r--r--mm-core/src/8960/qc_registry_table_android.c56
-rw-r--r--mm-core/src/8974/qc_registry_table.c8
-rw-r--r--mm-core/src/8974/qc_registry_table_android.c13
-rw-r--r--mm-core/src/common/omx_core_cmp.cpp4
-rw-r--r--mm-core/src/common/omx_core_cmp.h4
-rw-r--r--mm-core/src/common/qc_omx_core.c4
-rw-r--r--mm-core/src/common/qc_omx_core.h4
-rw-r--r--mm-core/src/default/qc_registry_table.c4
-rw-r--r--mm-core/src/default/qc_registry_table_android.c4
-rwxr-xr-xmm-video/DivxDrmDecrypt/Android.mk7
-rw-r--r--mm-video/DivxDrmDecrypt/inc/DivXDrmDecrypt.h98
-rw-r--r--mm-video/DivxDrmDecrypt/src/DivXDrmDecrypt.cpp4
-rw-r--r--mm-video/vidc/common/inc/extra_data_handler.h10
-rw-r--r--mm-video/vidc/common/inc/vidc_color_converter.h41
-rw-r--r--mm-video/vidc/common/src/extra_data_handler.cpp74
-rw-r--r--mm-video/vidc/common/src/vidc_color_converter.cpp41
-rwxr-xr-xmm-video/vidc/vdec/Android.mk47
-rw-r--r--mm-video/vidc/vdec/inc/Map.h4
-rw-r--r--mm-video/vidc/vdec/inc/decoder_driver_test.h140
-rw-r--r--mm-video/vidc/vdec/inc/frameparser.h9
-rw-r--r--mm-video/vidc/vdec/inc/h264_utils.h4
-rw-r--r--mm-video/vidc/vdec/inc/message_queue.h156
-rw-r--r--mm-video/vidc/vdec/inc/mp4_utils.h6
-rw-r--r--mm-video/vidc/vdec/inc/omx_vdec.h178
-rw-r--r--mm-video/vidc/vdec/inc/power_module.h42
-rw-r--r--mm-video/vidc/vdec/inc/qtypes.h4
-rw-r--r--mm-video/vidc/vdec/inc/queue.h4
-rw-r--r--mm-video/vidc/vdec/inc/ts_parser.h176
-rw-r--r--mm-video/vidc/vdec/src/frameparser.cpp30
-rw-r--r--mm-video/vidc/vdec/src/h264_utils.cpp40
-rw-r--r--mm-video/vidc/vdec/src/message_queue.c356
-rw-r--r--mm-video/vidc/vdec/src/mp4_utils.cpp48
-rw-r--r--mm-video/vidc/vdec/src/omx_vdec.cpp1770
-rw-r--r--mm-video/vidc/vdec/src/omx_vdec_copper.cpp (renamed from mm-video/vidc/vdec/src/omx_vdec_msm8974.cpp)2832
-rw-r--r--mm-video/vidc/vdec/src/power_module.cpp54
-rw-r--r--mm-video/vidc/vdec/src/queue.c4
-rw-r--r--mm-video/vidc/vdec/src/ts_parser.cpp526
-rw-r--r--mm-video/vidc/vdec/test/decoder_driver_test.c2396
-rw-r--r--mm-video/vidc/vdec/test/omx_vdec_test.cpp446
-rwxr-xr-xmm-video/vidc/venc/Android.mk41
-rw-r--r--mm-video/vidc/venc/inc/camera_test.h116
-rw-r--r--mm-video/vidc/venc/inc/fb_test.h96
-rw-r--r--mm-video/vidc/venc/inc/omx_video_base.h151
-rw-r--r--mm-video/vidc/venc/inc/omx_video_common.h4
-rw-r--r--mm-video/vidc/venc/inc/omx_video_encoder.h53
-rw-r--r--mm-video/vidc/venc/inc/queue.h160
-rw-r--r--mm-video/vidc/venc/inc/venc_util.h106
-rw-r--r--mm-video/vidc/venc/inc/video_encoder_device.h336
-rw-r--r--mm-video/vidc/venc/inc/video_encoder_device_copper.h (renamed from mm-video/vidc/venc/inc/video_encoder_device_v4l2.h)81
-rw-r--r--mm-video/vidc/venc/inc/video_encoder_test.h152
-rw-r--r--mm-video/vidc/venc/src/omx_video_base.cpp1081
-rw-r--r--mm-video/vidc/venc/src/omx_video_encoder.cpp371
-rw-r--r--mm-video/vidc/venc/src/video_encoder_device.cpp426
-rw-r--r--mm-video/vidc/venc/src/video_encoder_device_copper.cpp (renamed from mm-video/vidc/venc/src/video_encoder_device_v4l2.cpp)1892
-rw-r--r--mm-video/vidc/venc/test/camera_test.cpp186
-rw-r--r--mm-video/vidc/venc/test/fb_test.c96
-rw-r--r--mm-video/vidc/venc/test/queue.c348
-rw-r--r--mm-video/vidc/venc/test/venc_test.cpp226
-rw-r--r--mm-video/vidc/venc/test/venc_util.c102
-rw-r--r--mm-video/vidc/venc/test/video_encoder_test.c2128
116 files changed, 20087 insertions, 15352 deletions
diff --git a/Android.mk b/Android.mk
index 8380141..95d9ada 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,18 +1,5 @@
-QCOM_MEDIA_ROOT := $(call my-dir)
-ifneq ($(filter msm7627a,$(TARGET_BOARD_PLATFORM)),)
-include $(QCOM_MEDIA_ROOT)/mm-core/Android.mk
-include $(QCOM_MEDIA_ROOT)/libstagefrighthw/Android.mk
-endif
+ifneq ($(filter msm8960,$(TARGET_BOARD_PLATFORM)),)
-ifneq ($(filter msm8660 msm7630_surf,$(TARGET_BOARD_PLATFORM)),)
-include $(QCOM_MEDIA_ROOT)/mm-core/Android.mk
-include $(QCOM_MEDIA_ROOT)/libstagefrighthw/Android.mk
-include $(QCOM_MEDIA_ROOT)/mm-video/Android.mk
-endif
+include $(call all-subdir-makefiles)
-ifneq ($(filter msm8610 msm8226 msm8974 msm8960,$(TARGET_BOARD_PLATFORM)),)
-include $(QCOM_MEDIA_ROOT)/mm-core/Android.mk
-include $(QCOM_MEDIA_ROOT)/libstagefrighthw/Android.mk
-include $(QCOM_MEDIA_ROOT)/mm-video/Android.mk
-include $(QCOM_MEDIA_ROOT)/libc2dcolorconvert/Android.mk
endif
diff --git a/libc2dcolorconvert/C2DColorConverter.cpp b/libc2dcolorconvert/C2DColorConverter.cpp
index ed84872..0b8ae6c 100644
--- a/libc2dcolorconvert/C2DColorConverter.cpp
+++ b/libc2dcolorconvert/C2DColorConverter.cpp
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012 - 2013, The Linux Foundation. All rights reserved.
+/* copyright (c) 2012, code aurora forum. all rights reserved.
*
* redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -9,7 +9,7 @@
* 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 The Linux Foundation nor the names of its
+ * * neither the name of code aurora forum, inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -26,6 +26,9 @@
* if advised of the possibility of such damage.
*
*/
+/*--------------------------------------------------------------------------
+Copyright (c) 2012 Code Aurora Forum. All rights reserved.
+--------------------------------------------------------------------------*/
#include <C2DColorConverter.h>
#include <arm_neon.h>
@@ -270,7 +273,6 @@ bool C2DColorConverter::isYUVSurface(ColorConvertFormat format)
case YCbCr420P:
case YCrCb420P:
case NV12_2K:
- case NV12_128m:
return true;
case RGB565:
case RGBA8888:
@@ -379,7 +381,6 @@ uint32_t C2DColorConverter::getC2DFormat(ColorConvertFormat format)
return (C2D_COLOR_FORMAT_420_NV12 | C2D_FORMAT_MACROTILED);
case YCbCr420SP:
case NV12_2K:
- case NV12_128m:
return C2D_COLOR_FORMAT_420_NV12;
case YCbCr420P:
return C2D_COLOR_FORMAT_420_I420;
@@ -404,8 +405,6 @@ size_t C2DColorConverter::calcStride(ColorConvertFormat format, size_t width)
return ALIGN(width, ALIGN32);
case NV12_2K:
return ALIGN(width, ALIGN16);
- case NV12_128m:
- return ALIGN(width, ALIGN128);
case YCbCr420P:
return width;
case YCrCb420P:
@@ -431,8 +430,6 @@ size_t C2DColorConverter::calcYSize(ColorConvertFormat format, size_t width, siz
size_t lumaSize = ALIGN(alignedw * height, ALIGN2K);
return lumaSize;
}
- case NV12_128m:
- return ALIGN(width, ALIGN128) * ALIGN(height, ALIGN32);
default:
return 0;
}
@@ -477,11 +474,6 @@ size_t C2DColorConverter::calcSize(ColorConvertFormat format, size_t width, size
ALOGV("NV12_2k, width = %d, height = %d, size = %d", width, height, size);
}
break;
- case NV12_128m:
- alignedw = ALIGN(width, ALIGN128);
- alignedh = ALIGN(height, ALIGN32);
- size = ALIGN(alignedw * alignedh + (alignedw * ALIGN(height/2, ALIGN16)), ALIGN4K);
- break;
default:
break;
}
@@ -560,8 +552,6 @@ size_t C2DColorConverter::calcLumaAlign(ColorConvertFormat format) {
switch (format) {
case NV12_2K:
return ALIGN2K;
- case NV12_128m:
- return 1;
default:
ALOGE("unknown format passed for luma alignment number");
return 1;
@@ -575,7 +565,6 @@ size_t C2DColorConverter::calcSizeAlign(ColorConvertFormat format) {
case YCbCr420SP: //OR NV12
case YCbCr420P:
case NV12_2K:
- case NV12_128m:
return ALIGN4K;
default:
ALOGE("unknown format passed for size alignment number");
diff --git a/libc2dcolorconvert/C2DColorConverter.h b/libc2dcolorconvert/C2DColorConverter.h
index 999d297..4d011a0 100644
--- a/libc2dcolorconvert/C2DColorConverter.h
+++ b/libc2dcolorconvert/C2DColorConverter.h
@@ -1,4 +1,4 @@
-/* Copyright (c) 2012 - 2013, The Linux Foundation. All rights reserved.
+/* copyright (c) 2012, code aurora forum. all rights reserved.
*
* redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -9,7 +9,7 @@
* 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 The Linux Foundation nor the names of its
+ * * neither the name of code aurora forum, inc. nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
@@ -26,6 +26,9 @@
* if advised of the possibility of such damage.
*
*/
+/*--------------------------------------------------------------------------
+Copyright (c) 2012 Code Aurora Forum. All rights reserved.
+--------------------------------------------------------------------------*/
#ifndef C2D_ColorConverter_H_
#define C2D_ColorConverter_H_
@@ -64,7 +67,6 @@ typedef C2D_STATUS (*LINK_c2dDestroySurface)( uint32 surface_id );
namespace android {
-/*TODO: THIS NEEDS TO ENABLED FOR JB PLUS*/
enum ColorConvertFormat {
RGB565 = 1,
YCbCr420Tile,
@@ -73,7 +75,6 @@ enum ColorConvertFormat {
YCrCb420P,
RGBA8888,
NV12_2K,
- NV12_128m,
};
typedef struct {
diff --git a/libstagefrighthw/Android.mk b/libstagefrighthw/Android.mk
index 2a307ef..0440a1b 100755
--- a/libstagefrighthw/Android.mk
+++ b/libstagefrighthw/Android.mk
@@ -30,10 +30,10 @@ LOCAL_SHARED_LIBRARIES := \
libbinder \
libutils \
libcutils \
+ liblog \
libdl \
libui \
LOCAL_MODULE := libstagefrighthw
include $(BUILD_SHARED_LIBRARY)
-
diff --git a/libstagefrighthw/QComOMXMetadata.h b/libstagefrighthw/QComOMXMetadata.h
index e4cf73c..fe7e802 100644
--- a/libstagefrighthw/QComOMXMetadata.h
+++ b/libstagefrighthw/QComOMXMetadata.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2011 The Linux Foundation. All rights reserved.
+ * Copyright (C) 2011 The Code Aurora Forum. All rights reserved.
* Copyright (c) 2011 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
diff --git a/mm-core/Android.mk b/mm-core/Android.mk
index 6998cdd..fcf8137 100755
--- a/mm-core/Android.mk
+++ b/mm-core/Android.mk
@@ -3,8 +3,6 @@ ifneq ($(BUILD_TINY_ANDROID),true)
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-OMXCORE_CFLAGS := -g -O3 -DVERBOSE
-OMXCORE_CFLAGS += -O0 -fno-inline -fno-short-enums
OMXCORE_CFLAGS += -D_ANDROID_
OMXCORE_CFLAGS += -U_ENABLE_QC_MSG_LOG_
@@ -14,8 +12,6 @@ OMXCORE_CFLAGS += -U_ENABLE_QC_MSG_LOG_
ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
MM_CORE_TARGET = 7627A
-else ifeq ($(TARGET_BOARD_PLATFORM),msm7630_surf)
-MM_CORE_TARGET = 7630
else ifeq ($(TARGET_BOARD_PLATFORM),msm8660)
MM_CORE_TARGET = 8660
#Comment out following line to disable drm.play component
@@ -24,10 +20,6 @@ else ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
MM_CORE_TARGET = 8960
else ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
MM_CORE_TARGET = 8974
-else ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
-MM_CORE_TARGET = 8610
-else ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
-MM_CORE_TARGET = 8226
else
MM_CORE_TARGET = default
endif
@@ -61,8 +53,7 @@ LOCAL_COPY_HEADERS += inc/QOMX_SourceExtensions.h
LOCAL_COPY_HEADERS += inc/QOMX_VideoExtensions.h
LOCAL_COPY_HEADERS += inc/OMX_IndexExt.h
LOCAL_COPY_HEADERS += inc/QOMX_StreamingExtensions.h
-LOCAL_COPY_HEADERS += inc/QCMediaDefs.h
-LOCAL_COPY_HEADERS += inc/QCMetaData.h
+
#===============================================================================
# LIBRARY for Android apps
diff --git a/mm-core/inc/OMX_Audio.h b/mm-core/inc/OMX_Audio.h
index 0d45576..04f1a99 100644
--- a/mm-core/inc/OMX_Audio.h
+++ b/mm-core/inc/OMX_Audio.h
@@ -89,7 +89,6 @@ typedef enum OMX_AUDIO_CODINGTYPE {
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_CodingAC3, /**< Any variant of AC3 encoded data */
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
diff --git a/mm-core/inc/OMX_CoreExt.h b/mm-core/inc/OMX_CoreExt.h
index 3a18eb7..3ec14b0 100644
--- a/mm-core/inc/OMX_CoreExt.h
+++ b/mm-core/inc/OMX_CoreExt.h
@@ -1,66 +1,66 @@
-/*
- * Copyright (c) 2009 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>
-
-
-/** 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 */
+/*
+ * Copyright (c) 2009 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>
+
+
+/** 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/mm-core/inc/OMX_IndexExt.h b/mm-core/inc/OMX_IndexExt.h
index f79937a..56235e5 100644
--- a/mm-core/inc/OMX_IndexExt.h
+++ b/mm-core/inc/OMX_IndexExt.h
@@ -1,85 +1,85 @@
-/*
- * 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 */
-
- /* 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_IndexKhronosExtParamNALStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
- OMX_IndexKhronosExtParamNALStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
- OMX_IndexKhronosExtParamNALStreamFormatSelect, /**< 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 */
+/*
+ * 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 */
+
+ /* 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_IndexKhronosExtParamNALStreamFormatSupported, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexKhronosExtParamNALStreamFormat, /**< reference: OMX_NALSTREAMFORMATTYPE */
+ OMX_IndexKhronosExtParamNALStreamFormatSelect, /**< 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/mm-core/inc/OMX_QCOMExtns.h b/mm-core/inc/OMX_QCOMExtns.h
index 951e2b6..7890a1d 100644
--- a/mm-core/inc/OMX_QCOMExtns.h
+++ b/mm-core/inc/OMX_QCOMExtns.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2009-2012, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -86,14 +86,6 @@ struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE
#define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0)
-/* This error event is used for H.264 long-term reference (LTR) encoding.
- * When IL client specifies an LTR frame with its identifier via
- * OMX_QCOM_INDEX_CONFIG_VIDEO_LTRUSE to the encoder, if the specified
- * LTR frame can not be located by the encoder in its LTR list, the encoder
- * issues this error event to IL client to notify the failure of LTRUse config.
- */
-#define QOMX_ErrorLTRUseFailed (OMX_ErrorVendorStartUnused + 1)
-
#define QOMX_VIDEO_BUFFERFLAG_BFRAME 0x00100000
#define QOMX_VIDEO_BUFFERFLAG_EOSEQ 0x00200000
@@ -177,14 +169,6 @@ typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE {
} OMX_QCOM_PARAM_PORTDEFINITIONTYPE;
-typedef struct OMX_QCOM_VIDEO_PARAM_QPRANGETYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 minQP;
- OMX_U32 maxQP;
-} OMX_QCOM_VIDEO_PARAM_QPRANGETYPE;
-
#define OMX_QCOM_PLATFORMPVT_EXTN "OMX.QCOM.index.param.platformprivate"
/** Allowed APIs on the above Index: OMX_SetParameter() */
@@ -266,11 +250,10 @@ enum OMX_QCOM_COLOR_FORMATTYPE
* interleaved V and U pixels. V and U pixels are sub-sampled
* by a factor of two both horizontally and vertically.
*/
- QOMX_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
+ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka,
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m,
QOMX_COLOR_FormatAndroidOpaque = (OMX_COLOR_FORMATTYPE) OMX_COLOR_FormatVendorStartUnused + 0x789,
};
@@ -374,33 +357,9 @@ enum OMX_QCOM_EXTN_INDEXTYPE
OMX_QcomIndexEnableSliceDeliveryMode = 0x7F00001F,
- OMX_QcomIndexEnableExtnUserData = 0x7F000020,
-
- /*"OMX.QCOM.index.param.video.EnableSmoothStreaming"*/
- OMX_QcomIndexParamEnableSmoothStreaming = 0x7F000021,
-
- /*"OMX.QCOM.index.param.video.QPRange" */
- OMX_QcomIndexParamVideoQPRange = 0x7F000022,
-
- OMX_QcomIndexEnableH263PlusPType = 0x7F000023,
+ OMX_QcomIndexParamSequenceHeaderWithIDR = 0x7F000020,
- /*"OMX.QCOM.index.param.video.LTRCountRangeSupported"*/
- QOMX_IndexParamVideoLTRCountRangeSupported = 0x7F000024,
-
- /*"OMX.QCOM.index.param.video.LTRMode"*/
- QOMX_IndexParamVideoLTRMode = 0x7F000025,
-
- /*"OMX.QCOM.index.param.video.LTRCount"*/
- QOMX_IndexParamVideoLTRCount = 0x7F000026,
-
- /*"OMX.QCOM.index.config.video.LTRPeriod"*/
- QOMX_IndexConfigVideoLTRPeriod = 0x7F000027,
-
- /*"OMX.QCOM.index.config.video.LTRUse"*/
- QOMX_IndexConfigVideoLTRUse = 0x7F000028,
-
- /*"OMX.QCOM.index.config.video.LTRMark"*/
- QOMX_IndexConfigVideoLTRMark = 0x7F000029,
+ OMX_QcomIndexParamEnableVUIStreamRestrictFlag = 0x7F000021,
};
/**
@@ -430,141 +389,6 @@ typedef struct QOMX_EXTNINDEX_PARAMTYPE {
} QOMX_EXTNINDEX_PARAMTYPE;
/**
- * Range index parameter. This structure is used to enable
- * vendor specific extension on input/output port and
- * to pass the required minimum and maximum values
- *
- * STRUCT MEMBERS:
- * nSize : Size of Structure in bytes
- * nVersion : OpenMAX IL specification version information
- * nPortIndex : Index of the port to which this structure applies
- * nMin : Minimum value
- * nMax : Maximum value
- * nSteSize : Step size
- */
-typedef struct QOMX_EXTNINDEX_RANGETYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_S32 nMin;
- OMX_S32 nMax;
- OMX_S32 nStepSize;
-} QOMX_EXTNINDEX_RANGETYPE;
-
-/**
- * Specifies LTR mode types.
- */
-typedef enum QOMX_VIDEO_LTRMODETYPE
-{
- QOMX_VIDEO_LTRMode_Disable = 0x0, /**< LTR encoding is disabled */
- QOMX_VIDEO_LTRMode_Manual = 0x1, /**< In this mode, IL client configures
- ** the encoder the LTR count and manually
- ** controls the marking and use of LTR
- ** frames during video encoding.
- */
- QOMX_VIDEO_LTRMode_Auto = 0x2, /**< In this mode, IL client configures
- ** the encoder the LTR count and LTR
- ** period. The encoder marks LTR frames
- ** automatically based on the LTR period
- ** during video encoding. IL client controls
- ** the use of LTR frames.
- */
- QOMX_VIDEO_LTRMode_MAX = 0x7FFFFFFF /** Maximum LTR Mode type */
-} QOMX_VIDEO_LTRMODETYPE;
-
-/**
- * LTR mode index parameter. This structure is used
- * to enable vendor specific extension on output port
- * to pass the LTR mode information.
- *
- * STRUCT MEMBERS:
- * nSize : Size of Structure in bytes
- * nVersion : OpenMAX IL specification version information
- * nPortIndex : Index of the port to which this structure applies
- * eLTRMode : Specifies the LTR mode used in encoder
- */
-typedef struct QOMX_VIDEO_PARAM_LTRMODE_TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_VIDEO_LTRMODETYPE eLTRMode;
-} QOMX_VIDEO_PARAM_LTRMODE_TYPE;
-
-/**
- * LTR count index parameter. This structure is used
- * to enable vendor specific extension on output port
- * to pass the LTR count information.
- *
- * STRUCT MEMBERS:
- * nSize : Size of Structure in bytes
- * nVersion : OpenMAX IL specification version information
- * nPortIndex : Index of the port to which this structure applies
- * nCount : Specifies the number of LTR frames stored in the
- * encoder component
- */
-typedef struct QOMX_VIDEO_PARAM_LTRCOUNT_TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nCount;
-} QOMX_VIDEO_PARAM_LTRCOUNT_TYPE;
-
-/**
- * LTR period index parameter. This structure is used
- * to enable vendor specific extension on output port
- * to pass the LTR period information.
- *
- * STRUCT MEMBERS:
- * nSize : Size of Structure in bytes
- * nVersion : OpenMAX IL specification version information
- * nPortIndex : Index of the port to which this structure applies
- * nFrames : Specifies the number of frames between two consecutive
- * LTR frames.
- */
-typedef struct QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nFrames;
-} QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE;
-
-/**
- * Marks the next encoded frame as an LTR frame.
- * STRUCT MEMBERS:
- * nSize : Size of Structure in bytes
- * nVersion : OpenMAX IL specification version information
- * nPortIndex : Index of the port to which this structure applies
- */
-typedef struct QOMX_VIDEO_CONFIG_LTRMARK_TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
-} QOMX_VIDEO_CONFIG_LTRMARK_TYPE;
-
-/**
- * Specifies an LTR frame to encode subsequent frames.
- * STRUCT MEMBERS:
- * nSize : Size of Structure in bytes
- * nVersion : OpenMAX IL specification version information
- * nPortIndex : Index of the port to which this structure applies
- * nID : Specifies the identifier of the LTR frame to be used
- as reference frame for encoding subsequent frames.
- * nFrames : Specifies the number of subsequent frames to be
- encoded using the LTR frame with its identifier
- nID as reference frame. Short-term reference frames
- will be used thereafter. The value of 0xFFFFFFFF
- indicates that all subsequent frames will be
- encodedusing this LTR frame as reference frame.
- */
-typedef struct QOMX_VIDEO_CONFIG_LTRUSE_TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nID;
- OMX_U32 nFrames;
-} QOMX_VIDEO_CONFIG_LTRUSE_TYPE;
-
-/**
* Enumeration used to define the video encoder modes
*
* ENUMS:
@@ -764,12 +588,6 @@ typedef struct OMX_QCOM_ASPECT_RATIO
OMX_U32 aspectRatioY;
} OMX_QCOM_ASPECT_RATIO;
-typedef struct OMX_QCOM_DISPLAY_ASPECT_RATIO
-{
- OMX_U32 displayVerticalSize;
- OMX_U32 displayHorizontalSize;
-} OMX_QCOM_DISPLAY_ASPECT_RATIO;
-
typedef struct OMX_QCOM_FRAME_PACK_ARRANGEMENT
{
OMX_U32 nSize;
@@ -802,7 +620,6 @@ typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
OMX_QCOM_INTERLACETYPE interlaceType;
OMX_QCOM_PANSCAN panScan;
OMX_QCOM_ASPECT_RATIO aspectRatio;
- OMX_QCOM_DISPLAY_ASPECT_RATIO displayAspectRatio;
OMX_U32 nConcealedMacroblocks;
OMX_U32 nFrameRate;
} OMX_QCOM_EXTRADATA_FRAMEINFO;
@@ -844,10 +661,7 @@ typedef enum OMX_QCOM_EXTRADATATYPE
OMX_ExtraDataVideoEncoderSliceInfo = 0x7F000005,
OMX_ExtraDataConcealMB = 0x7F000006,
OMX_ExtraDataInterlaceFormat = 0x7F000007,
- OMX_ExtraDataPortDef = 0x7F000008,
- OMX_ExtraDataMP2ExtnData = 0x7F000009,
- OMX_ExtraDataMP2UserData = 0x7F00000a,
- OMX_ExtraDataVideoLTRInfo = 0x7F00000b,
+ OMX_ExtraDataPortDef = 0x7F000008
} OMX_QCOM_EXTRADATATYPE;
typedef struct OMX_STREAMINTERLACEFORMATTYPE {
@@ -1056,6 +870,15 @@ typedef enum {
QOMX_VIDEO_CONTENT_RL_VIEW = 2,
} QOMX_VIDEO_CONTENT_INTERPRETATION;
+// A pointer to this struct is passed to OMX_SetParameter when the extension
+// index for the 'OMX.google.android.index.setVUIStreamRestrictFlag' extension
+// is given.
+typedef struct QOMX_VUI_BITSTREAM_RESTRICT {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_BOOL bEnable;
+} QOMX_VUI_BITSTREAM_RESTRICT;
+
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/mm-core/inc/QCMediaDefs.h b/mm-core/inc/QCMediaDefs.h
deleted file mode 100644
index 79b21ab..0000000
--- a/mm-core/inc/QCMediaDefs.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright (c) 2012 - 2013, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * 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 QC_MEDIA_DEFS_H_
-
-#define QC_MEDIA_DEFS_H_
-
-namespace android {
-
-extern const char *MEDIA_MIMETYPE_AUDIO_EVRC;
-extern const char *MEDIA_MIMETYPE_VIDEO_WMV;
-extern const char *MEDIA_MIMETYPE_AUDIO_WMA;
-extern const char *MEDIA_MIMETYPE_CONTAINER_ASF;
-extern const char *MEDIA_MIMETYPE_VIDEO_DIVX;
-extern const char *MEDIA_MIMETYPE_AUDIO_AC3;
-extern const char *MEDIA_MIMETYPE_CONTAINER_AAC;
-extern const char *MEDIA_MIMETYPE_CONTAINER_QCP;
-extern const char *MEDIA_MIMETYPE_VIDEO_DIVX311;
-extern const char *MEDIA_MIMETYPE_VIDEO_DIVX4;
-extern const char *MEDIA_MIMETYPE_CONTAINER_MPEG2;
-extern const char *MEDIA_MIMETYPE_CONTAINER_3G2;
-extern const char *MEDIA_MIMETYPE_AUDIO_DTS;
-extern const char *MEDIA_MIMETYPE_AUDIO_DTS_LBR;
-extern const char *MEDIA_MIMETYPE_AUDIO_EAC3;
-extern const char *MEDIA_MIMETYPE_AUDIO_AMR_WB_PLUS;
-extern const char *MEDIA_MIMETYPE_CONTAINER_QCMPEG2TS;
-} // namespace android
-
-#endif //QC_MEDIA_DEFS_H_
diff --git a/mm-core/inc/QCMetaData.h b/mm-core/inc/QCMetaData.h
deleted file mode 100644
index abf6355..0000000
--- a/mm-core/inc/QCMetaData.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * Copyright (c) 2012-2013, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
- * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
- * 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 QC_META_DATA_H_
-
-#define QC_META_DATA_H_
-
-namespace android {
-
-enum {
- kKeyAacCodecSpecificData = 'nacc' , // for native aac files
-
- kKeyRawCodecSpecificData = 'rcsd', // raw data - added to support mmParser
- kKeyDivXVersion = 'DivX', // int32_t
- kKeyDivXDrm = 'QDrm', // void *
- kKeyWMAEncodeOpt = 'eopt', // int32_t
- kKeyWMABlockAlign = 'blka', // int32_t
- kKeyWMAVersion = 'wmav', // int32_t
- kKeyWMAAdvEncOpt1 = 'ade1', // int16_t
- kKeyWMAAdvEncOpt2 = 'ade2', // int32_t
- kKeyWMAFormatTag = 'fmtt', // int64_t
- kKeyWMABitspersample = 'bsps', // int64_t
- kKeyWMAVirPktSize = 'vpks', // int64_t
- kKeyWMAChannelMask = 'chmk', // int32_t
-
- kKeyFileFormat = 'ffmt', // cstring
-
- kkeyAacFormatAdif = 'adif', // bool (int32_t)
- kkeyAacFormatLtp = 'ltp',
-
-
- //DTS subtype
- kKeyDTSSubtype = 'dtss', //int32_t
-
- //Extractor sets this
- kKeyUseArbitraryMode = 'ArbM', //bool (int32_t)
- kKeySmoothStreaming = 'ESmS', //bool (int32_t)
- kKeyHFR = 'hfr ', // int32_t
-};
-
-enum {
- kTypeDivXVer_3_11,
- kTypeDivXVer_4,
- kTypeDivXVer_5,
- kTypeDivXVer_6,
-};
-enum {
- kTypeWMA,
- kTypeWMAPro,
- kTypeWMALossLess,
-};
-
-} // namespace android
-
-#endif // QC_META_DATA_H_
diff --git a/mm-core/inc/QOMX_AudioExtensions.h b/mm-core/inc/QOMX_AudioExtensions.h
index 642fe76..ccc1ca3 100644
--- a/mm-core/inc/QOMX_AudioExtensions.h
+++ b/mm-core/inc/QOMX_AudioExtensions.h
@@ -1,511 +1,511 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2009, 2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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.
---------------------------------------------------------------------------*/
-/*============================================================================
- O p e n M A X w r a p p e r s
- O p e n M A X C o r e
-
-*//** @file QOMX_AudioExtensions.h
- This module contains the extensions for Audio
-
-*//*========================================================================*/
-
-#ifndef __H_QOMX_AUDIOEXTENSIONS_H__
-#define __H_QOMX_AUDIOEXTENSIONS_H__
-
-/*========================================================================
-
- INCLUDE FILES FOR MODULE
-
-========================================================================== */
-#include <OMX_Audio.h>
-
-/*========================================================================
-
- DEFINITIONS AND DECLARATIONS
-
-========================================================================== */
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-
-/* Audio extension strings */
-#define OMX_QCOM_INDEX_PARAM_AMRWBPLUS "OMX.Qualcomm.index.audio.amrwbplus"
-#define OMX_QCOM_INDEX_PARAM_WMA10PRO "OMX.Qualcomm.index.audio.wma10pro"
-#define OMX_QCOM_INDEX_PARAM_SESSIONID "OMX.Qualcomm.index.audio.sessionId"
-#define OMX_QCOM_INDEX_PARAM_VOICERECORDTYPE "OMX.Qualcomm.index.audio.VoiceRecord"
-#define OMX_QCOM_INDEX_PARAM_AC3TYPE "OMX.Qualcomm.index.audio.ac3"
-#define OMX_QCOM_INDEX_PARAM_AC3PP "OMX.Qualcomm.index.audio.postproc.ac3"
-#define OMX_QCOM_INDEX_PARAM_DAK_BUNDLE "OMX.Qualcomm.index.audio.dakbundle"
-#define OMX_QCOM_INDEX_PARAM_DAK_M2S "OMX.Qualcomm.index.audio.dak_m2s"
-#define OMX_QCOM_INDEX_PARAM_DAK_SSE "OMX.Qualcomm.index.audio.dak_sse"
-#define OMX_QCOM_INDEX_PARAM_DAK_SLC "OMX.Qualcomm.index.audio.dak_slc"
-#define OMX_QCOM_INDEX_PARAM_DAK_VOL "OMX.Qualcomm.index.audio.dak_vol"
-#define OMX_QCOM_INDEX_PARAM_DAK_NB "OMX.Qualcomm.index.audio.dak_nb"
-#define OMX_QCOM_INDEX_PARAM_DAK_GEQ "OMX.Qualcomm.index.audio.dak_geq"
-#define OMX_QCOM_INDEX_PARAM_DAK_MSR "OMX.Qualcomm.index.audio.dak_msr"
-#define OMX_QCOM_INDEX_PARAM_DAK_HFE "OMX.Qualcomm.index.audio.dak_hfe"
-#define OMX_QCOM_INDEX_PARAM_DAK_FADE "OMX.Qualcomm.index.audio.dak_fade"
-#define OMX_QCOM_INDEX_PARAM_DAK_SEQ "OMX.Qualcomm.index.audio.dak_seq"
-#define OMX_QCOM_INDEX_CONFIG_DUALMONO "OMX.Qualcomm.index.audio.dualmono"
-
-typedef enum QOMX_AUDIO_AMRBANDMODETYPE {
- QOMX_AUDIO_AMRBandModeWB9 = 0x7F000001,/**< AMRWB Mode 9 = SID*/
- QOMX_AUDIO_AMRBandModeWB10 = 0x7F000002,/**< AMRWB Mode 10 = 13600 bps */
- QOMX_AUDIO_AMRBandModeWB11 = 0x7F000003,/**< AMRWB Mode 11 = 18000 bps */
- QOMX_AUDIO_AMRBandModeWB12 = 0x7F000004,/**< AMRWB Mode 12 = 24000 bps */
- QOMX_AUDIO_AMRBandModeWB13 = 0x7F000005,/**< AMRWB Mode 13 = 24000 bps */
- QOMX_AUDIO_AMRBandModeWB14 = 0x7F000006,/**< AMRWB Mode 14 = FRAME_ERASE*/
- QOMX_AUDIO_AMRBandModeWB15 = 0x7F000007,/**< AMRWB Mode 15 = NO_DATA */
-}QOMX_AUDIO_AMRBANDMODETYPE;
-
-typedef enum QOMX_AUDIO_CODINGTYPE {
- QOMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
- QOMX_AUDIO_CodingEVRCB = 0x7F000001,
- QOMX_AUDIO_CodingEVRCWB = 0x7F000002,
- QOMX_AUDIO_CodingFLAC = 0x7F000003,
- QOMX_AUDIO_CodingMax = 0x7FFFFFFF
-}QOMX_AUDIO_CODINGTYPE;
-
-
-/**
- * AMR WB PLUS type
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * nChannels : Number of channels
- * nBitRate : Bit rate read only field
- * nSampleRate : Sampling frequency for the clip(16/24/32/48KHz)
- * eAMRBandMode : AMR Band Mode enumeration
- * eAMRDTXMode : AMR DTX Mode enumeration
- * eAMRFrameFormat : AMR frame format enumeration
- */
-
-typedef struct QOMX_AUDIO_PARAM_AMRWBPLUSTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nChannels;
- OMX_U32 nBitRate;
- OMX_U32 nSampleRate;
- OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode;
- OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode;
- OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat;
-} QOMX_AUDIO_PARAM_AMRWBPLUSTYPE;
-
-typedef enum QOMX_AUDIO_WMAFORMATTYPE {
- QOMX_AUDIO_WMAFormat10Pro = 0x7F000001, /**< Windows Media Audio format 10*/
-} QOMX_AUDIO_WMAFORMATTYPE;
-
-/**
- * WMA 10 PRO type
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * nChannels : Number of channels
- * nBitRate : Bit rate read only field
- * eFormat : Version of WMA stream / data
- * eProfile : Profile of WMA stream / data
- * nSamplingRate : Sampling rate of the source data
- * nBlockAlign : block alignment, or block size, in bytes of the audio codec
- * nEncodeOptions : WMA Type-specific data
- * nSuperBlockAlign : WMA Type-specific data
- * validBitsPerSample : encoded stream (24-bit or 16-bit)
- * formatTag : codec ID(0x162 or 0x166)
- * advancedEncodeOpt : bit packed words indicating the features supported for LBR bitstream
- * advancedEncodeOpt2 : bit packed words indicating the features supported for LBR bitstream
- */
-typedef struct QOMX_AUDIO_PARAM_WMA10PROTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U16 nChannels;
- OMX_U32 nBitRate;
- QOMX_AUDIO_WMAFORMATTYPE eFormat;
- OMX_AUDIO_WMAPROFILETYPE eProfile;
- OMX_U32 nSamplingRate;
- OMX_U16 nBlockAlign;
- OMX_U16 nEncodeOptions;
- OMX_U32 nSuperBlockAlign;
- OMX_U32 validBitsPerSample;
- OMX_U32 formatTag;
- OMX_U32 advancedEncodeOpt;
- OMX_U32 advancedEncodeOpt2;
- OMX_U16 nVirtualPktSize;
-} QOMX_AUDIO_PARAM_WMA10PROTYPE;
-
-
-typedef enum OMX_AUDIO_AC3FORMATTYPE {
- omx_audio_ac3 = 0x7f000001, /**< ac-3 */
- omx_audio_eac3 = 0x7f000002 /**< eac-3 */
-} OMX_AUDIO_AC3FORMATTYPE;
-
-typedef enum OMX_AUDIO_AC3_CHANNEL_CONFIG
-{
- OMX_AUDIO_AC3_CHANNEL_CONFIG_RSVD = 0,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_1_0,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_2_0,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_2_1,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_1,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0_1,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2_1,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2_1,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0_2,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2_2,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2_2,
- OMX_AUDIO_AC3_CHANNEL_CONFIG_DEFAULT = 0xFFFF
-} OMX_AUDIO_AC3_CHANNEL_CONFIG;
-
-/**
- * AC-3 type
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * nChannels : Number of channels
- * nBitRate : Bitrate
- * nSamplingRate : Sampling rate, 32K, 44.1K, 48K only supported
- * eFormat : AC-3 or EAC-3
- * eChannelConfig : Channel configuration
- * nProgramID : Indication of ProgramID, 0-7
- * bCompressionOn : Flag to enable Compression
- * bLfeOn : Flag for LFE on/off
- * bDelaySurroundChannels : Flag to put delay on surround channels
- *
- */
-typedef struct QOMX_AUDIO_PARAM_AC3TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U16 nChannels;
- OMX_U32 nBitRate;
- OMX_U32 nSamplingRate;
- OMX_AUDIO_AC3FORMATTYPE eFormat;
- OMX_AUDIO_AC3_CHANNEL_CONFIG eChannelConfig;
- OMX_U8 nProgramID;
- OMX_BOOL bCompressionOn;
- OMX_BOOL bLfeOn;
- OMX_BOOL bDelaySurroundChannels;
-} QOMX_AUDIO_PARAM_AC3TYPE;
-
-typedef enum OMX_AUDIO_AC3_CHANNEL_ROUTING
-{
- OMX_AUDIO_AC3_CHANNEL_LEFT,
- OMX_AUDIO_AC3_CHANNEL_CENTER,
- OMX_AUDIO_AC3_CHANNEL_RIGHT,
- OMX_AUDIO_AC3_CHANNEL_LEFT_SURROUND,
- OMX_AUDIO_AC3_CHANNEL_RIGHT_SURROUND,
- OMX_AUDIO_AC3_CHANNEL_SURROUND,
- OMX_AUDIO_AC3_CHANNEL_EXTENSION_1,
- OMX_AUDIO_AC3_CHANNEL_EXTENSION_2,
- OMX_AUDIO_AC3_CHANNEL_DEFAULT = 0xFFFF
-} OMX_AUDIO_AC3_CHANNEL_ROUTING;
-
-typedef enum OMX_AUDIO_AC3_COMPRESSION_MODE
-{
- OMX_AUDIO_AC3_COMPRESSION_MODE_ANALOG_DIALNORM,
- OMX_AUDIO_AC3_COMPRESSION_MODE_DIGITAL_DIALNORM,
- OMX_AUDIO_AC3_COMPRESSION_MODE_LINE_OUT,
- OMX_AUDIO_AC3_COMPRESSION_MODE_RF_REMOD
-} OMX_AUDIO_AC3_COMPRESSION_MODE;
-
-typedef enum OMX_AUDIO_AC3_STEREO_MODE
-{
- OMX_AUDIO_AC3_STEREO_MODE_AUTO_DETECT,
- OMX_AUDIO_AC3_STEREO_MODE_LT_RT,
- OMX_AUDIO_AC3_STEREO_MODE_LO_RO,
- OMX_AUDIO_AC3_STEREO_MODE_DEFAULT = 0xFFFF
-} OMX_AUDIO_AC3_STEREO_MODE;
-
-typedef enum OMX_AUDIO_AC3_DUAL_MONO_MODE
-{
- OMX_AUDIO_AC3_DUAL_MONO_MODE_STEREO,
- OMX_AUDIO_AC3_DUAL_MONO_MODE_LEFT_MONO,
- OMX_AUDIO_AC3_DUAL_MONO_MODE_RIGHT_MONO,
- OMX_AUDIO_AC3_DUAL_MONO_MODE_MIXED_MONO,
- OMX_AUDIO_AC3_DUAL_MONO_MODE_DEFAULT = 0xFFFF
-} OMX_AUDIO_AC3_DUAL_MONO_MODE;
-
-typedef enum OMX_AUDIO_AC3_KARAOKE_MODE
-{
- OMX_AUDIO_AC3_KARAOKE_MODE_NO_VOCAL,
- OMX_AUDIO_AC3_KARAOKE_MODE_LEFT_VOCAL,
- OMX_AUDIO_AC3_KARAOKE_MODE_RIGHT_VOCAL,
- OMX_AUDIO_AC3_KARAOKE_MODE_BOTH_VOCAL,
- OMX_AUDIO_AC3_KARAOKE_MODE_DEFAULT = 0xFFFF
-} OMX_AUDIO_AC3_KARAOKE_MODE;
-
-
-typedef struct QOMX_AUDIO_PARAM_AC3PP
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_AUDIO_AC3_CHANNEL_ROUTING eChannelRouting[8];
- OMX_AUDIO_AC3_COMPRESSION_MODE eCompressionMode;
- OMX_AUDIO_AC3_STEREO_MODE eStereoMode;
- OMX_AUDIO_AC3_DUAL_MONO_MODE eDualMonoMode;
- OMX_U32 usPcmScale;
- OMX_U32 usDynamicScaleBoost;
- OMX_U32 usDynamicScaleCut;
- OMX_AUDIO_AC3_KARAOKE_MODE eKaraokeMode;
-} QOMX_AUDIO_PARAM_AC3PP;
-
-
-/**
- * Stream info data
- *
- * STRUCT MEMBERS:
- * sessionId : session Id for alsa to route data
- */
-typedef struct QOMX_AUDIO_STREAM_INFO_DATA {
- OMX_U8 sessionId;
-} QOMX_AUDIO_STREAM_INFO_DATA;
-
-
-/**
- * Record Path
- *
- * STRUCT MEMBERS:
- * recPath : Record Path for encoding
- */
-typedef enum{
-
-QOMX_AUDIO_VOICE_TX,
-QOMX_AUDIO_VOICE_RX,
-QOMX_AUDIO_VOICE_MIXED,
-
-} QOMX_AUDIO_VOICERECORDMODETYPE;
-typedef struct QOMX_AUDIO_CONFIG_VOICERECORDTYPE {
-
-OMX_U32 nSize;
-OMX_VERSIONTYPE nVersion;
-QOMX_AUDIO_VOICERECORDMODETYPE eVoiceRecordMode;
-} QOMX_AUDIO_CONFIG_VOICERECORDTYPE;
-
-/* Enum for mapping dual-mono contents to left and right channels */
-typedef enum OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG {
- OMX_AUDIO_DUAL_MONO_MODE_FL_FR,/* 1st SCE to left & right */
- OMX_AUDIO_DUAL_MONO_MODE_SL_SR,/* 2nd SCE to left & right */
- OMX_AUDIO_DUAL_MONO_MODE_SL_FR,/* 2nd SCE to left, 1st SCE to right */
- OMX_AUDIO_DUAL_MONO_MODE_FL_SR,/* 1st SCE to left, 2nd SCE to right default */
- OMX_AUDIO_DUAL_MONO_MODE_DEFAULT = OMX_AUDIO_DUAL_MONO_MODE_FL_SR,
- OMX_AUDIO_DUAL_MONO_MODE_INVALID = -1
-} OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG;
-
-/************************************/
-/* DAK */
-/*************************************/
-
-/** this is the list of custom vendor index */
-typedef enum OMX_INDEX_DAK_TYPE {
- OMX_IndexConfigDAK_BUNDLE = OMX_IndexVendorStartUnused /*0x7F000000*/, /**< reference: OMX_DAK_CONFIG_BUNDLETYPE */
- OMX_IndexConfigDAK_M2S, /**< reference: OMX_DAK_CONFIG_M2STYPE */
- OMX_IndexConfigDAK_SSE, /**< reference: OMX_DAK_CONFIG_SSETYPE */
- OMX_IndexConfigDAK_SLC, /**< reference: OMX_DAK_CONFIG_SLCTYPE */
- OMX_IndexConfigDAK_VOL, /**< reference: OMX_DAK_CONFIG_VOLTYPE */
- OMX_IndexConfigDAK_NB, /**< reference: OMX_DAK_CONFIG_NBTYPE */
- OMX_IndexConfigDAK_GEQ, /**< reference: OMX_DAK_CONFIG_GEQTYPE */
- OMX_IndexConfigDAK_MSR, /**< reference: OMX_DAK_CONFIG_MSRTYPE */
- OMX_IndexConfigDAK_HFE, /**< reference: OMX_DAK_CONFIG_HFETYPE */
- OMX_IndexConfigDAK_FADE,/**< reference: OMX_DAK_CONFIG_FADETYPE */
- OMX_IndexConfigDAK_SEQ, /**< reference: OMX_DAK_CONFIG_SEQTYPE */
-
-} OMX_INDEX_DAK_TYPE;
-
-
-/** Dolby Audio Kernel TDAS bundle */
-typedef struct OMX_DAK_CONFIG_BUNDLETYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_U32 nDAK_Version; /**< Dolby Audio Kernel version information */
- OMX_U32 nDAK_Revision; /**< Dolby Audio Kernel revision information */
- OMX_U8 nLfeMixLevel; /**< level at which the LFE channel is mixed into the output audio */
- OMX_U8 nSampleRateIndex; /**< Output sample rate */
- OMX_U8 nInChans; /**< Channel format of input audio */
- OMX_U8 nInMatrix; /**< L/R mixing specification for stereo audio input */
- OMX_U8 nBypass; /**< Audio Processing bypass */
- OMX_U8 nRateMultipier; /**< Sample-rate multiplier (output with respect to input) */
- OMX_U8 nInChanFormat; /**< Input/Output channel format */
- OMX_U8 nMsrMaxProfile; /**< Maximum number of virtual rendering channels in Mobile Surround */
- OMX_BOOL bPortablemodeEnable; /**< Enable or disable Pulse Portable Mode */
- OMX_S16 nPotablemodeGain; /**< Send the Portable Mode gain value from the Pulse decoder */
- OMX_U8 nORL; /**< Device specific target signal level (output reference level) */
- OMX_BOOL bPulsedownmixEnable; /**< Enable the Pulse Downmix compensation */
- OMX_S8 nPulsedownmixAtten; /**< Attenuation value that Pulse is currently applying */
- OMX_U8 nOutChans; /**< Channel format of output audio */
-
-} OMX_DAK_CONFIG_BUNDLETYPE;
-
-/** Dolby Audio Kernel Mono-to-Stereo Creator */
-typedef struct OMX_DAK_CONFIG_M2STYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Mono-to-Stereo Creator enable */
- OMX_BOOL bDetector; /**< Stereo detector status */
-} OMX_DAK_CONFIG_M2STYPE;
-
-/** Dolby Audio Kernel Sound Space Expander */
-typedef struct OMX_DAK_CONFIG_SSETYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Sound Space Expander enable */
- OMX_U8 nWidth; /**< Width of expansion effect */
- OMX_U8 nSpkMode; /**< Speaker Mode */
-} OMX_DAK_CONFIG_SSETYPE;
-
-/** Dolby Audio Kernel Sound Level Controller */
-typedef struct OMX_DAK_CONFIG_SLCTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Sound Level Controller enable */
- OMX_U8 nLevel; /**< Source audio RMS level */
- OMX_U8 nDepth; /**< Depth of effect */
-} OMX_DAK_CONFIG_SLCTYPE;
-
-/** Dolby Audio Kernel Volume */
-typedef struct OMX_DAK_CONFIG_VOLTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Volume enable */
- OMX_U8 nGainType; /**< Linear/Logarithmic audio scaling */
- OMX_U8 nInternalGain; /**< Audio volume scale */
- OMX_U8 nExternalGain; /**< Audio volume scale applied by external volume control */
- OMX_S8 nBalance; /**< L/R panning for output audio */
- OMX_BOOL bMute; /**< Audio Mute */
-} OMX_DAK_CONFIG_VOLTYPE;
-
-/** Dolby Audio Kernel Natural Bass */
-typedef struct OMX_DAK_CONFIG_NBTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Natural Bass enable */
- OMX_U8 nCutoff; /**< Speakers/headphones lower cutoff frequency */
- OMX_U8 nBoost; /**< Strength of effect */
- OMX_U8 nLevel; /**< Maximum output level capability of speakers/headphones */
-} OMX_DAK_CONFIG_NBTYPE;
-
-/** Dolby Audio Kernel Graphic EQ */
-typedef struct OMX_DAK_CONFIG_GEQTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Graphic EQ enable */
- OMX_U8 nNbands; /**< Number of frequency bands */
- OMX_S8 nPreamp; /**< Global attenuation to apply prior to band level adjustment */
- OMX_U8 nMaxboost; /**< Maximum absolute boost with respect to the source audio */
- OMX_S8 nBand1; /**< Boost/cut for 1st frequency band */
- OMX_S8 nBand2; /**< Boost/cut for 2nd frequency band */
- OMX_S8 nBand3; /**< Boost/cut for 3rd frequency band */
- OMX_S8 nBand4; /**< Boost/cut for 4th frequency band */
- OMX_S8 nBand5; /**< Boost/cut for 5th frequency band */
- OMX_S8 nBand6; /**< Boost/cut for 6th frequency band */
- OMX_S8 nBand7; /**< Boost/cut for 7th frequency band */
-} OMX_DAK_CONFIG_GEQTYPE;
-
-/** Dolby Audio Kernel, Mobile Surround and Surround Upmixer */
-typedef struct OMX_DAK_CONFIG_MSRTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bMsrEnable; /**< Mobile Surround enable */
- OMX_U8 nMsrRoom; /**< Room Size control */
- OMX_U8 nMsrBright; /**< Brightness control */
- OMX_BOOL bMupEnable; /**< Mobile Surround Upmixer enable */
-} OMX_DAK_CONFIG_MSRTYPE;
-
-/** Dolby Audio Kernel High Frequency Enhancer */
-typedef struct OMX_DAK_CONFIG_HFETYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< High Frequency Enhancer enable */
- OMX_U8 nDepth; /**< Strength of effect */
-} OMX_DAK_CONFIG_HFETYPE;
-
-/** Dolby Audio Kernel Fade */
-typedef struct OMX_DAK_CONFIG_FADETYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Fade enable */
- OMX_U8 nTarget; /**< Target fade level */
- OMX_U16 nTime; /**< Fade time interval */
-} OMX_DAK_CONFIG_FADETYPE;
-
-/** Dolby Audio Kernel Speaker EQ */
-typedef struct OMX_DAK_CONFIG_SEQTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL bEnable; /**< Speaker EQ enable */
- OMX_S8 nLeftGainDB; /**< Additional gain for Left channel */
- OMX_S8 nRightGainDB; /**< Additional gain for Right channel */
- OMX_U8 nCoef48000Size; /**< Length of the block of coefficients for 48KHz Sampling Rate case */
- OMX_PTR pCoef48000; /**< Pointer to the block of coefficients for the 48KHz case */
- OMX_U8 nCoef44100Size; /**< Length of the block of coefficients for 44.1KHz Sampling Rate case */
- OMX_PTR pCoef44100; /**< Pointer to the block of coefficients for the 44.1KHz case */
- OMX_U8 nCoef32000Size; /**< Length of the block of coefficients for 32KHz Sampling Rate case */
- OMX_PTR pCoef32000; /**< Pointer to the block of coefficients for the 32KHz case */
- OMX_U8 nCoef24000Size; /**< Length of the block of coefficients for 24KHz Sampling Rate case */
- OMX_PTR pCoef24000; /**< Pointer to the block of coefficients for the 24KHz case */
-
-} OMX_DAK_CONFIG_SEQTYPE;
-
-
-typedef enum OMX_AUDIO_CHANNELTYPE_EXTENSION {
- OMX_AUDIO_ChannelTS = OMX_AUDIO_ChannelVendorStartUnused, /**< Top Surround */
- OMX_AUDIO_ChannelCVH /**< Central Vertical Height */
-} OMX_AUDIO_CHANNELTYPE_EXTENSION;
-
-/**
- * DUAL-MONO type
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * eChannelConfig : Enum for channel config
- *
- */
-typedef struct QOMX_AUDIO_CONFIG_DUALMONOTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG eChannelConfig;
-} QOMX_AUDIO_CONFIG_DUALMONOTYPE;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* end of macro __H_QOMX_AUDIOEXTENSIONS_H__ */
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, 2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+*//** @file QOMX_AudioExtensions.h
+ This module contains the extensions for Audio
+
+*//*========================================================================*/
+
+#ifndef __H_QOMX_AUDIOEXTENSIONS_H__
+#define __H_QOMX_AUDIOEXTENSIONS_H__
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Audio.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/* Audio extension strings */
+#define OMX_QCOM_INDEX_PARAM_AMRWBPLUS "OMX.Qualcomm.index.audio.amrwbplus"
+#define OMX_QCOM_INDEX_PARAM_WMA10PRO "OMX.Qualcomm.index.audio.wma10pro"
+#define OMX_QCOM_INDEX_PARAM_SESSIONID "OMX.Qualcomm.index.audio.sessionId"
+#define OMX_QCOM_INDEX_PARAM_VOICERECORDTYPE "OMX.Qualcomm.index.audio.VoiceRecord"
+#define OMX_QCOM_INDEX_PARAM_AC3TYPE "OMX.Qualcomm.index.audio.ac3"
+#define OMX_QCOM_INDEX_PARAM_AC3PP "OMX.Qualcomm.index.audio.ac3.postproc"
+#define OMX_QCOM_INDEX_PARAM_DAK_BUNDLE "OMX.Qualcomm.index.audio.dakbundle"
+#define OMX_QCOM_INDEX_PARAM_DAK_M2S "OMX.Qualcomm.index.audio.dak_m2s"
+#define OMX_QCOM_INDEX_PARAM_DAK_SSE "OMX.Qualcomm.index.audio.dak_sse"
+#define OMX_QCOM_INDEX_PARAM_DAK_SLC "OMX.Qualcomm.index.audio.dak_slc"
+#define OMX_QCOM_INDEX_PARAM_DAK_VOL "OMX.Qualcomm.index.audio.dak_vol"
+#define OMX_QCOM_INDEX_PARAM_DAK_NB "OMX.Qualcomm.index.audio.dak_nb"
+#define OMX_QCOM_INDEX_PARAM_DAK_GEQ "OMX.Qualcomm.index.audio.dak_geq"
+#define OMX_QCOM_INDEX_PARAM_DAK_MSR "OMX.Qualcomm.index.audio.dak_msr"
+#define OMX_QCOM_INDEX_PARAM_DAK_HFE "OMX.Qualcomm.index.audio.dak_hfe"
+#define OMX_QCOM_INDEX_PARAM_DAK_FADE "OMX.Qualcomm.index.audio.dak_fade"
+#define OMX_QCOM_INDEX_PARAM_DAK_SEQ "OMX.Qualcomm.index.audio.dak_seq"
+#define OMX_QCOM_INDEX_CONFIG_DUALMONO "OMX.Qualcomm.index.audio.dualmono"
+
+typedef enum QOMX_AUDIO_AMRBANDMODETYPE {
+ QOMX_AUDIO_AMRBandModeWB9 = 0x7F000001,/**< AMRWB Mode 9 = SID*/
+ QOMX_AUDIO_AMRBandModeWB10 = 0x7F000002,/**< AMRWB Mode 10 = 13600 bps */
+ QOMX_AUDIO_AMRBandModeWB11 = 0x7F000003,/**< AMRWB Mode 11 = 18000 bps */
+ QOMX_AUDIO_AMRBandModeWB12 = 0x7F000004,/**< AMRWB Mode 12 = 24000 bps */
+ QOMX_AUDIO_AMRBandModeWB13 = 0x7F000005,/**< AMRWB Mode 13 = 24000 bps */
+ QOMX_AUDIO_AMRBandModeWB14 = 0x7F000006,/**< AMRWB Mode 14 = FRAME_ERASE*/
+ QOMX_AUDIO_AMRBandModeWB15 = 0x7F000007,/**< AMRWB Mode 15 = NO_DATA */
+}QOMX_AUDIO_AMRBANDMODETYPE;
+
+typedef enum QOMX_AUDIO_CODINGTYPE {
+ QOMX_AUDIO_CodingVendorStartUnused = 0x7F000000, /**< Reserved region for introducing Vendor Extensions */
+ QOMX_AUDIO_CodingEVRCB = 0x7F000001,
+ QOMX_AUDIO_CodingEVRCWB = 0x7F000002,
+ QOMX_AUDIO_CodingFLAC = 0x7F000003,
+ QOMX_AUDIO_CodingMax = 0x7FFFFFFF
+}QOMX_AUDIO_CODINGTYPE;
+
+
+/**
+ * AMR WB PLUS type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nChannels : Number of channels
+ * nBitRate : Bit rate read only field
+ * nSampleRate : Sampling frequency for the clip(16/24/32/48KHz)
+ * eAMRBandMode : AMR Band Mode enumeration
+ * eAMRDTXMode : AMR DTX Mode enumeration
+ * eAMRFrameFormat : AMR frame format enumeration
+ */
+
+typedef struct QOMX_AUDIO_PARAM_AMRWBPLUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannels;
+ OMX_U32 nBitRate;
+ OMX_U32 nSampleRate;
+ OMX_AUDIO_AMRBANDMODETYPE eAMRBandMode;
+ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode;
+ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat;
+} QOMX_AUDIO_PARAM_AMRWBPLUSTYPE;
+
+typedef enum QOMX_AUDIO_WMAFORMATTYPE {
+ QOMX_AUDIO_WMAFormat10Pro = 0x7F000001, /**< Windows Media Audio format 10*/
+} QOMX_AUDIO_WMAFORMATTYPE;
+
+/**
+ * WMA 10 PRO type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nChannels : Number of channels
+ * nBitRate : Bit rate read only field
+ * eFormat : Version of WMA stream / data
+ * eProfile : Profile of WMA stream / data
+ * nSamplingRate : Sampling rate of the source data
+ * nBlockAlign : block alignment, or block size, in bytes of the audio codec
+ * nEncodeOptions : WMA Type-specific data
+ * nSuperBlockAlign : WMA Type-specific data
+ * validBitsPerSample : encoded stream (24-bit or 16-bit)
+ * formatTag : codec ID(0x162 or 0x166)
+ * advancedEncodeOpt : bit packed words indicating the features supported for LBR bitstream
+ * advancedEncodeOpt2 : bit packed words indicating the features supported for LBR bitstream
+ */
+typedef struct QOMX_AUDIO_PARAM_WMA10PROTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 nChannels;
+ OMX_U32 nBitRate;
+ QOMX_AUDIO_WMAFORMATTYPE eFormat;
+ OMX_AUDIO_WMAPROFILETYPE eProfile;
+ OMX_U32 nSamplingRate;
+ OMX_U16 nBlockAlign;
+ OMX_U16 nEncodeOptions;
+ OMX_U32 nSuperBlockAlign;
+ OMX_U32 validBitsPerSample;
+ OMX_U32 formatTag;
+ OMX_U32 advancedEncodeOpt;
+ OMX_U32 advancedEncodeOpt2;
+ OMX_U16 nVirtualPktSize;
+} QOMX_AUDIO_PARAM_WMA10PROTYPE;
+
+
+typedef enum OMX_AUDIO_AC3FORMATTYPE {
+ omx_audio_ac3 = 0x7f000001, /**< ac-3 */
+ omx_audio_eac3 = 0x7f000002 /**< eac-3 */
+} OMX_AUDIO_AC3FORMATTYPE;
+
+typedef enum OMX_AUDIO_AC3_CHANNEL_CONFIG
+{
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_RSVD = 0,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_1_0,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_2_0,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_2_1,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_1,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0_1,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2_1,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2_1,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_0_2,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_2_2_2,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_3_2_2,
+ OMX_AUDIO_AC3_CHANNEL_CONFIG_DEFAULT = 0xFFFF
+} OMX_AUDIO_AC3_CHANNEL_CONFIG;
+
+/**
+ * AC-3 type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nChannels : Number of channels
+ * nBitRate : Bitrate
+ * nSamplingRate : Sampling rate, 32K, 44.1K, 48K only supported
+ * eFormat : AC-3 or EAC-3
+ * eChannelConfig : Channel configuration
+ * nProgramID : Indication of ProgramID, 0-7
+ * bCompressionOn : Flag to enable Compression
+ * bLfeOn : Flag for LFE on/off
+ * bDelaySurroundChannels : Flag to put delay on surround channels
+ *
+ */
+typedef struct QOMX_AUDIO_PARAM_AC3TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 nChannels;
+ OMX_U32 nBitRate;
+ OMX_U32 nSamplingRate;
+ OMX_AUDIO_AC3FORMATTYPE eFormat;
+ OMX_AUDIO_AC3_CHANNEL_CONFIG eChannelConfig;
+ OMX_U8 nProgramID;
+ OMX_BOOL bCompressionOn;
+ OMX_BOOL bLfeOn;
+ OMX_BOOL bDelaySurroundChannels;
+} QOMX_AUDIO_PARAM_AC3TYPE;
+
+typedef enum OMX_AUDIO_AC3_CHANNEL_ROUTING
+{
+ OMX_AUDIO_AC3_CHANNEL_LEFT,
+ OMX_AUDIO_AC3_CHANNEL_CENTER,
+ OMX_AUDIO_AC3_CHANNEL_RIGHT,
+ OMX_AUDIO_AC3_CHANNEL_LEFT_SURROUND,
+ OMX_AUDIO_AC3_CHANNEL_RIGHT_SURROUND,
+ OMX_AUDIO_AC3_CHANNEL_SURROUND,
+ OMX_AUDIO_AC3_CHANNEL_EXTENSION_1,
+ OMX_AUDIO_AC3_CHANNEL_EXTENSION_2,
+ OMX_AUDIO_AC3_CHANNEL_DEFAULT = 0xFFFF
+} OMX_AUDIO_AC3_CHANNEL_ROUTING;
+
+typedef enum OMX_AUDIO_AC3_COMPRESSION_MODE
+{
+ OMX_AUDIO_AC3_COMPRESSION_MODE_ANALOG_DIALNORM,
+ OMX_AUDIO_AC3_COMPRESSION_MODE_DIGITAL_DIALNORM,
+ OMX_AUDIO_AC3_COMPRESSION_MODE_LINE_OUT,
+ OMX_AUDIO_AC3_COMPRESSION_MODE_RF_REMOD
+} OMX_AUDIO_AC3_COMPRESSION_MODE;
+
+typedef enum OMX_AUDIO_AC3_STEREO_MODE
+{
+ OMX_AUDIO_AC3_STEREO_MODE_AUTO_DETECT,
+ OMX_AUDIO_AC3_STEREO_MODE_LT_RT,
+ OMX_AUDIO_AC3_STEREO_MODE_LO_RO,
+ OMX_AUDIO_AC3_STEREO_MODE_DEFAULT = 0xFFFF
+} OMX_AUDIO_AC3_STEREO_MODE;
+
+typedef enum OMX_AUDIO_AC3_DUAL_MONO_MODE
+{
+ OMX_AUDIO_AC3_DUAL_MONO_MODE_STEREO,
+ OMX_AUDIO_AC3_DUAL_MONO_MODE_LEFT_MONO,
+ OMX_AUDIO_AC3_DUAL_MONO_MODE_RIGHT_MONO,
+ OMX_AUDIO_AC3_DUAL_MONO_MODE_MIXED_MONO,
+ OMX_AUDIO_AC3_DUAL_MONO_MODE_DEFAULT = 0xFFFF
+} OMX_AUDIO_AC3_DUAL_MONO_MODE;
+
+typedef enum OMX_AUDIO_AC3_KARAOKE_MODE
+{
+ OMX_AUDIO_AC3_KARAOKE_MODE_NO_VOCAL,
+ OMX_AUDIO_AC3_KARAOKE_MODE_LEFT_VOCAL,
+ OMX_AUDIO_AC3_KARAOKE_MODE_RIGHT_VOCAL,
+ OMX_AUDIO_AC3_KARAOKE_MODE_BOTH_VOCAL,
+ OMX_AUDIO_AC3_KARAOKE_MODE_DEFAULT = 0xFFFF
+} OMX_AUDIO_AC3_KARAOKE_MODE;
+
+
+typedef struct QOMX_AUDIO_PARAM_AC3PP
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_AUDIO_AC3_CHANNEL_ROUTING eChannelRouting[8];
+ OMX_AUDIO_AC3_COMPRESSION_MODE eCompressionMode;
+ OMX_AUDIO_AC3_STEREO_MODE eStereoMode;
+ OMX_AUDIO_AC3_DUAL_MONO_MODE eDualMonoMode;
+ OMX_U32 usPcmScale;
+ OMX_U32 usDynamicScaleBoost;
+ OMX_U32 usDynamicScaleCut;
+ OMX_AUDIO_AC3_KARAOKE_MODE eKaraokeMode;
+} QOMX_AUDIO_PARAM_AC3PP;
+
+
+/**
+ * Stream info data
+ *
+ * STRUCT MEMBERS:
+ * sessionId : session Id for alsa to route data
+ */
+typedef struct QOMX_AUDIO_STREAM_INFO_DATA {
+ OMX_U8 sessionId;
+} QOMX_AUDIO_STREAM_INFO_DATA;
+
+
+/**
+ * Record Path
+ *
+ * STRUCT MEMBERS:
+ * recPath : Record Path for encoding
+ */
+typedef enum{
+
+QOMX_AUDIO_VOICE_TX,
+QOMX_AUDIO_VOICE_RX,
+QOMX_AUDIO_VOICE_MIXED,
+
+} QOMX_AUDIO_VOICERECORDMODETYPE;
+typedef struct QOMX_AUDIO_CONFIG_VOICERECORDTYPE {
+
+OMX_U32 nSize;
+OMX_VERSIONTYPE nVersion;
+QOMX_AUDIO_VOICERECORDMODETYPE eVoiceRecordMode;
+} QOMX_AUDIO_CONFIG_VOICERECORDTYPE;
+
+/* Enum for mapping dual-mono contents to left and right channels */
+typedef enum OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG {
+ OMX_AUDIO_DUAL_MONO_MODE_FL_FR,/* 1st SCE to left & right */
+ OMX_AUDIO_DUAL_MONO_MODE_SL_SR,/* 2nd SCE to left & right */
+ OMX_AUDIO_DUAL_MONO_MODE_SL_FR,/* 2nd SCE to left, 1st SCE to right */
+ OMX_AUDIO_DUAL_MONO_MODE_FL_SR,/* 1st SCE to left, 2nd SCE to right default */
+ OMX_AUDIO_DUAL_MONO_MODE_DEFAULT = OMX_AUDIO_DUAL_MONO_MODE_FL_SR,
+ OMX_AUDIO_DUAL_MONO_MODE_INVALID = -1
+} OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG;
+
+/************************************/
+/* DAK */
+/*************************************/
+
+/** this is the list of custom vendor index */
+typedef enum OMX_INDEX_DAK_TYPE {
+ OMX_IndexConfigDAK_BUNDLE = OMX_IndexVendorStartUnused /*0x7F000000*/, /**< reference: OMX_DAK_CONFIG_BUNDLETYPE */
+ OMX_IndexConfigDAK_M2S, /**< reference: OMX_DAK_CONFIG_M2STYPE */
+ OMX_IndexConfigDAK_SSE, /**< reference: OMX_DAK_CONFIG_SSETYPE */
+ OMX_IndexConfigDAK_SLC, /**< reference: OMX_DAK_CONFIG_SLCTYPE */
+ OMX_IndexConfigDAK_VOL, /**< reference: OMX_DAK_CONFIG_VOLTYPE */
+ OMX_IndexConfigDAK_NB, /**< reference: OMX_DAK_CONFIG_NBTYPE */
+ OMX_IndexConfigDAK_GEQ, /**< reference: OMX_DAK_CONFIG_GEQTYPE */
+ OMX_IndexConfigDAK_MSR, /**< reference: OMX_DAK_CONFIG_MSRTYPE */
+ OMX_IndexConfigDAK_HFE, /**< reference: OMX_DAK_CONFIG_HFETYPE */
+ OMX_IndexConfigDAK_FADE,/**< reference: OMX_DAK_CONFIG_FADETYPE */
+ OMX_IndexConfigDAK_SEQ, /**< reference: OMX_DAK_CONFIG_SEQTYPE */
+
+} OMX_INDEX_DAK_TYPE;
+
+
+/** Dolby Audio Kernel TDAS bundle */
+typedef struct OMX_DAK_CONFIG_BUNDLETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_U32 nDAK_Version; /**< Dolby Audio Kernel version information */
+ OMX_U32 nDAK_Revision; /**< Dolby Audio Kernel revision information */
+ OMX_U8 nLfeMixLevel; /**< level at which the LFE channel is mixed into the output audio */
+ OMX_U8 nSampleRateIndex; /**< Output sample rate */
+ OMX_U8 nInChans; /**< Channel format of input audio */
+ OMX_U8 nInMatrix; /**< L/R mixing specification for stereo audio input */
+ OMX_U8 nBypass; /**< Audio Processing bypass */
+ OMX_U8 nRateMultipier; /**< Sample-rate multiplier (output with respect to input) */
+ OMX_U8 nInChanFormat; /**< Input/Output channel format */
+ OMX_U8 nMsrMaxProfile; /**< Maximum number of virtual rendering channels in Mobile Surround */
+ OMX_BOOL bPortablemodeEnable; /**< Enable or disable Pulse Portable Mode */
+ OMX_S16 nPotablemodeGain; /**< Send the Portable Mode gain value from the Pulse decoder */
+ OMX_U8 nORL; /**< Device specific target signal level (output reference level) */
+ OMX_BOOL bPulsedownmixEnable; /**< Enable the Pulse Downmix compensation */
+ OMX_S8 nPulsedownmixAtten; /**< Attenuation value that Pulse is currently applying */
+ OMX_U8 nOutChans; /**< Channel format of output audio */
+
+} OMX_DAK_CONFIG_BUNDLETYPE;
+
+/** Dolby Audio Kernel Mono-to-Stereo Creator */
+typedef struct OMX_DAK_CONFIG_M2STYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Mono-to-Stereo Creator enable */
+ OMX_BOOL bDetector; /**< Stereo detector status */
+} OMX_DAK_CONFIG_M2STYPE;
+
+/** Dolby Audio Kernel Sound Space Expander */
+typedef struct OMX_DAK_CONFIG_SSETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Sound Space Expander enable */
+ OMX_U8 nWidth; /**< Width of expansion effect */
+ OMX_U8 nSpkMode; /**< Speaker Mode */
+} OMX_DAK_CONFIG_SSETYPE;
+
+/** Dolby Audio Kernel Sound Level Controller */
+typedef struct OMX_DAK_CONFIG_SLCTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Sound Level Controller enable */
+ OMX_U8 nLevel; /**< Source audio RMS level */
+ OMX_U8 nDepth; /**< Depth of effect */
+} OMX_DAK_CONFIG_SLCTYPE;
+
+/** Dolby Audio Kernel Volume */
+typedef struct OMX_DAK_CONFIG_VOLTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Volume enable */
+ OMX_U8 nGainType; /**< Linear/Logarithmic audio scaling */
+ OMX_U8 nInternalGain; /**< Audio volume scale */
+ OMX_U8 nExternalGain; /**< Audio volume scale applied by external volume control */
+ OMX_S8 nBalance; /**< L/R panning for output audio */
+ OMX_BOOL bMute; /**< Audio Mute */
+} OMX_DAK_CONFIG_VOLTYPE;
+
+/** Dolby Audio Kernel Natural Bass */
+typedef struct OMX_DAK_CONFIG_NBTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Natural Bass enable */
+ OMX_U8 nCutoff; /**< Speakers/headphones lower cutoff frequency */
+ OMX_U8 nBoost; /**< Strength of effect */
+ OMX_U8 nLevel; /**< Maximum output level capability of speakers/headphones */
+} OMX_DAK_CONFIG_NBTYPE;
+
+/** Dolby Audio Kernel Graphic EQ */
+typedef struct OMX_DAK_CONFIG_GEQTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Graphic EQ enable */
+ OMX_U8 nNbands; /**< Number of frequency bands */
+ OMX_S8 nPreamp; /**< Global attenuation to apply prior to band level adjustment */
+ OMX_U8 nMaxboost; /**< Maximum absolute boost with respect to the source audio */
+ OMX_S8 nBand1; /**< Boost/cut for 1st frequency band */
+ OMX_S8 nBand2; /**< Boost/cut for 2nd frequency band */
+ OMX_S8 nBand3; /**< Boost/cut for 3rd frequency band */
+ OMX_S8 nBand4; /**< Boost/cut for 4th frequency band */
+ OMX_S8 nBand5; /**< Boost/cut for 5th frequency band */
+ OMX_S8 nBand6; /**< Boost/cut for 6th frequency band */
+ OMX_S8 nBand7; /**< Boost/cut for 7th frequency band */
+} OMX_DAK_CONFIG_GEQTYPE;
+
+/** Dolby Audio Kernel, Mobile Surround and Surround Upmixer */
+typedef struct OMX_DAK_CONFIG_MSRTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bMsrEnable; /**< Mobile Surround enable */
+ OMX_U8 nMsrRoom; /**< Room Size control */
+ OMX_U8 nMsrBright; /**< Brightness control */
+ OMX_BOOL bMupEnable; /**< Mobile Surround Upmixer enable */
+} OMX_DAK_CONFIG_MSRTYPE;
+
+/** Dolby Audio Kernel High Frequency Enhancer */
+typedef struct OMX_DAK_CONFIG_HFETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< High Frequency Enhancer enable */
+ OMX_U8 nDepth; /**< Strength of effect */
+} OMX_DAK_CONFIG_HFETYPE;
+
+/** Dolby Audio Kernel Fade */
+typedef struct OMX_DAK_CONFIG_FADETYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Fade enable */
+ OMX_U8 nTarget; /**< Target fade level */
+ OMX_U16 nTime; /**< Fade time interval */
+} OMX_DAK_CONFIG_FADETYPE;
+
+/** Dolby Audio Kernel Speaker EQ */
+typedef struct OMX_DAK_CONFIG_SEQTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
+ OMX_BOOL bEnable; /**< Speaker EQ enable */
+ OMX_S8 nLeftGainDB; /**< Additional gain for Left channel */
+ OMX_S8 nRightGainDB; /**< Additional gain for Right channel */
+ OMX_U8 nCoef48000Size; /**< Length of the block of coefficients for 48KHz Sampling Rate case */
+ OMX_PTR pCoef48000; /**< Pointer to the block of coefficients for the 48KHz case */
+ OMX_U8 nCoef44100Size; /**< Length of the block of coefficients for 44.1KHz Sampling Rate case */
+ OMX_PTR pCoef44100; /**< Pointer to the block of coefficients for the 44.1KHz case */
+ OMX_U8 nCoef32000Size; /**< Length of the block of coefficients for 32KHz Sampling Rate case */
+ OMX_PTR pCoef32000; /**< Pointer to the block of coefficients for the 32KHz case */
+ OMX_U8 nCoef24000Size; /**< Length of the block of coefficients for 24KHz Sampling Rate case */
+ OMX_PTR pCoef24000; /**< Pointer to the block of coefficients for the 24KHz case */
+
+} OMX_DAK_CONFIG_SEQTYPE;
+
+
+typedef enum OMX_AUDIO_CHANNELTYPE_EXTENSION {
+ OMX_AUDIO_ChannelTS = OMX_AUDIO_ChannelVendorStartUnused, /**< Top Surround */
+ OMX_AUDIO_ChannelCVH /**< Central Vertical Height */
+} OMX_AUDIO_CHANNELTYPE_EXTENSION;
+
+/**
+ * DUAL-MONO type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eChannelConfig : Enum for channel config
+ *
+ */
+typedef struct QOMX_AUDIO_CONFIG_DUALMONOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_AUDIO_DUAL_MONO_CHANNEL_CONFIG eChannelConfig;
+} QOMX_AUDIO_CONFIG_DUALMONOTYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_AUDIOEXTENSIONS_H__ */
diff --git a/mm-core/inc/QOMX_AudioIndexExtensions.h b/mm-core/inc/QOMX_AudioIndexExtensions.h
index a16f5f1..c3c67d3 100644
--- a/mm-core/inc/QOMX_AudioIndexExtensions.h
+++ b/mm-core/inc/QOMX_AudioIndexExtensions.h
@@ -1,80 +1,78 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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.
---------------------------------------------------------------------------*/
-/*============================================================================
- O p e n M A X w r a p p e r s
- O p e n M A X C o r e
-
-*//** @file QOMX_AudioIndexExtensions.h
- This module contains the index extensions for Audio
-
-*//*========================================================================*/
-
-
-#ifndef __H_QOMX_AUDIOINDEXEXTENSIONS_H__
-#define __H_QOMX_AUDIOINDEXEXTENSIONS_H__
-
-/*========================================================================
-
- INCLUDE FILES FOR MODULE
-
-========================================================================== */
-#include <OMX_Core.h>
-
-/*========================================================================
-
- DEFINITIONS AND DECLARATIONS
-
-========================================================================== */
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-
-/**
- * Enumeration used to define Qualcomm's vendor extensions for
- * audio. The audio extensions occupy a range of
- * 0x7F100000-0x7F1FFFFF, inclusive.
- */
-typedef enum QOMX_AUDIO_EXTENSIONS_INDEXTYPE
-{
- QOMX_IndexParamAudioAmrWbPlus = 0x7F200000, /**< "OMX.Qualcomm.index.audio.amrwbplus" */
- QOMX_IndexParamAudioWma10Pro = 0x7F200001, /**< "OMX.Qualcomm.index.audio.wma10pro" */
- QOMX_IndexParamAudioSessionId = 0x7F200002, /**< "OMX.Qualcomm.index.audio.sessionId" */
- QOMX_IndexParamAudioVoiceRecord = 0x7F200003, /**< "OMX.Qualcomm.index.audio.VoiceRecord" */
- QOMX_IndexConfigAudioDualMono = 0x7F200004, /**< "OMX.Qualcomm.index.audio.dualmono" */
- QOMX_IndexParamAudioAc3 = 0x7F200005, /**< "OMX.Qualcomm.index.audio.ac3" */
- QOMX_IndexParamAudioAc3PostProc = 0x7F200006, /**< "OMX.Qualcomm.index.audio.postproc.ac3" */
- QOMX_IndexParamAudioUnused = 0x7F2FFFFF
-} QOMX_AUDIO_EXTENSIONS_INDEXTYPE;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* end of macro __H_QOMX_AUDIOINDEXEXTENSIONS_H__ */
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+*//** @file QOMX_AudioIndexExtensions.h
+ This module contains the index extensions for Audio
+
+*//*========================================================================*/
+
+
+#ifndef __H_QOMX_AUDIOINDEXEXTENSIONS_H__
+#define __H_QOMX_AUDIOINDEXEXTENSIONS_H__
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Core.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/**
+ * Enumeration used to define Qualcomm's vendor extensions for
+ * audio. The audio extensions occupy a range of
+ * 0x7F100000-0x7F1FFFFF, inclusive.
+ */
+typedef enum QOMX_AUDIO_EXTENSIONS_INDEXTYPE
+{
+ QOMX_IndexParamAudioAmrWbPlus = 0x7F200000, /**< "OMX.Qualcomm.index.audio.amrwbplus" */
+ QOMX_IndexParamAudioWma10Pro = 0x7F200001, /**< "OMX.Qualcomm.index.audio.wma10pro" */
+ QOMX_IndexParamAudioSessionId = 0x7F200002, /**< "OMX.Qualcomm.index.audio.sessionId" */
+ QOMX_IndexParamAudioVoiceRecord = 0x7F200003, /**< "OMX.Qualcomm.index.audio.VoiceRecord" */
+ QOMX_IndexConfigAudioDualMono = 0x7F200004, /**< "OMX.Qualcomm.index.audio.dualmono" */
+ QOMX_IndexParamAudioUnused = 0x7F2FFFFF
+} QOMX_AUDIO_EXTENSIONS_INDEXTYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_AUDIOINDEXEXTENSIONS_H__ */
diff --git a/mm-core/inc/QOMX_CoreExtensions.h b/mm-core/inc/QOMX_CoreExtensions.h
index 20595fe..e02930a 100644
--- a/mm-core/inc/QOMX_CoreExtensions.h
+++ b/mm-core/inc/QOMX_CoreExtensions.h
@@ -1,164 +1,164 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2011 The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __H_QOMX_COREEXTENSIONS_H__
-#define __H_QOMX_COREEXTENSIONS_H__
-
-
-
-/*========================================================================
-
- INCLUDE FILES FOR MODULE
-
-========================================================================== */
-#include <OMX_Core.h>
-
-/*========================================================================
-
- DEFINITIONS AND DECLARATIONS
-
-========================================================================== */
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-
-/**
- * Qualcom vendor extensions.
- */
-#define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData" /**< reference: QOMX_INDEXEXTRADATATYPE */
-#define OMX_QCOM_INDEX_PARAM_HELDBUFFERCOUNT "OMX.QCOM.index.param.HeldBufferCount" /**< reference: QOMX_HELDBUFFERCOUNTTYPE */
-
-/**
- * Buffer header nFlags field extension.
- *
- * The source of a stream sets the TIMESTAMPINVALID flag to
- * indicate that the buffer header nTimeStamp field does not
- * hold valid timestamp information. The component that updates
- * the nTimeStamp field to reflect a valid timestamp shall clear
- * this flag.
- */
-#define QOMX_BUFFERFLAG_TIMESTAMPINVALID 0x80000000
-
-/**
- * Buffer header nFlags field extension.
- *
- * The READONLY flag is set when the component emitting the
- * buffer on an output port identifies the buffer's contents to
- * be read-only. The IL client or input port that receives a
- * filled read-only buffer cannot alter the contents of the
- * buffer. This flag can be cleared by the component when the
- * emptied buffer is returned to it.
- */
-#define QOMX_BUFFERFLAG_READONLY 0x40000000
-
-/**
- * Buffer header nFlags field extension.
- *
- * The ENDOFSUBFRAME flag is an optional flag that is set by an
- * output port when the last byte that a buffer payload contains
- * is an end-of-subframe. Any component that implements setting
- * the ENDOFSUBFRAME flag on an output port shall set this flag
- * for every buffer sent from the output port containing an
- * end-of-subframe.
- *
- * A subframe is defined by the next level of natural
- * partitioning in a logical unit for a given format. For
- * example, a subframe in an H.264 access unit is defined as the
- * "network abstraction layer" unit, or NAL unit.
- */
-#define QOMX_BUFFERFLAG_ENDOFSUBFRAME 0x20000000
-
-/**
- * A component sends this error to the IL client (via the EventHandler callback)
- * in the event that application of a config or parameter has failed some time
- * after the return of OMX_SetConfig or OMX_SetParameter. This may happen when a
- * component transitions between states and discovers some incompatibility
- * between multiple settings. Configuration indicies sent via extra data may also
- * fail when set to a down stream component. The index that failed will be
- * included as the nData2 parameter of the EventHandler callback.
- */
-#define QOMX_ErrorAsyncIndexFailed (OMX_ErrorVendorStartUnused+1)
-
-/* In some scenarios there may be a possibilty to run out of the storage space
- * and components may want to notify this error to IL client to take appropriate
- * action by the IL client.
- *
- * For example, In recording scenario, MUX component can know the available
- * space in the recording media and can compute peridically to accommodate the
- * meta data before we reach to a stage where we end up no space to write even
- * the meta data. When the space limit reached in recording media, MUX component
- * would like to notify the IL client with QOMX_ErrorSpaceLimitReached.
- * After this error all the buffers that are returned will have nFilledLen
- * unchanges i.e not consumed.
- */
-#define QOMX_ErrorStorageLimitReached (OMX_ErrorVendorStartUnused + 2)
-
-/**
- * This structure is used to enable/disable the generation or
- * consumption of the QOMX_ExtraDataOMXIndex extra data type for
- * the specified OpenMax index.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * bEnabled : Enable/Disable the extra data processing
- * nIndex : The index associated with the extra data
- */
-typedef struct QOMX_INDEXEXTRADATATYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_BOOL bEnabled;
- OMX_INDEXTYPE nIndex;
-} QOMX_INDEXEXTRADATATYPE;
-
-/**
- * This structure is used to indicate the maximum number of buffers
- * that a port will hold during data flow.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nHeldBufferCount : Read-only, maximum number of buffers that will be held
- */
-typedef struct QOMX_HELDBUFFERCOUNTTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nHeldBufferCount;
-} QOMX_HELDBUFFERCOUNTTYPE;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* end of macro __H_QOMX_COREEXTENSIONS_H__ */
+/*--------------------------------------------------------------------------
+Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __H_QOMX_COREEXTENSIONS_H__
+#define __H_QOMX_COREEXTENSIONS_H__
+
+
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Core.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/**
+ * Qualcom vendor extensions.
+ */
+#define OMX_QCOM_INDEX_PARAM_INDEXEXTRADATA "OMX.QCOM.index.param.IndexExtraData" /**< reference: QOMX_INDEXEXTRADATATYPE */
+#define OMX_QCOM_INDEX_PARAM_HELDBUFFERCOUNT "OMX.QCOM.index.param.HeldBufferCount" /**< reference: QOMX_HELDBUFFERCOUNTTYPE */
+
+/**
+ * Buffer header nFlags field extension.
+ *
+ * The source of a stream sets the TIMESTAMPINVALID flag to
+ * indicate that the buffer header nTimeStamp field does not
+ * hold valid timestamp information. The component that updates
+ * the nTimeStamp field to reflect a valid timestamp shall clear
+ * this flag.
+ */
+#define QOMX_BUFFERFLAG_TIMESTAMPINVALID 0x80000000
+
+/**
+ * Buffer header nFlags field extension.
+ *
+ * The READONLY flag is set when the component emitting the
+ * buffer on an output port identifies the buffer's contents to
+ * be read-only. The IL client or input port that receives a
+ * filled read-only buffer cannot alter the contents of the
+ * buffer. This flag can be cleared by the component when the
+ * emptied buffer is returned to it.
+ */
+#define QOMX_BUFFERFLAG_READONLY 0x40000000
+
+/**
+ * Buffer header nFlags field extension.
+ *
+ * The ENDOFSUBFRAME flag is an optional flag that is set by an
+ * output port when the last byte that a buffer payload contains
+ * is an end-of-subframe. Any component that implements setting
+ * the ENDOFSUBFRAME flag on an output port shall set this flag
+ * for every buffer sent from the output port containing an
+ * end-of-subframe.
+ *
+ * A subframe is defined by the next level of natural
+ * partitioning in a logical unit for a given format. For
+ * example, a subframe in an H.264 access unit is defined as the
+ * "network abstraction layer" unit, or NAL unit.
+ */
+#define QOMX_BUFFERFLAG_ENDOFSUBFRAME 0x20000000
+
+/**
+ * A component sends this error to the IL client (via the EventHandler callback)
+ * in the event that application of a config or parameter has failed some time
+ * after the return of OMX_SetConfig or OMX_SetParameter. This may happen when a
+ * component transitions between states and discovers some incompatibility
+ * between multiple settings. Configuration indicies sent via extra data may also
+ * fail when set to a down stream component. The index that failed will be
+ * included as the nData2 parameter of the EventHandler callback.
+ */
+#define QOMX_ErrorAsyncIndexFailed (OMX_ErrorVendorStartUnused+1)
+
+/* In some scenarios there may be a possibilty to run out of the storage space
+ * and components may want to notify this error to IL client to take appropriate
+ * action by the IL client.
+ *
+ * For example, In recording scenario, MUX component can know the available
+ * space in the recording media and can compute peridically to accommodate the
+ * meta data before we reach to a stage where we end up no space to write even
+ * the meta data. When the space limit reached in recording media, MUX component
+ * would like to notify the IL client with QOMX_ErrorSpaceLimitReached.
+ * After this error all the buffers that are returned will have nFilledLen
+ * unchanges i.e not consumed.
+ */
+#define QOMX_ErrorStorageLimitReached (OMX_ErrorVendorStartUnused + 2)
+
+/**
+ * This structure is used to enable/disable the generation or
+ * consumption of the QOMX_ExtraDataOMXIndex extra data type for
+ * the specified OpenMax index.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * bEnabled : Enable/Disable the extra data processing
+ * nIndex : The index associated with the extra data
+ */
+typedef struct QOMX_INDEXEXTRADATATYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnabled;
+ OMX_INDEXTYPE nIndex;
+} QOMX_INDEXEXTRADATATYPE;
+
+/**
+ * This structure is used to indicate the maximum number of buffers
+ * that a port will hold during data flow.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nHeldBufferCount : Read-only, maximum number of buffers that will be held
+ */
+typedef struct QOMX_HELDBUFFERCOUNTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nHeldBufferCount;
+} QOMX_HELDBUFFERCOUNTTYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_COREEXTENSIONS_H__ */
diff --git a/mm-core/inc/QOMX_FileFormatExtensions.h b/mm-core/inc/QOMX_FileFormatExtensions.h
index b6eb913..e457693 100644
--- a/mm-core/inc/QOMX_FileFormatExtensions.h
+++ b/mm-core/inc/QOMX_FileFormatExtensions.h
@@ -1,155 +1,137 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2011 The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __QOMX_FILE_FORMAT_EXTENSIONS_H__
-#define __QOMX_FILE_FORMAT_EXTENSIONS_H__
-
-/*============================================================================
-*//** @file QOMX_FileFormatExtensions.h
- This header contains constants and type definitions that specify the
- extensions added to the OpenMAX Vendor specific APIs.
-*//*========================================================================*/
-
-/*============================================================================
- Edit History
-
-when who what, where, why
--------- --- -------------------------------------------------------
-
-============================================================================*/
-
-//////////////////////////////////////////////////////////////////////////////
-// Include Files
-//////////////////////////////////////////////////////////////////////////////
-#include "OMX_Core.h"
-
-
-/* :OMX.QCOM.index.param.container.info*/
-#define QOMX_QcomIndexParamContainerInfo 0x7F000009
-
-/**<OMX.Qualcomm.index.video.param.encrypttypeconfigparameters*/
-#define QOMX_FilemuxIndexEncryptionTypeConfigParameters 0x7F00000A
-
-#define QOMX_INDEX_CONTAINER_INFO_STRING "QOMX.Qualcomm.index.param.containerinfo"
-#define OMX_QCOM_INDEX_FILE_FORMAT "OMX.QCOM.index.config.FileFormat"
-#define QOMX_INDEX_CONFIG_ENCRYPT_TYPE "QOMX.Qualcomm.index.config.EncryptType"
-
-/**-----------------------------------------------------------------------------
- OMX.QCOM.index.param.container.info
---------------------------------------------------------------------------------
-*/
-
-typedef enum QOMX_CONTAINER_FORMATTYPE {
- QOMX_FORMAT_RAW,
- QOMX_FORMAT_MP4,
- QOMX_FORMAT_3GP,
- QOMX_FORMAT_3G2,
- QOMX_FORMAT_AMC,
- QOMX_FORMAT_SKM,
- QOMX_FORMAT_K3G,
- QOMX_FORMAT_VOB,
- QOMX_FORMAT_AVI,
- QOMX_FORMAT_ASF,
- QOMX_FORMAT_RM ,
- QOMX_FORMAT_MPEG_ES,
- QOMX_FORMAT_DIVX,
- QOMX_FORMATMPEG_TS,
- QOMX_FORMAT_QT,
- QOMX_FORMAT_M4A,
- QOMX_FORMAT_MP3,
- QOMX_FORMAT_WAVE,
- QOMX_FORMAT_XMF,
- QOMX_FORMAT_AMR,
- QOMX_FORMAT_AAC,
- QOMX_FORMAT_EVRC,
- QOMX_FORMAT_QCP,
- QOMX_FORMAT_SMF,
- QOMX_FORMAT_OGG,
- QOMX_FORMAT_BMP,
- QOMX_FORMAT_JPG,
- QOMX_FORMAT_JPG2000
-}QOMX_CONTAINER_FORMATTYPE;
-
-typedef struct QOMX_CONTAINER_INFOTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- QOMX_CONTAINER_FORMATTYPE eFmtType;
-} QOMX_CONTAINER_INFOTYPE;
-
-typedef enum QOMX_FILEFORMATTYPE {
- QOMX_FileFormatNone, /**< no file format naming convention is followed. */
- QOMX_FileFormatDCF, /**< DCF file naming convention. */
- QOMX_FileFormatMax = 0x7FFFFFFF
-} QOMX_FILEFORMATTYPE;
-
-/** QOMX_CONFIG_FILEFORMATTYPE is used to determine how the file writer will interpret
-the provided content URI and whether it will increment the index of the file name. */
-typedef struct QOMX_CONFIG_FILEFORMATTYPE {
- 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 */
- QOMX_FILEFORMATTYPE eFileFormat; /** file format type */
-} QOMX_CONFIG_FILEFORMATTYPE;
-
-/**The QOMX_RECORDINGSTATISTICSINTERVALTYPE structure is used to enable
-IL client to indicate the interval of the statistics notification to file mux
-component. Time interval will indicate the frequency(in ms) when client needs
-the statistics data*/
-typedef struct QOMX_RECORDINGSTATISTICSINTERVALTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion;/**< OMX specification version information */
- OMX_TICKS interval;/**< specifies the time(milliseconds) between updates */
- }QOMX_RECORDINGSTATISTICSINTERVALTYPE;
-
-/**QOMX_RECORDINGSTATISTICSTYPE indicates the current recording
-time and space statistics of this session, which can be used by client to
-identify current status of recorded data in milliseconds and bytes */
-typedef struct QOMX_RECORDINGSTATISTICSTYPE {
- OMX_U32 nSize;/**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion;/**< OMX specification version information */
- OMX_TICKS nRecordedTime; /** duration that we already recorded*/
- OMX_TICKS nTimeCanRecord;/** the time we can record at the same bitrate*/
- OMX_U64 nSpaceConsumed;/** space that consumed in bytes*/
- OMX_U64 nSpaceLeft;/** space left in bytes*/
-} QOMX_RECORDINGSTATISTICSTYPE;
-
-/**QOMX_ENCRYPT_TYPE indicates the type of encryption */
-typedef enum QOMX_ENCRYPT_TYPE {
- QOMX_ENCRYPT_TYPE_HDCP,
- QOMX_ENCRYPT_TYPE_INVALID
-}QOMX_ENCRYPT_TYPE;
-
-/**QOMX_ENCRYPTIONTYPE indicates the encrypt type */
-typedef struct QOMX_ENCRYPTIONTYPE {
- OMX_U32 nSize; /**< size of the structure in bytes */
- OMX_VERSIONTYPE nVersion; /**< OMX specification version information */
- OMX_BOOL nStreamEncrypted; /** stream is encrypted or not */
- QOMX_ENCRYPT_TYPE nType; /** type of Encryption */
- OMX_U32 nEncryptVersion; /** Encrypt version */
-} QOMX_ENCRYPTIONTYPE;
-#endif /*__QOMX_FILE_FORMAT_EXTENSIONS_H__*/
+/*--------------------------------------------------------------------------
+Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __QOMX_FILE_FORMAT_EXTENSIONS_H__
+#define __QOMX_FILE_FORMAT_EXTENSIONS_H__
+
+/*============================================================================
+*//** @file QOMX_FileFormatExtensions.h
+ This header contains constants and type definitions that specify the
+ extensions added to the OpenMAX Vendor specific APIs.
+*//*========================================================================*/
+
+/*============================================================================
+ Edit History
+
+when who what, where, why
+-------- --- -------------------------------------------------------
+
+============================================================================*/
+
+//////////////////////////////////////////////////////////////////////////////
+// Include Files
+//////////////////////////////////////////////////////////////////////////////
+#include "OMX_Core.h"
+
+
+/* :OMX.QCOM.index.param.container.info*/
+#define QOMX_QcomIndexParamContainerInfo 0x7F000009
+
+#define QOMX_INDEX_CONTAINER_INFO_STRING "QOMX.Qualcomm.index.param.containerinfo"
+#define OMX_QCOM_INDEX_FILE_FORMAT "OMX.QCOM.index.config.FileFormat"
+
+/**-----------------------------------------------------------------------------
+ OMX.QCOM.index.param.container.info
+--------------------------------------------------------------------------------
+*/
+
+typedef enum QOMX_CONTAINER_FORMATTYPE {
+ QOMX_FORMAT_RAW,
+ QOMX_FORMAT_MP4,
+ QOMX_FORMAT_3GP,
+ QOMX_FORMAT_3G2,
+ QOMX_FORMAT_AMC,
+ QOMX_FORMAT_SKM,
+ QOMX_FORMAT_K3G,
+ QOMX_FORMAT_VOB,
+ QOMX_FORMAT_AVI,
+ QOMX_FORMAT_ASF,
+ QOMX_FORMAT_RM ,
+ QOMX_FORMAT_MPEG_ES,
+ QOMX_FORMAT_DIVX,
+ QOMX_FORMATMPEG_TS,
+ QOMX_FORMAT_QT,
+ QOMX_FORMAT_M4A,
+ QOMX_FORMAT_MP3,
+ QOMX_FORMAT_WAVE,
+ QOMX_FORMAT_XMF,
+ QOMX_FORMAT_AMR,
+ QOMX_FORMAT_AAC,
+ QOMX_FORMAT_EVRC,
+ QOMX_FORMAT_QCP,
+ QOMX_FORMAT_SMF,
+ QOMX_FORMAT_OGG,
+ QOMX_FORMAT_BMP,
+ QOMX_FORMAT_JPG,
+ QOMX_FORMAT_JPG2000
+}QOMX_CONTAINER_FORMATTYPE;
+
+typedef struct QOMX_CONTAINER_INFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ QOMX_CONTAINER_FORMATTYPE eFmtType;
+} QOMX_CONTAINER_INFOTYPE;
+
+typedef enum QOMX_FILEFORMATTYPE {
+ QOMX_FileFormatNone, /**< no file format naming convention is followed. */
+ QOMX_FileFormatDCF, /**< DCF file naming convention. */
+ QOMX_FileFormatMax = 0x7FFFFFFF
+} QOMX_FILEFORMATTYPE;
+
+/** QOMX_CONFIG_FILEFORMATTYPE is used to determine how the file writer will interpret
+the provided content URI and whether it will increment the index of the file name. */
+typedef struct QOMX_CONFIG_FILEFORMATTYPE {
+ 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 */
+ QOMX_FILEFORMATTYPE eFileFormat; /** file format type */
+} QOMX_CONFIG_FILEFORMATTYPE;
+
+/**The QOMX_RECORDINGSTATISTICSINTERVALTYPE structure is used to enable
+IL client to indicate the interval of the statistics notification to file mux
+component. Time interval will indicate the frequency(in ms) when client needs
+the statistics data*/
+typedef struct QOMX_RECORDINGSTATISTICSINTERVALTYPE {
+ OMX_U32 nSize; /**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/**< OMX specification version information */
+ OMX_TICKS interval;/**< specifies the time(milliseconds) between updates */
+ }QOMX_RECORDINGSTATISTICSINTERVALTYPE;
+
+/**QOMX_RECORDINGSTATISTICSTYPE indicates the current recording
+time and space statistics of this session, which can be used by client to
+identify current status of recorded data in milliseconds and bytes */
+typedef struct QOMX_RECORDINGSTATISTICSTYPE {
+ OMX_U32 nSize;/**< size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/**< OMX specification version information */
+ OMX_TICKS nRecordedTime; /** duration that we already recorded*/
+ OMX_TICKS nTimeCanRecord;/** the time we can record at the same bitrate*/
+ OMX_U64 nSpaceConsumed;/** space that consumed in bytes*/
+ OMX_U64 nSpaceLeft;/** space left in bytes*/
+} QOMX_RECORDINGSTATISTICSTYPE;
+
+#endif /*__QOMX_FILE_FORMAT_EXTENSIONS_H__*/
diff --git a/mm-core/inc/QOMX_IVCommonExtensions.h b/mm-core/inc/QOMX_IVCommonExtensions.h
index 2cd1819..bb25632 100644
--- a/mm-core/inc/QOMX_IVCommonExtensions.h
+++ b/mm-core/inc/QOMX_IVCommonExtensions.h
@@ -1,400 +1,399 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2011 The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __H_QOMX_IVCOMMONEXTENSIONS_H__
-#define __H_QOMX_IVCOMMONEXTENSIONS_H__
-
-/*========================================================================
-
-*//** @file QOMX_CommonExtensions.h
-
-@par FILE SERVICES:
- common extensions API for OpenMax IL.
-
- This file contains the description of the Qualcomm OpenMax IL
- common extention interface, through which the IL client and OpenMax
- components can access additional capabilities.
-
-*//*====================================================================== */
-
-
-/*========================================================================
-
- INCLUDE FILES FOR MODULE
-
-========================================================================== */
-#include <OMX_Core.h>
-
-/*========================================================================
-
- DEFINITIONS AND DECLARATIONS
-
-========================================================================== */
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-
-/* IV common extension strings */
-#define OMX_QCOM_INDEX_CONFIG_MEDIAINFO "OMX.QCOM.index.config.mediainfo" /**< reference: QOMX_MEDIAINFOTYPE */
-#define OMX_QCOM_INDEX_CONFIG_CONTENTURI "OMX.QCOM.index.config.contenturi" /**< reference: OMX_PARAM_CONTENTURITYPE */
-#define OMX_QCOM_INDEX_PARAM_IMAGESIZECONTROL "OMX.Qualcomm.index.param.ImageSizeControl" /**< reference: QOMX_IMAGE_IMAGESIZECONTROLTYPE */
-#define OMX_QCOM_INDEX_CONFIG_PAUSEPORT "OMX.QCOM.index.config.PausePort" /**< reference: QOMX_CONFIG_PAUSEPORTTYPE */
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give width in pixels */
-#define OMX_QCOM_INDEX_PARAM_FRAMEWIDTHRANGESUPPORTED "OMX.QCOM.index.param.FrameWidthRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give height in pixels */
-#define OMX_QCOM_INDEX_PARAM_FRAMEHEIGHTRANGESUPPORTED "OMX.QCOM.index.param.FrameHeightRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give the number of macroblocks per
- * frame. */
-#define OMX_QCOM_INDEX_PARAM_MACROBLOCKSPERFRAMERANGESUPPORTED "OMX.QCOM.index.param.MacroblocksPerFrameRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give the number of macroblocks per
- * second. */
-#define OMX_QCOM_INDEX_PARAM_MACROBLOCKSPERSECONDRANGESUPPORTED "OMX.QCOM.index.param.MacroblocksPerSecondRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give frame rate in frames per second
- * in Q16 format. */
-#define OMX_QCOM_INDEX_PARAM_FRAMERATERANGESUPPORTED "OMX.QCOM.index.param.FrameRateRangeSupported"
-
-#define OMX_QCOM_INDEX_PARAM_PLANEDEFINITION "OMX.QCOM.index.param.PlaneDefinition" /** reference: QOMX_PLANEDEFINITIONTYPE */
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give the crop width in pixels */
-#define OMX_QOMX_INDEX_PARAM_CROPWIDTHRANGESUPPORTED "OMX.QCOM.index.param.CropWidthRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give the crop height in pixels */
-#define OMX_QOMX_INDEX_PARAM_CROPHEIGHTRANGESUPPORTED "OMX.QCOM.index.param.CropHeightRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give the digital zoom factor on width
- * in Q16 format. */
-#define OMX_QCOM_INDEX_PARAM_DIGITALZOOMWIDTHRANGESUPPORTED "OMX.QCOM.index.param.DigitalZoomWidthRangeSupported"
-
-/** reference: QOMX_URANGETYPE
- * nMin, nMax, nStepSize give the digital zoom factor on height
- * in Q16 format. */
-#define OMX_QCOM_INDEX_PARAM_DIGITALZOOMHEIGHTRANGESUPPORTED "OMX.QCOM.index.param.DigitalZoomHeightRangeSupported"
-
-/**
- * Enumeration defining the extended uncompressed image/video
- * formats.
- *
- * ENUMS:
- * YVU420PackedSemiPlanar : Buffer containing all Y, and then V and U
- * interleaved.
- * YVU420PackedSemiPlanar32m4ka : YUV planar format, similar to the
- * YVU420PackedSemiPlanar format, but with the
- * following restrictions:
- *
- * 1. The width and height of both plane must
- * be a multiple of 32 texels.
- *
- * 2. The base address of both planes must be
- * aligned to a 4kB boundary.
- *
- * YUV420PackedSemiPlanar16m2ka : YUV planar format, similar to the
- * YUV420PackedSemiPlanar format, but with the
- * following restrictions:
- *
- * 1. The width of the luma plane must be a
- * multiple of 16 pixels.
- *
- * 2. The address of both planes must be
- * aligned to a 2kB boundary.
- *
- * YUV420PackedSemiPlanar64x32Tile2m8ka : YUV planar format, similar to the
- * YUV420PackedSemiPlanar format, but with the
- * following restrictions:
- *
- * 1. The data is laid out in a 4x2 MB tiling
- * memory structure
- *
- * 2. The width of each plane is a multiple of
- * 2 4x2 MB tiles.
- *
- * 3. The height of each plan is a multiple of
- * a 4x2 MB tile.
- *
- * 4. The base address of both planes must be
- * aligned to an 8kB boundary.
- *
- * 5. The tiles are scanned in the order
- * defined in the MFCV5.1 User's Manual.
- */
-typedef enum QOMX_COLOR_FORMATTYPE
-{
- QOMX_COLOR_FormatYVU420PackedSemiPlanar = 0x7F000001,
- QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
- QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
- QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka,
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m,
-} QOMX_COLOR_FORMATTYPE;
-
-typedef enum QOMX_MEDIAINFOTAGTYPE {
- QOMX_MediaInfoTagVersion, /**< OMX_VERSIONTYPE. Version of the standard specifying the media information.*/
- QOMX_MediaInfoTagUID, /**< OMX_U8*. Unique ID of the media data, ie image unique ID.*/
- QOMX_MediaInfoTagDescription, /**< OMX_U8*. Comments about the media.*/
- QOMX_MediaInfoTagTitle, /**< OMX_U8*. Title of the media.*/
- QOMX_MediaInfoTagAuthor, /**< OMX_U8*. Author of the media.*/
- QOMX_MediaInfoTagCopyright, /**< OMX_U8*. Copyright information.*/
- QOMX_MediaInfoTagTrackNum, /**< OMX_U32. Track number.*/
- QOMX_MediaInfoTagGenre, /**< OMX_U8*. The genre of the media.*/
- QOMX_MediaInfoTagEquipmentMake, /**< OMX_U8*. Manufacturer of recording equipment.*/
- QOMX_MediaInfoTagEquipmentModel,/**< OMX_U8*. Model or name of the recording equipment.*/
- QOMX_MediaInfoTagSoftware, /**< OMX_U8*. Name and version of the software or firmware of the device generating the media.*/
- QOMX_MediaInfoTagAssociatedFile,/**< OMX_U8*. The name of the file related to the media. For example, an audio file related to an image file.*/
- QOMX_MediaInfoTagResolution, /**< QOMX_RESOLUTIONTYPE. Number of pixels per resolution unit.*/
- QOMX_MediaInfoTagDateCreated, /**< QOMX_DATESTAMPTYPE. Date when media was created.*/
- QOMX_MediaInfoTagTimeCreated, /**< QOMX_TIMESTAMPTYPE. Time when media was created.*/
- QOMX_MediaInfoTagDateModified, /**< QOMX_DATESTAMPETYPE. Date when file was last modified.*/
- QOMX_MediaInfoTagTimeModified, /**< QOMX_TIMESTAMPTYPE. Time when file was last modified.*/
- QOMX_MediaInfoTagGPSAreaName, /**< OMX_U8*. The name of the location.*/
- QOMX_MediaInfoTagGPSVersion, /**< OMX_VERSIONTYPE. GPS version.*/
- QOMX_MediaInfoTagGPSCoordinates,/**< QOMX_GEODETICTYPE. The longitude, latitude, and altitude.*/
- QOMX_MediaInfoTagGPSSatellites, /**< OMX_U8*. The GPS satellites used for measurements.*/
- QOMX_MediaInfoTagGPSPrecision, /**< OMX_U32. GPS degree of precision.*/
- QOMX_MediaInfoTagGPSDateStamp, /**< QOMX_DATESTAMPTYPE. Date of the GPS data.*/
- QOMX_MediaInfoTagGPSTimeStamp, /**< QOMX_TIMESTAMPTYPE. Time of the GPS data.*/
- QOMX_MediaInfoTagMediaStreamType,/**< QOMX_MEDIASTREAMTYPE. Type of the stream. */
- QOMX_MediaInfoDuration, /**< OMX_TICKS. Total duration of the media.*/
- QOMX_MediaInfoSize, /**< OMX_U32. Total size of the media in bytes.*/
- QOMX_MediaInfoTagAlbum, /**< OMX_U8*. Name of album/movie/show.*/
- QOMX_MediaInfoTagLocation, /**< OMX_U8*. Recording location information.*/
- QOMX_MediaInfoTagClassification, /**< OMX_U8*. Classification information of media.*/
- QOMX_MediaInfoTagRatings, /**< OMX_U8*. Media Ratings based on popularity & rating criteria.*/
- QOMX_MediaInfoTagKeyword, /**< OMX_U8*. Keyword associated with media which are intended to reflect mood of the A/V.*/
- QOMX_MediaInfoTagPerformance, /**< OMX_U8*. Media Performer information..*/
- QOMX_MediaInfoTagYear, /**< OMX_U8*. Production year information of media.*/
- QOMX_MediaInfoTagComposer, /**< OMX_U8*. Name of the composer of media i.e. audio.*/
- QOMX_MediaInfoTagEncoderName, /**< OMX_U8*. Name of the person or organisation who encoded media.*/
- QOMX_MediaInfoTagCopyProhibitFlag, /**< OMX_U8*. Flag to indicate if copy is allowed or not.*/
- QOMX_MediaInfoTagLyricist, /**< OMX_U8*. Name of the lyricist or text writer in recording. Specific to ID3 tag.*/
- QOMX_MediaInfoTagSubtitle, /**< OMX_U8*. Subtitle/Description used for informaton directly related to title of media.*/
- QOMX_MediaInfoTagOriginalFileName, /**< OMX_U8*. Original file name.*/
- QOMX_MediaInfoTagOriginalLyricist, /**< OMX_U8*. Name of the original lyricist/text writer of original recording.*/
- QOMX_MediaInfoTagOriginalArtist, /**< OMX_U8*. Name of the original artist.*/
- QOMX_MediaInfoTagOriginalReleaseYear, /**< OMX_U8*. Original release year of recorded media.*/
- QOMX_MediaInfoTagFileOwner, /**< OMX_U8*. Licensee or name of the file owner.*/
- QOMX_MediaInfoTagOrchestra, /**< OMX_U8*. Name of the orchestra or performers during recording.*/
- QOMX_MediaInfoTagConductor, /**< OMX_U8*. Name of the conductor.*/
- QOMX_MediaInfoTagRemixedBy, /**< OMX_U8*. Person or organization name who did the remix.*/
- QOMX_MediaInfoTagAlbumArtist, /**< OMX_U8*. Name of the album artist.*/
- QOMX_MediaInfoTagPublisher, /**< OMX_U8*. Name of the publisher or label.*/
- QOMX_MediaInfoTagRecordingDates, /**< OMX_U8*. Recording date of media.*/
- QOMX_MediaInfoTagInternetRadioStationName, /**< OMX_U8*. Name of the Internet radio station from which the audio is streamed.*/
- QOMX_MediaInfoTagInternetRadioStationOwner, /**< OMX_U8*. Name of the owner of the Internet radio station from which the audio is streamed.*/
- QOMX_MediaInfoTagInternationalRecordingCode,/**< OMX_U8*. International standard recording code.*/
- QOMX_MediaInfoTagEncoderSwHwSettings, /**< OMX_U8*. Software,hardware settings used by encoder.*/
- QOMX_MediaInfoTagInvolvedPeopleList, /**< OMX_U8*. List of people involved. Specific to ID3 tag.*/
- QOMX_MediaInfoTagComments, /**< OMX_U8*. Comments about the media. It can be any kind of full text informaton.*/
- QOMX_MediaInfoTagCommissioned, /**< OMX_U8*. Commissioned information of media.*/
- QOMX_MediaInfoTagSubject, /**< OMX_U8*. Subject associated with media.*/
- QOMX_MediaInfoTagContact, /**< OMX_U8*. Conatct information. URL information of the seller.*/
- QOMX_MediaInfoTagValidityPeriod, /**< OMX_U8*. Length or period of validity of media.*/
- QOMX_MediaInfoTagValidityEffectiveDate, /**< OMX_U8*. Validity effective date of media*/
- QOMX_MediaInfoTagNumberOfAllowedPlaybacks, /**< OMX_U8*. Number of allowed playbacks for this media*/
- QOMX_MediaInfoTagPlayCounter, /**< OMX_U8*. Current play counter of the media.Its number of times a file has been played.*/
- QOMX_MediaInfoTagMemo, /**< OMX_U8*. Memo associatd with media.*/
- QOMX_MediaInfoTagDeviceName, /**< OMX_U8*. Name of the devices used in creating media.*/
- QOMX_MediaInfoTagURL, /**< OMX_U8*. List artist /genre /movie sites URL.*/
- QOMX_MediaInfoTagFileType, /**< OMX_U8*. Indicates type of audio track.*/
- QOMX_MediaInfoTagContentGroupDesc, /**< OMX_U8*. Content group description if the sound belongs to a larger category of of music /sound.*/
- QOMX_MediaInfoTagInitialKeys, /**< OMX_U8*. Contains the musical key in which media starts.*/
- QOMX_MediaInfoTagLanguages, /**< OMX_U8*. Languages of the text or lyrics spoken or sung in the media.*/
- QOMX_MediaInfoTagMediaType, /**< OMX_U8*. Describes from which media the media sound originated.*/
- QOMX_MediaInfoTagPlaylistDelay, /**< OMX_U8*. Denotes number of milliseconds between each song of the playlist.*/
- QOMX_MediaInfoTagBeatsPerMinute, /**< OMX_U8*. Number of beats per minute in main part of audio.*/
- QOMX_MediaInfoTagPartOfSet, /**< OMX_U8*. Describes part of the set selected or played. */
- QOMX_MediaInfoTagInstrumentName, /**< OMX_U8*. Name of the instrument used in creating media.*/
- QOMX_MediaInfoTagLyrics, /**< OMX_U8*. Lyrics of the media/audio track.*/
- QOMX_MediaInfoTagTrackName, /**< OMX_U8*. Name of the media/audio track.*/
- QOMX_MediaInfoTagMarker, /**< OMX_U8*. Text string cotnents placed at a specific location to denote information about the music at that point.*/
- QOMX_MediaInfoTagCuePoint, /**< OMX_U8*. Subset of the content which can be optionally played.*/
- QOMX_MediaInfoTagGPSPositioningName, /**< OMX_U8*. GPS positioning name. */
- QOMX_MediaInfoTagGPSPositioningMethod, /**< OMX_U8*. GPS positioning method.*/
- QOMX_MediaInfoTagGPSSurveyData, /**< OMX_U8*. GPS survey data. */
- QOMX_MediaInfoTagGPSByteOrder, /**< OMX_U16.GPS byte order. */
- QOMX_MediaInfoTagGPSLatitudeRef, /**< OMX_U32.Reference GPS latitude. */
- QOMX_MediaInfoTagGPSLongitudeRef, /**< OMX_U32.Reference GPS longitude */
- QOMX_MediaInfoTagGPSAltitudeRef, /**< OMX_U32. Reference GPS altitude.*/
- QOMX_MediaInfoTagGPSExtensionMapScaleInfo, /**< OMX_U64. GPS extension map scale information.*/
- QOMX_MediaInfoTagUUIDAtomInfo, /**< OMX_U8*. The user defined data associated with UUID.*/
- QOMX_MediaInfoTagUUIDAtomCount, /**< OMX_U32 UUID atom count.*/
- QOMX_MediaInfoTagLocationRole, /**< OMX_32. Indicates the role of the place. i.e. ‘0’ indicate ‘shooting location'. ‘1’ ‘real location’.*/
- QOMX_MediaInfoTagAstronomicalBody, /**< OMX_U8*. Astronomical body on which the location exists.*/
- QOMX_MediaInfoTagUserInfoData /**< OMX_U8*. The user defined tag informaton.*/
-} QOMX_MEDIAINFOTAGTYPE;
-
-typedef struct QOMX_MEDIAINFOTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex; /**< Read-only value containing the index of the output port. */
- QOMX_MEDIAINFOTAGTYPE eTag; /**< The type of media info being specified. */
- OMX_U32 nDataSize; /**< The size of the associated cData. Set nDataSize to 0 to retrieve the size required for cData. */
- OMX_U8 cData[1]; /**< The media data info */
-} QOMX_MEDIAINFOTYPE;
-
-
-typedef enum QOMX_RESOLUTIONUNITTYPE {
- QOMX_ResolutionUnitInch,
- QOMX_ResolutionCentimeter
-} QOMX_RESOLUTIONUNITTYPE;
-
-typedef struct QOMX_RESOLUTIONTYPE {
- QOMX_RESOLUTIONUNITTYPE eUnit; /**< The unit of measurement. */
- OMX_U32 nX; /**< The number of pixels per unit in the width direction. */
- OMX_U32 nY; /**< The number of pixels per unit in the height direction. */
-} QOMX_RESOLUTIONTYPE;
-
-typedef struct QOMX_TIMESTAMPTYPE {
- OMX_U32 nHour; /**< The hour portion of the time stamp, based on a 24-hour format. */
- OMX_U32 nMinute; /**< The minute portion of the time stamp. */
- OMX_U32 nSecond; /**< The second portion of the time stamp. */
- OMX_U32 nMillisecond; /**< the millisecond portion of the time stamp. */
-} QOMX_TIMESTAMPTYPE;
-
-typedef struct QOMX_DATESTAMPTYPE {
- OMX_U32 nYear; /**< The year portion of the date stamp. */
- OMX_U32 nMonth; /**< The monthportion of the date stamp. Valid values are 1 to 12.*/
- OMX_U32 nDay; /**< The day portion of the date stamp. Valid values are 1 to 31 depending on the month specified.*/
-} QOMX_DATESTAMPTYPE;
-
-typedef enum QOMX_GEODETICREFTYPE {
- QOMX_GeodeticRefNorth, /**< North latitude. */
- QOMX_GeodeticRefSouth, /**< South latitude. */
- QOMX_GeodeticRefEast, /**< East longitude. */
- QOMX_GeodeticRefWest /**< West longitude. */
-} QOMX_GEODETICREFTYPE;
-
-/** QOMX_GEODETICANGLETYPE is used to set geodetic angle coordinates on an ellipsoid (the Earth),
-and is explicitly used to specify latitude and longitude. This structure is referenced by QOMX_GEODETICTYPE. */
-typedef struct QOMX_GEODETICANGLETYPE {
- QOMX_GEODETICREFTYPE eReference; /**< Indicates whether the geodetic angle is a latitude or longitude. */
- OMX_U32 nDegree; /**< The degree of the latitude or longitude. */
- OMX_U32 nMinute; /**< The minute of the latitude or longitude. */
- OMX_U32 nSecond; /**< The second of the latitude or longitude. */
-} QOMX_GEODETICANGLETYPE;
-
-typedef enum QOMX_ALTITUDEREFTYPE {
- QOMX_AltitudeRefSeaLevel, /**< At sea level. */
- QOMX_AltitudeRefBelowSeaLevel /**< Below sea level. */
-} QOMX_ALTITUDEREFTYPE;
-
-typedef struct QOMX_ALTITUDETYPE {
- QOMX_ALTITUDEREFTYPE eReference; /**< The reference point for the altitude. */
- OMX_U32 nMeter; /**< The absolute value of the number of meters above or below sea level. */
- OMX_U32 nMillimeter; /**< The absolute value of the number of millimeters above or below sea level. */
-} QOMX_ALTITUDETYPE;
-
-/** QOMX_GEODETICTYPE is used to set geodetic coordinates such as longitude, latitude, and altitude.
-This structure references QOMX_GEODETICANGLETYPE and QOMX_ALTITUDETYPE. */
-typedef struct QOMX_GEODETICTYPE {
- QOMX_GEODETICANGLETYPE sLatitude; /**< Indicates the latitude.*/
- QOMX_GEODETICANGLETYPE sLongitude; /**< Indicates the longitude.*/
- QOMX_ALTITUDETYPE sAltitude; /**< Indicates the altitude.*/
-} QOMX_GEODETICTYPE;
-
-
-typedef struct QOMX_IMAGE_IMAGESIZECONTROLTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex; /**< port index on which size control needs to be applied */
- OMX_U32 nTargetImageSize; /**< expected max target size in Bytes */
-} QOMX_IMAGE_IMAGESIZECONTROLTYPE;
-
-typedef enum QOMX_URITYPE {
- QOMX_URITYPE_RTSP, /**< RTSP URI Type. */
- QOMX_URITYPE_HTTP, /**< HTTP URI Type. */
- QOMX_URITYPE_LOCAL /**< Local URI Type.(i.e Non Network) */
-}QOMX_URITYPE;
-
-
-typedef enum QOMX_STREAMTYPE {
- QOMX_STREAMTYPE_VOD, /**< Video On demand Stream */
- QOMX_STREAMTYPE_LIVE,/**< Live Stream */
- QOMX_STREAMTYPE_FILE /**< File based Stream */
-}QOMX_STREAMTYPE;
-
-
-typedef struct QOMX_MEDIASTREAMTYPE{
- QOMX_URITYPE eURIType;
- QOMX_STREAMTYPE eStreamType;
-}QOMX_MEDIASTREAMTYPE;
-
-
-/**
- * This structure specifies the parameters associated with each
- * plane of the uncompressed image/video format.
- */
-typedef struct QOMX_PLANEDEFINITIONTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex; /**< Represents the port that this structure applies to */
- OMX_U32 nPlaneIndex; /**< Specifies the plane enumeration index that this structure applies to, starting with a base value of 1 */
- OMX_U32 nMinStride; /**< Read-only parameter that specifies the minimum buffer stride */
- OMX_U32 nMaxStride; /**< Read-only parameter that specifies the maximum buffer stride */
- OMX_U32 nStrideMultiples; /**< Read-only parameter that specifies the buffer stride multiple supported */
- OMX_S32 nActualStride; /**< Specifies the actual stride to be applied */
- OMX_U32 nMinPlaneBufferHeight; /**< Read-only parameter that specifies the minimum buffer height (number of stride lines) */
- OMX_U32 nActualPlaneBufferHeight; /**< Specifies the actual buffer height (number of stride lines) to be applied */
- OMX_U32 nBufferSize; /**< Read-only parameter that specifies the minimum size of the buffer, in bytes */
- OMX_U32 nBufferAlignment; /**< Read-only field that specifies the required alignment of the buffer, in bytes */
-} QOMX_PLANEDEFINITIONTYPE;
-
-/**
- * Pause port parameters
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Index of port that this structure represent
- * bPausePort : Boolean field which indicates if port is paused or resume. By default bPausePort = OMX_FALSE
- * & port will be paused when bPausePort = OMX_TRUE
- */
-typedef struct QOMX_CONFIG_PAUSEPORTTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex; /**< Represents the port that this structure applies to */
- OMX_BOOL bPausePort; /**< Specifies if port need to PAUSE or RESUME */
-} QOMX_CONFIG_PAUSEPORTTYPE;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* end of macro __H_QOMX_IVCOMMONEXTENSIONS_H__ */
+/*--------------------------------------------------------------------------
+Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __H_QOMX_IVCOMMONEXTENSIONS_H__
+#define __H_QOMX_IVCOMMONEXTENSIONS_H__
+
+/*========================================================================
+
+*//** @file QOMX_CommonExtensions.h
+
+@par FILE SERVICES:
+ common extensions API for OpenMax IL.
+
+ This file contains the description of the Qualcomm OpenMax IL
+ common extention interface, through which the IL client and OpenMax
+ components can access additional capabilities.
+
+*//*====================================================================== */
+
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Core.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/* IV common extension strings */
+#define OMX_QCOM_INDEX_CONFIG_MEDIAINFO "OMX.QCOM.index.config.mediainfo" /**< reference: QOMX_MEDIAINFOTYPE */
+#define OMX_QCOM_INDEX_CONFIG_CONTENTURI "OMX.QCOM.index.config.contenturi" /**< reference: OMX_PARAM_CONTENTURITYPE */
+#define OMX_QCOM_INDEX_PARAM_IMAGESIZECONTROL "OMX.Qualcomm.index.param.ImageSizeControl" /**< reference: QOMX_IMAGE_IMAGESIZECONTROLTYPE */
+#define OMX_QCOM_INDEX_CONFIG_PAUSEPORT "OMX.QCOM.index.config.PausePort" /**< reference: QOMX_CONFIG_PAUSEPORTTYPE */
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give width in pixels */
+#define OMX_QCOM_INDEX_PARAM_FRAMEWIDTHRANGESUPPORTED "OMX.QCOM.index.param.FrameWidthRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give height in pixels */
+#define OMX_QCOM_INDEX_PARAM_FRAMEHEIGHTRANGESUPPORTED "OMX.QCOM.index.param.FrameHeightRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give the number of macroblocks per
+ * frame. */
+#define OMX_QCOM_INDEX_PARAM_MACROBLOCKSPERFRAMERANGESUPPORTED "OMX.QCOM.index.param.MacroblocksPerFrameRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give the number of macroblocks per
+ * second. */
+#define OMX_QCOM_INDEX_PARAM_MACROBLOCKSPERSECONDRANGESUPPORTED "OMX.QCOM.index.param.MacroblocksPerSecondRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give frame rate in frames per second
+ * in Q16 format. */
+#define OMX_QCOM_INDEX_PARAM_FRAMERATERANGESUPPORTED "OMX.QCOM.index.param.FrameRateRangeSupported"
+
+#define OMX_QCOM_INDEX_PARAM_PLANEDEFINITION "OMX.QCOM.index.param.PlaneDefinition" /** reference: QOMX_PLANEDEFINITIONTYPE */
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give the crop width in pixels */
+#define OMX_QOMX_INDEX_PARAM_CROPWIDTHRANGESUPPORTED "OMX.QCOM.index.param.CropWidthRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give the crop height in pixels */
+#define OMX_QOMX_INDEX_PARAM_CROPHEIGHTRANGESUPPORTED "OMX.QCOM.index.param.CropHeightRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give the digital zoom factor on width
+ * in Q16 format. */
+#define OMX_QCOM_INDEX_PARAM_DIGITALZOOMWIDTHRANGESUPPORTED "OMX.QCOM.index.param.DigitalZoomWidthRangeSupported"
+
+/** reference: QOMX_URANGETYPE
+ * nMin, nMax, nStepSize give the digital zoom factor on height
+ * in Q16 format. */
+#define OMX_QCOM_INDEX_PARAM_DIGITALZOOMHEIGHTRANGESUPPORTED "OMX.QCOM.index.param.DigitalZoomHeightRangeSupported"
+
+/**
+ * Enumeration defining the extended uncompressed image/video
+ * formats.
+ *
+ * ENUMS:
+ * YVU420PackedSemiPlanar : Buffer containing all Y, and then V and U
+ * interleaved.
+ * YVU420PackedSemiPlanar32m4ka : YUV planar format, similar to the
+ * YVU420PackedSemiPlanar format, but with the
+ * following restrictions:
+ *
+ * 1. The width and height of both plane must
+ * be a multiple of 32 texels.
+ *
+ * 2. The base address of both planes must be
+ * aligned to a 4kB boundary.
+ *
+ * YUV420PackedSemiPlanar16m2ka : YUV planar format, similar to the
+ * YUV420PackedSemiPlanar format, but with the
+ * following restrictions:
+ *
+ * 1. The width of the luma plane must be a
+ * multiple of 16 pixels.
+ *
+ * 2. The address of both planes must be
+ * aligned to a 2kB boundary.
+ *
+ * YUV420PackedSemiPlanar64x32Tile2m8ka : YUV planar format, similar to the
+ * YUV420PackedSemiPlanar format, but with the
+ * following restrictions:
+ *
+ * 1. The data is laid out in a 4x2 MB tiling
+ * memory structure
+ *
+ * 2. The width of each plane is a multiple of
+ * 2 4x2 MB tiles.
+ *
+ * 3. The height of each plan is a multiple of
+ * a 4x2 MB tile.
+ *
+ * 4. The base address of both planes must be
+ * aligned to an 8kB boundary.
+ *
+ * 5. The tiles are scanned in the order
+ * defined in the MFCV5.1 User's Manual.
+ */
+typedef enum QOMX_COLOR_FORMATTYPE
+{
+ QOMX_COLOR_FormatYVU420PackedSemiPlanar = 0x7F000001,
+ QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka
+} QOMX_COLOR_FORMATTYPE;
+
+typedef enum QOMX_MEDIAINFOTAGTYPE {
+ QOMX_MediaInfoTagVersion, /**< OMX_VERSIONTYPE. Version of the standard specifying the media information.*/
+ QOMX_MediaInfoTagUID, /**< OMX_U8*. Unique ID of the media data, ie image unique ID.*/
+ QOMX_MediaInfoTagDescription, /**< OMX_U8*. Comments about the media.*/
+ QOMX_MediaInfoTagTitle, /**< OMX_U8*. Title of the media.*/
+ QOMX_MediaInfoTagAuthor, /**< OMX_U8*. Author of the media.*/
+ QOMX_MediaInfoTagCopyright, /**< OMX_U8*. Copyright information.*/
+ QOMX_MediaInfoTagTrackNum, /**< OMX_U32. Track number.*/
+ QOMX_MediaInfoTagGenre, /**< OMX_U8*. The genre of the media.*/
+ QOMX_MediaInfoTagEquipmentMake, /**< OMX_U8*. Manufacturer of recording equipment.*/
+ QOMX_MediaInfoTagEquipmentModel,/**< OMX_U8*. Model or name of the recording equipment.*/
+ QOMX_MediaInfoTagSoftware, /**< OMX_U8*. Name and version of the software or firmware of the device generating the media.*/
+ QOMX_MediaInfoTagAssociatedFile,/**< OMX_U8*. The name of the file related to the media. For example, an audio file related to an image file.*/
+ QOMX_MediaInfoTagResolution, /**< QOMX_RESOLUTIONTYPE. Number of pixels per resolution unit.*/
+ QOMX_MediaInfoTagDateCreated, /**< QOMX_DATESTAMPTYPE. Date when media was created.*/
+ QOMX_MediaInfoTagTimeCreated, /**< QOMX_TIMESTAMPTYPE. Time when media was created.*/
+ QOMX_MediaInfoTagDateModified, /**< QOMX_DATESTAMPETYPE. Date when file was last modified.*/
+ QOMX_MediaInfoTagTimeModified, /**< QOMX_TIMESTAMPTYPE. Time when file was last modified.*/
+ QOMX_MediaInfoTagGPSAreaName, /**< OMX_U8*. The name of the location.*/
+ QOMX_MediaInfoTagGPSVersion, /**< OMX_VERSIONTYPE. GPS version.*/
+ QOMX_MediaInfoTagGPSCoordinates,/**< QOMX_GEODETICTYPE. The longitude, latitude, and altitude.*/
+ QOMX_MediaInfoTagGPSSatellites, /**< OMX_U8*. The GPS satellites used for measurements.*/
+ QOMX_MediaInfoTagGPSPrecision, /**< OMX_U32. GPS degree of precision.*/
+ QOMX_MediaInfoTagGPSDateStamp, /**< QOMX_DATESTAMPTYPE. Date of the GPS data.*/
+ QOMX_MediaInfoTagGPSTimeStamp, /**< QOMX_TIMESTAMPTYPE. Time of the GPS data.*/
+ QOMX_MediaInfoTagMediaStreamType,/**< QOMX_MEDIASTREAMTYPE. Type of the stream. */
+ QOMX_MediaInfoDuration, /**< OMX_TICKS. Total duration of the media.*/
+ QOMX_MediaInfoSize, /**< OMX_U32. Total size of the media in bytes.*/
+ QOMX_MediaInfoTagAlbum, /**< OMX_U8*. Name of album/movie/show.*/
+ QOMX_MediaInfoTagLocation, /**< OMX_U8*. Recording location information.*/
+ QOMX_MediaInfoTagClassification, /**< OMX_U8*. Classification information of media.*/
+ QOMX_MediaInfoTagRatings, /**< OMX_U8*. Media Ratings based on popularity & rating criteria.*/
+ QOMX_MediaInfoTagKeyword, /**< OMX_U8*. Keyword associated with media which are intended to reflect mood of the A/V.*/
+ QOMX_MediaInfoTagPerformance, /**< OMX_U8*. Media Performer information..*/
+ QOMX_MediaInfoTagYear, /**< OMX_U8*. Production year information of media.*/
+ QOMX_MediaInfoTagComposer, /**< OMX_U8*. Name of the composer of media i.e. audio.*/
+ QOMX_MediaInfoTagEncoderName, /**< OMX_U8*. Name of the person or organisation who encoded media.*/
+ QOMX_MediaInfoTagCopyProhibitFlag, /**< OMX_U8*. Flag to indicate if copy is allowed or not.*/
+ QOMX_MediaInfoTagLyricist, /**< OMX_U8*. Name of the lyricist or text writer in recording. Specific to ID3 tag.*/
+ QOMX_MediaInfoTagSubtitle, /**< OMX_U8*. Subtitle/Description used for informaton directly related to title of media.*/
+ QOMX_MediaInfoTagOriginalFileName, /**< OMX_U8*. Original file name.*/
+ QOMX_MediaInfoTagOriginalLyricist, /**< OMX_U8*. Name of the original lyricist/text writer of original recording.*/
+ QOMX_MediaInfoTagOriginalArtist, /**< OMX_U8*. Name of the original artist.*/
+ QOMX_MediaInfoTagOriginalReleaseYear, /**< OMX_U8*. Original release year of recorded media.*/
+ QOMX_MediaInfoTagFileOwner, /**< OMX_U8*. Licensee or name of the file owner.*/
+ QOMX_MediaInfoTagOrchestra, /**< OMX_U8*. Name of the orchestra or performers during recording.*/
+ QOMX_MediaInfoTagConductor, /**< OMX_U8*. Name of the conductor.*/
+ QOMX_MediaInfoTagRemixedBy, /**< OMX_U8*. Person or organization name who did the remix.*/
+ QOMX_MediaInfoTagAlbumArtist, /**< OMX_U8*. Name of the album artist.*/
+ QOMX_MediaInfoTagPublisher, /**< OMX_U8*. Name of the publisher or label.*/
+ QOMX_MediaInfoTagRecordingDates, /**< OMX_U8*. Recording date of media.*/
+ QOMX_MediaInfoTagInternetRadioStationName, /**< OMX_U8*. Name of the Internet radio station from which the audio is streamed.*/
+ QOMX_MediaInfoTagInternetRadioStationOwner, /**< OMX_U8*. Name of the owner of the Internet radio station from which the audio is streamed.*/
+ QOMX_MediaInfoTagInternationalRecordingCode,/**< OMX_U8*. International standard recording code.*/
+ QOMX_MediaInfoTagEncoderSwHwSettings, /**< OMX_U8*. Software,hardware settings used by encoder.*/
+ QOMX_MediaInfoTagInvolvedPeopleList, /**< OMX_U8*. List of people involved. Specific to ID3 tag.*/
+ QOMX_MediaInfoTagComments, /**< OMX_U8*. Comments about the media. It can be any kind of full text informaton.*/
+ QOMX_MediaInfoTagCommissioned, /**< OMX_U8*. Commissioned information of media.*/
+ QOMX_MediaInfoTagSubject, /**< OMX_U8*. Subject associated with media.*/
+ QOMX_MediaInfoTagContact, /**< OMX_U8*. Conatct information. URL information of the seller.*/
+ QOMX_MediaInfoTagValidityPeriod, /**< OMX_U8*. Length or period of validity of media.*/
+ QOMX_MediaInfoTagValidityEffectiveDate, /**< OMX_U8*. Validity effective date of media*/
+ QOMX_MediaInfoTagNumberOfAllowedPlaybacks, /**< OMX_U8*. Number of allowed playbacks for this media*/
+ QOMX_MediaInfoTagPlayCounter, /**< OMX_U8*. Current play counter of the media.Its number of times a file has been played.*/
+ QOMX_MediaInfoTagMemo, /**< OMX_U8*. Memo associatd with media.*/
+ QOMX_MediaInfoTagDeviceName, /**< OMX_U8*. Name of the devices used in creating media.*/
+ QOMX_MediaInfoTagURL, /**< OMX_U8*. List artist /genre /movie sites URL.*/
+ QOMX_MediaInfoTagFileType, /**< OMX_U8*. Indicates type of audio track.*/
+ QOMX_MediaInfoTagContentGroupDesc, /**< OMX_U8*. Content group description if the sound belongs to a larger category of of music /sound.*/
+ QOMX_MediaInfoTagInitialKeys, /**< OMX_U8*. Contains the musical key in which media starts.*/
+ QOMX_MediaInfoTagLanguages, /**< OMX_U8*. Languages of the text or lyrics spoken or sung in the media.*/
+ QOMX_MediaInfoTagMediaType, /**< OMX_U8*. Describes from which media the media sound originated.*/
+ QOMX_MediaInfoTagPlaylistDelay, /**< OMX_U8*. Denotes number of milliseconds between each song of the playlist.*/
+ QOMX_MediaInfoTagBeatsPerMinute, /**< OMX_U8*. Number of beats per minute in main part of audio.*/
+ QOMX_MediaInfoTagPartOfSet, /**< OMX_U8*. Describes part of the set selected or played. */
+ QOMX_MediaInfoTagInstrumentName, /**< OMX_U8*. Name of the instrument used in creating media.*/
+ QOMX_MediaInfoTagLyrics, /**< OMX_U8*. Lyrics of the media/audio track.*/
+ QOMX_MediaInfoTagTrackName, /**< OMX_U8*. Name of the media/audio track.*/
+ QOMX_MediaInfoTagMarker, /**< OMX_U8*. Text string cotnents placed at a specific location to denote information about the music at that point.*/
+ QOMX_MediaInfoTagCuePoint, /**< OMX_U8*. Subset of the content which can be optionally played.*/
+ QOMX_MediaInfoTagGPSPositioningName, /**< OMX_U8*. GPS positioning name. */
+ QOMX_MediaInfoTagGPSPositioningMethod, /**< OMX_U8*. GPS positioning method.*/
+ QOMX_MediaInfoTagGPSSurveyData, /**< OMX_U8*. GPS survey data. */
+ QOMX_MediaInfoTagGPSByteOrder, /**< OMX_U16.GPS byte order. */
+ QOMX_MediaInfoTagGPSLatitudeRef, /**< OMX_U32.Reference GPS latitude. */
+ QOMX_MediaInfoTagGPSLongitudeRef, /**< OMX_U32.Reference GPS longitude */
+ QOMX_MediaInfoTagGPSAltitudeRef, /**< OMX_U32. Reference GPS altitude.*/
+ QOMX_MediaInfoTagGPSExtensionMapScaleInfo, /**< OMX_U64. GPS extension map scale information.*/
+ QOMX_MediaInfoTagUUIDAtomInfo, /**< OMX_U8*. The user defined data associated with UUID.*/
+ QOMX_MediaInfoTagUUIDAtomCount, /**< OMX_U32 UUID atom count.*/
+ QOMX_MediaInfoTagLocationRole, /**< OMX_32. Indicates the role of the place. i.e. ‘0’ indicate ‘shooting location'. ‘1’ ‘real location’.*/
+ QOMX_MediaInfoTagAstronomicalBody, /**< OMX_U8*. Astronomical body on which the location exists.*/
+ QOMX_MediaInfoTagUserInfoData /**< OMX_U8*. The user defined tag informaton.*/
+} QOMX_MEDIAINFOTAGTYPE;
+
+typedef struct QOMX_MEDIAINFOTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< Read-only value containing the index of the output port. */
+ QOMX_MEDIAINFOTAGTYPE eTag; /**< The type of media info being specified. */
+ OMX_U32 nDataSize; /**< The size of the associated cData. Set nDataSize to 0 to retrieve the size required for cData. */
+ OMX_U8 cData[1]; /**< The media data info */
+} QOMX_MEDIAINFOTYPE;
+
+
+typedef enum QOMX_RESOLUTIONUNITTYPE {
+ QOMX_ResolutionUnitInch,
+ QOMX_ResolutionCentimeter
+} QOMX_RESOLUTIONUNITTYPE;
+
+typedef struct QOMX_RESOLUTIONTYPE {
+ QOMX_RESOLUTIONUNITTYPE eUnit; /**< The unit of measurement. */
+ OMX_U32 nX; /**< The number of pixels per unit in the width direction. */
+ OMX_U32 nY; /**< The number of pixels per unit in the height direction. */
+} QOMX_RESOLUTIONTYPE;
+
+typedef struct QOMX_TIMESTAMPTYPE {
+ OMX_U32 nHour; /**< The hour portion of the time stamp, based on a 24-hour format. */
+ OMX_U32 nMinute; /**< The minute portion of the time stamp. */
+ OMX_U32 nSecond; /**< The second portion of the time stamp. */
+ OMX_U32 nMillisecond; /**< the millisecond portion of the time stamp. */
+} QOMX_TIMESTAMPTYPE;
+
+typedef struct QOMX_DATESTAMPTYPE {
+ OMX_U32 nYear; /**< The year portion of the date stamp. */
+ OMX_U32 nMonth; /**< The monthportion of the date stamp. Valid values are 1 to 12.*/
+ OMX_U32 nDay; /**< The day portion of the date stamp. Valid values are 1 to 31 depending on the month specified.*/
+} QOMX_DATESTAMPTYPE;
+
+typedef enum QOMX_GEODETICREFTYPE {
+ QOMX_GeodeticRefNorth, /**< North latitude. */
+ QOMX_GeodeticRefSouth, /**< South latitude. */
+ QOMX_GeodeticRefEast, /**< East longitude. */
+ QOMX_GeodeticRefWest /**< West longitude. */
+} QOMX_GEODETICREFTYPE;
+
+/** QOMX_GEODETICANGLETYPE is used to set geodetic angle coordinates on an ellipsoid (the Earth),
+and is explicitly used to specify latitude and longitude. This structure is referenced by QOMX_GEODETICTYPE. */
+typedef struct QOMX_GEODETICANGLETYPE {
+ QOMX_GEODETICREFTYPE eReference; /**< Indicates whether the geodetic angle is a latitude or longitude. */
+ OMX_U32 nDegree; /**< The degree of the latitude or longitude. */
+ OMX_U32 nMinute; /**< The minute of the latitude or longitude. */
+ OMX_U32 nSecond; /**< The second of the latitude or longitude. */
+} QOMX_GEODETICANGLETYPE;
+
+typedef enum QOMX_ALTITUDEREFTYPE {
+ QOMX_AltitudeRefSeaLevel, /**< At sea level. */
+ QOMX_AltitudeRefBelowSeaLevel /**< Below sea level. */
+} QOMX_ALTITUDEREFTYPE;
+
+typedef struct QOMX_ALTITUDETYPE {
+ QOMX_ALTITUDEREFTYPE eReference; /**< The reference point for the altitude. */
+ OMX_U32 nMeter; /**< The absolute value of the number of meters above or below sea level. */
+ OMX_U32 nMillimeter; /**< The absolute value of the number of millimeters above or below sea level. */
+} QOMX_ALTITUDETYPE;
+
+/** QOMX_GEODETICTYPE is used to set geodetic coordinates such as longitude, latitude, and altitude.
+This structure references QOMX_GEODETICANGLETYPE and QOMX_ALTITUDETYPE. */
+typedef struct QOMX_GEODETICTYPE {
+ QOMX_GEODETICANGLETYPE sLatitude; /**< Indicates the latitude.*/
+ QOMX_GEODETICANGLETYPE sLongitude; /**< Indicates the longitude.*/
+ QOMX_ALTITUDETYPE sAltitude; /**< Indicates the altitude.*/
+} QOMX_GEODETICTYPE;
+
+
+typedef struct QOMX_IMAGE_IMAGESIZECONTROLTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< port index on which size control needs to be applied */
+ OMX_U32 nTargetImageSize; /**< expected max target size in Bytes */
+} QOMX_IMAGE_IMAGESIZECONTROLTYPE;
+
+typedef enum QOMX_URITYPE {
+ QOMX_URITYPE_RTSP, /**< RTSP URI Type. */
+ QOMX_URITYPE_HTTP, /**< HTTP URI Type. */
+ QOMX_URITYPE_LOCAL /**< Local URI Type.(i.e Non Network) */
+}QOMX_URITYPE;
+
+
+typedef enum QOMX_STREAMTYPE {
+ QOMX_STREAMTYPE_VOD, /**< Video On demand Stream */
+ QOMX_STREAMTYPE_LIVE,/**< Live Stream */
+ QOMX_STREAMTYPE_FILE /**< File based Stream */
+}QOMX_STREAMTYPE;
+
+
+typedef struct QOMX_MEDIASTREAMTYPE{
+ QOMX_URITYPE eURIType;
+ QOMX_STREAMTYPE eStreamType;
+}QOMX_MEDIASTREAMTYPE;
+
+
+/**
+ * This structure specifies the parameters associated with each
+ * plane of the uncompressed image/video format.
+ */
+typedef struct QOMX_PLANEDEFINITIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< Represents the port that this structure applies to */
+ OMX_U32 nPlaneIndex; /**< Specifies the plane enumeration index that this structure applies to, starting with a base value of 1 */
+ OMX_U32 nMinStride; /**< Read-only parameter that specifies the minimum buffer stride */
+ OMX_U32 nMaxStride; /**< Read-only parameter that specifies the maximum buffer stride */
+ OMX_U32 nStrideMultiples; /**< Read-only parameter that specifies the buffer stride multiple supported */
+ OMX_S32 nActualStride; /**< Specifies the actual stride to be applied */
+ OMX_U32 nMinPlaneBufferHeight; /**< Read-only parameter that specifies the minimum buffer height (number of stride lines) */
+ OMX_U32 nActualPlaneBufferHeight; /**< Specifies the actual buffer height (number of stride lines) to be applied */
+ OMX_U32 nBufferSize; /**< Read-only parameter that specifies the minimum size of the buffer, in bytes */
+ OMX_U32 nBufferAlignment; /**< Read-only field that specifies the required alignment of the buffer, in bytes */
+} QOMX_PLANEDEFINITIONTYPE;
+
+/**
+ * Pause port parameters
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Index of port that this structure represent
+ * bPausePort : Boolean field which indicates if port is paused or resume. By default bPausePort = OMX_FALSE
+ * & port will be paused when bPausePort = OMX_TRUE
+ */
+typedef struct QOMX_CONFIG_PAUSEPORTTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex; /**< Represents the port that this structure applies to */
+ OMX_BOOL bPausePort; /**< Specifies if port need to PAUSE or RESUME */
+} QOMX_CONFIG_PAUSEPORTTYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_IVCOMMONEXTENSIONS_H__ */
diff --git a/mm-core/inc/QOMX_SourceExtensions.h b/mm-core/inc/QOMX_SourceExtensions.h
index fa68a6c..9936f6d 100644
--- a/mm-core/inc/QOMX_SourceExtensions.h
+++ b/mm-core/inc/QOMX_SourceExtensions.h
@@ -1,157 +1,157 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2011-2012 The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __H_QOMX_SOURCEEXTENSIONS_H__
-#define __H_QOMX_SOURCEEXTENSIONS_H__
-/*========================================================================
-*//** @file QOMX_SourceExtensions.h
-
-@par FILE SERVICES:
- Qualcomm extensions API for OpenMax IL demuxer component.
-
- This file contains the description of the Qualcomm OpenMax IL
- demuxer component extention interface, through which the IL client and
- OpenMax components can access additional capabilities of the demuxer.
-
-*//*====================================================================== */
-
-
-/*========================================================================
- INCLUDE FILES FOR MODULE
-========================================================================== */
-#include <OMX_Core.h>
-/*========================================================================
- DEFINITIONS AND DECLARATIONS
-========================================================================== */
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-/* Frame size query supported extension string */
-#define OMX_QCOM_INDEX_PARAM_FRAMESIZEQUERYSUPPORTED "OMX.QCOM.index.param.FrameSizeQuerySupported" /**< reference: QOMX_FRAMESIZETYPE */
-
-/* Content interface extension strings */
-#define OMX_QCOM_INDEX_PARAM_CONTENTINTERFACE_IXSTREAM "OMX.QCOM.index.param.contentinterface.ixstream" /**< reference: QOMX_CONTENTINTERFACETYPE*/
-#define OMX_QCOM_INDEX_PARAM_CONTENTINTERFACE_ISTREAMPORT "OMX.QCOM.index.param.contentinterface.istreamport" /**< reference: QOMX_CONTENTINTERFACETYPE*/
-
-/* Source seek access extension string */
-#define OMX_QCOM_INDEX_PARAM_SEEK_ACCESS "OMX.QCOM.index.param.SeekAccess" /**< reference: QOMX_PARAM_SEEKACCESSTYPE*/
-
-/* Media duration extension string*/
-#define OMX_QCOM_INDEX_CONFIG_MEDIADURATION "OMX.QCOM.index.config.MediaDuration" /**< reference: OMX_TIME_CONFIG_MEDIADURATIONTYPE*/
-
-/**
- * Data interface Params
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nInterfaceSize : Size of the data pointed by pInterface
- * pInterface : Interface pointer
- */
-typedef struct QOMX_CONTENTINTERFACETYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nInterfaceSize;
- OMX_U8 pInterface[1];
-} QOMX_DATAINTERFACETYPE;
-
-/**
- * Seek Access Parameters
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Index of port
- * bSeekAllowed : Flag to indicate whether seek is supported or not
- */
-typedef struct QOMX_PARAM_SEEKACCESSTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_BOOL bSeekAllowed;
-} QOMX_PARAM_SEEKACCESSTYPE;
-
-/**
- * Media Duration parameters
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Index of port
- * nDuration : Total duration of the media
-*/
-typedef struct OMX_TIME_CONFIG_MEDIADURATIONTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_TICKS nDuration;
-} OMX_TIME_CONFIG_MEDIADURATIONTYPE;
-
-/**
- * The parameters for QOMX_FRAMESIZETYPE are defined as
- * follows:
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Represents the port that this structure
- * applies to
- * sFrameSize : Indicates the size of the frame
- * nFrameSizeIndex : Enumerates the possible frame sizes for
- * the given session/URL configuration. The
- * caller specifies all fields and the
- * OMX_GetParameter call returns the value of
- * the frame size. The value of
- * nFrameSizeIndex goes from 0 to N-1, where
- * N is the number of frame sizes that may be
- * emitted by the port. The port does not
- * need to report N as the caller can
- * determine N by enumerating all the frame
- * sizes supported by the port. If the port
- * does not have advance knowledge of the
- * possible frame sizes, it may report no
- * frame sizes. If there are no more frame
- * sizes, OMX_GetParameter returns
- * OMX_ErrorNoMore.
- */
-typedef struct QOMX_FRAMESIZETYPE
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_FRAMESIZETYPE sFrameSize;
- OMX_U32 nFrameSizeIndex;
-} QOMX_FRAMESIZETYPE;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* end of macro __H_QOMX_SOURCEEXTENSIONS_H__ */
+/*--------------------------------------------------------------------------
+Copyright (c) 2011-2012 Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __H_QOMX_SOURCEEXTENSIONS_H__
+#define __H_QOMX_SOURCEEXTENSIONS_H__
+/*========================================================================
+*//** @file QOMX_SourceExtensions.h
+
+@par FILE SERVICES:
+ Qualcomm extensions API for OpenMax IL demuxer component.
+
+ This file contains the description of the Qualcomm OpenMax IL
+ demuxer component extention interface, through which the IL client and
+ OpenMax components can access additional capabilities of the demuxer.
+
+*//*====================================================================== */
+
+
+/*========================================================================
+ INCLUDE FILES FOR MODULE
+========================================================================== */
+#include <OMX_Core.h>
+/*========================================================================
+ DEFINITIONS AND DECLARATIONS
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+/* Frame size query supported extension string */
+#define OMX_QCOM_INDEX_PARAM_FRAMESIZEQUERYSUPPORTED "OMX.QCOM.index.param.FrameSizeQuerySupported" /**< reference: QOMX_FRAMESIZETYPE */
+
+/* Content interface extension strings */
+#define OMX_QCOM_INDEX_PARAM_CONTENTINTERFACE_IXSTREAM "OMX.QCOM.index.param.contentinterface.ixstream" /**< reference: QOMX_CONTENTINTERFACETYPE*/
+#define OMX_QCOM_INDEX_PARAM_CONTENTINTERFACE_ISTREAMPORT "OMX.QCOM.index.param.contentinterface.istreamport" /**< reference: QOMX_CONTENTINTERFACETYPE*/
+
+/* Source seek access extension string */
+#define OMX_QCOM_INDEX_PARAM_SEEK_ACCESS "OMX.QCOM.index.param.SeekAccess" /**< reference: QOMX_PARAM_SEEKACCESSTYPE*/
+
+/* Media duration extension string*/
+#define OMX_QCOM_INDEX_CONFIG_MEDIADURATION "OMX.QCOM.index.config.MediaDuration" /**< reference: OMX_TIME_CONFIG_MEDIADURATIONTYPE*/
+
+/**
+ * Data interface Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nInterfaceSize : Size of the data pointed by pInterface
+ * pInterface : Interface pointer
+ */
+typedef struct QOMX_CONTENTINTERFACETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nInterfaceSize;
+ OMX_U8 pInterface[1];
+} QOMX_DATAINTERFACETYPE;
+
+/**
+ * Seek Access Parameters
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Index of port
+ * bSeekAllowed : Flag to indicate whether seek is supported or not
+ */
+typedef struct QOMX_PARAM_SEEKACCESSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bSeekAllowed;
+} QOMX_PARAM_SEEKACCESSTYPE;
+
+/**
+ * Media Duration parameters
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Index of port
+ * nDuration : Total duration of the media
+*/
+typedef struct OMX_TIME_CONFIG_MEDIADURATIONTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_TICKS nDuration;
+} OMX_TIME_CONFIG_MEDIADURATIONTYPE;
+
+/**
+ * The parameters for QOMX_FRAMESIZETYPE are defined as
+ * follows:
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Represents the port that this structure
+ * applies to
+ * sFrameSize : Indicates the size of the frame
+ * nFrameSizeIndex : Enumerates the possible frame sizes for
+ * the given session/URL configuration. The
+ * caller specifies all fields and the
+ * OMX_GetParameter call returns the value of
+ * the frame size. The value of
+ * nFrameSizeIndex goes from 0 to N-1, where
+ * N is the number of frame sizes that may be
+ * emitted by the port. The port does not
+ * need to report N as the caller can
+ * determine N by enumerating all the frame
+ * sizes supported by the port. If the port
+ * does not have advance knowledge of the
+ * possible frame sizes, it may report no
+ * frame sizes. If there are no more frame
+ * sizes, OMX_GetParameter returns
+ * OMX_ErrorNoMore.
+ */
+typedef struct QOMX_FRAMESIZETYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_FRAMESIZETYPE sFrameSize;
+ OMX_U32 nFrameSizeIndex;
+} QOMX_FRAMESIZETYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_SOURCEEXTENSIONS_H__ */
diff --git a/mm-core/inc/QOMX_StreamingExtensions.h b/mm-core/inc/QOMX_StreamingExtensions.h
index 011047c..ec88de8 100644
--- a/mm-core/inc/QOMX_StreamingExtensions.h
+++ b/mm-core/inc/QOMX_StreamingExtensions.h
@@ -1,486 +1,486 @@
-#ifndef QOMX_STREAMINGEXTENSIONS_H_
-#define QOMX_STREAMINGEXTENSIONS_H_
-/*--------------------------------------------------------------------------
-Copyright (c) 2012, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 QOMX_StreamingExtensions.h
-
-@par FILE SERVICES:
- Qualcomm extensions API for OpenMax IL Streaming Components.
-
- This file contains the description of the Qualcomm OpenMax IL
- streaming extention interface, through which the IL client and OpenMax
- components can access additional streaming capabilities.
-
-*//*====================================================================== */
-
-/*========================================================================
- Edit History
-
-$Header: //source/qcom/qct/multimedia2/api/OpenMax/QCOM/main/latest/QOMX_StreamingExtensions.h#7 $
-$DateTime: 2011/03/02 12:27:27 $
-$Change: 1638323 $
-
-========================================================================== */
-
-/* =======================================================================
-** Includes and Public Data Declarations
-** ======================================================================= */
-
-/* =======================================================================
-
- INCLUDE FILES FOR MODULE
-
-========================================================================== */
-
-#include <OMX_Types.h>
-#include <OMX_Component.h>
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-
-/* =======================================================================
-
- DATA DECLARATIONS
-
-========================================================================== */
-/* -----------------------------------------------------------------------
-** Type Declarations
-** ----------------------------------------------------------------------- */
-/**
- * Qualcomm vendor streaming extension strings.
- */
-#define OMX_QUALCOMM_INDEX_CONFIG_WATERMARK "OMX.Qualcomm.index.config.Watermark"
-#define OMX_QUALCOMM_INDEX_CONFIG_WATERMARKSTATUS "OMX.Qualcomm.index.config.WatermarkStatus"
-#define OMX_QUALCOMM_INDEX_CONFIG_BUFFERMARKING "OMX.Qualcomm.index.config.BufferMarking"
-#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_NETWORKINTERFACE "OMX.Qualcomm.index.param.streaming.NetworkInterface"
-#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_NETWORKPROFILE "OMX.Qualcomm.index.param.streaming.NetworkProfile"
-#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_PROXYSERVER "OMX.Qualcomm.index.param.streaming.ProxyServer"
-#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_SOURCEPORTS "OMX.Qualcomm.index.param.streaming.SourcePorts"
-#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_PROTOCOLHEADER "OMX.Qualcomm.index.param.streaming.ProtocolHeader"
-#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_PROTOCOLEVENT "OMX.Qualcomm.index.config.streaming.ProtocolEvent"
-#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_DYNAMIC_SWITCH_CAPABILITY "OMX.Qualcomm.index.config.streaming.DynamicSessionSwitchCapability"
-#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_PROTOCOLHEADERSEVENT "OMX.QCOM.index.config.streaming.ProtocolHeadersEvent"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_USERPAUSETIMEOUT "OMX.QCOM.index.config.streaming.UserPauseTimeout"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_NOTIFYERRORONOPTIONSTIMEOUT "OMX.QCOM.index.config.streaming.NotifyErrorOnOptionsTimeout"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_USEINTERLEAVEDTCP "OMX.QCOM.index.config.streaming.UseInterleavedTCP"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_DATAINACTIVITYTIMEOUT "OMX.QCOM.index.config.streaming.DataInactivityTimeout"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTSPOPTIONSKEEPALIVEINTERVAL "OMX.QCOM.index.config.streaming.RTSPOptionsKeepaliveInterval"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTCPRRINTERVAL "OMX.QCOM.index.config.streaming.RTCPRRInterval"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_RECONFIGUREPORT "OMX.QCOM.index.config.streaming.ReconfigurePort"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_DEFAULTRTSPMESSAGETIMEOUT "OMX.QCOM.index.config.streaming.DefaultRTSPMessageTimeout"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_ENABLEFIREWALLPROBES "OMX.QCOM.index.config.streaming.EnableFirewallProbes"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTSPOPTIONSBEFORESETUP "OMX.QCOM.index.config.streaming.RTSPOptionsBeforeSetup"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTSPPIPELINEDFASTSTARTUP "OMX.QCOM.index.config.streaming.RTSPPipelinedFastStartup"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_WMFASTSTARTSPEED "OMX.QCOM.index.config.streaming.WMFastStartSpeed"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_ENABLEFASTRECONNECT "OMX.QCOM.index.config.streaming.EnableFastReconnect"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_FASTRECONNECTMAXATTEMPTS "OMX.QCOM.index.config.streaming.FastReconnectMaxAttempts"
-#define OMX_QCOM_INDEX_CONFIG_STREAMING_DOWNLOADPROGRESSUNITSTYPE "OMX.QCOM.index.config.streaming.DownloadProgressUnitsType"
-#define OMX_QOMX_INDEX_CONFIG_STREAMING_DOWNLOADPROGRESS "OMX.QCOM.index.config.streaming.DownloadProgress"
-/**
- * Enumeration of the buffering watermark types
- */
-typedef enum QOMX_WATERMARKTYPE
-{
- QOMX_WATERMARK_UNDERRUN, /**< buffer has reached or is operating in an underrun condition */
- QOMX_WATERMARK_NORMAL /**< has reached or is operating in a normal (optimal) condition */
-}QOMX_WATERMARKTYPE;
-
-/**
- * Enumeration of type of buffering level tracking
- */
-typedef enum QOMX_WATERMARKUNITSTYPE
-{
- QOMX_WATERMARKUNITSTYPE_Time, /**< use a media time based reference */
- QOMX_WATERMARKUNITSTYPE_Data /**< use a data fullness based reference */
-}QOMX_WATERMARKUNITSTYPE;
-
-/**
- * Buffering watermark levels.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * eWaterMark : eWaterMark specifies the type of buffering watermark being
- * configured
- * QOMX_WATERMARK_UNDERRUN Indicates the condition when the
- * buffer has reached or is operating in an underrun condition
- * - not enough data
- * QOMX_WATERMARK_NORMAL Indicates the condition when the buffer
- * has reached or is operating in a normal (optimal) condition
- * - sufficient data within the buffer.
- *
- * nLevel : specifies the buffering level associated with the watermark.
- * The units associated with the watermark level is dependent
- * on the eUnitsType being selected.
- * QOMX_WATERMARKUNITSTYPE_Time nLevel in units of microseconds.
- * QOMX_WATERMARKUNITSTYPE_Data nLevel in units of bytes.
- *
- * nUnitsType : specifies the type of buffering level tracking to be used.
- * QOMX_WATERMARKUNITSTYPE_Time the buffer watermark level
- * shall use a media time based reference.
- * QOMX_WATERMARKUNITSTYPE_Data the buffer watermark level
- * shall use a data fullness based reference.
- * bEnable : specifies if the watermark type is being enabled or disabled
- */
-typedef struct QOMX_BUFFERINGWATERMARKTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_WATERMARKTYPE eWaterMark;
- OMX_U32 nLevel;
- QOMX_WATERMARKUNITSTYPE eUnitsType;
- OMX_BOOL bEnable;
-} QOMX_BUFFERINGWATERMARKTYPE;
-
-/**
- * Current buffering status of the streaming source component, for a given
- * media port
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * eCurrentWaterMark : specifies the current buffer watermark level condition
- * QOMX_WATERMARK_UNDERRUN Indicates the condition when the
- * buffer has reached or is operating in an underrun
- * condition - not enough data
- * QOMX_WATERMARK_NORMAL Indicates the condition when the
- * buffer has reached or is operating in a normal
- * (optimal) condition - sufficient data within the buffer.
- * eUnitsType : specifies the type of buffering level tracking to be used.
- * QOMX_WATERMARKUNITSTYPE_Time the buffer watermark level
- * shall use a media time based reference.
- * QOMX_WATERMARKUNITSTYPE_Data the buffer watermark level
- * shall use a data fullness based reference.
- * nCurrentLevel : specifies the current buffer watermark level condition
- * The units associated with the watermark level is dependent
- * on the eUnitsType being selected.
- * QOMX_WATERMARKUNITSTYPE_Time nLevel in units of microseconds.
- * QOMX_WATERMARKUNITSTYPE_Data nLevel in units of bytes.
- */
-typedef struct QOMX_BUFFERINGSTATUSTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_WATERMARKTYPE eCurrentWaterMark;
- QOMX_WATERMARKUNITSTYPE eUnitsType;
- OMX_U32 nCurrentLevel;
-} QOMX_BUFFERINGSTATUSTYPE;
-
-/**
- * marked buffer shall be emitted when the buffering level has reach an
- * underrun condition (QOMX_WATERMARK_UNDERRUN).
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * markInfo : identifies the target component handle that shall emit
- * the mark buffer event and associated
- * bEnable : enables or disables the buffer marking insertion.
- *
- */
-typedef struct QOMX_BUFFERMARKINGTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_MARKTYPE markInfo;
- OMX_BOOL bEnable;
-} QOMX_BUFFERMARKINGTYPE;
-
-/**
- * Source ports.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nMinimumPortNumber : Minimum port number the component may use
- * nMaximumPortNumber : Maximum port number the component may use
- */
-typedef struct QOMX_PARAM_STREAMING_SOURCE_PORTS
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U16 nMinimumPortNumber;
- OMX_U16 nMaximumPortNumber;
-} QOMX_PARAM_STREAMING_SOURCE_PORTS;
-
-/**
- * Enumeration used to define to the protocol message type.
- */
-typedef enum QOMX_STREAMING_PROTOCOLMESSAGETYPE
-{
- QOMX_STREAMING_PROTOCOLMESSAGE_REQUEST,
- QOMX_STREAMING_PROTOCOLMESSAGE_RESPONSE,
- QOMX_STREAMING_PROTOCOLMESSAGE_ALL
-} QOMX_STREAMING_PROTOCOLMESSAGETYPE;
-
-/**
- * Enumeration used to define the protocol header action type.
- */
-typedef enum QOMX_STREAMING_PROTOCOLHEADERACTIONTYPE
-{
- QOMX_STREAMING_PROTOCOLHEADERACTION_NONE,
- QOMX_STREAMING_PROTOCOLHEADERACTION_ADD,
- QOMX_STREAMING_PROTOCOLHEADERACTION_REMOVE
-} QOMX_STREAMING_PROTOCOLHEADERACTIONTYPE;
-
-/**
- * Protocol message header.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes (including size of
- messageHeader parameter)
- * nVersion : OMX specification version information
- * eMessageType : enumeration to distinguish protocol message type
- * eActionType : enumeration indicating protocol header action type
- * nMessageClassSize : size of the message class string (excluding any
- * terminating characters)
- * nHeaderNameSize : size of the header name string (excluding any
- * terminating characters)
- * nHeaderValueSize : size of the header value string (excluding any
- * terminating characters)
- * messageHeader : the NULL-terminated message header string formed by
- * concatenating message class, header name and value
- * strings, i.e. the first nMessageClassSize bytes of the
- * messageHeader parameter correspond to the message class
- * (without any terminating characters), followed by the
- * header name of size nHeaderNameSize bytes and then the
- * header value of size nHeaderValueSize bytes. The value
- * of message class is interpreted by what is mentioned in
- * eMessageType,
- * 1) For request message
- * (QOMX_STREAMING_PROTOCOLMESSAGE_REQUEST) it is the
- * Method token (as specified in the RFC 2616 and RFC
- * 2326).
- * 2) For response message
- * (QOMX_STREAMING_PROTOCOLMESSAGE_RESPONSE) it is
- * either or both the Method token and a three digit
- * Status-Code (as specified in the RFC 2616 and
- * RFC 2326) or a class of the response Status-Codes
- * (1xx, 2xx, 3xx, 4xx, and 5xx). When both present,
- * the method token and status code are separated by
- * 1 empty space.
- * 3) For all messages
- * (QOMX_STREAMING_PROTOCOLMESSAGE_ALL) it will be
- * absent (nMessageClassSize will be zero).
- */
-typedef struct QOMX_CONFIG_STREAMING_PROTOCOLHEADERTYPE
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- QOMX_STREAMING_PROTOCOLMESSAGETYPE eMessageType;
- QOMX_STREAMING_PROTOCOLHEADERACTIONTYPE eActionType;
- OMX_U32 nMessageClassSize;
- OMX_U32 nHeaderNameSize;
- OMX_U32 nHeaderValueSize;
- OMX_U8 messageHeader[1];
-} QOMX_CONFIG_STREAMING_PROTOCOLHEADERTYPE;
-
-/**
- * Protocol Event.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes (including size of
- protocolEventText parameter)
- * nVersion : OMX specification version information
- * nProtocolEvent : 1xx, 2xx, 3xx, 4xx or 5xx codes for HTTP/RTSP protocol
- * nReasonPhraseSize : size of the reason phrase string (excluding any
- * terminating characters)
- * nEntityBodySize : size of the entity body string (excluding any
- * terminating characters)
- * nContentUriSize : size of the url (exclusing any terminating characters)
- * url is used a key to identify for which operation this
- * event belongs to
- * protocolEventText : NULL-terminated protocol event text string formed by
- * concatenating reason phrase and entity body
- * and uri, i.e. the first nReasonPhraseSize bytes of the
- * protocolEventText parameter correspond to the reason
- * phrase (without any terminating characters), followed
- * by the entity body of size nEntityBodySize bytes,
- * followed by nContentUriSize bytes of URI
- */
-typedef struct QOMX_CONFIG_STREAMING_PROTOCOLEVENTTYPE
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nProtocolEvent;
- OMX_U32 nReasonPhraseSize;
- OMX_U32 nEntityBodySize;
- OMX_U32 nContentUriSize;
- OMX_U8 protocolEventText[1];
-} QOMX_CONFIG_STREAMING_PROTOCOLEVENTTYPE;
-
-/**
- * Protocol Headers Event
- *
- * STRUCT MEMBERS:
- * nSize: Size of the structure in bytes including
- * messageHeaders.
- * nVersion: OMX specification version information
- * eMessageType: enumeration to distinguish protocol message
- * type
- * nMessageClassSize: Size of the message class string.
- * nMessageAttributesSize: Size of the message attributes
- * string.
- *
- * This structure can be populated in 2 modes:
- * (i) Query for required sizes of message class and message
- * attributes. In this mode, nMessageClassSize and
- * nMessageAtributesSize both need to be set to zero.
- * (ii) Request to populate messageHeaders. In this mode, at
- * least one of nMessageClassSize or nMessageAttributesSize
- * need to be non-zero. On output, messageHeaders will be
- * populated with the message class and message attributes.
- * nMessageClassSize and/or nMessageAtributesSize may be
- * overwritten to reflect the actual start and end of
- * message class and message attributes. The max sizes of
- * message class and message attributes will not exceed the
- * values input by the client. The strings are not null
- * terminated.
- */
-typedef struct QOMX_STREAMING_PROTOCOLHEADERSTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- QOMX_STREAMING_PROTOCOLMESSAGETYPE eMessageType;
- OMX_U32 nMessageClassSize;
- OMX_U32 nMessageAtributesSize;
- OMX_U8 messageHeaders[1];
-} QOMX_STREAMING_PROTOCOLHEADERSTYPE;
-
-/**
- * Enumeration of possible streaming network interfaces.
- */
-typedef enum QOMX_STREAMING_NETWORKINTERFACETYPE
-{
- QOMX_STREAMING_NETWORKINTERFACE_ANY_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_CDMA_SN_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_CDMA_AN_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_UMTS_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_SIO_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_CDMA_BCAST_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_WLAN_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_DUN_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_FLO_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_DVBH_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_STA_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_IPSEC_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_LO_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_MBMS_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_IWLAN_3GPP_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_IWLAN_3GPP2_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_MIP6_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_UW_FMC_IFACE,
- QOMX_STREAMING_NETWORKINTERFACE_CMMB_IFACE
-} QOMX_STREAMING_NETWORKINTERFACETYPE;
-
-/*
- * Network interface.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes (including size of
- protocolErrorText parameter)
- * nVersion : OMX specification version information
- * eNetworkInterface : Network interface the component may use
- */
-typedef struct QOMX_PARAM_STREAMING_NETWORKINTERFACE
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- QOMX_STREAMING_NETWORKINTERFACETYPE eNetworkInterface;
-} QOMX_PARAM_STREAMING_NETWORKINTERFACE;
-
-/**
- * Enumeration of UnitType for DownloadProgress
- */
-typedef enum QOMX_DOWNLOADPROGRESSUNITSTYPE
-{
- QOMX_DOWNLOADPROGRESSUNITSTYPE_TIME,
- QOMX_DOWNLOADPROGRESSUNITSTYPE_DATA
-} QOMX_DOWNLOADPROGRESSUNITSTYPE;
-
-
-/**
- * DownloadProgress units
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes (including size of
- protocolEventText parameter)
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * eUnitsType : Specifies the type of units type in
- * which download prgoress should be
- * reported
- */
-typedef struct QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSUNITS
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_DOWNLOADPROGRESSUNITSTYPE eUnitsType;
-} QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSUNITS;
-
-
-/**
- * Download Progress
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes (including size of
- protocolEventText parameter)
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * nDataDownloaded : specifies the amount of data downloaded
- * in time or data scale (based on
- * eUnitsType) from the media position
- * specified by nStartOffset below. It
- * starts at zero and progressively
- * increases as more data is downloaded
- * nCurrentStartOffset: specifies is the current download start
- * position in time or data scale (based
- * on eUnitsType)
- */
-typedef struct QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSTYPE
-{
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nDataDownloaded;
- OMX_U32 nCurrentStartOffset;
-} QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSTYPE;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* QOMX_STREAMINGEXTENSIONS_H_ */
-
+#ifndef QOMX_STREAMINGEXTENSIONS_H_
+#define QOMX_STREAMINGEXTENSIONS_H_
+/*--------------------------------------------------------------------------
+Copyright (c) 2012, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 QOMX_StreamingExtensions.h
+
+@par FILE SERVICES:
+ Qualcomm extensions API for OpenMax IL Streaming Components.
+
+ This file contains the description of the Qualcomm OpenMax IL
+ streaming extention interface, through which the IL client and OpenMax
+ components can access additional streaming capabilities.
+
+*//*====================================================================== */
+
+/*========================================================================
+ Edit History
+
+$Header: //source/qcom/qct/multimedia2/api/OpenMax/QCOM/main/latest/QOMX_StreamingExtensions.h#7 $
+$DateTime: 2011/03/02 12:27:27 $
+$Change: 1638323 $
+
+========================================================================== */
+
+/* =======================================================================
+** Includes and Public Data Declarations
+** ======================================================================= */
+
+/* =======================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+
+#include <OMX_Types.h>
+#include <OMX_Component.h>
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/* =======================================================================
+
+ DATA DECLARATIONS
+
+========================================================================== */
+/* -----------------------------------------------------------------------
+** Type Declarations
+** ----------------------------------------------------------------------- */
+/**
+ * Qualcomm vendor streaming extension strings.
+ */
+#define OMX_QUALCOMM_INDEX_CONFIG_WATERMARK "OMX.Qualcomm.index.config.Watermark"
+#define OMX_QUALCOMM_INDEX_CONFIG_WATERMARKSTATUS "OMX.Qualcomm.index.config.WatermarkStatus"
+#define OMX_QUALCOMM_INDEX_CONFIG_BUFFERMARKING "OMX.Qualcomm.index.config.BufferMarking"
+#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_NETWORKINTERFACE "OMX.Qualcomm.index.param.streaming.NetworkInterface"
+#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_NETWORKPROFILE "OMX.Qualcomm.index.param.streaming.NetworkProfile"
+#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_PROXYSERVER "OMX.Qualcomm.index.param.streaming.ProxyServer"
+#define OMX_QUALCOMM_INDEX_PARAM_STREAMING_SOURCEPORTS "OMX.Qualcomm.index.param.streaming.SourcePorts"
+#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_PROTOCOLHEADER "OMX.Qualcomm.index.param.streaming.ProtocolHeader"
+#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_PROTOCOLEVENT "OMX.Qualcomm.index.config.streaming.ProtocolEvent"
+#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_DYNAMIC_SWITCH_CAPABILITY "OMX.Qualcomm.index.config.streaming.DynamicSessionSwitchCapability"
+#define OMX_QUALCOMM_INDEX_CONFIG_STREAMING_PROTOCOLHEADERSEVENT "OMX.QCOM.index.config.streaming.ProtocolHeadersEvent"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_USERPAUSETIMEOUT "OMX.QCOM.index.config.streaming.UserPauseTimeout"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_NOTIFYERRORONOPTIONSTIMEOUT "OMX.QCOM.index.config.streaming.NotifyErrorOnOptionsTimeout"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_USEINTERLEAVEDTCP "OMX.QCOM.index.config.streaming.UseInterleavedTCP"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_DATAINACTIVITYTIMEOUT "OMX.QCOM.index.config.streaming.DataInactivityTimeout"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTSPOPTIONSKEEPALIVEINTERVAL "OMX.QCOM.index.config.streaming.RTSPOptionsKeepaliveInterval"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTCPRRINTERVAL "OMX.QCOM.index.config.streaming.RTCPRRInterval"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_RECONFIGUREPORT "OMX.QCOM.index.config.streaming.ReconfigurePort"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_DEFAULTRTSPMESSAGETIMEOUT "OMX.QCOM.index.config.streaming.DefaultRTSPMessageTimeout"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_ENABLEFIREWALLPROBES "OMX.QCOM.index.config.streaming.EnableFirewallProbes"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTSPOPTIONSBEFORESETUP "OMX.QCOM.index.config.streaming.RTSPOptionsBeforeSetup"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_RTSPPIPELINEDFASTSTARTUP "OMX.QCOM.index.config.streaming.RTSPPipelinedFastStartup"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_WMFASTSTARTSPEED "OMX.QCOM.index.config.streaming.WMFastStartSpeed"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_ENABLEFASTRECONNECT "OMX.QCOM.index.config.streaming.EnableFastReconnect"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_FASTRECONNECTMAXATTEMPTS "OMX.QCOM.index.config.streaming.FastReconnectMaxAttempts"
+#define OMX_QCOM_INDEX_CONFIG_STREAMING_DOWNLOADPROGRESSUNITSTYPE "OMX.QCOM.index.config.streaming.DownloadProgressUnitsType"
+#define OMX_QOMX_INDEX_CONFIG_STREAMING_DOWNLOADPROGRESS "OMX.QCOM.index.config.streaming.DownloadProgress"
+/**
+ * Enumeration of the buffering watermark types
+ */
+typedef enum QOMX_WATERMARKTYPE
+{
+ QOMX_WATERMARK_UNDERRUN, /**< buffer has reached or is operating in an underrun condition */
+ QOMX_WATERMARK_NORMAL /**< has reached or is operating in a normal (optimal) condition */
+}QOMX_WATERMARKTYPE;
+
+/**
+ * Enumeration of type of buffering level tracking
+ */
+typedef enum QOMX_WATERMARKUNITSTYPE
+{
+ QOMX_WATERMARKUNITSTYPE_Time, /**< use a media time based reference */
+ QOMX_WATERMARKUNITSTYPE_Data /**< use a data fullness based reference */
+}QOMX_WATERMARKUNITSTYPE;
+
+/**
+ * Buffering watermark levels.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eWaterMark : eWaterMark specifies the type of buffering watermark being
+ * configured
+ * QOMX_WATERMARK_UNDERRUN Indicates the condition when the
+ * buffer has reached or is operating in an underrun condition
+ * - not enough data
+ * QOMX_WATERMARK_NORMAL Indicates the condition when the buffer
+ * has reached or is operating in a normal (optimal) condition
+ * - sufficient data within the buffer.
+ *
+ * nLevel : specifies the buffering level associated with the watermark.
+ * The units associated with the watermark level is dependent
+ * on the eUnitsType being selected.
+ * QOMX_WATERMARKUNITSTYPE_Time nLevel in units of microseconds.
+ * QOMX_WATERMARKUNITSTYPE_Data nLevel in units of bytes.
+ *
+ * nUnitsType : specifies the type of buffering level tracking to be used.
+ * QOMX_WATERMARKUNITSTYPE_Time the buffer watermark level
+ * shall use a media time based reference.
+ * QOMX_WATERMARKUNITSTYPE_Data the buffer watermark level
+ * shall use a data fullness based reference.
+ * bEnable : specifies if the watermark type is being enabled or disabled
+ */
+typedef struct QOMX_BUFFERINGWATERMARKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_WATERMARKTYPE eWaterMark;
+ OMX_U32 nLevel;
+ QOMX_WATERMARKUNITSTYPE eUnitsType;
+ OMX_BOOL bEnable;
+} QOMX_BUFFERINGWATERMARKTYPE;
+
+/**
+ * Current buffering status of the streaming source component, for a given
+ * media port
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eCurrentWaterMark : specifies the current buffer watermark level condition
+ * QOMX_WATERMARK_UNDERRUN Indicates the condition when the
+ * buffer has reached or is operating in an underrun
+ * condition - not enough data
+ * QOMX_WATERMARK_NORMAL Indicates the condition when the
+ * buffer has reached or is operating in a normal
+ * (optimal) condition - sufficient data within the buffer.
+ * eUnitsType : specifies the type of buffering level tracking to be used.
+ * QOMX_WATERMARKUNITSTYPE_Time the buffer watermark level
+ * shall use a media time based reference.
+ * QOMX_WATERMARKUNITSTYPE_Data the buffer watermark level
+ * shall use a data fullness based reference.
+ * nCurrentLevel : specifies the current buffer watermark level condition
+ * The units associated with the watermark level is dependent
+ * on the eUnitsType being selected.
+ * QOMX_WATERMARKUNITSTYPE_Time nLevel in units of microseconds.
+ * QOMX_WATERMARKUNITSTYPE_Data nLevel in units of bytes.
+ */
+typedef struct QOMX_BUFFERINGSTATUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_WATERMARKTYPE eCurrentWaterMark;
+ QOMX_WATERMARKUNITSTYPE eUnitsType;
+ OMX_U32 nCurrentLevel;
+} QOMX_BUFFERINGSTATUSTYPE;
+
+/**
+ * marked buffer shall be emitted when the buffering level has reach an
+ * underrun condition (QOMX_WATERMARK_UNDERRUN).
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * markInfo : identifies the target component handle that shall emit
+ * the mark buffer event and associated
+ * bEnable : enables or disables the buffer marking insertion.
+ *
+ */
+typedef struct QOMX_BUFFERMARKINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_MARKTYPE markInfo;
+ OMX_BOOL bEnable;
+} QOMX_BUFFERMARKINGTYPE;
+
+/**
+ * Source ports.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nMinimumPortNumber : Minimum port number the component may use
+ * nMaximumPortNumber : Maximum port number the component may use
+ */
+typedef struct QOMX_PARAM_STREAMING_SOURCE_PORTS
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U16 nMinimumPortNumber;
+ OMX_U16 nMaximumPortNumber;
+} QOMX_PARAM_STREAMING_SOURCE_PORTS;
+
+/**
+ * Enumeration used to define to the protocol message type.
+ */
+typedef enum QOMX_STREAMING_PROTOCOLMESSAGETYPE
+{
+ QOMX_STREAMING_PROTOCOLMESSAGE_REQUEST,
+ QOMX_STREAMING_PROTOCOLMESSAGE_RESPONSE,
+ QOMX_STREAMING_PROTOCOLMESSAGE_ALL
+} QOMX_STREAMING_PROTOCOLMESSAGETYPE;
+
+/**
+ * Enumeration used to define the protocol header action type.
+ */
+typedef enum QOMX_STREAMING_PROTOCOLHEADERACTIONTYPE
+{
+ QOMX_STREAMING_PROTOCOLHEADERACTION_NONE,
+ QOMX_STREAMING_PROTOCOLHEADERACTION_ADD,
+ QOMX_STREAMING_PROTOCOLHEADERACTION_REMOVE
+} QOMX_STREAMING_PROTOCOLHEADERACTIONTYPE;
+
+/**
+ * Protocol message header.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes (including size of
+ messageHeader parameter)
+ * nVersion : OMX specification version information
+ * eMessageType : enumeration to distinguish protocol message type
+ * eActionType : enumeration indicating protocol header action type
+ * nMessageClassSize : size of the message class string (excluding any
+ * terminating characters)
+ * nHeaderNameSize : size of the header name string (excluding any
+ * terminating characters)
+ * nHeaderValueSize : size of the header value string (excluding any
+ * terminating characters)
+ * messageHeader : the NULL-terminated message header string formed by
+ * concatenating message class, header name and value
+ * strings, i.e. the first nMessageClassSize bytes of the
+ * messageHeader parameter correspond to the message class
+ * (without any terminating characters), followed by the
+ * header name of size nHeaderNameSize bytes and then the
+ * header value of size nHeaderValueSize bytes. The value
+ * of message class is interpreted by what is mentioned in
+ * eMessageType,
+ * 1) For request message
+ * (QOMX_STREAMING_PROTOCOLMESSAGE_REQUEST) it is the
+ * Method token (as specified in the RFC 2616 and RFC
+ * 2326).
+ * 2) For response message
+ * (QOMX_STREAMING_PROTOCOLMESSAGE_RESPONSE) it is
+ * either or both the Method token and a three digit
+ * Status-Code (as specified in the RFC 2616 and
+ * RFC 2326) or a class of the response Status-Codes
+ * (1xx, 2xx, 3xx, 4xx, and 5xx). When both present,
+ * the method token and status code are separated by
+ * 1 empty space.
+ * 3) For all messages
+ * (QOMX_STREAMING_PROTOCOLMESSAGE_ALL) it will be
+ * absent (nMessageClassSize will be zero).
+ */
+typedef struct QOMX_CONFIG_STREAMING_PROTOCOLHEADERTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ QOMX_STREAMING_PROTOCOLMESSAGETYPE eMessageType;
+ QOMX_STREAMING_PROTOCOLHEADERACTIONTYPE eActionType;
+ OMX_U32 nMessageClassSize;
+ OMX_U32 nHeaderNameSize;
+ OMX_U32 nHeaderValueSize;
+ OMX_U8 messageHeader[1];
+} QOMX_CONFIG_STREAMING_PROTOCOLHEADERTYPE;
+
+/**
+ * Protocol Event.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes (including size of
+ protocolEventText parameter)
+ * nVersion : OMX specification version information
+ * nProtocolEvent : 1xx, 2xx, 3xx, 4xx or 5xx codes for HTTP/RTSP protocol
+ * nReasonPhraseSize : size of the reason phrase string (excluding any
+ * terminating characters)
+ * nEntityBodySize : size of the entity body string (excluding any
+ * terminating characters)
+ * nContentUriSize : size of the url (exclusing any terminating characters)
+ * url is used a key to identify for which operation this
+ * event belongs to
+ * protocolEventText : NULL-terminated protocol event text string formed by
+ * concatenating reason phrase and entity body
+ * and uri, i.e. the first nReasonPhraseSize bytes of the
+ * protocolEventText parameter correspond to the reason
+ * phrase (without any terminating characters), followed
+ * by the entity body of size nEntityBodySize bytes,
+ * followed by nContentUriSize bytes of URI
+ */
+typedef struct QOMX_CONFIG_STREAMING_PROTOCOLEVENTTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nProtocolEvent;
+ OMX_U32 nReasonPhraseSize;
+ OMX_U32 nEntityBodySize;
+ OMX_U32 nContentUriSize;
+ OMX_U8 protocolEventText[1];
+} QOMX_CONFIG_STREAMING_PROTOCOLEVENTTYPE;
+
+/**
+ * Protocol Headers Event
+ *
+ * STRUCT MEMBERS:
+ * nSize: Size of the structure in bytes including
+ * messageHeaders.
+ * nVersion: OMX specification version information
+ * eMessageType: enumeration to distinguish protocol message
+ * type
+ * nMessageClassSize: Size of the message class string.
+ * nMessageAttributesSize: Size of the message attributes
+ * string.
+ *
+ * This structure can be populated in 2 modes:
+ * (i) Query for required sizes of message class and message
+ * attributes. In this mode, nMessageClassSize and
+ * nMessageAtributesSize both need to be set to zero.
+ * (ii) Request to populate messageHeaders. In this mode, at
+ * least one of nMessageClassSize or nMessageAttributesSize
+ * need to be non-zero. On output, messageHeaders will be
+ * populated with the message class and message attributes.
+ * nMessageClassSize and/or nMessageAtributesSize may be
+ * overwritten to reflect the actual start and end of
+ * message class and message attributes. The max sizes of
+ * message class and message attributes will not exceed the
+ * values input by the client. The strings are not null
+ * terminated.
+ */
+typedef struct QOMX_STREAMING_PROTOCOLHEADERSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ QOMX_STREAMING_PROTOCOLMESSAGETYPE eMessageType;
+ OMX_U32 nMessageClassSize;
+ OMX_U32 nMessageAtributesSize;
+ OMX_U8 messageHeaders[1];
+} QOMX_STREAMING_PROTOCOLHEADERSTYPE;
+
+/**
+ * Enumeration of possible streaming network interfaces.
+ */
+typedef enum QOMX_STREAMING_NETWORKINTERFACETYPE
+{
+ QOMX_STREAMING_NETWORKINTERFACE_ANY_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_CDMA_SN_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_CDMA_AN_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_UMTS_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_SIO_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_CDMA_BCAST_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_WLAN_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_DUN_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_FLO_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_DVBH_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_STA_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_IPSEC_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_LO_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_MBMS_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_IWLAN_3GPP_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_IWLAN_3GPP2_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_MIP6_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_UW_FMC_IFACE,
+ QOMX_STREAMING_NETWORKINTERFACE_CMMB_IFACE
+} QOMX_STREAMING_NETWORKINTERFACETYPE;
+
+/*
+ * Network interface.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes (including size of
+ protocolErrorText parameter)
+ * nVersion : OMX specification version information
+ * eNetworkInterface : Network interface the component may use
+ */
+typedef struct QOMX_PARAM_STREAMING_NETWORKINTERFACE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ QOMX_STREAMING_NETWORKINTERFACETYPE eNetworkInterface;
+} QOMX_PARAM_STREAMING_NETWORKINTERFACE;
+
+/**
+ * Enumeration of UnitType for DownloadProgress
+ */
+typedef enum QOMX_DOWNLOADPROGRESSUNITSTYPE
+{
+ QOMX_DOWNLOADPROGRESSUNITSTYPE_TIME,
+ QOMX_DOWNLOADPROGRESSUNITSTYPE_DATA
+} QOMX_DOWNLOADPROGRESSUNITSTYPE;
+
+
+/**
+ * DownloadProgress units
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes (including size of
+ protocolEventText parameter)
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eUnitsType : Specifies the type of units type in
+ * which download prgoress should be
+ * reported
+ */
+typedef struct QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSUNITS
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_DOWNLOADPROGRESSUNITSTYPE eUnitsType;
+} QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSUNITS;
+
+
+/**
+ * Download Progress
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes (including size of
+ protocolEventText parameter)
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nDataDownloaded : specifies the amount of data downloaded
+ * in time or data scale (based on
+ * eUnitsType) from the media position
+ * specified by nStartOffset below. It
+ * starts at zero and progressively
+ * increases as more data is downloaded
+ * nCurrentStartOffset: specifies is the current download start
+ * position in time or data scale (based
+ * on eUnitsType)
+ */
+typedef struct QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSTYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nDataDownloaded;
+ OMX_U32 nCurrentStartOffset;
+} QOMX_CONFIG_STREAMING_DOWNLOADPROGRESSTYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* QOMX_STREAMINGEXTENSIONS_H_ */
+
diff --git a/mm-core/inc/QOMX_VideoExtensions.h b/mm-core/inc/QOMX_VideoExtensions.h
index 1872a95..2ab013a 100644
--- a/mm-core/inc/QOMX_VideoExtensions.h
+++ b/mm-core/inc/QOMX_VideoExtensions.h
@@ -1,581 +1,580 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2011 The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __H_QOMX_VIDEOEXTENSIONS_H__
-#define __H_QOMX_VIDEOEXTENSIONS_H__
-
-/*========================================================================
-
-*//** @file QOMX_VideoExtensions.h
-
-@par FILE SERVICES:
- Qualcomm extensions API for OpenMax IL Video.
-
- This file contains the description of the Qualcomm OpenMax IL
- video extention interface, through which the IL client and OpenMax
- components can access additional video capabilities.
-
-*//*====================================================================== */
-
-
-/*========================================================================== */
-
-/*========================================================================
-
- INCLUDE FILES FOR MODULE
-
-========================================================================== */
-#include <OMX_Core.h>
-#include <OMX_Video.h>
-
-/*========================================================================
-
- DEFINITIONS AND DECLARATIONS
-
-========================================================================== */
-
-#if defined( __cplusplus )
-extern "C"
-{
-#endif /* end of macro __cplusplus */
-
-/* Video extension strings */
-#define OMX_QCOM_INDEX_PARAM_VIDEO_SYNTAXHDR "OMX.QCOM.index.param.video.SyntaxHdr"
-#define OMX_QCOM_INDEX_PARAM_VIDEO_ENCODERMODE "OMX.QCOM.index.param.video.EncoderMode"
-#define OMX_QCOM_INDEX_CONFIG_VIDEO_INTRAREFRESH "OMX.QCOM.index.config.video.IntraRefresh"
-#define OMX_QCOM_INDEX_CONFIG_VIDEO_INTRAPERIOD "OMX.QCOM.index.config.video.IntraPeriod"
-#define OMX_QCOM_INDEX_CONFIG_VIDEO_TEMPORALSPATIALTRADEOFF "OMX.QCOM.index.config.video.TemporalSpatialTradeOff"
-#define OMX_QCOM_INDEX_CONFIG_VIDEO_MBCONCEALMENTREPORTING "OMX.QCOM.index.config.video.MBConcealmentReporting"
-#define OMX_QCOM_INDEX_PARAM_VIDEO_EXTRADATAMULTISLICEINFO "OMX.QCOM.index.param.video.ExtraDataMultiSliceInfo" /**< reference: QOMX_ENABLETYPE */
-#define OMX_QCOM_INDEX_CONFIG_VIDEO_FLOWSTATUS "OMX.QCOM.index.config.video.FlowStatus" /**< reference: QOMX_FLOWSTATUSTYPE */
-#define OMX_QCOM_INDEX_PARAM_VIDEO_PICTURETYPEDECODE "OMX.QCOM.index.param.video.PictureTypeDecode" /**< reference: QOMX_VIDEO_DECODEPICTURETYPE */
-#define OMX_QCOM_INDEX_PARAM_VIDEO_SAMPLEASPECTRATIO "OMX.QCOM.index.param.video.SampleAspectRatio" /**< reference: QOMX_VIDEO_SAMPLEASPECTRATIO */
-#define OMX_QCOM_INDEX_PARAM_VIDEO_EXTRADATALTRINFO "OMX.QCOM.index.param.video.ExtraDataLTRInfo" /**< reference: QOMX_ENABLETYPE */
-
-/* Video coding types */
-#define OMX_QCOM_INDEX_PARAM_VIDEO_DIVX "OMX.QCOM.index.param.video.DivX"
-#define OMX_QCOM_INDEX_PARAM_VIDEO_VP "OMX.QCOM.index.param.video.VP"
-#define OMX_QCOM_INDEX_PARAM_VIDEO_SPARK "OMX.QCOM.index.param.video.Spark"
-#define OMX_QCOM_INDEX_PARAM_VIDEO_VC1 "OMX.QCOM.index.param.video.VC1"
-
-/**
- * Enumeration used to define the extended video compression
- * codings, not present in the OpenMax IL 1.1.2 specification.
- * 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.
- */
-typedef enum QOMX_VIDEO_CODINGTYPE
-{
- QOMX_VIDEO_CodingDivX = 0x7F000001, /**< all versions of DivX */
- QOMX_VIDEO_CodingVP = 0x7F000002, /**< all versions of On2 VP codec */
- QOMX_VIDEO_CodingSpark = 0x7F000003, /**< Sorenson Spark */
- QOMX_VIDEO_CodingVC1 = 0x7F000004, /**< VC-1 */
- QOMX_VIDEO_MPEG1 = 0x7F000005 /**< MPEG-1 */
-} QOMX_VIDEO_CODINGTYPE;
-
-/**
- * DivX Versions
- */
-typedef enum QOMX_VIDEO_DIVXFORMATTYPE {
- QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
- QOMX_VIDEO_DIVXFormat311 = 0x02, /**< DivX 3.11 */
- QOMX_VIDEO_DIVXFormat4 = 0x04, /**< DivX 4 */
- QOMX_VIDEO_DIVXFormat5 = 0x08, /**< DivX 5 */
- QOMX_VIDEO_DIVXFormat6 = 0x10, /**< DivX 6 */
- QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
-} QOMX_VIDEO_DIVXFORMATTYPE;
-
-/**
- * DivX profile types, each profile indicates support for
- * various performance bounds.
- */
-typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
- QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
- QOMX_VIDEO_DivXProfileMobile = 0x02, /**< Mobile Profile */
- QOMX_VIDEO_DivXProfileMT = 0x04, /**< Mobile Theatre Profile */
- QOMX_VIDEO_DivXProfileHT = 0x08, /**< Home Theatre Profile */
- QOMX_VIDEO_DivXProfileHD = 0x10, /**< High Definition Profile */
- QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
-} QOMX_VIDEO_DIVXPROFILETYPE;
-
-/**
- * DivX Video 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 DivX stream / data
- * eProfile : Profile of DivX stream / data
- */
-typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_VIDEO_DIVXFORMATTYPE eFormat;
- QOMX_VIDEO_DIVXPROFILETYPE eProfile;
-} QOMX_VIDEO_PARAM_DIVXTYPE;
-
-/**
- * VP Versions
- */
-typedef enum QOMX_VIDEO_VPFORMATTYPE {
- QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
- QOMX_VIDEO_VPFormat6 = 0x02, /**< VP6 Video Format */
- QOMX_VIDEO_VPFormat7 = 0x04, /**< VP7 Video Format */
- QOMX_VIDEO_VPFormat8 = 0x08, /**< VP8 Video Format */
- QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
-} QOMX_VIDEO_VPFORMATTYPE;
-
-/**
- * VP profile types, each profile indicates support for various
- * encoding tools.
- */
-typedef enum QOMX_VIDEO_VPPROFILETYPE {
- QOMX_VIDEO_VPProfileSimple = 0x01, /**< Simple Profile, applies to VP6 only */
- QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
- QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
- QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
- QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
- QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
- QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
-} QOMX_VIDEO_VPPROFILETYPE;
-
-/**
- * VP Video Params
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * eFormat : Format of VP stream / data
- * eProfile : Profile or Version of VP stream / data
- */
-typedef struct QOMX_VIDEO_PARAM_VPTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_VIDEO_VPFORMATTYPE eFormat;
- QOMX_VIDEO_VPPROFILETYPE eProfile;
-} QOMX_VIDEO_PARAM_VPTYPE;
-
-/**
- * Spark Versions
- */
-typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
- QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
- QOMX_VIDEO_SparkFormat0 = 0x02, /**< Video Format Version 0 */
- QOMX_VIDEO_SparkFormat1 = 0x04, /**< Video Format Version 1 */
- QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
-} QOMX_VIDEO_SPARKFORMATTYPE;
-
-/**
- * Spark Video 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 Spark stream / data
- */
-typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_VIDEO_SPARKFORMATTYPE eFormat;
-} QOMX_VIDEO_PARAM_SPARKTYPE;
-
-/**
- * VC-1 profile types, each profile indicates support for
- * various encoding tools.
- */
-typedef enum QOMX_VIDEO_VC1PROFILETYPE {
- QOMX_VIDEO_VC1ProfileSimple = 0x01, /**< Simple Profile */
- QOMX_VIDEO_VC1ProfileMain = 0x02, /**< Main Profile */
- QOMX_VIDEO_VC1ProfileAdvanced = 0x04, /**< Advanced Profile */
- QOMX_VIDEO_VC1ProfileKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_VC1ProfileVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_VC1ProfileMax = 0x7FFFFFFF
-} QOMX_VIDEO_VC1PROFILETYPE;
-
-/**
- * VC-1 level types, each level indicates support for various
- * performance bounds.
- */
-typedef enum QOMX_VIDEO_VC1LEVELTYPE {
- QOMX_VIDEO_VC1LevelLow = 0x01, /**< Low Level, applies to simple and main profiles*/
- QOMX_VIDEO_VC1LevelMedium = 0x02, /**< Medium Level, applies to simple and main profiles */
- QOMX_VIDEO_VC1LevelHigh = 0x04, /**< High Level, applies to main profile only */
- QOMX_VIDEO_VC1Level0 = 0x08, /**< Level 0, applies to advanced profile only */
- QOMX_VIDEO_VC1Level1 = 0x10, /**< Level 1, applies to advanced profile only */
- QOMX_VIDEO_VC1Level2 = 0x20, /**< Level 2, applies to advanced profile only */
- QOMX_VIDEO_VC1Level3 = 0x40, /**< Level 3, applies to advanced profile only */
- QOMX_VIDEO_VC1Level4 = 0x80, /**< Level 4, applies to advanced profile only */
- QOMX_VIDEO_VC1LevelKhronosExtensions = 0x6F000000,
- QOMX_VIDEO_VC1LevelVendorStartUnused = 0x7F000000,
- QOMX_VIDEO_VC1LevelMax = 0x7FFFFFFF
-} QOMX_VIDEO_VC1LEVELTYPE;
-
-/**
- * VC-1 Video Params
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version information
- * nPortIndex : Port that this structure applies to
- * eProfile : Profile of VC-1 stream / data
- * eLevel : Level of VC-1 stream / data
- */
-typedef struct QOMX_VIDEO_PARAM_VC1TYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_VIDEO_VC1PROFILETYPE eProfile;
- QOMX_VIDEO_VC1LEVELTYPE eLevel;
-} QOMX_VIDEO_PARAM_VC1TYPE;
-
-/**
- * Extended MPEG-4 level types not defined in the OpenMax IL
- * 1.1.2 specification, each level indicates support for various
- * frame sizes, bit rates, decoder frame rates.
- */
-typedef enum QOMX_VIDEO_MPEG4LEVELTYPE {
- QOMX_VIDEO_MPEG4Level6 = 0x7F000001, /**< Level 6 */
- QOMX_VIDEO_MPEG4Level7 = 0x7F000002, /**< Level 7 */
- QOMX_VIDEO_MPEG4Level8 = 0x7F000003, /**< Level 8 */
- QOMX_VIDEO_MPEG4Level9 = 0x7F000004, /**< Level 9 */
- QOMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF
-} QOMX_VIDEO_MPEG4LEVELTYPE;
-
-/**
- * This structure is used in retrieving the syntax header from a
- * video encoder component, or setting the out of band syntax
- * header configuration data on a video decoder component.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nBytes : When used with OMX_GetParameter for the encoder
- * component, it is a read-write field. When
- * QOMX_VIDEO_SYNTAXHDRTYPE is passed in
- * OMX_GetParameter this is the size of the buffer
- * array pointed by data field. When the
- * OMX_GetParameter call returns this is the
- * amount of data within the buffer array.
- *
- * The IL client needs to allocate the buffer
- * array and then request for the syntax header.
- * If the size of buffer array to allocate is
- * unknown to the IL client, then it can call
- * OMX_GetParamter with nBytes set to 0. In this
- * case, when OMX_GetParameter returns, the nBytes
- * field will be set to the size of the syntax
- * header. IL Client can then allocate a buffer of
- * this size and call OMX_GetParamter again.
- *
- * When used with OMX_SetParameter for the decoder
- * component, it is a read-only field specifying
- * the amount of data in the buffer array.
- * data : The syntax header data. The format of the
- * syntax header is specific to the video codec,
- * and is described below.
- *
- * H.263 : N/A
- * H.264 : The SPS and PPS parameter sets
- * MPEG-4 : The VO, VOS, and VOL header
- * WMV7 : The "Extra Data" info, in the ASF Stream
- * Properties Object.
- * WMV8 : The "Extra Data" info, in the ASF Stream
- * Properties Object.
- * WMV9 SP/MP : The STRUCT_C portion of the sequence layer
- * meta data, defined in Table 263 of the VC-1
- * specification.
- * VC-1 SP/MP : The STRUCT_C portion of the sequence layer
- * meta data, defined in Table 263 of the VC-1
- * specification.
- * VC-1 AP : The sequence and entry point header
- * DivX 3 : N/A
- * DivX 4.x : The VO, VOS, and VOL header
- * DivX 5.x : The VO, VOS, and VOL header
- * DivX 6.x : The VO, VOS, and VOL header
- * VP6 : N/A
- * Spark : N/A
- */
-typedef struct QOMX_VIDEO_SYNTAXHDRTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nBytes;
- OMX_U8 data[1];
-} QOMX_VIDEO_SYNTAXHDRTYPE;
-
-
-/**
- * Enumeration used to define the extended video intra refresh types, not
- * present in the OpenMax IL 1.1.2 specification.
- *
- * ENUMS:
- * IntraRefreshRandom : Random intra refresh mode.
- */
-typedef enum QOMX_VIDEO_INTRAREFRESHTYPE
-{
- QOMX_VIDEO_IntraRefreshRandom = 0x7F100000
-} QOMX_VIDEO_INTRAREFRESHTYPE;
-
-
-/**
- * This structure is used to configure the intra periodicity for encoder.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nIDRPeriod : Defines the periodicity of IDR occurrence. This specifies
- * coding a frame as IDR after a specific number of intra
- * frames. The periodicity of intra frame coding is specified by
- * the nPFrames. If nIDRPeriod is set to 0, only the first
- * frame of the encode session is an IDR frame. This field is
- * ignored for non-AVC codecs and is used only for codecs that
- * support IDR Period.
- * nPFrames : Specifies the number of P frames between each I Frame.
- * nBFrames : Specifies the number of B frames between each I Frame.
- */
-typedef struct QOMX_VIDEO_INTRAPERIODTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nIDRPeriod;
- OMX_U32 nPFrames;
- OMX_U32 nBFrames;
-} QOMX_VIDEO_INTRAPERIODTYPE;
-
-
-/**
- * Enumeration used to define the extended video extra data payload types not
- * present in the OpenMax IL 1.1.2 specification.
- *
- * ENUMS:
- * VideoMultiSliceInfo : Multi slice layout information
- *
- * Slice information layout:
- * First 4 bytes = Number of Slice Entries
- *
- * Then individual slice entries: 8 bytes per entry.
- * Slice1 information: offset (4 bytes), Length (4 bytes)
- * Slice2 information: offset (4 bytes), Length (4 bytes)
- * Slice3 information: offset (4 bytes), Length (4 bytes)
- * ...................................
- * ...................................
- * SliceN information: offset (4 bytes), Length (4 bytes)
- *
- *
- * VideoNumConcealedMB : Number of concealed MBs
- *
- * The data array consists of an unsigned 32-bit size field
- * indicating the number of concealed macroblocks in the
- * uncompressed frame.
- *
- *
- * QOMX_ExtraDataOMXIndex : Indicates that the data payload contains an
- * OpenMax index and associated payload.
- *
- * The data of the extra data payload shall contain the value of the
- * OMX_INDEXTYPE corresponding to the requested operation as an unsigned
- * 32 bit number occupying the first four bytes of the payload. The index
- * will be immediately followed by the associated structure. Padding bytes
- * are appended to ensure 32 bit address alignment if needed.
- */
-typedef enum QOMX_VIDEO_EXTRADATATYPE
-{
- QOMX_ExtraDataVideoMultiSliceInfo = 0x7F100000,
- QOMX_ExtraDataVideoNumConcealedMB,
- QOMX_ExtraDataOMXIndex,
- QOMX_ExtraDataHDCPEncryptionInfo
-} QOMX_VIDEO_EXTRADATATYPE;
-
-
-/**
- * Enumeration used to define the video encoder modes
- *
- * ENUMS:
- * EncoderModeDefault : Default video recording mode.
- * All encoder settings made through
- * OMX_SetParameter/OMX_SetConfig are applied. No
- * parameter is overridden.
- * EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
- * Service). This mode is similar to EncoderModeDefault
- * except that here the Rate control mode is overridden
- * internally and set as a variant of variable bitrate with
- * variable frame rate. After this mode is set if the IL
- * client tries to set OMX_VIDEO_CONTROLRATETYPE via
- * OMX_IndexParamVideoBitrate that would be rejected. For
- * this, client should set mode back to EncoderModeDefault
- * first and then change OMX_VIDEO_CONTROLRATETYPE.
- */
-typedef enum QOMX_VIDEO_ENCODERMODETYPE
-{
- QOMX_VIDEO_EncoderModeDefault = 0x01,
- QOMX_VIDEO_EncoderModeMMS = 0x02,
- QOMX_VIDEO_EncoderModeMax = 0x7FFFFFFF
-} QOMX_VIDEO_ENCODERMODETYPE;
-
-/**
- * This structure is used to set the video encoder mode.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nMode : defines the video encoder mode
- */
-typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- QOMX_VIDEO_ENCODERMODETYPE nMode;
-} QOMX_VIDEO_PARAM_ENCODERMODETYPE;
-
-
-/**
- * This structure is used to set the temporal (picture rate) - spatial
- * (picture quality) trade-off factor.
- * This setting is only valid when rate control is enabled and set to a mode
- * with variable frame rate. For all other rate control modes this setting is
- * ignored.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nTSFactor : temporal-spatial tradeoff factor value in the range of 0-100.
- * A factor of 0 won't emphasizes picture rate in rate
- * control decisions at all i.e only picture quality is emphasized. For
- * increasing values from 1 to 99 the emphasis of picture rate in rate
- * control decisions increases. A factor of 100 emphasizes only picture rate
- * in rate control decisions.
- */
-typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nTSFactor;
-} QOMX_VIDEO_TEMPORALSPATIALTYPE;
-
-/**
- * This structure is used to enable or disable the MB concealmenet reporting
- * for the uncompressed frames emitted from the port.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * bEnableMBConcealmentReporting : Flag indicating whether MB concealment
- * reporting is enabled or disabled.
- * OMX_TRUE: Enables MB concealment reporting
- * OMX_FALSE: Disables MB concealment reporting
- */
-typedef struct QOMX_VIDEO_MBCONCEALMENTREPORTINGTYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_BOOL bEnableMBConcealmentReporting;
-} QOMX_VIDEO_MBCONCEALMENTREPORTINGTYPE;
-
-/**
- * Specifies the extended picture types. These values should be
- * OR'd along with the types defined in OMX_VIDEO_PICTURETYPE to
- * signal all pictures types which are allowed.
- *
- * ENUMS:
- * H.264 Specific Picture Types: IDR
- */
-typedef enum QOMX_VIDEO_PICTURETYPE {
- QOMX_VIDEO_PictureTypeIDR = OMX_VIDEO_PictureTypeVendorStartUnused + 0x1000
-} QOMX_VIDEO_PICTURETYPE;
-
-/**
- * This structure is used to configure the processing of
- * specific picture types.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nPictureTypes : Specifies the picture type(s)
- * that shall be processed. The value consists
- * of the desired picture types, defined by the
- * OMX_VIDEO_PICTURETYPE and
- * QOMX_VIDEO_PICTURETYPE enumerations, OR'd to
- * signal all the pictures types which are
- * allowed.
- */
-typedef struct QOMX_VIDEO_DECODEPICTURETYPE {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U32 nPictureTypes;
-} QOMX_VIDEO_DECODEPICTURETYPE;
-
-/**
- * This structure describes the sample aspect ratio information.
- *
- * STRUCT MEMBERS:
- * nSize : Size of the structure in bytes
- * nVersion : OMX specification version info
- * nPortIndex : Port that this structure applies to
- * nWidth : Specifies the horizontal aspect size of
- * the sample
- * nHeight : Specifies the vertical aspect size of the
- * sample
- */
-typedef struct QOMX_VIDEO_SAMPLEASPECTRATIO {
- OMX_U32 nSize;
- OMX_VERSIONTYPE nVersion;
- OMX_U32 nPortIndex;
- OMX_U16 nWidth;
- OMX_U16 nHeight;
-} QOMX_VIDEO_SAMPLEASPECTRATIO;
-
-#if defined( __cplusplus )
-}
-#endif /* end of macro __cplusplus */
-
-#endif /* end of macro __H_QOMX_VIDEOEXTENSIONS_H__ */
+/*--------------------------------------------------------------------------
+Copyright (c) 2011 Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __H_QOMX_VIDEOEXTENSIONS_H__
+#define __H_QOMX_VIDEOEXTENSIONS_H__
+
+/*========================================================================
+
+*//** @file QOMX_VideoExtensions.h
+
+@par FILE SERVICES:
+ Qualcomm extensions API for OpenMax IL Video.
+
+ This file contains the description of the Qualcomm OpenMax IL
+ video extention interface, through which the IL client and OpenMax
+ components can access additional video capabilities.
+
+*//*====================================================================== */
+
+
+/*========================================================================== */
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Core.h>
+#include <OMX_Video.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/* Video extension strings */
+#define OMX_QCOM_INDEX_PARAM_VIDEO_SYNTAXHDR "OMX.QCOM.index.param.video.SyntaxHdr"
+#define OMX_QCOM_INDEX_PARAM_VIDEO_ENCODERMODE "OMX.QCOM.index.param.video.EncoderMode"
+#define OMX_QCOM_INDEX_CONFIG_VIDEO_INTRAREFRESH "OMX.QCOM.index.config.video.IntraRefresh"
+#define OMX_QCOM_INDEX_CONFIG_VIDEO_INTRAPERIOD "OMX.QCOM.index.config.video.IntraPeriod"
+#define OMX_QCOM_INDEX_CONFIG_VIDEO_TEMPORALSPATIALTRADEOFF "OMX.QCOM.index.config.video.TemporalSpatialTradeOff"
+#define OMX_QCOM_INDEX_CONFIG_VIDEO_MBCONCEALMENTREPORTING "OMX.QCOM.index.config.video.MBConcealmentReporting"
+#define OMX_QCOM_INDEX_PARAM_VIDEO_EXTRADATAMULTISLICEINFO "OMX.QCOM.index.param.video.ExtraDataMultiSliceInfo" /**< reference: QOMX_ENABLETYPE */
+#define OMX_QCOM_INDEX_CONFIG_VIDEO_FLOWSTATUS "OMX.QCOM.index.config.video.FlowStatus" /**< reference: QOMX_FLOWSTATUSTYPE */
+#define OMX_QCOM_INDEX_PARAM_VIDEO_PICTURETYPEDECODE "OMX.QCOM.index.param.video.PictureTypeDecode" /**< reference: QOMX_VIDEO_DECODEPICTURETYPE */
+#define OMX_QCOM_INDEX_PARAM_VIDEO_SAMPLEASPECTRATIO "OMX.QCOM.index.param.video.SampleAspectRatio" /**< reference: QOMX_VIDEO_SAMPLEASPECTRATIO */
+
+/* Video coding types */
+#define OMX_QCOM_INDEX_PARAM_VIDEO_DIVX "OMX.QCOM.index.param.video.DivX"
+#define OMX_QCOM_INDEX_PARAM_VIDEO_VP "OMX.QCOM.index.param.video.VP"
+#define OMX_QCOM_INDEX_PARAM_VIDEO_SPARK "OMX.QCOM.index.param.video.Spark"
+#define OMX_QCOM_INDEX_PARAM_VIDEO_VC1 "OMX.QCOM.index.param.video.VC1"
+
+/**
+ * Enumeration used to define the extended video compression
+ * codings, not present in the OpenMax IL 1.1.2 specification.
+ * 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.
+ */
+typedef enum QOMX_VIDEO_CODINGTYPE
+{
+ QOMX_VIDEO_CodingDivX = 0x7F000001, /**< all versions of DivX */
+ QOMX_VIDEO_CodingVP = 0x7F000002, /**< all versions of On2 VP codec */
+ QOMX_VIDEO_CodingSpark = 0x7F000003, /**< Sorenson Spark */
+ QOMX_VIDEO_CodingVC1 = 0x7F000004, /**< VC-1 */
+ QOMX_VIDEO_MPEG1 = 0x7F000005 /**< MPEG-1 */
+} QOMX_VIDEO_CODINGTYPE;
+
+/**
+ * DivX Versions
+ */
+typedef enum QOMX_VIDEO_DIVXFORMATTYPE {
+ QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
+ QOMX_VIDEO_DIVXFormat311 = 0x02, /**< DivX 3.11 */
+ QOMX_VIDEO_DIVXFormat4 = 0x04, /**< DivX 4 */
+ QOMX_VIDEO_DIVXFormat5 = 0x08, /**< DivX 5 */
+ QOMX_VIDEO_DIVXFormat6 = 0x10, /**< DivX 6 */
+ QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
+} QOMX_VIDEO_DIVXFORMATTYPE;
+
+/**
+ * DivX profile types, each profile indicates support for
+ * various performance bounds.
+ */
+typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
+ QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
+ QOMX_VIDEO_DivXProfileMobile = 0x02, /**< Mobile Profile */
+ QOMX_VIDEO_DivXProfileMT = 0x04, /**< Mobile Theatre Profile */
+ QOMX_VIDEO_DivXProfileHT = 0x08, /**< Home Theatre Profile */
+ QOMX_VIDEO_DivXProfileHD = 0x10, /**< High Definition Profile */
+ QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
+} QOMX_VIDEO_DIVXPROFILETYPE;
+
+/**
+ * DivX Video 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 DivX stream / data
+ * eProfile : Profile of DivX stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_DIVXFORMATTYPE eFormat;
+ QOMX_VIDEO_DIVXPROFILETYPE eProfile;
+} QOMX_VIDEO_PARAM_DIVXTYPE;
+
+/**
+ * VP Versions
+ */
+typedef enum QOMX_VIDEO_VPFORMATTYPE {
+ QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
+ QOMX_VIDEO_VPFormat6 = 0x02, /**< VP6 Video Format */
+ QOMX_VIDEO_VPFormat7 = 0x04, /**< VP7 Video Format */
+ QOMX_VIDEO_VPFormat8 = 0x08, /**< VP8 Video Format */
+ QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
+} QOMX_VIDEO_VPFORMATTYPE;
+
+/**
+ * VP profile types, each profile indicates support for various
+ * encoding tools.
+ */
+typedef enum QOMX_VIDEO_VPPROFILETYPE {
+ QOMX_VIDEO_VPProfileSimple = 0x01, /**< Simple Profile, applies to VP6 only */
+ QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
+ QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
+ QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
+ QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
+ QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
+ QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
+} QOMX_VIDEO_VPPROFILETYPE;
+
+/**
+ * VP Video Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Format of VP stream / data
+ * eProfile : Profile or Version of VP stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_VPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_VPFORMATTYPE eFormat;
+ QOMX_VIDEO_VPPROFILETYPE eProfile;
+} QOMX_VIDEO_PARAM_VPTYPE;
+
+/**
+ * Spark Versions
+ */
+typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
+ QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
+ QOMX_VIDEO_SparkFormat0 = 0x02, /**< Video Format Version 0 */
+ QOMX_VIDEO_SparkFormat1 = 0x04, /**< Video Format Version 1 */
+ QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
+} QOMX_VIDEO_SPARKFORMATTYPE;
+
+/**
+ * Spark Video 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 Spark stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_SPARKFORMATTYPE eFormat;
+} QOMX_VIDEO_PARAM_SPARKTYPE;
+
+/**
+ * VC-1 profile types, each profile indicates support for
+ * various encoding tools.
+ */
+typedef enum QOMX_VIDEO_VC1PROFILETYPE {
+ QOMX_VIDEO_VC1ProfileSimple = 0x01, /**< Simple Profile */
+ QOMX_VIDEO_VC1ProfileMain = 0x02, /**< Main Profile */
+ QOMX_VIDEO_VC1ProfileAdvanced = 0x04, /**< Advanced Profile */
+ QOMX_VIDEO_VC1ProfileKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_VC1ProfileVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_VC1ProfileMax = 0x7FFFFFFF
+} QOMX_VIDEO_VC1PROFILETYPE;
+
+/**
+ * VC-1 level types, each level indicates support for various
+ * performance bounds.
+ */
+typedef enum QOMX_VIDEO_VC1LEVELTYPE {
+ QOMX_VIDEO_VC1LevelLow = 0x01, /**< Low Level, applies to simple and main profiles*/
+ QOMX_VIDEO_VC1LevelMedium = 0x02, /**< Medium Level, applies to simple and main profiles */
+ QOMX_VIDEO_VC1LevelHigh = 0x04, /**< High Level, applies to main profile only */
+ QOMX_VIDEO_VC1Level0 = 0x08, /**< Level 0, applies to advanced profile only */
+ QOMX_VIDEO_VC1Level1 = 0x10, /**< Level 1, applies to advanced profile only */
+ QOMX_VIDEO_VC1Level2 = 0x20, /**< Level 2, applies to advanced profile only */
+ QOMX_VIDEO_VC1Level3 = 0x40, /**< Level 3, applies to advanced profile only */
+ QOMX_VIDEO_VC1Level4 = 0x80, /**< Level 4, applies to advanced profile only */
+ QOMX_VIDEO_VC1LevelKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_VC1LevelVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_VC1LevelMax = 0x7FFFFFFF
+} QOMX_VIDEO_VC1LEVELTYPE;
+
+/**
+ * VC-1 Video Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eProfile : Profile of VC-1 stream / data
+ * eLevel : Level of VC-1 stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_VC1TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_VC1PROFILETYPE eProfile;
+ QOMX_VIDEO_VC1LEVELTYPE eLevel;
+} QOMX_VIDEO_PARAM_VC1TYPE;
+
+/**
+ * Extended MPEG-4 level types not defined in the OpenMax IL
+ * 1.1.2 specification, each level indicates support for various
+ * frame sizes, bit rates, decoder frame rates.
+ */
+typedef enum QOMX_VIDEO_MPEG4LEVELTYPE {
+ QOMX_VIDEO_MPEG4Level6 = 0x7F000001, /**< Level 6 */
+ QOMX_VIDEO_MPEG4Level7 = 0x7F000002, /**< Level 7 */
+ QOMX_VIDEO_MPEG4Level8 = 0x7F000003, /**< Level 8 */
+ QOMX_VIDEO_MPEG4Level9 = 0x7F000004, /**< Level 9 */
+ QOMX_VIDEO_MPEG4LevelMax = 0x7FFFFFFF
+} QOMX_VIDEO_MPEG4LEVELTYPE;
+
+/**
+ * This structure is used in retrieving the syntax header from a
+ * video encoder component, or setting the out of band syntax
+ * header configuration data on a video decoder component.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nBytes : When used with OMX_GetParameter for the encoder
+ * component, it is a read-write field. When
+ * QOMX_VIDEO_SYNTAXHDRTYPE is passed in
+ * OMX_GetParameter this is the size of the buffer
+ * array pointed by data field. When the
+ * OMX_GetParameter call returns this is the
+ * amount of data within the buffer array.
+ *
+ * The IL client needs to allocate the buffer
+ * array and then request for the syntax header.
+ * If the size of buffer array to allocate is
+ * unknown to the IL client, then it can call
+ * OMX_GetParamter with nBytes set to 0. In this
+ * case, when OMX_GetParameter returns, the nBytes
+ * field will be set to the size of the syntax
+ * header. IL Client can then allocate a buffer of
+ * this size and call OMX_GetParamter again.
+ *
+ * When used with OMX_SetParameter for the decoder
+ * component, it is a read-only field specifying
+ * the amount of data in the buffer array.
+ * data : The syntax header data. The format of the
+ * syntax header is specific to the video codec,
+ * and is described below.
+ *
+ * H.263 : N/A
+ * H.264 : The SPS and PPS parameter sets
+ * MPEG-4 : The VO, VOS, and VOL header
+ * WMV7 : The "Extra Data" info, in the ASF Stream
+ * Properties Object.
+ * WMV8 : The "Extra Data" info, in the ASF Stream
+ * Properties Object.
+ * WMV9 SP/MP : The STRUCT_C portion of the sequence layer
+ * meta data, defined in Table 263 of the VC-1
+ * specification.
+ * VC-1 SP/MP : The STRUCT_C portion of the sequence layer
+ * meta data, defined in Table 263 of the VC-1
+ * specification.
+ * VC-1 AP : The sequence and entry point header
+ * DivX 3 : N/A
+ * DivX 4.x : The VO, VOS, and VOL header
+ * DivX 5.x : The VO, VOS, and VOL header
+ * DivX 6.x : The VO, VOS, and VOL header
+ * VP6 : N/A
+ * Spark : N/A
+ */
+typedef struct QOMX_VIDEO_SYNTAXHDRTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nBytes;
+ OMX_U8 data[1];
+} QOMX_VIDEO_SYNTAXHDRTYPE;
+
+
+/**
+ * Enumeration used to define the extended video intra refresh types, not
+ * present in the OpenMax IL 1.1.2 specification.
+ *
+ * ENUMS:
+ * IntraRefreshRandom : Random intra refresh mode.
+ */
+typedef enum QOMX_VIDEO_INTRAREFRESHTYPE
+{
+ QOMX_VIDEO_IntraRefreshRandom = 0x7F100000
+} QOMX_VIDEO_INTRAREFRESHTYPE;
+
+
+/**
+ * This structure is used to configure the intra periodicity for encoder.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nIDRPeriod : Defines the periodicity of IDR occurrence. This specifies
+ * coding a frame as IDR after a specific number of intra
+ * frames. The periodicity of intra frame coding is specified by
+ * the nPFrames. If nIDRPeriod is set to 0, only the first
+ * frame of the encode session is an IDR frame. This field is
+ * ignored for non-AVC codecs and is used only for codecs that
+ * support IDR Period.
+ * nPFrames : Specifies the number of P frames between each I Frame.
+ * nBFrames : Specifies the number of B frames between each I Frame.
+ */
+typedef struct QOMX_VIDEO_INTRAPERIODTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIDRPeriod;
+ OMX_U32 nPFrames;
+ OMX_U32 nBFrames;
+} QOMX_VIDEO_INTRAPERIODTYPE;
+
+
+/**
+ * Enumeration used to define the extended video extra data payload types not
+ * present in the OpenMax IL 1.1.2 specification.
+ *
+ * ENUMS:
+ * VideoMultiSliceInfo : Multi slice layout information
+ *
+ * Slice information layout:
+ * First 4 bytes = Number of Slice Entries
+ *
+ * Then individual slice entries: 8 bytes per entry.
+ * Slice1 information: offset (4 bytes), Length (4 bytes)
+ * Slice2 information: offset (4 bytes), Length (4 bytes)
+ * Slice3 information: offset (4 bytes), Length (4 bytes)
+ * ...................................
+ * ...................................
+ * SliceN information: offset (4 bytes), Length (4 bytes)
+ *
+ *
+ * VideoNumConcealedMB : Number of concealed MBs
+ *
+ * The data array consists of an unsigned 32-bit size field
+ * indicating the number of concealed macroblocks in the
+ * uncompressed frame.
+ *
+ *
+ * QOMX_ExtraDataOMXIndex : Indicates that the data payload contains an
+ * OpenMax index and associated payload.
+ *
+ * The data of the extra data payload shall contain the value of the
+ * OMX_INDEXTYPE corresponding to the requested operation as an unsigned
+ * 32 bit number occupying the first four bytes of the payload. The index
+ * will be immediately followed by the associated structure. Padding bytes
+ * are appended to ensure 32 bit address alignment if needed.
+ */
+typedef enum QOMX_VIDEO_EXTRADATATYPE
+{
+ QOMX_ExtraDataVideoMultiSliceInfo = 0x7F100000,
+ QOMX_ExtraDataVideoNumConcealedMB,
+ QOMX_ExtraDataOMXIndex,
+ QOMX_ExtraDataHDCPEncryptionInfo
+} QOMX_VIDEO_EXTRADATATYPE;
+
+
+/**
+ * Enumeration used to define the video encoder modes
+ *
+ * ENUMS:
+ * EncoderModeDefault : Default video recording mode.
+ * All encoder settings made through
+ * OMX_SetParameter/OMX_SetConfig are applied. No
+ * parameter is overridden.
+ * EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
+ * Service). This mode is similar to EncoderModeDefault
+ * except that here the Rate control mode is overridden
+ * internally and set as a variant of variable bitrate with
+ * variable frame rate. After this mode is set if the IL
+ * client tries to set OMX_VIDEO_CONTROLRATETYPE via
+ * OMX_IndexParamVideoBitrate that would be rejected. For
+ * this, client should set mode back to EncoderModeDefault
+ * first and then change OMX_VIDEO_CONTROLRATETYPE.
+ */
+typedef enum QOMX_VIDEO_ENCODERMODETYPE
+{
+ QOMX_VIDEO_EncoderModeDefault = 0x01,
+ QOMX_VIDEO_EncoderModeMMS = 0x02,
+ QOMX_VIDEO_EncoderModeMax = 0x7FFFFFFF
+} QOMX_VIDEO_ENCODERMODETYPE;
+
+/**
+ * This structure is used to set the video encoder mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nMode : defines the video encoder mode
+ */
+typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_ENCODERMODETYPE nMode;
+} QOMX_VIDEO_PARAM_ENCODERMODETYPE;
+
+
+/**
+ * This structure is used to set the temporal (picture rate) - spatial
+ * (picture quality) trade-off factor.
+ * This setting is only valid when rate control is enabled and set to a mode
+ * with variable frame rate. For all other rate control modes this setting is
+ * ignored.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nTSFactor : temporal-spatial tradeoff factor value in the range of 0-100.
+ * A factor of 0 won't emphasizes picture rate in rate
+ * control decisions at all i.e only picture quality is emphasized. For
+ * increasing values from 1 to 99 the emphasis of picture rate in rate
+ * control decisions increases. A factor of 100 emphasizes only picture rate
+ * in rate control decisions.
+ */
+typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nTSFactor;
+} QOMX_VIDEO_TEMPORALSPATIALTYPE;
+
+/**
+ * This structure is used to enable or disable the MB concealmenet reporting
+ * for the uncompressed frames emitted from the port.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * bEnableMBConcealmentReporting : Flag indicating whether MB concealment
+ * reporting is enabled or disabled.
+ * OMX_TRUE: Enables MB concealment reporting
+ * OMX_FALSE: Disables MB concealment reporting
+ */
+typedef struct QOMX_VIDEO_MBCONCEALMENTREPORTINGTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnableMBConcealmentReporting;
+} QOMX_VIDEO_MBCONCEALMENTREPORTINGTYPE;
+
+/**
+ * Specifies the extended picture types. These values should be
+ * OR'd along with the types defined in OMX_VIDEO_PICTURETYPE to
+ * signal all pictures types which are allowed.
+ *
+ * ENUMS:
+ * H.264 Specific Picture Types: IDR
+ */
+typedef enum QOMX_VIDEO_PICTURETYPE {
+ QOMX_VIDEO_PictureTypeIDR = OMX_VIDEO_PictureTypeVendorStartUnused + 0x1000
+} QOMX_VIDEO_PICTURETYPE;
+
+/**
+ * This structure is used to configure the processing of
+ * specific picture types.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nPictureTypes : Specifies the picture type(s)
+ * that shall be processed. The value consists
+ * of the desired picture types, defined by the
+ * OMX_VIDEO_PICTURETYPE and
+ * QOMX_VIDEO_PICTURETYPE enumerations, OR'd to
+ * signal all the pictures types which are
+ * allowed.
+ */
+typedef struct QOMX_VIDEO_DECODEPICTURETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nPictureTypes;
+} QOMX_VIDEO_DECODEPICTURETYPE;
+
+/**
+ * This structure describes the sample aspect ratio information.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nWidth : Specifies the horizontal aspect size of
+ * the sample
+ * nHeight : Specifies the vertical aspect size of the
+ * sample
+ */
+typedef struct QOMX_VIDEO_SAMPLEASPECTRATIO {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 nWidth;
+ OMX_U16 nHeight;
+} QOMX_VIDEO_SAMPLEASPECTRATIO;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_VIDEOEXTENSIONS_H__ */
diff --git a/mm-core/inc/drmplay_version.h b/mm-core/inc/drmplay_version.h
index 230b633..e3562f3 100644
--- a/mm-core/inc/drmplay_version.h
+++ b/mm-core/inc/drmplay_version.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/inc/qc_omx_common.h b/mm-core/inc/qc_omx_common.h
index 0459185..a673d3c 100644
--- a/mm-core/inc/qc_omx_common.h
+++ b/mm-core/inc/qc_omx_common.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/inc/qc_omx_component.h b/mm-core/inc/qc_omx_component.h
index 9b5ebf7..ad226d0 100644
--- a/mm-core/inc/qc_omx_component.h
+++ b/mm-core/inc/qc_omx_component.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/inc/qc_omx_msg.h b/mm-core/inc/qc_omx_msg.h
index deb0ab7..53ee908 100644
--- a/mm-core/inc/qc_omx_msg.h
+++ b/mm-core/inc/qc_omx_msg.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -40,35 +40,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef _ENABLE_QC_MSG_LOG_
#ifdef _ANDROID_
#include <utils/Log.h>
-
- #ifdef __cplusplus
- extern "C" {
- #endif
-
- #ifndef LOGE
- #define LOGE ALOGE
- #endif
-
- #ifndef LOGW
- #define LOGW ALOGW
- #endif
-
- #ifndef LOGD
- #define LOGD ALOGD
- #endif
-
- #ifndef LOGV
- #define LOGV ALOGV
- #endif
-
- #ifndef LOGI
- #define LOGI ALOGI
- #endif
-
- #ifdef __cplusplus
- }
- #endif
-
#define DEBUG_PRINT_ERROR LOGE
#define DEBUG_PRINT LOGI
#define DEBUG_DETAIL LOGV
diff --git a/mm-core/omxcore/Android.mk b/mm-core/omxcore/Android.mk
new file mode 100644
index 0000000..f27e392
--- /dev/null
+++ b/mm-core/omxcore/Android.mk
@@ -0,0 +1,94 @@
+#--------------------------------------------------------------------------
+#Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+#NON-INFRINGEMENT 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.
+#--------------------------------------------------------------------------
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+OMXCORE_CFLAGS += -D_ANDROID_
+OMXCORE_CFLAGS += -D_ENABLE_QC_MSG_LOG_
+
+ifeq ($(TARGET_BOARD_PLATFORM),msm7x30)
+ MM_CORE_TARGET = 7630
+else
+ $(error Unsupported target platform $(TARGET_BOARD_PLATFORM))
+endif
+
+#===============================================================================
+# Deploy the headers that can be exposed
+#===============================================================================
+
+LOCAL_COPY_HEADERS_TO := mm-core/omxcore
+LOCAL_COPY_HEADERS := inc/OMX_Audio.h
+LOCAL_COPY_HEADERS += inc/OMX_Component.h
+LOCAL_COPY_HEADERS += inc/OMX_ContentPipe.h
+LOCAL_COPY_HEADERS += inc/OMX_Core.h
+LOCAL_COPY_HEADERS += inc/OMX_Image.h
+LOCAL_COPY_HEADERS += inc/OMX_Index.h
+LOCAL_COPY_HEADERS += inc/OMX_IVCommon.h
+LOCAL_COPY_HEADERS += inc/OMX_Other.h
+LOCAL_COPY_HEADERS += inc/OMX_QCOMExtns.h
+LOCAL_COPY_HEADERS += inc/OMX_Types.h
+LOCAL_COPY_HEADERS += inc/OMX_Video.h
+LOCAL_COPY_HEADERS += inc/qc_omx_common.h
+LOCAL_COPY_HEADERS += inc/qc_omx_component.h
+LOCAL_COPY_HEADERS += inc/qc_omx_msg.h
+LOCAL_COPY_HEADERS += inc/QOMX_AudioExtensions.h
+LOCAL_COPY_HEADERS += inc/QOMX_AudioIndexExtensions.h
+
+#===============================================================================
+# LIBRARY for Android apps
+#===============================================================================
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
+LOCAL_MODULE := libOmxCore
+LOCAL_SHARED_LIBRARIES := liblog libdl
+LOCAL_CFLAGS := $(OMXCORE_CFLAGS)
+
+LOCAL_SRC_FILES := src/common/omx_core_cmp.cpp
+LOCAL_SRC_FILES += src/common/qc_omx_core.c
+LOCAL_SRC_FILES += src/$(MM_CORE_TARGET)/qc_registry_table_android.c
+
+include $(BUILD_SHARED_LIBRARY)
+
+#===============================================================================
+# LIBRARY for command line test apps
+#===============================================================================
+
+include $(CLEAR_VARS)
+
+LOCAL_C_INCLUDES := $(LOCAL_PATH)/src/common
+LOCAL_C_INCLUDES += $(LOCAL_PATH)/inc
+LOCAL_MODULE := libmm-omxcore
+LOCAL_SHARED_LIBRARIES := liblog libdl
+LOCAL_CFLAGS := $(OMXCORE_CFLAGS)
+
+LOCAL_SRC_FILES := src/common/omx_core_cmp.cpp
+LOCAL_SRC_FILES += src/common/qc_omx_core.c
+LOCAL_SRC_FILES += src/$(MM_CORE_TARGET)/qc_registry_table.c
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/mm-core/omxcore/inc/OMX_Audio.h b/mm-core/omxcore/inc/OMX_Audio.h
new file mode 100644
index 0000000..04f1a99
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Audio.h
@@ -0,0 +1,1311 @@
+/*
+ * 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_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_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;
+
+
+/** 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/mm-core/omxcore/inc/OMX_Component.h b/mm-core/omxcore/inc/OMX_Component.h
new file mode 100644
index 0000000..d595640
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Component.h
@@ -0,0 +1,579 @@
+/*
+ * 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/mm-core/omxcore/inc/OMX_ContentPipe.h b/mm-core/omxcore/inc/OMX_ContentPipe.h
new file mode 100644
index 0000000..5f6310c
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_ContentPipe.h
@@ -0,0 +1,195 @@
+/*
+ * 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/mm-core/omxcore/inc/OMX_Core.h b/mm-core/omxcore/inc/OMX_Core.h
new file mode 100644
index 0000000..a076f2f
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Core.h
@@ -0,0 +1,1431 @@
+/*
+ * 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/mm-core/omxcore/inc/OMX_IVCommon.h b/mm-core/omxcore/inc/OMX_IVCommon.h
new file mode 100644
index 0000000..4c4995c
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_IVCommon.h
@@ -0,0 +1,920 @@
+/**
+ * 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 */
+ 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/mm-core/omxcore/inc/OMX_Image.h b/mm-core/omxcore/inc/OMX_Image.h
new file mode 100644
index 0000000..a6d4666
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Image.h
@@ -0,0 +1,328 @@
+/**
+ * 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/mm-core/omxcore/inc/OMX_Index.h b/mm-core/omxcore/inc/OMX_Index.h
new file mode 100644
index 0000000..44d4ea7
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Index.h
@@ -0,0 +1,258 @@
+/*
+ * 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_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/mm-core/omxcore/inc/OMX_Other.h b/mm-core/omxcore/inc/OMX_Other.h
new file mode 100644
index 0000000..caf7f38
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Other.h
@@ -0,0 +1,337 @@
+/*
+ * 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/mm-core/omxcore/inc/OMX_QCOMExtns.h b/mm-core/omxcore/inc/OMX_QCOMExtns.h
new file mode 100644
index 0000000..b9af594
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_QCOMExtns.h
@@ -0,0 +1,689 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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_QCOM_EXTENSIONS_H__
+#define __OMX_QCOM_EXTENSIONS_H__
+
+/*============================================================================
+*//** @file OMX_QCOMExtns.h
+ This header contains constants and type definitions that specify the
+ extensions added to the OpenMAX Vendor specific APIs.
+
+*//*========================================================================*/
+
+
+//////////////////////////////////////////////////////////////////////////////
+// Include Files
+//////////////////////////////////////////////////////////////////////////////
+#include "OMX_Core.h"
+#include "OMX_Video.h"
+
+/**
+ * This extension is used to register mapping of a virtual
+ * address to a physical address. This extension is a parameter
+ * which can be set using the OMX_SetParameter macro. The data
+ * pointer corresponding to this extension is
+ * OMX_QCOM_MemMapEntry. This parameter is a 'write only'
+ * parameter (Current value cannot be queried using
+ * OMX_GetParameter macro).
+ */
+#define OMX_QCOM_EXTN_REGISTER_MMAP "OMX.QCOM.index.param.register_mmap"
+
+/**
+ * This structure describes the data pointer corresponding to
+ * the OMX_QCOM_MMAP_REGISTER_EXTN extension. This parameter
+ * must be set only 'after' populating a port with a buffer
+ * using OMX_UseBuffer, wherein the data pointer of the buffer
+ * corresponds to the virtual address as specified in this
+ * structure.
+ */
+struct OMX_QCOM_PARAM_MEMMAPENTRYTYPE
+{
+ 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 */
+
+ /**
+ * The virtual address of memory block
+ */
+ OMX_U64 nVirtualAddress;
+
+ /**
+ * The physical address corresponding to the virtual address. The physical
+ * address is contiguous for the entire valid range of the virtual
+ * address.
+ */
+ OMX_U64 nPhysicalAddress;
+};
+
+#define QOMX_VIDEO_IntraRefreshRandom (OMX_VIDEO_IntraRefreshVendorStartUnused + 0)
+
+#define OMX_QCOM_PORTDEFN_EXTN "OMX.QCOM.index.param.portdefn"
+/* Allowed APIs on the above Index: OMX_GetParameter() and OMX_SetParameter() */
+
+typedef enum OMX_QCOMMemoryRegion
+{
+ OMX_QCOM_MemRegionInvalid,
+ OMX_QCOM_MemRegionEBI1,
+ OMX_QCOM_MemRegionSMI,
+ OMX_QCOM_MemRegionMax = 0X7FFFFFFF
+} OMX_QCOMMemoryRegion;
+
+typedef enum OMX_QCOMCacheAttr
+{
+ OMX_QCOM_CacheAttrNone,
+ OMX_QCOM_CacheAttrWriteBack,
+ OMX_QCOM_CacheAttrWriteThrough,
+ OMX_QCOM_CacheAttrMAX = 0X7FFFFFFF
+} OMX_QCOMCacheAttr;
+
+typedef struct OMX_QCOMRectangle
+{
+ OMX_S32 x;
+ OMX_S32 y;
+ OMX_S32 dx;
+ OMX_S32 dy;
+} OMX_QCOMRectangle;
+
+/** OMX_QCOMFramePackingFormat
+ * Input or output buffer format
+ */
+typedef enum OMX_QCOMFramePackingFormat
+{
+ /* 0 - unspecified
+ */
+ OMX_QCOM_FramePacking_Unspecified,
+
+ /* 1 - Partial frames may be present OMX IL 1.1.1 Figure 2-10:
+ * Case 1??Each Buffer Filled In Whole or In Part
+ */
+ OMX_QCOM_FramePacking_Arbitrary,
+
+ /* 2 - Multiple complete frames per buffer (integer number)
+ * OMX IL 1.1.1 Figure 2-11: Case 2—Each Buffer Filled with
+ * Only Complete Frames of Data
+ */
+ OMX_QCOM_FramePacking_CompleteFrames,
+
+ /* 3 - Only one complete frame per buffer, no partial frame
+ * OMX IL 1.1.1 Figure 2-12: Case 3—Each Buffer Filled with
+ * Only One Frame of Compressed Data. Usually at least one
+ * complete unit of data will be delivered in a buffer for
+ * uncompressed data formats.
+ */
+ OMX_QCOM_FramePacking_OnlyOneCompleteFrame,
+
+ /* 4 - Only one complete subframe per buffer, no partial subframe
+ * Example: In H264, one complete NAL per buffer, where one frame
+ * can contatin multiple NAL
+ */
+ OMX_QCOM_FramePacking_OnlyOneCompleteSubFrame,
+
+ OMX_QCOM_FramePacking_MAX = 0X7FFFFFFF
+} OMX_QCOMFramePackingFormat;
+
+typedef struct OMX_QCOM_PARAM_PORTDEFINITIONTYPE {
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+
+ /** Platform specific memory region EBI1, SMI, etc.,*/
+ OMX_QCOMMemoryRegion nMemRegion;
+
+ OMX_QCOMCacheAttr nCacheAttr; /** Cache attributes */
+
+ /** Input or output buffer format */
+ OMX_U32 nFramePackingFormat;
+
+} OMX_QCOM_PARAM_PORTDEFINITIONTYPE;
+
+#define OMX_QCOM_PLATFORMPVT_EXTN "OMX.QCOM.index.param.platformprivate"
+/** Allowed APIs on the above Index: OMX_SetParameter() */
+
+typedef enum OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
+{
+ /** Enum for PMEM information */
+ OMX_QCOM_PLATFORM_PRIVATE_PMEM = 0x1
+} OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE;
+
+/** IL client will set the following structure. A failure
+ * code will be returned if component does not support the
+ * value provided for 'type'.
+ */
+struct OMX_QCOM_PLATFORMPRIVATE_EXTN
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /** OMX spec version information */
+ OMX_U32 nPortIndex; /** Port number on which usebuffer extn is applied */
+
+ /** Type of extensions should match an entry from
+ OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE
+ */
+ OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
+};
+
+typedef struct OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO
+{
+ /** pmem file descriptor */
+ OMX_U32 pmem_fd;
+ /** Offset from pmem device base address */
+ OMX_U32 offset;
+}OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO;
+
+typedef struct OMX_QCOM_PLATFORM_PRIVATE_ENTRY
+{
+ /** Entry type */
+ OMX_QCOM_PLATFORM_PRIVATE_ENTRY_TYPE type;
+
+ /** Pointer to platform specific entry */
+ void* entry;
+}OMX_QCOM_PLATFORM_PRIVATE_ENTRY;
+
+typedef struct OMX_QCOM_PLATFORM_PRIVATE_LIST
+{
+ /** Number of entries */
+ OMX_U32 nEntries;
+
+ /** Pointer to array of platform specific entries *
+ * Contiguous block of OMX_QCOM_PLATFORM_PRIVATE_ENTRY element
+ */
+ OMX_QCOM_PLATFORM_PRIVATE_ENTRY* entryList;
+}OMX_QCOM_PLATFORM_PRIVATE_LIST;
+
+#define OMX_QCOM_FRAME_PACKING_FORMAT "OMX.QCOM.index.param.framepackfmt"
+/* Allowed API call: OMX_GetParameter() */
+/* IL client can use this index to rerieve the list of frame formats *
+ * supported by the component */
+
+typedef struct OMX_QCOM_FRAME_PACKINGFORMAT_TYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_QCOMFramePackingFormat eframePackingFormat;
+} OMX_QCOM_FRAME_PACKINGFORMAT_TYPE;
+
+
+/**
+ * Following is the enum for color formats supported on Qualcomm
+ * MSMs YVU420SemiPlanar color format is not defined in OpenMAX
+ * 1.1.1 and prior versions of OpenMAX specification.
+ */
+
+enum OMX_QCOM_COLOR_FORMATTYPE
+{
+
+/** YVU420SemiPlanar: YVU planar format, organized with a first
+ * plane containing Y pixels, and a second plane containing
+ * interleaved V and U pixels. V and U pixels are sub-sampled
+ * by a factor of two both horizontally and vertically.
+ */
+ OMX_QCOM_COLOR_FormatYVU420SemiPlanar = 0x7FA30C00,
+ QOMX_COLOR_FormatYVU420PackedSemiPlanar32m4ka,
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar16m2ka,
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka
+};
+
+enum OMX_QCOM_VIDEO_CODINGTYPE
+{
+/** Codecs support by qualcomm which are not listed in OMX 1.1.x
+ * spec
+ * */
+ OMX_QCOM_VIDEO_CodingVC1 = 0x7FA30C00 ,
+ OMX_QCOM_VIDEO_CodingWMV9 = 0x7FA30C01,
+ QOMX_VIDEO_CodingDivx = 0x7FA30C02, /**< Value when coding is Divx */
+ QOMX_VIDEO_CodingSpark = 0x7FA30C03, /**< Value when coding is Sorenson Spark */
+ QOMX_VIDEO_CodingVp = 0x7FA30C04
+};
+
+enum OMX_QCOM_EXTN_INDEXTYPE
+{
+ /** Qcom proprietary extension index list */
+
+ /* "OMX.QCOM.index.param.register_mmap" */
+ OMX_QcomIndexRegmmap = 0x7F000000,
+
+ /* "OMX.QCOM.index.param.platformprivate" */
+ OMX_QcomIndexPlatformPvt = 0x7F000001,
+
+ /* "OMX.QCOM.index.param.portdefn" */
+ OMX_QcomIndexPortDefn = 0x7F000002,
+
+ /* "OMX.QCOM.index.param.framepackingformat" */
+ OMX_QcomIndexPortFramePackFmt = 0x7F000003,
+
+ /*"OMX.QCOM.index.param.Interlaced */
+ OMX_QcomIndexParamInterlaced = 0x7F000004,
+
+ /*"OMX.QCOM.index.config.interlaceformat */
+ OMX_QcomIndexConfigInterlaced = 0x7F000005,
+
+ /*"OMX.QCOM.index.param.syntaxhdr" */
+ QOMX_IndexParamVideoSyntaxHdr = 0x7F000006,
+
+ /*"OMX.QCOM.index.config.intraperiod" */
+ QOMX_IndexConfigVideoIntraperiod = 0x7F000007,
+
+ /*"OMX.QCOM.index.config.randomIntrarefresh" */
+ QOMX_IndexConfigVideoIntraRefresh = 0x7F000008,
+
+ /*"OMX.QCOM.index.config.video.TemporalSpatialTradeOff" */
+ QOMX_IndexConfigVideoTemporalSpatialTradeOff = 0x7F000009,
+
+ /*"OMX.QCOM.index.param.video.EncoderMode" */
+ QOMX_IndexParamVideoEncoderMode = 0x7F00000A,
+
+ /*"OMX.QCOM.index.param.Divxtype */
+ OMX_QcomIndexParamVideoDivx = 0x7F00000B,
+
+ /*"OMX.QCOM.index.param.Sparktype */
+ OMX_QcomIndexParamVideoSpark = 0x7F00000C,
+
+ /*"OMX.QCOM.index.param.Vptype */
+ OMX_QcomIndexParamVideoVp = 0x7F00000D,
+
+ OMX_QcomIndexQueryNumberOfVideoDecInstance = 0x7F00000E
+};
+
+/**
+ * Enumeration used to define the video encoder modes
+ *
+ * ENUMS:
+ * EncoderModeDefault : Default video recording mode.
+ * All encoder settings made through
+ * OMX_SetParameter/OMX_SetConfig are applied. No
+ * parameter is overridden.
+ * EncoderModeMMS : Video recording mode for MMS (Multimedia Messaging
+ * Service). This mode is similar to EncoderModeDefault
+ * except that here the Rate control mode is overridden
+ * internally and set as a variant of variable bitrate with
+ * variable frame rate. After this mode is set if the IL
+ * client tries to set OMX_VIDEO_CONTROLRATETYPE via
+ * OMX_IndexParamVideoBitrate that would be rejected. For
+ * this, client should set mode back to EncoderModeDefault
+ * first and then change OMX_VIDEO_CONTROLRATETYPE.
+ */
+typedef enum QOMX_VIDEO_ENCODERMODETYPE
+{
+ QOMX_VIDEO_EncoderModeDefault = 0x00,
+ QOMX_VIDEO_EncoderModeMMS = 0x01,
+ QOMX_VIDEO_EncoderModeMax = 0x7FFFFFFF
+} QOMX_VIDEO_ENCODERMODETYPE;
+
+/**
+ * This structure is used to set the video encoder mode.
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version info
+ * nPortIndex : Port that this structure applies to
+ * nMode : defines the video encoder mode
+ */
+typedef struct QOMX_VIDEO_PARAM_ENCODERMODETYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_ENCODERMODETYPE nMode;
+} QOMX_VIDEO_PARAM_ENCODERMODETYPE;
+
+/**
+ * This structure describes the parameters corresponding to the
+ * QOMX_VIDEO_SYNTAXHDRTYPE extension. This parameter can be queried
+ * during the loaded state.
+ */
+
+typedef struct QOMX_VIDEO_SYNTAXHDRTYPE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_U32 nBytes; /** The number of bytes filled in to the buffer */
+ OMX_U8 data[1]; /** Buffer to store the header information */
+} QOMX_VIDEO_SYNTAXHDRTYPE;
+
+/**
+ * This structure describes the parameters corresponding to the
+ * QOMX_VIDEO_TEMPORALSPATIALTYPE extension. This parameter can be set
+ * dynamically during any state except the state invalid. This is primarily
+ * used for setting MaxQP from the application. This is set on the out port.
+ */
+
+typedef struct QOMX_VIDEO_TEMPORALSPATIALTYPE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_U32 nTSFactor; /** Temoral spatial tradeoff factor value in 0-100 */
+} QOMX_VIDEO_TEMPORALSPATIALTYPE;
+
+/**
+ * This structure describes the parameters corresponding to the
+ * OMX_QCOM_VIDEO_CONFIG_INTRAPERIODTYPE extension. This parameter can be set
+ * dynamically during any state except the state invalid. This is set on the out port.
+ */
+
+typedef struct QOMX_VIDEO_INTRAPERIODTYPE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_U32 nIDRPeriod; /** This specifies coding a frame as IDR after every nPFrames
+ of intra frames. If this parameter is set to 0, only the
+ first frame of the encode session is an IDR frame. This
+ field is ignored for non-AVC codecs and is used only for
+ codecs that support IDR Period */
+ OMX_U32 nPFrames; /** The number of "P" frames between two "I" frames */
+ OMX_U32 nBFrames; /** The number of "B" frames between two "I" frames */
+} QOMX_VIDEO_INTRAPERIODTYPE;
+
+/**
+ * This structure describes the parameters corresponding to the
+ * OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE extension. This parameter can be set
+ * dynamically during any state except the state invalid. This is used for the buffer negotiation
+ * with other clients. This is set on the out port.
+ */
+typedef struct OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion; /** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_U32 nBufferOccupancy; /** The number of bytes to be set for the buffer occupancy */
+} OMX_QCOM_VIDEO_CONFIG_ULBUFFEROCCUPANCYTYPE;
+
+/**
+ * This structure describes the parameters corresponding to the
+ * OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE extension. This parameter can be set
+ * dynamically during any state except the state invalid. This is primarily used for the dynamic/random
+ * intrarefresh. This is set on the out port.
+ */
+typedef struct OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_U32 nRirMBs; /** The number of MBs to be set for intrarefresh */
+} OMX_QCOM_VIDEO_CONFIG_RANDOMINTRAREFRESHTYPE;
+
+
+/**
+ * This structure describes the parameters corresponding to the
+ * OMX_QCOM_VIDEO_CONFIG_QPRANGE extension. This parameter can be set
+ * dynamically during any state except the state invalid. This is primarily
+ * used for the min/max QP to be set from the application. This
+ * is set on the out port.
+ */
+typedef struct OMX_QCOM_VIDEO_CONFIG_QPRANGE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_U32 nMinQP; /** The number for minimum quantization parameter */
+ OMX_U32 nMaxQP; /** The number for maximum quantization parameter */
+} OMX_QCOM_VIDEO_CONFIG_QPRANGE;
+
+
+typedef struct OMX_VENDOR_EXTRADATATYPE {
+ OMX_U32 nPortIndex;
+ OMX_U32 nDataSize;
+ OMX_U8 *pData; // cdata (codec_data/extradata)
+} OMX_VENDOR_EXTRADATATYPE;
+
+typedef enum OMX_INDEXVENDORTYPE {
+ OMX_IndexVendorFileReadInputFilename = 0xFF000001,
+ OMX_IndexVendorParser3gpInputFilename = 0xFF000002,
+ OMX_IndexVendorVideoExtraData = 0xFF000003,
+ OMX_IndexVendorAudioExtraData = 0xFF000004
+} OMX_INDEXVENDORTYPE;
+
+typedef enum OMX_QCOM_VC1RESOLUTIONTYPE
+{
+ OMX_QCOM_VC1_PICTURE_RES_1x1,
+ OMX_QCOM_VC1_PICTURE_RES_2x1,
+ OMX_QCOM_VC1_PICTURE_RES_1x2,
+ OMX_QCOM_VC1_PICTURE_RES_2x2
+} OMX_QCOM_VC1RESOLUTIONTYPE;
+
+typedef enum OMX_QCOM_INTERLACETYPE
+{
+ OMX_QCOM_InterlaceFrameProgressive,
+ OMX_QCOM_InterlaceInterleaveFrameTopFieldFirst,
+ OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst,
+ OMX_QCOM_InterlaceFrameTopFieldFirst,
+ OMX_QCOM_InterlaceFrameBottomFieldFirst,
+ OMX_QCOM_InterlaceFieldTop,
+ OMX_QCOM_InterlaceFieldBottom
+}OMX_QCOM_INTERLACETYPE;
+
+typedef struct OMX_QCOM_PARAM_VIDEO_INTERLACETYPE
+{
+ OMX_U32 nSize; /** Size of the structure in bytes */
+ OMX_VERSIONTYPE nVersion;/** OMX specification version information */
+ OMX_U32 nPortIndex; /** Portindex which is extended by this structure */
+ OMX_BOOL bInterlace; /** Interlace content **/
+}OMX_QCOM_PARAM_VIDEO_INTERLACETYPE;
+
+typedef struct OMX_QCOM_CONFIG_INTERLACETYPE
+{
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nIndex;
+ OMX_QCOM_INTERLACETYPE eInterlaceType;
+}OMX_QCOM_CONFIG_INTERLACETYPE;
+
+#define MAX_PAN_SCAN_WINDOWS 4
+
+typedef struct OMX_QCOM_PANSCAN
+{
+ OMX_U32 numWindows;
+ OMX_QCOMRectangle window[MAX_PAN_SCAN_WINDOWS];
+} OMX_QCOM_PANSCAN;
+
+typedef struct OMX_QCOM_EXTRADATA_FRAMEINFO
+{
+ // common frame meta data. interlace related info removed
+ OMX_VIDEO_PICTURETYPE ePicType;
+ OMX_QCOM_INTERLACETYPE interlaceType;
+ OMX_QCOM_PANSCAN panScan;
+ OMX_U32 nConcealedMacroblocks;
+} OMX_QCOM_EXTRADATA_FRAMEINFO;
+
+typedef struct OMX_QCOM_EXTRADATA_FRAMEDIMENSION
+{
+ /** Frame Dimensions added to each YUV buffer */
+ OMX_U32 nDecWidth; /** Width rounded to multiple of 16 */
+ OMX_U32 nDecHeight; /** Height rounded to multiple of 16 */
+ OMX_U32 nActualWidth; /** Actual Frame Width */
+ OMX_U32 nActualHeight; /** Actual Frame Height */
+
+}OMX_QCOM_EXTRADATA_FRAMEDIMENSION;
+
+typedef struct OMX_QCOM_H264EXTRADATA
+{
+ OMX_U64 seiTimeStamp;
+} OMX_QCOM_H264EXTRADATA;
+
+typedef struct OMX_QCOM_VC1EXTRADATA
+{
+ OMX_U32 nVC1RangeY;
+ OMX_U32 nVC1RangeUV;
+ OMX_QCOM_VC1RESOLUTIONTYPE eVC1PicResolution;
+} OMX_QCOM_VC1EXTRADATA;
+
+typedef union OMX_QCOM_EXTRADATA_CODEC_DATA
+{
+ OMX_QCOM_H264EXTRADATA h264ExtraData;
+ OMX_QCOM_VC1EXTRADATA vc1ExtraData;
+} OMX_QCOM_EXTRADATA_CODEC_DATA;
+
+typedef enum OMX_QCOM_EXTRADATATYPE
+{
+ OMX_ExtraDataFrameInfo = 0x7F000001,
+ OMX_ExtraDataH264 = 0x7F000002,
+ OMX_ExtraDataVC1 = 0x7F000003,
+ OMX_ExtraDataFrameDimension = 0x7F000004,
+ OMX_ExtraDataVideoEncoderSliceInfo = 0x7F000005
+} OMX_QCOM_EXTRADATATYPE;
+
+
+#define OMX_EXTRADATA_HEADER_SIZE 20
+
+/**
+ * DivX Versions
+ */
+typedef enum QOMX_VIDEO_DIVXFORMATTYPE {
+ QOMX_VIDEO_DIVXFormatUnused = 0x01, /**< Format unused or unknown */
+ QOMX_VIDEO_DIVXFormat311 = 0x02, /**< DivX 3.11 */
+ QOMX_VIDEO_DIVXFormat4 = 0x04, /**< DivX 4 */
+ QOMX_VIDEO_DIVXFormat5 = 0x08, /**< DivX 5 */
+ QOMX_VIDEO_DIVXFormat6 = 0x10, /**< DivX 6 */
+ QOMX_VIDEO_DIVXFormatKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_DIVXFormatVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_DIVXFormatMax = 0x7FFFFFFF
+} QOMX_VIDEO_DIVXFORMATTYPE;
+
+/**
+ * DivX profile types, each profile indicates support for
+ * various performance bounds.
+ */
+typedef enum QOMX_VIDEO_DIVXPROFILETYPE {
+ QOMX_VIDEO_DivXProfileqMobile = 0x01, /**< qMobile Profile */
+ QOMX_VIDEO_DivXProfileMobile = 0x02, /**< Mobile Profile */
+ QOMX_VIDEO_DivXProfileMT = 0x04, /**< Mobile Theatre Profile */
+ QOMX_VIDEO_DivXProfileHT = 0x08, /**< Home Theatre Profile */
+ QOMX_VIDEO_DivXProfileHD = 0x10, /**< High Definition Profile */
+ QOMX_VIDEO_DIVXProfileKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_DIVXProfileVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_DIVXProfileMax = 0x7FFFFFFF
+} QOMX_VIDEO_DIVXPROFILETYPE;
+
+/**
+ * DivX Video 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 DivX stream / data
+ * eProfile : Profile of DivX stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_DIVXTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_DIVXFORMATTYPE eFormat;
+ QOMX_VIDEO_DIVXPROFILETYPE eProfile;
+} QOMX_VIDEO_PARAM_DIVXTYPE;
+
+
+
+/**
+ * VP Versions
+ */
+typedef enum QOMX_VIDEO_VPFORMATTYPE {
+ QOMX_VIDEO_VPFormatUnused = 0x01, /**< Format unused or unknown */
+ QOMX_VIDEO_VPFormat6 = 0x02, /**< VP6 Video Format */
+ QOMX_VIDEO_VPFormat7 = 0x04, /**< VP7 Video Format */
+ QOMX_VIDEO_VPFormat8 = 0x08, /**< VP8 Video Format */
+ QOMX_VIDEO_VPFormatKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_VPFormatVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_VPFormatMax = 0x7FFFFFFF
+} QOMX_VIDEO_VPFORMATTYPE;
+
+/**
+ * VP profile types, each profile indicates support for various
+ * encoding tools.
+ */
+typedef enum QOMX_VIDEO_VPPROFILETYPE {
+ QOMX_VIDEO_VPProfileSimple = 0x01, /**< Simple Profile, applies to VP6 only */
+ QOMX_VIDEO_VPProfileAdvanced = 0x02, /**< Advanced Profile, applies to VP6 only */
+ QOMX_VIDEO_VPProfileVersion0 = 0x04, /**< Version 0, applies to VP7 and VP8 */
+ QOMX_VIDEO_VPProfileVersion1 = 0x08, /**< Version 1, applies to VP7 and VP8 */
+ QOMX_VIDEO_VPProfileVersion2 = 0x10, /**< Version 2, applies to VP8 only */
+ QOMX_VIDEO_VPProfileVersion3 = 0x20, /**< Version 3, applies to VP8 only */
+ QOMX_VIDEO_VPProfileKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_VPProfileVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_VPProfileMax = 0x7FFFFFFF
+} QOMX_VIDEO_VPPROFILETYPE;
+
+/**
+ * VP Video Params
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * eFormat : Format of VP stream / data
+ * eProfile : Profile or Version of VP stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_VPTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_VPFORMATTYPE eFormat;
+ QOMX_VIDEO_VPPROFILETYPE eProfile;
+} QOMX_VIDEO_PARAM_VPTYPE;
+
+/**
+ * Spark Versions
+ */
+typedef enum QOMX_VIDEO_SPARKFORMATTYPE {
+ QOMX_VIDEO_SparkFormatUnused = 0x01, /**< Format unused or unknown */
+ QOMX_VIDEO_SparkFormat0 = 0x02, /**< Video Format Version 0 */
+ QOMX_VIDEO_SparkFormat1 = 0x04, /**< Video Format Version 1 */
+ QOMX_VIDEO_SparkFormatKhronosExtensions = 0x6F000000,
+ QOMX_VIDEO_SparkFormatVendorStartUnused = 0x7F000000,
+ QOMX_VIDEO_SparkFormatMax = 0x7FFFFFFF
+} QOMX_VIDEO_SPARKFORMATTYPE;
+
+/**
+ * Spark Video 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 Spark stream / data
+ */
+typedef struct QOMX_VIDEO_PARAM_SPARKTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ QOMX_VIDEO_SPARKFORMATTYPE eFormat;
+} QOMX_VIDEO_PARAM_SPARKTYPE;
+
+
+typedef struct QOMX_VIDEO_QUERY_DECODER_INSTANCES {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nNumOfInstances;
+} QOMX_VIDEO_QUERY_DECODER_INSTANCES;
+
+
+
+#endif /* __OMX_QCOM_EXTENSIONS_H__ */
diff --git a/mm-core/omxcore/inc/OMX_Types.h b/mm-core/omxcore/inc/OMX_Types.h
new file mode 100644
index 0000000..9b02a3e
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Types.h
@@ -0,0 +1,347 @@
+/*
+ * 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/mm-core/omxcore/inc/OMX_Video.h b/mm-core/omxcore/inc/OMX_Video.h
new file mode 100644
index 0000000..163e450
--- /dev/null
+++ b/mm-core/omxcore/inc/OMX_Video.h
@@ -0,0 +1,1060 @@
+/**
+ * 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_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/mm-core/omxcore/inc/QOMX_AudioExtensions.h b/mm-core/omxcore/inc/QOMX_AudioExtensions.h
new file mode 100644
index 0000000..85a1764
--- /dev/null
+++ b/mm-core/omxcore/inc/QOMX_AudioExtensions.h
@@ -0,0 +1,181 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+*//** @file QOMX_AudioExtensions.h
+ This module contains the extensions for Audio
+
+*//*========================================================================*/
+
+#ifndef __H_QOMX_AUDIOEXTENSIONS_H__
+#define __H_QOMX_AUDIOEXTENSIONS_H__
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Audio.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/* Audio extension strings */
+#define OMX_QCOM_INDEX_PARAM_AMRWBPLUS "OMX.Qualcomm.index.audio.amrwbplus"
+#define OMX_QCOM_INDEX_PARAM_WMA10PRO "OMX.Qualcomm.index.audio.wma10pro"
+#define OMX_QCOM_INDEX_PARAM_SESSIONID "OMX.Qualcomm.index.audio.sessionId"
+#define OMX_QCOM_INDEX_PARAM_VOICERECORDTYPE "OMX.Qualcomm.index.audio.VoiceRecord"
+
+typedef enum QOMX_AUDIO_AMRBANDMODETYPE {
+ QOMX_AUDIO_AMRBandModeWB9 = 0x7F000001,/**< AMRWB Mode 9 = SID*/
+ QOMX_AUDIO_AMRBandModeWB10 = 0x7F000002,/**< AMRWB Mode 10 = 13600 bps */
+ QOMX_AUDIO_AMRBandModeWB11 = 0x7F000003,/**< AMRWB Mode 11 = 18000 bps */
+ QOMX_AUDIO_AMRBandModeWB12 = 0x7F000004,/**< AMRWB Mode 12 = 24000 bps */
+ QOMX_AUDIO_AMRBandModeWB13 = 0x7F000005,/**< AMRWB Mode 13 = 24000 bps */
+ QOMX_AUDIO_AMRBandModeWB14 = 0x7F000006,/**< AMRWB Mode 14 = FRAME_ERASE*/
+ QOMX_AUDIO_AMRBandModeWB15 = 0x7F000007,/**< AMRWB Mode 15 = NO_DATA */
+}QOMX_AUDIO_AMRBANDMODETYPE;
+
+/**
+ * AMR WB PLUS type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nChannels : Number of channels
+ * nBitRate : Bit rate read only field
+ * nSampleRate : Sampling frequency for the clip(16/24/32/48KHz)
+ * eAMRBandMode : AMR Band Mode enumeration
+ * eAMRDTXMode : AMR DTX Mode enumeration
+ * eAMRFrameFormat : AMR frame format enumeration
+ */
+
+typedef struct QOMX_AUDIO_PARAM_AMRWBPLUSTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U32 nChannels;
+ OMX_U32 nBitRate;
+ OMX_U32 nSampleRate;
+ QOMX_AUDIO_AMRBANDMODETYPE eAMRBandMode;
+ OMX_AUDIO_AMRDTXMODETYPE eAMRDTXMode;
+ OMX_AUDIO_AMRFRAMEFORMATTYPE eAMRFrameFormat;
+} QOMX_AUDIO_PARAM_AMRWBPLUSTYPE;
+
+typedef enum QOMX_AUDIO_WMAFORMATTYPE {
+ QOMX_AUDIO_WMAFormat10Pro = 0x7F000001, /**< Windows Media Audio format 10*/
+} QOMX_AUDIO_WMAFORMATTYPE;
+
+/**
+ * WMA 10 PRO type
+ *
+ * STRUCT MEMBERS:
+ * nSize : Size of the structure in bytes
+ * nVersion : OMX specification version information
+ * nPortIndex : Port that this structure applies to
+ * nChannels : Number of channels
+ * nBitRate : Bit rate read only field
+ * eFormat : Version of WMA stream / data
+ * eProfile : Profile of WMA stream / data
+ * nSamplingRate : Sampling rate of the source data
+ * nBlockAlign : block alignment, or block size, in bytes of the audio codec
+ * nEncodeOptions : WMA Type-specific data
+ * nSuperBlockAlign : WMA Type-specific data
+ * validBitsPerSample : encoded stream (24-bit or 16-bit)
+ * formatTag : codec ID(0x162 or 0x166)
+ * advancedEncodeOpt : bit packed words indicating the features supported for LBR bitstream
+ * advancedEncodeOpt2 : bit packed words indicating the features supported for LBR bitstream
+ */
+typedef struct QOMX_AUDIO_PARAM_WMA10PROTYPE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_U16 nChannels;
+ OMX_U32 nBitRate;
+ QOMX_AUDIO_WMAFORMATTYPE eFormat;
+ OMX_AUDIO_WMAPROFILETYPE eProfile;
+ OMX_U32 nSamplingRate;
+ OMX_U16 nBlockAlign;
+ OMX_U16 nEncodeOptions;
+ OMX_U32 nSuperBlockAlign;
+ OMX_U32 validBitsPerSample;
+ OMX_U32 formatTag;
+ OMX_U32 advancedEncodeOpt;
+ OMX_U32 advancedEncodeOpt2;
+} QOMX_AUDIO_PARAM_WMA10PROTYPE;
+
+/**
+ * Stream info data
+ *
+ * STRUCT MEMBERS:
+ * sessionId : session Id for alsa to route data
+ */
+typedef struct QOMX_AUDIO_STREAM_INFO_DATA {
+ OMX_U8 sessionId;
+} QOMX_AUDIO_STREAM_INFO_DATA;
+
+
+/**
+ * Record Path
+ *
+ * STRUCT MEMBERS:
+ * recPath : Record Path for encoding
+ */
+typedef enum{
+
+QOMX_AUDIO_VOICE_TX,
+QOMX_AUDIO_VOICE_RX,
+QOMX_AUDIO_VOICE_MIXED,
+
+} QOMX_AUDIO_VOICERECORDMODETYPE;
+typedef struct QOMX_AUDIO_CONFIG_VOICERECORDTYPE {
+
+OMX_U32 nSize;
+OMX_VERSIONTYPE nVersion;
+QOMX_AUDIO_VOICERECORDMODETYPE eVoiceRecordMode;
+} QOMX_AUDIO_CONFIG_VOICERECORDTYPE;
+
+
+
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_AUDIOEXTENSIONS_H__ */
diff --git a/mm-core/omxcore/inc/QOMX_AudioIndexExtensions.h b/mm-core/omxcore/inc/QOMX_AudioIndexExtensions.h
new file mode 100644
index 0000000..09c1673
--- /dev/null
+++ b/mm-core/omxcore/inc/QOMX_AudioIndexExtensions.h
@@ -0,0 +1,77 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+*//** @file QOMX_AudioIndexExtensions.h
+ This module contains the index extensions for Audio
+
+*//*========================================================================*/
+
+
+#ifndef __H_QOMX_AUDIOINDEXEXTENSIONS_H__
+#define __H_QOMX_AUDIOINDEXEXTENSIONS_H__
+
+/*========================================================================
+
+ INCLUDE FILES FOR MODULE
+
+========================================================================== */
+#include <OMX_Core.h>
+
+/*========================================================================
+
+ DEFINITIONS AND DECLARATIONS
+
+========================================================================== */
+
+#if defined( __cplusplus )
+extern "C"
+{
+#endif /* end of macro __cplusplus */
+
+/**
+ * Enumeration used to define Qualcomm's vendor extensions for
+ * audio. The audio extensions occupy a range of
+ * 0x7F100000-0x7F1FFFFF, inclusive.
+ */
+typedef enum QOMX_AUDIO_EXTENSIONS_INDEXTYPE
+{
+ QOMX_IndexParamAudioAmrWbPlus = 0x7F200000, /**< "OMX.Qualcomm.index.audio.amrwbplus" */
+ QOMX_IndexParamAudioWma10Pro = 0x7F200001, /**< "OMX.Qualcomm.index.audio.wma10pro" */
+ QOMX_IndexParamAudioSessionId = 0x7F200002, /**< "OMX.Qualcomm.index.audio.sessionId" */
+ QOMX_IndexParamAudioVoiceRecord = 0x7F200003, /**< "OMX.Qualcomm.index.audio.VoiceRecord" */
+ QOMX_IndexParamAudioUnused = 0x7F2FFFFF
+} QOMX_AUDIO_EXTENSIONS_INDEXTYPE;
+
+#if defined( __cplusplus )
+}
+#endif /* end of macro __cplusplus */
+
+#endif /* end of macro __H_QOMX_AUDIOINDEXEXTENSIONS_H__ */
diff --git a/mm-core/omxcore/inc/qc_omx_common.h b/mm-core/omxcore/inc/qc_omx_common.h
new file mode 100644
index 0000000..a673d3c
--- /dev/null
+++ b/mm-core/omxcore/inc/qc_omx_common.h
@@ -0,0 +1,65 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+*//** @file qc_omx_common.h
+ This module contains the definitions of the OpenMAX core.
+
+*//*========================================================================*/
+
+#ifndef QC_OMX_COMMON_H
+#define QC_OMX_COMMON_H
+
+
+#include <stdio.h> // Standard IO
+#include "OMX_Core.h" // OMX API
+#include "OMX_QCOMExtns.h" // OMX API
+
+#define OMX_CORE_MAX_CMP 1 // MAX Components supported
+#define OMX_CORE_MAX_CMP_ROLES 1 // MAX Roles per component
+#define OMX_SPEC_VERSION 0x00000101 // OMX Version
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void * (*create_qc_omx_component)(void);
+
+#ifdef _ANDROID_
+#define LOG_TAG "QC_CORE"
+#endif
+#include "qc_omx_msg.h"
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/mm-core/omxcore/inc/qc_omx_component.h b/mm-core/omxcore/inc/qc_omx_component.h
new file mode 100644
index 0000000..ad226d0
--- /dev/null
+++ b/mm-core/omxcore/inc/qc_omx_component.h
@@ -0,0 +1,183 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o m p o n e n t I n t e r f a c e
+
+*//** @file qc_omx_component.h
+ This module contains the abstract interface for the OpenMAX components.
+
+*//*========================================================================*/
+
+#ifndef QC_OMX_COMPONENT_H
+#define QC_OMX_COMPONENT_H
+//////////////////////////////////////////////////////////////////////////////
+// Include Files
+//////////////////////////////////////////////////////////////////////////////
+#include "OMX_Core.h"
+#include "OMX_Component.h"
+
+class qc_omx_component
+{
+
+public:
+ /* single member to hold the vtable */
+ OMX_COMPONENTTYPE m_cmp;
+
+public:
+
+ // this is critical, otherwise, sub class destructor will not be called
+ virtual ~qc_omx_component(){}
+
+ // Initialize the component after creation
+ virtual OMX_ERRORTYPE component_init(OMX_IN OMX_STRING componentName)=0;
+
+ /*******************************************************************/
+ /* Standard OpenMAX Methods */
+ /*******************************************************************/
+
+ // Query the component for its information
+ virtual
+ OMX_ERRORTYPE get_component_version(OMX_HANDLETYPE cmp_handle,
+ OMX_STRING cmp_name,
+ OMX_VERSIONTYPE* cmp_version,
+ OMX_VERSIONTYPE* spec_version,
+ OMX_UUIDTYPE* cmp_UUID)=0;
+
+ // Invoke a command on the component
+ virtual
+ OMX_ERRORTYPE send_command(OMX_HANDLETYPE cmp_handle,
+ OMX_COMMANDTYPE cmd,
+ OMX_U32 param1,
+ OMX_PTR cmd_data)=0;
+
+ // Get a Parameter setting from the component
+ virtual
+ OMX_ERRORTYPE get_parameter(OMX_HANDLETYPE cmp_handle,
+ OMX_INDEXTYPE param_index,
+ OMX_PTR param_data)=0;
+
+ // Send a parameter structure to the component
+ virtual
+ OMX_ERRORTYPE set_parameter(OMX_HANDLETYPE cmp_handle,
+ OMX_INDEXTYPE param_index,
+ OMX_PTR param_data)=0;
+
+ // Get a configuration structure from the component
+ virtual
+ OMX_ERRORTYPE get_config(OMX_HANDLETYPE cmp_handle,
+ OMX_INDEXTYPE config_index,
+ OMX_PTR config_data)=0;
+
+ // Set a component configuration value
+ virtual
+ OMX_ERRORTYPE set_config(OMX_HANDLETYPE cmp_handle,
+ OMX_INDEXTYPE config_index,
+ OMX_PTR config_data)=0;
+
+ // Translate the vendor specific extension string to
+ // standardized index type
+ virtual
+ OMX_ERRORTYPE get_extension_index(OMX_HANDLETYPE cmp_handle,
+ OMX_STRING paramName,
+ OMX_INDEXTYPE* indexType)=0;
+
+ // Get Current state information
+ virtual
+ OMX_ERRORTYPE get_state(OMX_HANDLETYPE cmp_handle,
+ OMX_STATETYPE* state)=0;
+
+ // Component Tunnel Request
+ virtual
+ OMX_ERRORTYPE component_tunnel_request(OMX_HANDLETYPE cmp_handle,
+ OMX_U32 port,
+ OMX_HANDLETYPE peer_component,
+ OMX_U32 peer_port,
+ OMX_TUNNELSETUPTYPE* tunnel_setup)=0;
+
+ // Use a buffer already allocated by the IL client
+ // or a buffer already supplied by a tunneled component
+ virtual
+ OMX_ERRORTYPE use_buffer(OMX_HANDLETYPE cmp_handle,
+ OMX_BUFFERHEADERTYPE** buffer_hdr,
+ OMX_U32 port,
+ OMX_PTR app_data,
+ OMX_U32 bytes,
+ OMX_U8* buffer)=0;
+
+
+ // Request that the component allocate new buffer and associated header
+ virtual
+ OMX_ERRORTYPE allocate_buffer(OMX_HANDLETYPE cmp_handle,
+ OMX_BUFFERHEADERTYPE** buffer_hdr,
+ OMX_U32 port,
+ OMX_PTR app_data,
+ OMX_U32 bytes)=0;
+
+ // Release the buffer and associated header from the component
+ virtual
+ OMX_ERRORTYPE free_buffer(OMX_HANDLETYPE cmp_handle,
+ OMX_U32 port,
+ OMX_BUFFERHEADERTYPE* buffer)=0;
+
+ // Send a filled buffer to an input port of a component
+ virtual
+ OMX_ERRORTYPE empty_this_buffer(OMX_HANDLETYPE cmp_handle,
+ OMX_BUFFERHEADERTYPE* buffer)=0;
+
+ // Send an empty buffer to an output port of a component
+ virtual
+ OMX_ERRORTYPE fill_this_buffer(OMX_HANDLETYPE cmp_handle,
+ OMX_BUFFERHEADERTYPE* buffer)=0;
+
+ // Set callbacks
+ virtual
+ OMX_ERRORTYPE set_callbacks( OMX_HANDLETYPE cmp_handle,
+ OMX_CALLBACKTYPE* callbacks,
+ OMX_PTR app_data)=0;
+
+ // Component De-Initialize
+ virtual
+ OMX_ERRORTYPE component_deinit( OMX_HANDLETYPE cmp_handle)=0;
+
+ // Use the Image already allocated via EGL
+ virtual
+ OMX_ERRORTYPE use_EGL_image(OMX_HANDLETYPE cmp_handle,
+ OMX_BUFFERHEADERTYPE** buffer_hdr,
+ OMX_U32 port,
+ OMX_PTR app_data,
+ void* egl_image)=0;
+
+ // Component Role enum
+ virtual
+ OMX_ERRORTYPE component_role_enum( OMX_HANDLETYPE cmp_handle,
+ OMX_U8* role,
+ OMX_U32 index)=0;
+
+};
+#endif /* QC_OMX_COMPONENT_H */
diff --git a/mm-core/omxcore/inc/qc_omx_msg.h b/mm-core/omxcore/inc/qc_omx_msg.h
new file mode 100644
index 0000000..af8b7e7
--- /dev/null
+++ b/mm-core/omxcore/inc/qc_omx_msg.h
@@ -0,0 +1,58 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*==========================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+*//** @file qc_omx_msg.h
+ This module contains the definitions of the OpenMAX core.
+
+*//*========================================================================*/
+
+#ifndef _QC_OMX_MSG_H_
+#define _QC_OMX_MSG_H_
+
+#ifdef _ENABLE_QC_MSG_LOG_
+ #ifdef _ANDROID_
+ #include <utils/Log.h>
+ #define DEBUG_PRINT_ERROR ALOGE
+ #define DEBUG_PRINT ALOGI
+ #define DEBUG_DETAIL ALOGV
+ #else
+ #define DEBUG_PRINT_ERROR printf
+ #define DEBUG_PRINT printf
+ #define DEBUG_DETAIL printf
+ #endif // _ANDROID_
+#else
+ #define DEBUG_PRINT_ERROR
+ #define DEBUG_PRINT
+ #define DEBUG_DETAIL
+#endif // _ENABLE_QC_MSG_LOG_
+
+
+#endif // _QC_OMX_MSG_H_
diff --git a/mm-core/src/7630/qc_registry_table.c b/mm-core/omxcore/src/7630/qc_registry_table.c
index eb53d90..f764420 100644
--- a/mm-core/src/7630/qc_registry_table.c
+++ b/mm-core/omxcore/src/7630/qc_registry_table.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009,2012 The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -48,7 +48,11 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVdec.so",
+ #else
+ "libmm-vdec-omxh264.so.1",
+ #endif
{
"video_decoder.avc"
}
@@ -64,7 +68,11 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVdec.so",
+ #else
+ "libmm-vdec-omxmp4.so.1",
+ #endif
{
"video_decoder.mpeg4"
}
@@ -80,7 +88,11 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVdec.so",
+ #else
+ "libmm-vdec-omxwmv.so.1",
+ #endif
{
"video_decoder.vc1"
}
@@ -96,44 +108,16 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVdec.so",
+ #else
+ "libmm-vdec-omxmp4.so.1",
+ #endif
{
"video_decoder.h263"
}
},
{
- "OMX.qcom.video.decoder.divx4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
"OMX.qcom.video.encoder.mpeg4",
NULL, // Create instance function
// Unique instance handle
@@ -144,7 +128,11 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVenc.so",
+ #else
+ "libmm-venc-omx.so.1",
+ #endif
{
"video_encoder.mpeg4"
}
@@ -160,7 +148,11 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVenc.so",
+ #else
+ "libmm-venc-omx.so.1",
+ #endif
{
"video_encoder.h263",
}
@@ -176,7 +168,11 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
+ #ifdef _ANDROID_
"libOmxVenc.so",
+ #else
+ "libmm-venc-omx.so.1",
+ #endif
{
"video_encoder.avc"
}
@@ -322,27 +318,7 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.audio.encoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- #ifdef _ANDROID_
- "libOmxAacEnc.so",
- #else
- "libmm-aenc-omxaac.so.1",
- #endif
- {
- "audio_encoder.aac"
- }
- },
- {
- "OMX.qcom.audio.decoder.Qcelp13Hw",
+ "OMX.qcom.audio.decoder.Qcelp13",
NULL, // Create instance function
// Unique instance handle
{
@@ -353,7 +329,7 @@ omx_core_cb_type core[] =
},
NULL, // Shared object library handle
#ifdef _ANDROID_
- "libOmxQcelpHwDec.so",
+ "libOmxQcelpDec.so",
#else
"libmm-adec-omxQcelp13.so.1",
#endif
@@ -361,26 +337,8 @@ omx_core_cb_type core[] =
"audio_decoder.Qcelp13"
}
},
-#ifdef _ANDROID_
{
- "OMX.qcom.audio.decoder.Qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
- {
- "audio_decoder.Qcelp13"
- }
- },
-#endif
- {
- "OMX.qcom.audio.decoder.tunneled.Qcelp13Hw",
+ "OMX.qcom.audio.decoder.tunneled.Qcelp13",
NULL, // Create instance function
// Unique instance handle
{
@@ -391,7 +349,7 @@ omx_core_cb_type core[] =
},
NULL, // Shared object library handle
#ifdef _ANDROID_
- "libOmxQcelpHwDec.so",
+ "libOmxQcelpDec.so",
#else
"libmm-adec-omxQcelp13.so.1",
#endif
@@ -640,26 +598,6 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.audio.encoder.qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- #ifdef _ANDROID_
- "libOmxQcelp13Enc.so",
- #else
- "libmm-aenc-omxqcelp13.so.1",
- #endif
- {
- "audio_encoder.qcelp13"
- }
- },
- {
"OMX.qcom.audio.encoder.tunneled.evrc",
NULL, // Create instance function
// Unique instance handle
@@ -680,26 +618,6 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.audio.encoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- #ifdef _ANDROID_
- "libOmxEvrcEnc.so",
- #else
- "libmm-aenc-omxevrc.so.1",
- #endif
- {
- "audio_encoder.evrc"
- }
- },
- {
"OMX.qcom.audio.decoder.adpcm",
NULL, // Create instance function
// Unique instance handle
diff --git a/mm-core/src/7630/qc_registry_table_android.c b/mm-core/omxcore/src/7630/qc_registry_table_android.c
index f7314d2..764aea8 100644
--- a/mm-core/src/7630/qc_registry_table_android.c
+++ b/mm-core/omxcore/src/7630/qc_registry_table_android.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009,2011 The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -35,7 +35,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "qc_omx_core.h"
-#include "drmplay_version.h"
omx_core_cb_type core[] =
{
@@ -88,22 +87,6 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.video.decoder.wmv",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
"OMX.qcom.video.decoder.h263",
NULL, // Create instance function
// Unique instance handle
@@ -119,38 +102,6 @@ omx_core_cb_type core[] =
"video_decoder.h263"
}
},
- {
- "OMX.qcom.video.decoder.divx4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
{
"OMX.qcom.video.encoder.mpeg4",
NULL, // Create instance function
@@ -210,7 +161,7 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
+ "libOmxQcelpDec.so",
{
"audio_decoder.Qcelp13"
}
@@ -247,79 +198,23 @@ omx_core_cb_type core[] =
"audio_decoder.amrwbp"
}
},
- {
- "drm.play" DRMPLAY_API_VERSION,
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libDrmPlay.so",
- {
- "drm.play" DRMPLAY_API_VERSION
- }
- },
- {
- "OMX.qcom.audio.decoder.wma",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.encoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- #ifdef _ANDROID_
- "libOmxEvrcEnc.so",
- #else
- "libmm-aenc-omxevrc.so.1",
- #endif
- {
- "audio_encoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.encoder.qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- #ifdef _ANDROID_
- "libOmxQcelp13Enc.so",
- #else
- "libmm-aenc-omxqcelp13.so.1",
- #endif
- {
- "audio_encoder.qcelp13"
- }
- },
#ifndef _ANDROID_
+ {
+ "OMX.qcom.audio.decoder.mp3",
+ NULL, // Create instance function
+ // Unique instance handle
+ {
+ NULL,
+ NULL,
+ NULL,
+ NULL
+ },
+ NULL, // Shared object library handle
+ "libOmxMp3Dec.so",
+ {
+ "audio_decoder.mp3"
+ }
+ },
{
"OMX.qcom.audio.decoder.aac",
NULL, // Create instance function
@@ -432,8 +327,8 @@ omx_core_cb_type core[] =
"audio_encoder.aac"
}
},
- {
- "OMX.qcom.audio.encoder.aac",
+ {
+ "OMX.qcom.audio.decoder.tunneled.Qcelp13",
NULL, // Create instance function
// Unique instance handle
{
@@ -443,13 +338,13 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libOmxAacEnc.so",
+ "libOmxQcelpDec.so",
{
- "audio_encoder.aac"
+ "audio_decoder.Qcelp13"
}
},
{
- "OMX.qcom.audio.decoder.tunneled.Qcelp13",
+ "OMX.qcom.audio.decoder.tunneled.evrc",
NULL, // Create instance function
// Unique instance handle
{
@@ -459,13 +354,13 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
+ "libOmxEvrcDec.so",
{
- "audio_decoder.Qcelp13"
+ "audio_decoder.evrc"
}
},
{
- "OMX.qcom.audio.decoder.tunneled.evrc",
+ "OMX.qcom.audio.encoder.tunneled.amr",
NULL, // Create instance function
// Unique instance handle
{
@@ -475,13 +370,13 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libOmxEvrcDec.so",
+ "libOmxAmrEnc.so",
{
- "audio_decoder.evrc"
+ "audio_encoder.amr"
}
},
{
- "OMX.qcom.audio.encoder.tunneled.amr",
+ "OMX.qcom.audio.decoder.wma",
NULL, // Create instance function
// Unique instance handle
{
@@ -491,9 +386,9 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libOmxAmrEnc.so",
+ "libOmxWmaDec.so",
{
- "audio_encoder.amr"
+ "audio_decoder.wma"
}
},
{
diff --git a/mm-core/omxcore/src/common/omx_core_cmp.cpp b/mm-core/omxcore/src/common/omx_core_cmp.cpp
new file mode 100644
index 0000000..a641743
--- /dev/null
+++ b/mm-core/omxcore/src/common/omx_core_cmp.cpp
@@ -0,0 +1,407 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+ This module contains the implementation of the OpenMAX core Macros which
+ operate directly on the component.
+
+*//*========================================================================*/
+
+//////////////////////////////////////////////////////////////////////////////
+// Include Files
+//////////////////////////////////////////////////////////////////////////////
+#include "qc_omx_common.h"
+#include "omx_core_cmp.h"
+#include "qc_omx_component.h"
+#include <string.h>
+
+
+void * qc_omx_create_component_wrapper(OMX_PTR obj_ptr)
+{
+ qc_omx_component *pThis = (qc_omx_component *)obj_ptr;
+ OMX_COMPONENTTYPE* component = &(pThis->m_cmp);
+ memset(&pThis->m_cmp,0,sizeof(OMX_COMPONENTTYPE));
+
+ component->nSize = sizeof(OMX_COMPONENTTYPE);
+ component->nVersion.nVersion = OMX_SPEC_VERSION;
+ component->pApplicationPrivate = 0;
+ component->pComponentPrivate = obj_ptr;
+
+ component->AllocateBuffer = &qc_omx_component_allocate_buffer;
+ component->FreeBuffer = &qc_omx_component_free_buffer;
+ component->GetParameter = &qc_omx_component_get_parameter;
+ component->SetParameter = &qc_omx_component_set_parameter;
+ component->SendCommand = &qc_omx_component_send_command;
+ component->FillThisBuffer = &qc_omx_component_fill_this_buffer;
+ component->EmptyThisBuffer = &qc_omx_component_empty_this_buffer;
+ component->GetState = &qc_omx_component_get_state;
+ component->GetComponentVersion = &qc_omx_component_get_version;
+ component->GetConfig = &qc_omx_component_get_config;
+ component->SetConfig = &qc_omx_component_set_config;
+ component->GetExtensionIndex = &qc_omx_component_get_extension_index;
+ component->ComponentTunnelRequest = &qc_omx_component_tunnel_request;
+ component->UseBuffer = &qc_omx_component_use_buffer;
+ component->SetCallbacks = &qc_omx_component_set_callbacks;
+ component->UseEGLImage = &qc_omx_component_use_EGL_image;
+ component->ComponentRoleEnum = &qc_omx_component_role_enum;
+ component->ComponentDeInit = &qc_omx_component_deinit;
+ return (void *)component;
+}
+
+
+
+/************************************************************************/
+/* COMPONENT INTERFACE */
+/************************************************************************/
+
+OMX_ERRORTYPE
+qc_omx_component_init(OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_STRING componentName)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_init %x\n",(unsigned)hComp);
+
+ if(pThis)
+ {
+ // call the init fuction
+ eRet = pThis->component_init(componentName);
+
+ if(eRet != OMX_ErrorNone)
+ {
+ // in case of error, please destruct the component created
+ delete pThis;
+ }
+ }
+ return eRet;
+}
+
+
+OMX_ERRORTYPE
+qc_omx_component_get_version(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_OUT OMX_STRING componentName,
+ OMX_OUT OMX_VERSIONTYPE* componentVersion,
+ OMX_OUT OMX_VERSIONTYPE* specVersion,
+ OMX_OUT OMX_UUIDTYPE* componentUUID)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_get_version %x, %s , %x\n",(unsigned)hComp,componentName,(unsigned)componentVersion);
+ if(pThis)
+ {
+ eRet = pThis->get_component_version(hComp,componentName,componentVersion,specVersion,componentUUID);
+ }
+ return eRet;
+}
+
+OMX_ERRORTYPE
+qc_omx_component_send_command(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_COMMANDTYPE cmd,
+ OMX_IN OMX_U32 param1,
+ OMX_IN OMX_PTR cmdData)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_send_command %x, %d , %d\n",(unsigned)hComp,(unsigned)cmd,(unsigned)param1);
+
+ if(pThis)
+ {
+ eRet = pThis->send_command(hComp,cmd,param1,cmdData);
+ }
+ return eRet;
+}
+
+OMX_ERRORTYPE
+qc_omx_component_get_parameter(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE paramIndex,
+ OMX_INOUT OMX_PTR paramData)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_get_parameter %x, %x , %d\n",(unsigned)hComp,(unsigned)paramData,paramIndex);
+
+ if(pThis)
+ {
+ eRet = pThis->get_parameter(hComp,paramIndex,paramData);
+ }
+ return eRet;
+}
+
+OMX_ERRORTYPE
+qc_omx_component_set_parameter(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE paramIndex,
+ OMX_IN OMX_PTR paramData)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_set_parameter %x, %x , %d\n",(unsigned)hComp,(unsigned)paramData,paramIndex);
+
+ if(pThis)
+ {
+ eRet = pThis->set_parameter(hComp,paramIndex,paramData);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_get_config(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE configIndex,
+ OMX_INOUT OMX_PTR configData)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_get_config %x\n",(unsigned)hComp);
+
+ if(pThis)
+ {
+ eRet = pThis->get_config(hComp,
+ configIndex,
+ configData);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_set_config(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE configIndex,
+ OMX_IN OMX_PTR configData)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_set_config %x\n",(unsigned)hComp);
+
+ if(pThis)
+ {
+ eRet = pThis->set_config(hComp,
+ configIndex,
+ configData);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_get_extension_index(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_STRING paramName,
+ OMX_OUT OMX_INDEXTYPE* indexType)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ if(pThis)
+ {
+ eRet = pThis->get_extension_index(hComp,paramName,indexType);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_get_state(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_OUT OMX_STATETYPE* state)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_get_state %x\n",(unsigned)hComp);
+
+ if(pThis)
+ {
+ eRet = pThis->get_state(hComp,state);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_tunnel_request(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_HANDLETYPE peerComponent,
+ OMX_IN OMX_U32 peerPort,
+ OMX_INOUT OMX_TUNNELSETUPTYPE* tunnelSetup)
+{
+ DEBUG_PRINT("Error: qc_omx_component_tunnel_request Not Implemented\n");
+ return OMX_ErrorNotImplemented;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_use_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_PTR appData,
+ OMX_IN OMX_U32 bytes,
+ OMX_IN OMX_U8* buffer)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_use_buffer %x\n",(unsigned)hComp);
+
+ if(pThis)
+ {
+ eRet = pThis->use_buffer(hComp,
+ bufferHdr,
+ port,
+ appData,
+ bytes,
+ buffer);
+ }
+ return eRet;
+}
+
+
+// qc_omx_component_allocate_buffer -- API Call
+ OMX_ERRORTYPE
+qc_omx_component_allocate_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_PTR appData,
+ OMX_IN OMX_U32 bytes)
+{
+
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_allocate_buffer %x, %x , %d\n",(unsigned)hComp,(unsigned)bufferHdr,(unsigned)port);
+
+ if(pThis)
+ {
+ eRet = pThis->allocate_buffer(hComp,bufferHdr,port,appData,bytes);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_free_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+{
+
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_free_buffer[%d] %x, %x\n", (unsigned)port, (unsigned)hComp, (unsigned)buffer);
+
+ if(pThis)
+ {
+ eRet = pThis->free_buffer(hComp,port,buffer);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_empty_this_buffer %x, %x\n",(unsigned)hComp,(unsigned)buffer);
+
+ if(pThis)
+ {
+ eRet = pThis->empty_this_buffer(hComp,buffer);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_fill_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_fill_this_buffer %x, %x\n",(unsigned)hComp,(unsigned)buffer);
+ if(pThis)
+ {
+ eRet = pThis->fill_this_buffer(hComp,buffer);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_set_callbacks(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_CALLBACKTYPE* callbacks,
+ OMX_IN OMX_PTR appData)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_set_callbacks %x, %x , %x\n",(unsigned)hComp,(unsigned)callbacks,(unsigned)appData);
+
+ if(pThis)
+ {
+ eRet = pThis->set_callbacks(hComp,callbacks,appData);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_deinit(OMX_IN OMX_HANDLETYPE hComp)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_deinit %x\n",(unsigned)hComp);
+
+ if(pThis)
+ {
+ // call the deinit fuction first
+ OMX_STATETYPE state;
+ pThis->get_state(hComp,&state);
+ DEBUG_PRINT("Calling FreeHandle in state %d \n", state);
+ eRet = pThis->component_deinit(hComp);
+ // destroy the component.
+ delete pThis;
+ ((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate = NULL;
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_use_EGL_image(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_PTR appData,
+ OMX_IN void* eglImage)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_use_EGL_image %x, %x , %d\n",(unsigned)hComp,(unsigned)bufferHdr,(unsigned)port);
+ if(pThis)
+ {
+ eRet = pThis->use_EGL_image(hComp,bufferHdr,port,appData,eglImage);
+ }
+ return eRet;
+}
+
+ OMX_ERRORTYPE
+qc_omx_component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_OUT OMX_U8* role,
+ OMX_IN OMX_U32 index)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorBadParameter;
+ qc_omx_component *pThis = (hComp)? (qc_omx_component *)(((OMX_COMPONENTTYPE *)hComp)->pComponentPrivate):NULL;
+ DEBUG_PRINT("OMXCORE: qc_omx_component_role_enum %x, %x , %d\n",(unsigned)hComp,(unsigned)role,(unsigned)index);
+
+ if(pThis)
+ {
+ eRet = pThis->component_role_enum(hComp,role,index);
+ }
+ return eRet;
+}
diff --git a/mm-core/omxcore/src/common/omx_core_cmp.h b/mm-core/omxcore/src/common/omx_core_cmp.h
new file mode 100644
index 0000000..1daf26e
--- /dev/null
+++ b/mm-core/omxcore/src/common/omx_core_cmp.h
@@ -0,0 +1,160 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+ OpenMAX Core Macros interface.
+
+============================================================================*/
+
+//////////////////////////////////////////////////////////////////////////////
+// Include Files
+//////////////////////////////////////////////////////////////////////////////
+#ifndef OMX_CORE_CMP_H
+#define OMX_CORE_CMP_H
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+void * qc_omx_create_component_wrapper(OMX_PTR obj_ptr);
+
+
+OMX_ERRORTYPE
+qc_omx_component_init(OMX_IN OMX_HANDLETYPE hComp, OMX_IN OMX_STRING componentName);
+
+
+OMX_ERRORTYPE
+qc_omx_component_get_version(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_OUT OMX_STRING componentName,
+ OMX_OUT OMX_VERSIONTYPE* componentVersion,
+ OMX_OUT OMX_VERSIONTYPE* specVersion,
+ OMX_OUT OMX_UUIDTYPE* componentUUID);
+
+OMX_ERRORTYPE
+qc_omx_component_send_command(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_COMMANDTYPE cmd,
+ OMX_IN OMX_U32 param1,
+ OMX_IN OMX_PTR cmdData);
+
+OMX_ERRORTYPE
+qc_omx_component_get_parameter(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE paramIndex,
+ OMX_INOUT OMX_PTR paramData);
+
+OMX_ERRORTYPE
+qc_omx_component_set_parameter(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE paramIndex,
+ OMX_IN OMX_PTR paramData);
+
+OMX_ERRORTYPE
+qc_omx_component_get_config(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE configIndex,
+ OMX_INOUT OMX_PTR configData);
+
+OMX_ERRORTYPE
+qc_omx_component_set_config(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_INDEXTYPE configIndex,
+ OMX_IN OMX_PTR configData);
+
+OMX_ERRORTYPE
+qc_omx_component_get_extension_index(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_STRING paramName,
+ OMX_OUT OMX_INDEXTYPE* indexType);
+
+OMX_ERRORTYPE
+qc_omx_component_get_state(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_OUT OMX_STATETYPE* state);
+
+OMX_ERRORTYPE
+qc_omx_component_tunnel_request(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_HANDLETYPE peerComponent,
+ OMX_IN OMX_U32 peerPort,
+ OMX_INOUT OMX_TUNNELSETUPTYPE* tunnelSetup);
+
+OMX_ERRORTYPE
+qc_omx_component_use_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_PTR appData,
+ OMX_IN OMX_U32 bytes,
+ OMX_IN OMX_U8* buffer);
+
+
+// qc_omx_component_allocate_buffer -- API Call
+OMX_ERRORTYPE
+qc_omx_component_allocate_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_PTR appData,
+ OMX_IN OMX_U32 bytes);
+
+OMX_ERRORTYPE
+qc_omx_component_free_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer);
+
+OMX_ERRORTYPE
+qc_omx_component_empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer);
+
+OMX_ERRORTYPE
+qc_omx_component_fill_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer);
+
+OMX_ERRORTYPE
+qc_omx_component_set_callbacks(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_CALLBACKTYPE* callbacks,
+ OMX_IN OMX_PTR appData);
+
+OMX_ERRORTYPE
+qc_omx_component_deinit(OMX_IN OMX_HANDLETYPE hComp);
+
+OMX_ERRORTYPE
+qc_omx_component_use_EGL_image(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
+ OMX_IN OMX_U32 port,
+ OMX_IN OMX_PTR appData,
+ OMX_IN void* eglImage);
+
+OMX_ERRORTYPE
+qc_omx_component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_OUT OMX_U8* role,
+ OMX_IN OMX_U32 index);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+
diff --git a/mm-core/omxcore/src/common/qc_omx_core.c b/mm-core/omxcore/src/common/qc_omx_core.c
new file mode 100644
index 0000000..d41397f
--- /dev/null
+++ b/mm-core/omxcore/src/common/qc_omx_core.c
@@ -0,0 +1,847 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+ This module contains the implementation of the OpenMAX core.
+
+*//*========================================================================*/
+
+//////////////////////////////////////////////////////////////////////////////
+// Include Files
+//////////////////////////////////////////////////////////////////////////////
+
+#include <dlfcn.h> // dynamic library
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdio.h>
+
+#include "qc_omx_core.h"
+#include "omx_core_cmp.h"
+
+#define DEBUG_PRINT_ERROR printf
+#define DEBUG_PRINT printf
+#define DEBUG_DETAIL printf
+
+extern omx_core_cb_type core[];
+extern const unsigned int SIZE_OF_CORE;
+
+
+/* ======================================================================
+FUNCTION
+ omx_core_load_cmp_library
+
+DESCRIPTION
+ Loads up the libary name mentioned in the argument
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Constructor for creating component instances.
+========================================================================== */
+static create_qc_omx_component
+omx_core_load_cmp_library(char *libname, void **handle_ptr)
+{
+ create_qc_omx_component fn_ptr = NULL;
+ if(handle_ptr)
+ {
+ DEBUG_PRINT("Dynamically Loading the library : %s\n",libname);
+ *handle_ptr = dlopen(libname,RTLD_NOW);
+ if(*handle_ptr)
+ {
+ fn_ptr = dlsym(*handle_ptr, "get_omx_component_factory_fn");
+
+ if(fn_ptr == NULL)
+ {
+ DEBUG_PRINT("Error: Library %s incompatible as QCOM OMX component loader - %s\n",
+ libname, dlerror());
+ *handle_ptr = NULL;
+ }
+ }
+ else
+ {
+ DEBUG_PRINT("Error: Couldn't load %s: %s\n",libname,dlerror());
+ }
+ }
+ return fn_ptr;
+}
+
+/* ======================================================================
+FUNCTION
+ OMX_Init
+
+DESCRIPTION
+ This is the first function called by the application.
+ There is nothing to do here since components shall be loaded
+ whenever the get handle method is called.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY
+OMX_Init()
+{
+ DEBUG_PRINT("OMXCORE API - OMX_Init \n");
+ /* Nothing to do here ; shared objects shall be loaded at the get handle method */
+ return OMX_ErrorNone;
+}
+
+/* ======================================================================
+FUNCTION
+ get_cmp_index
+
+DESCRIPTION
+ Obtains the index associated with the name.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Error None.
+========================================================================== */
+static int get_cmp_index(char *cmp_name)
+{
+ int rc = -1,i=0;
+ DEBUG_PRINT("before get_cmp_index **********%d\n", rc);
+
+ for(i=0; i< (int)SIZE_OF_CORE; i++)
+ {
+ DEBUG_PRINT("get_cmp_index: cmp_name = %s , core[i].name = %s ,count = %d \n",cmp_name,core[i].name,i);
+
+ if(!strcmp(cmp_name, core[i].name))
+ {
+ rc = i;
+ break;
+ }
+ }
+ DEBUG_PRINT("returning index %d\n", rc);
+ return rc;
+}
+
+/* ======================================================================
+FUNCTION
+ clear_cmp_handle
+
+DESCRIPTION
+ Clears the component handle from the component table.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+static void clear_cmp_handle(OMX_HANDLETYPE inst)
+{
+ unsigned i = 0,j=0;
+
+ if(NULL == inst)
+ return;
+
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ for(j=0; j< OMX_COMP_MAX_INST; j++)
+ {
+ if(inst == core[i].inst[j])
+ {
+ core[i].inst[j] = NULL;
+ return;
+ }
+ }
+ }
+ return;
+}
+/* ======================================================================
+FUNCTION
+ is_cmp_handle_exists
+
+DESCRIPTION
+ Check if the component handle already exists or not.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ index pointer if the handle exists
+ negative value otherwise
+========================================================================== */
+static int is_cmp_handle_exists(OMX_HANDLETYPE inst)
+{
+ unsigned i=0,j=0;
+ int rc = -1;
+
+ if(NULL == inst)
+ return rc;
+
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ for(j=0; j< OMX_COMP_MAX_INST; j++)
+ {
+ if(inst == core[i].inst[j])
+ {
+ rc = i;
+ return rc;
+ }
+ }
+ }
+ return rc;
+}
+
+/* ======================================================================
+FUNCTION
+ get_comp_handle_index
+
+DESCRIPTION
+ Gets the index to store the next handle for specified component name.
+
+PARAMETERS
+ cmp_name : Component Name
+
+RETURN VALUE
+ Index of next handle to be stored
+========================================================================== */
+static int get_comp_handle_index(char *cmp_name)
+{
+ unsigned i=0,j=0;
+ int rc = -1;
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ if(!strcmp(cmp_name, core[i].name))
+ {
+ for(j=0; j< OMX_COMP_MAX_INST; j++)
+ {
+ if(NULL == core[i].inst[j])
+ {
+ rc = j;
+ DEBUG_PRINT("free handle slot exists %d\n", rc);
+ return rc;
+ }
+ }
+ break;
+ }
+ }
+ return rc;
+}
+
+/* ======================================================================
+FUNCTION
+ check_lib_unload
+
+DESCRIPTION
+ Check if any component instance is using the library
+
+PARAMETERS
+ index: Component Index in core array.
+
+RETURN VALUE
+ 1: Library Unused and can be unloaded.
+ 0: Library used and shouldnt be unloaded.
+========================================================================== */
+static int check_lib_unload(int index)
+{
+ unsigned i=0;
+ int rc = 1;
+
+ for(i=0; i< OMX_COMP_MAX_INST; i++)
+ {
+ if(core[index].inst[i])
+ {
+ rc = 0;
+ DEBUG_PRINT("Library Used \n");
+ break;
+ }
+ }
+ return rc;
+}
+/* ======================================================================
+FUNCTION
+ is_cmp_already_exists
+
+DESCRIPTION
+ Check if the component already exists or not. Used in the
+ management of component handles.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Error None.
+========================================================================== */
+static int is_cmp_already_exists(char *cmp_name)
+{
+ unsigned i =0,j=0;
+ int rc = -1;
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ if(!strcmp(cmp_name, core[i].name))
+ {
+ for(j=0; j< OMX_COMP_MAX_INST; j++)
+ {
+ if(core[i].inst[j])
+ {
+ rc = i;
+ DEBUG_PRINT("Component exists %d\n", rc);
+ return rc;
+ }
+ }
+ break;
+ }
+ }
+ return rc;
+}
+
+/* ======================================================================
+FUNCTION
+ get_cmp_handle
+
+DESCRIPTION
+ Get component handle.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Error None.
+========================================================================== */
+void* get_cmp_handle(char *cmp_name)
+{
+ unsigned i =0,j=0;
+
+ DEBUG_PRINT("get_cmp_handle \n");
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ if(!strcmp(cmp_name, core[i].name))
+ {
+ for(j=0; j< OMX_COMP_MAX_INST; j++)
+ {
+ if(core[i].inst[j])
+ {
+ DEBUG_PRINT("get_cmp_handle match\n");
+ return core[i].inst[j];
+ }
+ }
+ }
+ }
+ DEBUG_PRINT("get_cmp_handle returning NULL \n");
+ return NULL;
+}
+
+/* ======================================================================
+FUNCTION
+ OMX_DeInit
+
+DESCRIPTION
+ DeInitialize all the the relevant OMX components.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Error None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY
+OMX_Deinit()
+{
+ int err;
+ unsigned i=0,j=0;
+ OMX_ERRORTYPE eRet;
+
+ /* Free the dangling handles here if any */
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ for(j=0; j< OMX_COMP_MAX_INST; j++)
+ {
+ if(core[i].inst[j])
+ {
+ DEBUG_PRINT("OMX DeInit: Freeing handle for %s\n",
+ core[i].name);
+
+ /* Release the component and unload dynmaic library */
+ eRet = OMX_FreeHandle(core[i].inst[j]);
+ if(eRet != OMX_ErrorNone)
+ return eRet;
+ }
+ }
+ }
+ return OMX_ErrorNone;
+}
+
+/* ======================================================================
+FUNCTION
+ OMX_GetHandle
+
+DESCRIPTION
+ Constructs requested component. Relevant library is loaded if needed.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Error None if everything goes fine.
+========================================================================== */
+
+ OMX_API OMX_ERRORTYPE OMX_APIENTRY
+OMX_GetHandle(OMX_OUT OMX_HANDLETYPE* handle,
+ OMX_IN OMX_STRING componentName,
+ OMX_IN OMX_PTR appData,
+ OMX_IN OMX_CALLBACKTYPE* callBacks)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ int cmp_index = -1;
+ int hnd_index = -1;
+
+ DEBUG_PRINT("OMXCORE API : Get Handle %x %s %x\n",(unsigned) handle,
+ componentName,
+ (unsigned) appData);
+ if(handle)
+ {
+ struct stat sd;
+
+ *handle = NULL;
+ if(stat("/dev/pmem_adsp",&sd) != 0)
+ return OMX_ErrorInsufficientResources;
+
+ cmp_index = get_cmp_index(componentName);
+
+ if(cmp_index >= 0)
+ {
+ DEBUG_PRINT("getting fn pointer\n");
+
+ // dynamically load the so
+ core[cmp_index].fn_ptr =
+ omx_core_load_cmp_library(core[cmp_index].so_lib_name,
+ &core[cmp_index].so_lib_handle);
+
+ if(core[cmp_index].fn_ptr)
+ {
+ // Construct the component requested
+ // Function returns the opaque handle
+ void* pThis = (*(core[cmp_index].fn_ptr))();
+ if(pThis)
+ {
+ void *hComp = NULL;
+ hComp = qc_omx_create_component_wrapper((OMX_PTR)pThis);
+ if((eRet = qc_omx_component_init(hComp, core[cmp_index].name)) !=
+ OMX_ErrorNone)
+ {
+ DEBUG_PRINT("Component not created succesfully\n");
+ return eRet;
+
+ }
+ qc_omx_component_set_callbacks(hComp,callBacks,appData);
+ hnd_index = get_comp_handle_index(componentName);
+ if(hnd_index >= 0)
+ {
+ core[cmp_index].inst[hnd_index]= *handle = (OMX_HANDLETYPE) hComp;
+ }
+ else
+ {
+ DEBUG_PRINT("OMX_GetHandle:NO free slot available to store Component Handle\n");
+ return OMX_ErrorInsufficientResources;
+ }
+ DEBUG_PRINT("Component %x Successfully created\n",(unsigned)*handle);
+ }
+ else
+ {
+ eRet = OMX_ErrorInsufficientResources;
+ DEBUG_PRINT("Component Creation failed\n");
+ }
+ }
+ else
+ {
+ eRet = OMX_ErrorNotImplemented;
+ DEBUG_PRINT("library couldnt return create instance fn\n");
+ }
+
+ }
+ else
+ {
+ eRet = OMX_ErrorNotImplemented;
+ DEBUG_PRINT("ERROR: Already another instance active ;rejecting \n");
+ }
+ }
+ else
+ {
+ eRet = OMX_ErrorBadParameter;
+ DEBUG_PRINT("\n OMX_GetHandle: NULL handle \n");
+ }
+ return eRet;
+}
+/* ======================================================================
+FUNCTION
+ OMX_FreeHandle
+
+DESCRIPTION
+ Destructs the component handles.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ Error None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY
+OMX_FreeHandle(OMX_IN OMX_HANDLETYPE hComp)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ int err = 0, i = 0;
+ DEBUG_PRINT("OMXCORE API : Free Handle %x\n",(unsigned) hComp);
+
+ // 0. Check that we have an active instance
+ if((i=is_cmp_handle_exists(hComp)) >=0)
+ {
+ // 1. Delete the component
+ if ((eRet = qc_omx_component_deinit(hComp)) == OMX_ErrorNone)
+ {
+ /* Unload component library */
+ if( ((unsigned int)i < SIZE_OF_CORE) && core[i].so_lib_handle)
+ {
+ if(check_lib_unload(i))
+ {
+ DEBUG_PRINT_ERROR(" Unloading the dynamic library for %s\n",
+ core[i].name);
+ err = dlclose(core[i].so_lib_handle);
+ if(err)
+ {
+ DEBUG_PRINT_ERROR("Error %d in dlclose of lib %s\n",
+ err,core[i].name);
+ }
+ core[i].so_lib_handle = NULL;
+ }
+ }
+ clear_cmp_handle(hComp);
+ }
+ else
+ {
+ DEBUG_PRINT(" OMX_FreeHandle failed on %x\n",(unsigned) hComp);
+ return eRet;
+ }
+ }
+ else
+ {
+ DEBUG_PRINT_ERROR("OMXCORE Warning: Free Handle called with no active instances\n");
+ }
+ return OMX_ErrorNone;
+}
+/* ======================================================================
+FUNCTION
+ OMX_SetupTunnel
+
+DESCRIPTION
+ Not Implemented.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY
+OMX_SetupTunnel(OMX_IN OMX_HANDLETYPE outputComponent,
+ OMX_IN OMX_U32 outputPort,
+ OMX_IN OMX_HANDLETYPE inputComponent,
+ OMX_IN OMX_U32 inputPort)
+{
+ /* Not supported right now */
+ DEBUG_PRINT("OMXCORE API: OMX_SetupTunnel Not implemented \n");
+ return OMX_ErrorNotImplemented;
+}
+/* ======================================================================
+FUNCTION
+ OMX_GetContentPipe
+
+DESCRIPTION
+ Not Implemented.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE
+OMX_GetContentPipe(OMX_OUT OMX_HANDLETYPE* pipe,
+ OMX_IN OMX_STRING uri)
+{
+ /* Not supported right now */
+ DEBUG_PRINT("OMXCORE API: OMX_GetContentPipe Not implemented \n");
+ return OMX_ErrorNotImplemented;
+}
+
+/* ======================================================================
+FUNCTION
+ OMX_GetComponentNameEnum
+
+DESCRIPTION
+ Returns the component name associated with the index.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE OMX_APIENTRY
+OMX_ComponentNameEnum(OMX_OUT OMX_STRING componentName,
+ OMX_IN OMX_U32 nameLen,
+ OMX_IN OMX_U32 index)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ DEBUG_PRINT("OMXCORE API - OMX_ComponentNameEnum %x %d %d\n",(unsigned) componentName
+ ,(unsigned)nameLen
+ ,(unsigned)index);
+ if(index < SIZE_OF_CORE)
+ {
+ #ifdef _ANDROID_
+ strlcpy(componentName, core[index].name,nameLen);
+ #else
+ strncpy(componentName, core[index].name,nameLen);
+ #endif
+ }
+ else
+ {
+ eRet = OMX_ErrorNoMore;
+ }
+ return eRet;
+}
+
+/* ======================================================================
+FUNCTION
+ OMX_GetComponentsOfRole
+
+DESCRIPTION
+ Returns the component name which can fulfill the roles passed in the
+ argument.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE
+OMX_GetComponentsOfRole(OMX_IN OMX_STRING role,
+ OMX_INOUT OMX_U32* numComps,
+ OMX_INOUT OMX_U8** compNames)
+{
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ unsigned i,j,namecount=0;
+
+ printf(" Inside OMX_GetComponentsOfRole \n");
+
+ /*If CompNames is NULL then return*/
+ if (compNames == NULL)
+ {
+ if (numComps == NULL)
+ {
+ eRet = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ *numComps = 0;
+ for (i=0; i<SIZE_OF_CORE;i++)
+ {
+ for(j=0; j<OMX_CORE_MAX_CMP_ROLES && core[i].roles[j] ; j++)
+ {
+ if(!strcmp(role,core[i].roles[j]))
+ {
+ (*numComps)++;
+ }
+ }
+ }
+ }
+ return eRet;
+ }
+
+ if(numComps)
+ {
+ namecount = *numComps;
+
+ if (namecount == 0)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ *numComps = 0;
+
+ for (i=0; i<SIZE_OF_CORE;i++)
+ {
+ for(j=0; j<OMX_CORE_MAX_CMP_ROLES && core[i].roles[j] ; j++)
+ {
+ if(!strcmp(role,core[i].roles[j]))
+ {
+ #ifdef _ANDROID_
+ strlcpy((char *)compNames[*numComps],core[i].name, OMX_MAX_STRINGNAME_SIZE);
+ #else
+ strncpy((char *)compNames[*numComps],core[i].name, OMX_MAX_STRINGNAME_SIZE);
+ #endif
+ (*numComps)++;
+ break;
+ }
+ }
+ if (*numComps == namecount)
+ {
+ break;
+ }
+ }
+ }
+ else
+ {
+ eRet = OMX_ErrorBadParameter;
+ }
+
+ printf(" Leaving OMX_GetComponentsOfRole \n");
+ return eRet;
+}
+/* ======================================================================
+FUNCTION
+ OMX_GetRolesOfComponent
+
+DESCRIPTION
+ Returns the primary role of the components supported.
+
+PARAMETERS
+ None
+
+RETURN VALUE
+ None.
+========================================================================== */
+OMX_API OMX_ERRORTYPE
+OMX_GetRolesOfComponent(OMX_IN OMX_STRING compName,
+ OMX_INOUT OMX_U32* numRoles,
+ OMX_OUT OMX_U8** roles)
+{
+ /* Not supported right now */
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ unsigned i,j,numofroles = 0;;
+ DEBUG_PRINT("GetRolesOfComponent %s\n",compName);
+
+ if (roles == NULL)
+ {
+ if (numRoles == NULL)
+ {
+ eRet = OMX_ErrorBadParameter;
+ }
+ else
+ {
+ *numRoles = 0;
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ if(!strcmp(compName,core[i].name))
+ {
+ for(j=0; (j<OMX_CORE_MAX_CMP_ROLES) && core[i].roles[j];j++)
+ {
+ (*numRoles)++;
+ }
+ break;
+ }
+ }
+
+ }
+ return eRet;
+ }
+
+ if(numRoles)
+ {
+ if (*numRoles == 0)
+ {
+ return OMX_ErrorBadParameter;
+ }
+
+ numofroles = *numRoles;
+ *numRoles = 0;
+ for(i=0; i< SIZE_OF_CORE; i++)
+ {
+ if(!strcmp(compName,core[i].name))
+ {
+ for(j=0; (j<OMX_CORE_MAX_CMP_ROLES) && core[i].roles[j];j++)
+ {
+ if(roles && roles[*numRoles])
+ {
+ #ifdef _ANDROID_
+ strlcpy((char *)roles[*numRoles],core[i].roles[j],OMX_MAX_STRINGNAME_SIZE);
+ #else
+ strncpy((char *)roles[*numRoles],core[i].roles[j],OMX_MAX_STRINGNAME_SIZE);
+ #endif
+ }
+ (*numRoles)++;
+ if (numofroles == *numRoles)
+ {
+ break;
+ }
+ }
+ break;
+ }
+ }
+ }
+ else
+ {
+ DEBUG_PRINT("ERROR: Both Roles and numRoles Invalid\n");
+ eRet = OMX_ErrorBadParameter;
+ }
+ return eRet;
+}
+
+OMX_API OMX_BOOL
+OMXConfigParser(
+ OMX_PTR aInputParameters,
+ OMX_PTR aOutputParameters)
+{
+ OMX_BOOL Status = OMX_TRUE;
+ VideoOMXConfigParserOutputs *aOmxOutputParameters;
+ OMXConfigParserInputs *aOmxInputParameters;
+ aOmxOutputParameters = (VideoOMXConfigParserOutputs *)aOutputParameters;
+ aOmxInputParameters = (OMXConfigParserInputs *)aInputParameters;
+
+ aOmxOutputParameters->width = 176; //setting width to QCIF
+ aOmxOutputParameters->height = 144; //setting height to QCIF
+
+ //TODO
+ //Qcom component do not use the level/profile from IL client .They are parsing the first buffer
+ //sent in ETB so for now setting the defalut values . Going farward we can call
+ //QC parser here.
+ if (0 == strcmp(aOmxInputParameters->cComponentRole, (OMX_STRING)"video_decoder.avc"))
+ {
+ aOmxOutputParameters->profile = 66; //minimum supported h264 profile - setting to baseline profile
+ aOmxOutputParameters->level = 0; // minimum supported h264 level
+ }
+ else if ((0 == strcmp(aOmxInputParameters->cComponentRole, (OMX_STRING)"video_decoder.mpeg4")) || (0 == strcmp(aOmxInputParameters ->cComponentRole, (OMX_STRING)"video_decoder.h263")))
+ {
+ aOmxOutputParameters->profile = 8; //minimum supported h263/mpeg4 profile
+ aOmxOutputParameters->level = 0; // minimum supported h263/mpeg4 level
+ }
+
+ return Status;
+}
diff --git a/mm-core/omxcore/src/common/qc_omx_core.h b/mm-core/omxcore/src/common/qc_omx_core.h
new file mode 100644
index 0000000..c3ae26a
--- /dev/null
+++ b/mm-core/omxcore/src/common/qc_omx_core.h
@@ -0,0 +1,72 @@
+/*--------------------------------------------------------------------------
+Copyright (c) 2009, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ O p e n M A X w r a p p e r s
+ O p e n M A X C o r e
+
+ This module contains the definitions of the OpenMAX core.
+
+*//*========================================================================*/
+
+#ifndef QC_OMX_CORE_H
+#define QC_OMX_CORE_H
+
+#include "qc_omx_common.h" // OMX API
+#include <string.h>
+
+#define OMX_COMP_MAX_INST 4
+
+typedef struct _omx_core_cb_type
+{
+ char* name;// Component name
+ create_qc_omx_component fn_ptr;// create instance fn ptr
+ void* inst[OMX_COMP_MAX_INST];// Instance handle
+ void* so_lib_handle;// So Library handle
+ char* so_lib_name;// so directory
+ char* roles[OMX_CORE_MAX_CMP_ROLES];// roles played
+}omx_core_cb_type;
+
+typedef struct
+{
+ OMX_U32 width;
+ OMX_U32 height;
+ OMX_U32 profile;
+ OMX_U32 level;
+} VideoOMXConfigParserOutputs;
+
+
+typedef struct
+{
+ OMX_U8* inPtr; //pointer to codec configuration header
+ OMX_U32 inBytes; //length of codec configuration header
+ OMX_STRING cComponentRole; //OMX component codec type
+ OMX_STRING cComponentName; //OMX component name
+} OMXConfigParserInputs;
+
+#endif
+
diff --git a/mm-core/src/7627A/qc_registry_table.c b/mm-core/src/7627A/qc_registry_table.c
index aa65c1a..ad0d83e 100644
--- a/mm-core/src/7627A/qc_registry_table.c
+++ b/mm-core/src/7627A/qc_registry_table.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2011-2012 The Linux Foundation. All rights reserved.
+Copyright (c) 2011,2012 Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -773,38 +773,6 @@ omx_core_cb_type core[] =
"audio_encoder.evrc"
}
},
- {
- "OMX.qcom.audio.decoder.ac3",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAc3HwDec.so",
- {
- "audio_decoder.ac3"
- }
- },
- {
- "OMX.qcom.audio.decoder.eac3",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAc3HwDec.so",
- {
- "audio_decoder.eac3"
- }
- },
};
const unsigned int SIZE_OF_CORE = sizeof(core) / sizeof(omx_core_cb_type);
diff --git a/mm-core/src/7627A/qc_registry_table_android.c b/mm-core/src/7627A/qc_registry_table_android.c
index af55f50..5cfb6f4 100644
--- a/mm-core/src/7627A/qc_registry_table_android.c
+++ b/mm-core/src/7627A/qc_registry_table_android.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2011-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -478,38 +478,6 @@ omx_core_cb_type core[] =
"audio_encoder.qcelp13"
}
},
- {
- "OMX.qcom.audio.decoder.ac3",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAc3HwDec.so",
- {
- "audio_decoder.ac3"
- }
- },
- {
- "OMX.qcom.audio.decoder.eac3",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAc3HwDec.so",
- {
- "audio_decoder.eac3"
- }
- },
#ifndef _ANDROID_
{
"OMX.qcom.audio.decoder.amrnb",
diff --git a/mm-core/src/8226/qc_registry_table.c b/mm-core/src/8226/qc_registry_table.c
deleted file mode 100644
index fc1dad0..0000000
--- a/mm-core/src/8226/qc_registry_table.c
+++ /dev/null
@@ -1,447 +0,0 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2013, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
-
---------------------------------------------------------------------------*/
-/*============================================================================
- O p e n M A X w r a p p e r s
- O p e n M A X C o r e
-
- This module contains the registry table for the QCOM's OpenMAX core.
-
-*//*========================================================================*/
-
-#include "qc_omx_core.h"
-
-omx_core_cb_type core[] =
-{
- {
- "OMX.qcom.video.decoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.avc"
- }
- },
- {
- "OMX.qcom.video.decoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.decoder.vc1",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.video.decoder.wmv",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.file.muxer",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
-
- "libOmxMux.so",
- {
- "container_muxer.mp2"
- }
- },
- {
- "OMX.qcom.video.decoder.divx4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx311",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.h263"
- }
- },
- {
- "OMX.qcom.video.decoder.vp8",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vp8"
- }
- },
- {
- "OMX.qcom.video.encoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.encoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.h263",
- }
- },
- {
- "OMX.qcom.video.encoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.avc"
- }
- },
-{
- "OMX.qcom.video.encoder.vp8",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.vp8",
- }
- },
- {
- "OMX.qcom.audio.decoder.Qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
- {
- "audio_decoder.Qcelp13"
- }
- },
- {
- "OMX.qcom.audio.decoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcDec.so",
- {
- "audio_decoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma10Pro",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacEnc.so",
- {
- "audio_encoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Enc.so",
- {
- "audio_encoder.qcelp13"
- }
- },
- {
- "OMX.qcom.audio.encoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcEnc.so",
- {
- "audio_encoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.encoder.amrnb",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAmrEnc.so",
- {
- "audio_encoder.amrnb"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.decoder.multiaac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
-};
-
-const unsigned int SIZE_OF_CORE = sizeof(core) / sizeof(omx_core_cb_type);
-
-
diff --git a/mm-core/src/8226/qc_registry_table_android.c b/mm-core/src/8226/qc_registry_table_android.c
deleted file mode 100644
index f6adc73..0000000
--- a/mm-core/src/8226/qc_registry_table_android.c
+++ /dev/null
@@ -1,495 +0,0 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2013, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
-
---------------------------------------------------------------------------*/
-/*============================================================================
- O p e n M A X w r a p p e r s
- O p e n M A X C o r e
-
- This module contains the registry table for the QCOM's OpenMAX core.
-
-*//*========================================================================*/
-
-
-#include "qc_omx_core.h"
-
-omx_core_cb_type core[] =
-{
- {
- "OMX.qcom.video.decoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.avc"
- }
- },
- {
- "OMX.qcom.video.decoder.avc.secure",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.avc"
- }
- },
- {
- "OMX.qcom.video.decoder.divx4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx311",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.decoder.mpeg2",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.mpeg2"
- }
- },
- {
- "OMX.qcom.video.decoder.vc1",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.video.decoder.wmv",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.video.decoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.h263"
- }
- },
-{
- "OMX.qcom.video.decoder.vp8",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vp8"
- }
- },
- {
- "OMX.qcom.video.encoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.encoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.h263"
- }
- },
- {
- "OMX.qcom.video.encoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.avc"
- }
- },
-{
- "OMX.qcom.video.encoder.vp8",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.vp8"
- }
- },
- {
- "OMX.qcom.audio.decoder.Qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
- {
- "audio_decoder.Qcelp13"
- }
- },
- {
- "OMX.qcom.audio.decoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcDec.so",
- {
- "audio_decoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma10Pro",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacEnc.so",
- {
- "audio_encoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Enc.so",
- {
- "audio_encoder.qcelp13"
- }
- },
- {
- "OMX.qcom.audio.encoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcEnc.so",
- {
- "audio_encoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.encoder.amrnb",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAmrEnc.so",
- {
- "audio_encoder.amrnb"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.decoder.multiaac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "AIV.play",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libAivPlay.so",
- {
- "AIV.play.101"
- }
- },
- {
- "OMX.qcom.file.muxer",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxMux.so",
- {
- "container_muxer.mp2"
- }
- }
-};
-
-const unsigned int SIZE_OF_CORE = sizeof(core) / sizeof(omx_core_cb_type);
-
-
diff --git a/mm-core/src/8610/qc_registry_table.c b/mm-core/src/8610/qc_registry_table.c
deleted file mode 100644
index 71ff4f8..0000000
--- a/mm-core/src/8610/qc_registry_table.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2013, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
-
---------------------------------------------------------------------------*/
-/*============================================================================
- O p e n M A X w r a p p e r s
- O p e n M A X C o r e
-
- This module contains the registry table for the QCOM's OpenMAX core.
-
-*//*========================================================================*/
-
-#include "qc_omx_core.h"
-
-omx_core_cb_type core[] =
-{
- {
- "OMX.qcom.video.decoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.avc"
- }
- },
- {
- "OMX.qcom.video.decoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.decoder.vc1",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.video.decoder.wmv",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.file.muxer",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
-
- "libOmxMux.so",
- {
- "container_muxer.mp2"
- }
- },
- {
- "OMX.qcom.video.decoder.divx4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx311",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.h263"
- }
- },
- {
- "OMX.qcom.video.decoder.vp8",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vp8"
- }
- },
- {
- "OMX.qcom.video.encoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.encoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.h263",
- }
- },
- {
- "OMX.qcom.video.encoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.avc"
- }
- },
- {
- "OMX.qcom.audio.decoder.Qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
- {
- "audio_decoder.Qcelp13"
- }
- },
- {
- "OMX.qcom.audio.decoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcDec.so",
- {
- "audio_decoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma10Pro",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacEnc.so",
- {
- "audio_encoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Enc.so",
- {
- "audio_encoder.qcelp13"
- }
- },
- {
- "OMX.qcom.audio.encoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcEnc.so",
- {
- "audio_encoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.encoder.amrnb",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAmrEnc.so",
- {
- "audio_encoder.amrnb"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.decoder.multiaac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
-
-};
-
-const unsigned int SIZE_OF_CORE = sizeof(core) / sizeof(omx_core_cb_type);
-
-
diff --git a/mm-core/src/8610/qc_registry_table_android.c b/mm-core/src/8610/qc_registry_table_android.c
deleted file mode 100644
index 820d030..0000000
--- a/mm-core/src/8610/qc_registry_table_android.c
+++ /dev/null
@@ -1,463 +0,0 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2013, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
-
---------------------------------------------------------------------------*/
-/*============================================================================
- O p e n M A X w r a p p e r s
- O p e n M A X C o r e
-
- This module contains the registry table for the QCOM's OpenMAX core.
-
-*//*========================================================================*/
-
-
-#include "qc_omx_core.h"
-
-omx_core_cb_type core[] =
-{
- {
- "OMX.qcom.video.decoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.avc"
- }
- },
- {
- "OMX.qcom.video.decoder.avc.secure",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.avc"
- }
- },
- {
- "OMX.qcom.video.decoder.divx4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.divx311",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.divx"
- }
- },
- {
- "OMX.qcom.video.decoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.decoder.vc1",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.video.decoder.wmv",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vc1"
- }
- },
- {
- "OMX.qcom.video.decoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.h263"
- }
- },
- {
- "OMX.qcom.video.decoder.vp8",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVdec.so",
- {
- "video_decoder.vp8"
- }
- },
- {
- "OMX.qcom.video.encoder.mpeg4",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.mpeg4"
- }
- },
- {
- "OMX.qcom.video.encoder.h263",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.h263"
- }
- },
- {
- "OMX.qcom.video.encoder.avc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxVenc.so",
- {
- "video_encoder.avc"
- }
- },
- {
- "OMX.qcom.audio.decoder.Qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Dec.so",
- {
- "audio_decoder.Qcelp13"
- }
- },
- {
- "OMX.qcom.audio.decoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcDec.so",
- {
- "audio_decoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.wma10Pro",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxWmaDec.so",
- {
- "audio_decoder.wma"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacEnc.so",
- {
- "audio_encoder.aac"
- }
- },
- {
- "OMX.qcom.audio.encoder.qcelp13",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxQcelp13Enc.so",
- {
- "audio_encoder.qcelp13"
- }
- },
- {
- "OMX.qcom.audio.encoder.evrc",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxEvrcEnc.so",
- {
- "audio_encoder.evrc"
- }
- },
- {
- "OMX.qcom.audio.encoder.amrnb",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAmrEnc.so",
- {
- "audio_encoder.amrnb"
- }
- },
- {
- "OMX.qcom.audio.decoder.aac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "OMX.qcom.audio.decoder.multiaac",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAacDec.so",
- {
- "audio_decoder.aac"
- }
- },
- {
- "drm.play",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libDrmPlay.so",
- {
- "drm.play"
- }
- },
- {
- "OMX.qcom.file.muxer",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxMux.so",
- {
- "container_muxer.mp2"
- }
- }
-};
-
-const unsigned int SIZE_OF_CORE = sizeof(core) / sizeof(omx_core_cb_type);
-
-
diff --git a/mm-core/src/8660/qc_registry_table.c b/mm-core/src/8660/qc_registry_table.c
index 287b8aa..3253370 100644
--- a/mm-core/src/8660/qc_registry_table.c
+++ b/mm-core/src/8660/qc_registry_table.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ met:
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 The Linux Foundation nor the names of its
+ * Neither the name of Code Aurora Forum, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
diff --git a/mm-core/src/8660/qc_registry_table_android.c b/mm-core/src/8660/qc_registry_table_android.c
index b9d551d..2ab2cfc 100644
--- a/mm-core/src/8660/qc_registry_table_android.c
+++ b/mm-core/src/8660/qc_registry_table_android.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ met:
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 The Linux Foundation nor the names of its
+ * Neither the name of Code Aurora Forum, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
diff --git a/mm-core/src/8960/qc_registry_table.c b/mm-core/src/8960/qc_registry_table.c
index 5f7afe9..ac47efc 100644
--- a/mm-core/src/8960/qc_registry_table.c
+++ b/mm-core/src/8960/qc_registry_table.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ met:
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 The Linux Foundation nor the names of its
+ * Neither the name of Code Aurora Forum, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
diff --git a/mm-core/src/8960/qc_registry_table_android.c b/mm-core/src/8960/qc_registry_table_android.c
index a0f52ff..f2d7ab9 100644
--- a/mm-core/src/8960/qc_registry_table_android.c
+++ b/mm-core/src/8960/qc_registry_table_android.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ met:
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 The Linux Foundation nor the names of its
+ * Neither the name of Code Aurora Forum, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
@@ -153,7 +153,7 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.video.decoder.mpeg2.secure",
+ "OMX.qcom.video.decoder.vc1",
NULL, // Create instance function
// Unique instance handle
{
@@ -165,11 +165,11 @@ omx_core_cb_type core[] =
NULL, // Shared object library handle
"libOmxVdec.so",
{
- "video_decoder.mpeg2"
+ "video_decoder.vc1"
}
},
{
- "OMX.qcom.video.decoder.vc1",
+ "OMX.qcom.video.decoder.wmv",
NULL, // Create instance function
// Unique instance handle
{
@@ -185,7 +185,7 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.video.decoder.wmv",
+ "OMX.qcom.video.decoder.h263",
NULL, // Create instance function
// Unique instance handle
{
@@ -197,11 +197,11 @@ omx_core_cb_type core[] =
NULL, // Shared object library handle
"libOmxVdec.so",
{
- "video_decoder.vc1"
+ "video_decoder.h263"
}
},
- {
- "OMX.qcom.video.decoder.h263",
+ {
+ "OMX.qcom.video.encoder.mpeg4",
NULL, // Create instance function
// Unique instance handle
{
@@ -211,13 +211,13 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libOmxVdec.so",
+ "libOmxVenc.so",
{
- "video_decoder.h263"
+ "video_encoder.mpeg4"
}
},
{
- "OMX.qcom.video.encoder.mpeg4",
+ "OMX.qcom.video.encoder.h263",
NULL, // Create instance function
// Unique instance handle
{
@@ -229,11 +229,11 @@ omx_core_cb_type core[] =
NULL, // Shared object library handle
"libOmxVenc.so",
{
- "video_encoder.mpeg4"
+ "video_encoder.h263"
}
},
{
- "OMX.qcom.video.encoder.h263",
+ "OMX.qcom.video.encoder.avc",
NULL, // Create instance function
// Unique instance handle
{
@@ -245,11 +245,11 @@ omx_core_cb_type core[] =
NULL, // Shared object library handle
"libOmxVenc.so",
{
- "video_encoder.h263"
+ "video_encoder.avc"
}
},
- {
- "OMX.qcom.video.encoder.avc",
+ {
+ "OMX.qcom.video.encoder.avc.secure",
NULL, // Create instance function
// Unique instance handle
{
@@ -329,22 +329,6 @@ omx_core_cb_type core[] =
}
},
{
- "OMX.qcom.audio.decoder.amrwbplus",
- NULL, // Create instance function
- // Unique instance handle
- {
- NULL,
- NULL,
- NULL,
- NULL
- },
- NULL, // Shared object library handle
- "libOmxAmrwbplusDec.so",
- {
- "audio_decoder.awbplus"
- }
- },
- {
"OMX.qcom.audio.decoder.aac",
NULL, // Create instance function
// Unique instance handle
@@ -457,7 +441,7 @@ omx_core_cb_type core[] =
}
},
{
- "AIV.play",
+ "drm.play",
NULL, // Create instance function
// Unique instance handle
{
@@ -467,9 +451,9 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libAivPlay.so",
+ "libDrmPlay.so",
{
- "AIV.play.101"
+ "drm.play"
}
},
{
diff --git a/mm-core/src/8974/qc_registry_table.c b/mm-core/src/8974/qc_registry_table.c
index d163c6b..9d7c905 100644
--- a/mm-core/src/8974/qc_registry_table.c
+++ b/mm-core/src/8974/qc_registry_table.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ met:
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 The Linux Foundation nor the names of its
+ * Neither the name of Code Aurora Forum, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
@@ -184,7 +184,7 @@ omx_core_cb_type core[] =
"video_decoder.h263"
}
},
- {
+ {
"OMX.qcom.video.decoder.vp8",
NULL, // Create instance function
// Unique instance handle
@@ -248,7 +248,7 @@ omx_core_cb_type core[] =
"video_encoder.avc"
}
},
- {
+{
"OMX.qcom.video.encoder.vp8",
NULL, // Create instance function
// Unique instance handle
diff --git a/mm-core/src/8974/qc_registry_table_android.c b/mm-core/src/8974/qc_registry_table_android.c
index 2d5d17d..9be7492 100644
--- a/mm-core/src/8974/qc_registry_table_android.c
+++ b/mm-core/src/8974/qc_registry_table_android.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2012 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
@@ -10,7 +10,7 @@ met:
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 The Linux Foundation nor the names of its
+ * Neither the name of Code Aurora Forum, Inc. nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
@@ -25,6 +25,7 @@ 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.
+
--------------------------------------------------------------------------*/
/*============================================================================
O p e n M A X w r a p p e r s
@@ -199,7 +200,7 @@ omx_core_cb_type core[] =
"video_decoder.h263"
}
},
- {
+{
"OMX.qcom.video.decoder.vp8",
NULL, // Create instance function
// Unique instance handle
@@ -456,7 +457,7 @@ omx_core_cb_type core[] =
}
},
{
- "AIV.play",
+ "drm.play",
NULL, // Create instance function
// Unique instance handle
{
@@ -466,9 +467,9 @@ omx_core_cb_type core[] =
NULL
},
NULL, // Shared object library handle
- "libAivPlay.so",
+ "libDrmPlay.so",
{
- "AIV.play.101"
+ "drm.play"
}
},
{
diff --git a/mm-core/src/common/omx_core_cmp.cpp b/mm-core/src/common/omx_core_cmp.cpp
index a11cc4c..dfe0466 100644
--- a/mm-core/src/common/omx_core_cmp.cpp
+++ b/mm-core/src/common/omx_core_cmp.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/src/common/omx_core_cmp.h b/mm-core/src/common/omx_core_cmp.h
index b3c9df5..1daf26e 100644
--- a/mm-core/src/common/omx_core_cmp.h
+++ b/mm-core/src/common/omx_core_cmp.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/src/common/qc_omx_core.c b/mm-core/src/common/qc_omx_core.c
index c8b560c..f332f65 100644
--- a/mm-core/src/common/qc_omx_core.c
+++ b/mm-core/src/common/qc_omx_core.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/src/common/qc_omx_core.h b/mm-core/src/common/qc_omx_core.h
index 1a68e21..c3ae26a 100644
--- a/mm-core/src/common/qc_omx_core.h
+++ b/mm-core/src/common/qc_omx_core.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/src/default/qc_registry_table.c b/mm-core/src/default/qc_registry_table.c
index b0f7a95..5cf6dd9 100644
--- a/mm-core/src/default/qc_registry_table.c
+++ b/mm-core/src/default/qc_registry_table.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-core/src/default/qc_registry_table_android.c b/mm-core/src/default/qc_registry_table_android.c
index bb5e01f..118a111 100644
--- a/mm-core/src/default/qc_registry_table_android.c
+++ b/mm-core/src/default/qc_registry_table_android.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2009, The Linux Foundation. All rights reserved.
+Copyright (c) 2009, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/DivxDrmDecrypt/Android.mk b/mm-video/DivxDrmDecrypt/Android.mk
index 0af340a..26a2f7a 100755
--- a/mm-video/DivxDrmDecrypt/Android.mk
+++ b/mm-video/DivxDrmDecrypt/Android.mk
@@ -1,13 +1,6 @@
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
-#===============================================================================
-# Deploy the headers that can be exposed
-#===============================================================================
-
-LOCAL_COPY_HEADERS_TO := mm-video/DivxDrmDecrypt
-LOCAL_COPY_HEADERS := inc/DivXDrmDecrypt.h
-
LOCAL_CFLAGS := \
-D_ANDROID_
diff --git a/mm-video/DivxDrmDecrypt/inc/DivXDrmDecrypt.h b/mm-video/DivxDrmDecrypt/inc/DivXDrmDecrypt.h
index 4b0b707..f73ebcd 100644
--- a/mm-video/DivxDrmDecrypt/inc/DivXDrmDecrypt.h
+++ b/mm-video/DivxDrmDecrypt/inc/DivXDrmDecrypt.h
@@ -1,49 +1,49 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __DIVXDRMDECRYPT_H__
-#define __DIVXDRMDECRYPT_H__
-
-#include <OMX_Core.h>
-
-//Abstract base class of API to decrypt DRM content.
-class DivXDrmDecrypt
-{
-public:
- static DivXDrmDecrypt* Create();
- virtual OMX_ERRORTYPE Init() = 0;
- virtual OMX_ERRORTYPE Decrypt(OMX_BUFFERHEADERTYPE* buffer) = 0;
- inline virtual ~DivXDrmDecrypt() {}
-};
-
-//.so file should provide a function with the name createDivXDrmDecrypt with
-//prototype of DivXDrmDecryptFactory.
-static const char* MEDIA_CREATE_DIVX_DRM_DECRYPT = "createDivXDrmDecrypt";
-typedef DivXDrmDecrypt* (*DivXDrmDecryptFactory)();
-
-#endif //__DIVXDRMDECRYPT_H__
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2012, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __DIVXDRMDECRYPT_H__
+#define __DIVXDRMDECRYPT_H__
+
+#include <OMX_Core.h>
+
+//Abstract base class of API to decrypt DRM content.
+class DivXDrmDecrypt
+{
+public:
+ static DivXDrmDecrypt* Create();
+ virtual OMX_ERRORTYPE Init() = 0;
+ virtual OMX_ERRORTYPE Decrypt(OMX_BUFFERHEADERTYPE* buffer) = 0;
+ inline virtual ~DivXDrmDecrypt() {}
+};
+
+//.so file should provide a function with the name createDivXDrmDecrypt with
+//prototype of DivXDrmDecryptFactory.
+static const char* MEDIA_CREATE_DIVX_DRM_DECRYPT = "createDivXDrmDecrypt";
+typedef DivXDrmDecrypt* (*DivXDrmDecryptFactory)();
+
+#endif //__DIVXDRMDECRYPT_H__
diff --git a/mm-video/DivxDrmDecrypt/src/DivXDrmDecrypt.cpp b/mm-video/DivxDrmDecrypt/src/DivXDrmDecrypt.cpp
index ff4a382..f723427 100644
--- a/mm-video/DivxDrmDecrypt/src/DivXDrmDecrypt.cpp
+++ b/mm-video/DivxDrmDecrypt/src/DivXDrmDecrypt.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/common/inc/extra_data_handler.h b/mm-video/vidc/common/inc/extra_data_handler.h
index 42fc3ea..19e3ca7 100644
--- a/mm-video/vidc/common/inc/extra_data_handler.h
+++ b/mm-video/vidc/common/inc/extra_data_handler.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -43,12 +43,12 @@ extern "C"{
#include<utils/Log.h>
}
#ifdef ENABLE_DEBUG_LOW
-#define DEBUG_PRINT_LOW ALOGE
+#define DEBUG_PRINT_LOW ALOGV
#else
#define DEBUG_PRINT_LOW
#endif
#ifdef ENABLE_DEBUG_HIGH
-#define DEBUG_PRINT_HIGH ALOGE
+#define DEBUG_PRINT_HIGH ALOGV
#else
#define DEBUG_PRINT_HIGH
#endif
@@ -98,8 +98,6 @@ private:
OMX_U32 create_sei(OMX_U8 *buffer);
OMX_S32 parse_sliceinfo(OMX_BUFFERHEADERTYPE *pBufHdr,
OMX_OTHER_EXTRADATATYPE *pExtra);
- OMX_S32 parse_ltrinfo(OMX_BUFFERHEADERTYPE *pBufHdr,
- OMX_OTHER_EXTRADATATYPE *pExtra);
};
#endif
diff --git a/mm-video/vidc/common/inc/vidc_color_converter.h b/mm-video/vidc/common/inc/vidc_color_converter.h
index e42a8da..379e75b 100644
--- a/mm-video/vidc/common/inc/vidc_color_converter.h
+++ b/mm-video/vidc/common/inc/vidc_color_converter.h
@@ -1,30 +1,29 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+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 The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
+ * 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 Code Aurora 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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>
#include "C2DColorConverter.h"
diff --git a/mm-video/vidc/common/src/extra_data_handler.cpp b/mm-video/vidc/common/src/extra_data_handler.cpp
index aa3b563..28f2d95 100644
--- a/mm-video/vidc/common/src/extra_data_handler.cpp
+++ b/mm-video/vidc/common/src/extra_data_handler.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -216,16 +216,6 @@ OMX_S32 extra_data_handler::parse_sei(OMX_U8 *buffer, OMX_U32 buffer_length)
payload_size, byte_ptr);
return 1;
}
-
-OMX_S32 extra_data_handler::parse_ltrinfo(
- OMX_BUFFERHEADERTYPE *pBufHdr, OMX_OTHER_EXTRADATATYPE *pExtra)
-{
- OMX_U32 *pLTR;
- pExtra->eType = (OMX_EXTRADATATYPE)OMX_ExtraDataVideoLTRInfo;
- pLTR = (OMX_U32* )pExtra + 5;
- DEBUG_PRINT_HIGH("ExtraData LTR ID %d", *pLTR, 0, 0);
- return 0;
-}
/*======================================================================
Slice Information will be available as below (each line is of 4 bytes)
| number of slices |
@@ -242,7 +232,7 @@ OMX_S32 extra_data_handler::parse_sliceinfo(
OMX_U8 *pBuffer = (OMX_U8 *)pBufHdr->pBuffer;
OMX_U32 *data = (OMX_U32 *)pExtra->data;
OMX_U32 num_slices = *data;
- DEBUG_PRINT_LOW("number of slices = %d", num_slices);
+ DEBUG_PRINT_HIGH("number of slices = %d", num_slices);
if ((4 + num_slices * 8) != (OMX_U32)pExtra->nDataSize) {
DEBUG_PRINT_ERROR("unknown error in slice info extradata");
return -1;
@@ -265,7 +255,7 @@ OMX_S32 extra_data_handler::parse_sliceinfo(
}
slice_size = (OMX_U32)(*(data + (i*2 + 2)));
total_size += slice_size;
- DEBUG_PRINT_LOW("slice number %d offset/size = %d/%d",
+ DEBUG_PRINT_HIGH("slice number %d offset/size = %d/%d",
i, slice_offset, slice_size);
}
if (pBufHdr->nFilledLen != total_size) {
@@ -278,56 +268,29 @@ OMX_S32 extra_data_handler::parse_sliceinfo(
OMX_U32 extra_data_handler::parse_extra_data(OMX_BUFFERHEADERTYPE *buf_hdr)
{
- DEBUG_PRINT_LOW("In %s() flags: 0x%x", __func__,buf_hdr->nFlags);
-
- if (buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA) {
-
- OMX_OTHER_EXTRADATATYPE *extra_data = (OMX_OTHER_EXTRADATATYPE *)
- ((unsigned)(buf_hdr->pBuffer + buf_hdr->nOffset +
- buf_hdr->nFilledLen + 3)&(~3));
+ OMX_OTHER_EXTRADATATYPE *extra_data = (OMX_OTHER_EXTRADATATYPE *)
+ ((unsigned)(buf_hdr->pBuffer + buf_hdr->nOffset +
+ buf_hdr->nFilledLen + 3)&(~3));
- while(extra_data &&
- ((OMX_U32)extra_data > (OMX_U32)buf_hdr->pBuffer) &&
- ((OMX_U32)extra_data < (OMX_U32)buf_hdr->pBuffer + buf_hdr->nAllocLen)) {
+ DEBUG_PRINT_LOW("\nIn %s() symbol : %u", __func__,buf_hdr->nFlags);
- DEBUG_PRINT_LOW("extradata(0x%x): nSize = 0x%x, eType = 0x%x,"
- " nDataSize = 0x%x", (unsigned)extra_data, extra_data->nSize,
- extra_data->eType, extra_data->nDataSize);
-
- if ((extra_data->eType == VDEC_EXTRADATA_NONE) ||
- (extra_data->eType == VEN_EXTRADATA_NONE)) {
- DEBUG_PRINT_LOW("No more extradata available");
- extra_data->eType = OMX_ExtraDataNone;
- break;
- }
- else if (extra_data->eType == VDEC_EXTRADATA_SEI) {
- DEBUG_PRINT_LOW("Extradata SEI of size %d found, "
- "parsing it", extra_data->nDataSize);
+ if (buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA) {
+ while(extra_data && (OMX_U8*)extra_data < (buf_hdr->pBuffer +
+ buf_hdr->nAllocLen) && extra_data->eType != VDEC_EXTRADATA_NONE) {
+ DEBUG_PRINT_LOW("\nExtra data type(%x) Extra data size(%u)",
+ extra_data->eType, extra_data->nDataSize);
+ if (extra_data->eType == VDEC_EXTRADATA_SEI) {
parse_sei(extra_data->data, extra_data->nDataSize);
}
else if (extra_data->eType == VEN_EXTRADATA_QCOMFILLER) {
- DEBUG_PRINT_LOW("Extradata Qcom Filler found, skip %d bytes",
+ DEBUG_PRINT_HIGH("Extradata Qcom Filler found, skip %d bytes",
extra_data->nSize);
}
else if (extra_data->eType == VEN_EXTRADATA_SLICEINFO) {
- DEBUG_PRINT_LOW("Extradata SliceInfo of size %d found, "
+ DEBUG_PRINT_HIGH("Extradata SliceInfo of size %d found, "
"parsing it", extra_data->nDataSize);
parse_sliceinfo(buf_hdr, extra_data);
}
-#ifndef _MSM8974_
- else if (extra_data->eType == VEN_EXTRADATA_LTRINFO) {
- DEBUG_PRINT_LOW("Extradata LTRInfo of size %d found, "
- "parsing it", extra_data->nDataSize);
- parse_ltrinfo(buf_hdr, extra_data);
- }
-#endif
- else {
- DEBUG_PRINT_ERROR("Unknown extradata(0x%x) found, nSize = 0x%x, "
- "eType = 0x%x, nDataSize = 0x%x", (unsigned)extra_data,
- extra_data->nSize, extra_data->eType, extra_data->nDataSize);
- buf_hdr->nFlags &= ~(OMX_BUFFERFLAG_EXTRADATA);
- break;
- }
extra_data = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) extra_data) +
extra_data->nSize);
}
@@ -496,6 +459,9 @@ OMX_U32 extra_data_handler::create_extra_data(OMX_BUFFERHEADERTYPE *buf_hdr)
buf_hdr->nOffset + buf_hdr->nFilledLen));
OMX_U32 msg_size;
+ DEBUG_PRINT_LOW("\n filled_len/orig_len %d/%d", buf_hdr->nFilledLen,
+ buf_hdr->nAllocLen);
+
if(buf_hdr->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
DEBUG_PRINT_LOW("\n%s:%d create extra data with config", __func__,
__LINE__);
@@ -505,6 +471,8 @@ OMX_U32 extra_data_handler::create_extra_data(OMX_BUFFERHEADERTYPE *buf_hdr)
buf_hdr->nFilledLen += msg_size;
}
}
+ DEBUG_PRINT_LOW("\n filled_len/orig_len %d/%d", buf_hdr->nFilledLen,
+ buf_hdr->nAllocLen);
return 1;
}
diff --git a/mm-video/vidc/common/src/vidc_color_converter.cpp b/mm-video/vidc/common/src/vidc_color_converter.cpp
index fc3462b..4920e5d 100644
--- a/mm-video/vidc/common/src/vidc_color_converter.cpp
+++ b/mm-video/vidc/common/src/vidc_color_converter.cpp
@@ -1,30 +1,29 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+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 The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
+ * 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 Code Aurora 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 <utils/Log.h>
#include <gralloc_priv.h>
diff --git a/mm-video/vidc/vdec/Android.mk b/mm-video/vidc/vdec/Android.mk
index 5223b45..28bd354 100755
--- a/mm-video/vidc/vdec/Android.mk
+++ b/mm-video/vidc/vdec/Android.mk
@@ -9,10 +9,8 @@ LOCAL_PATH:= $(ROOT_DIR)
# Common definitons
# ---------------------------------------------------------------------------------
-libOmxVdec-def := -D__alignx\(x\)=__attribute__\(\(__aligned__\(x\)\)\)
libOmxVdec-def += -D__align=__alignx
libOmxVdec-def += -Dinline=__inline
-libOmxVdec-def += -g -O3
libOmxVdec-def += -DIMAGE_APPS_PROC
libOmxVdec-def += -D_ANDROID_
libOmxVdec-def += -DCDECL
@@ -32,38 +30,19 @@ ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
libOmxVdec-def += -DMAX_RES_1080P
libOmxVdec-def += -DMAX_RES_1080P_EBI
libOmxVdec-def += -DPROCESS_EXTRADATA_IN_OUTPUT_PORT
-libOmxVdec-def += -D_MSM8960_
endif
ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
libOmxVdec-def += -DMAX_RES_1080P
libOmxVdec-def += -DMAX_RES_1080P_EBI
libOmxVdec-def += -DPROCESS_EXTRADATA_IN_OUTPUT_PORT
-libOmxVdec-def += -D_MSM8974_
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
-libOmxVdec-def += -DMAX_RES_720P
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm7630_surf)
-libOmxVdec-def += -DMAX_RES_720P
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
-libOmxVdec-def += -DMAX_RES_1080P
-libOmxVdec-def += -DMAX_RES_1080P_EBI
-libOmxVdec-def += -DPROCESS_EXTRADATA_IN_OUTPUT_PORT
-libOmxVdec-def += -D_MSM8974_
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
-libOmxVdec-def += -DMAX_RES_1080P
-libOmxVdec-def += -DMAX_RES_1080P_EBI
-libOmxVdec-def += -DPROCESS_EXTRADATA_IN_OUTPUT_PORT
-libOmxVdec-def += -D_MSM8974_
+libOmxVdec-def += -D_COPPER_
endif
libOmxVdec-def += -D_ANDROID_ICS_
-ifeq ($(TARGET_USES_ION),true)
+#ifeq ($(TARGET_USES_ION),true)
libOmxVdec-def += -DUSE_ION
-endif
+#endif
# ---------------------------------------------------------------------------------
# Make the Shared library (libOmxVdec)
@@ -82,10 +61,10 @@ libmm-vdec-inc += $(OMX_VIDEO_PATH)/DivxDrmDecrypt/inc
libmm-vdec-inc += hardware/qcom/display/libgralloc
libmm-vdec-inc += frameworks/native/include/media/openmax
libmm-vdec-inc += frameworks/native/include/media/hardware
-libmm-vdec-inc += hardware/qcom/display/libqdutils
-libmm-vdec-inc += hardware/qcom/media/libc2dcolorconvert
-libmm-vdec-inc += hardware/qcom/display/libcopybit
-libmm-vdec-inc += frameworks/av/include/media/stagefright
+libmm-vdec-inc += hardware/qcom/media/libc2dcolorconvert
+libmm-vdec-inc += hardware/qcom/display/libcopybit
+libmm-vdec-inc += frameworks/av/include/media/stagefright
+libmm-vdec-inc += hardware/qcom/display/libqservice
LOCAL_MODULE := libOmxVdec
@@ -97,21 +76,13 @@ LOCAL_PRELINK_MODULE := false
LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils libdl
LOCAL_SHARED_LIBRARIES += libdivxdrmdecrypt
-LOCAL_SHARED_LIBRARIES += libqdMetaData
+LOCAL_SHARED_LIBRARIES += libqservice
LOCAL_SRC_FILES := src/frameparser.cpp
LOCAL_SRC_FILES += src/h264_utils.cpp
LOCAL_SRC_FILES += src/ts_parser.cpp
LOCAL_SRC_FILES += src/mp4_utils.cpp
-ifneq ($(filter msm8974 msm8610 msm8226,$(TARGET_BOARD_PLATFORM)),)
-LOCAL_SRC_FILES += src/omx_vdec_msm8974.cpp
-else
-LOCAL_SHARED_LIBRARIES += libhardware
-libmm-vdec-inc += hardware/qcom/display/libhwcomposer
-LOCAL_SRC_FILES += src/power_module.cpp
LOCAL_SRC_FILES += src/omx_vdec.cpp
-endif
-
LOCAL_SRC_FILES += ../common/src/extra_data_handler.cpp
LOCAL_SRC_FILES += ../common/src/vidc_color_converter.cpp
@@ -131,7 +102,7 @@ LOCAL_CFLAGS := $(libOmxVdec-def)
LOCAL_C_INCLUDES := $(mm-vdec-test-inc)
LOCAL_PRELINK_MODULE := false
-LOCAL_SHARED_LIBRARIES := libutils libOmxCore libOmxVdec libbinder libcutils
+LOCAL_SHARED_LIBRARIES := libutils liblog libOmxCore libOmxVdec libbinder
LOCAL_SRC_FILES := src/queue.c
LOCAL_SRC_FILES += test/omx_vdec_test.cpp
diff --git a/mm-video/vidc/vdec/inc/Map.h b/mm-video/vidc/vdec/inc/Map.h
index 6d5873e..a9b7981 100644
--- a/mm-video/vidc/vdec/inc/Map.h
+++ b/mm-video/vidc/vdec/inc/Map.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/vdec/inc/decoder_driver_test.h b/mm-video/vidc/vdec/inc/decoder_driver_test.h
index b3afafe..dd95e5e 100644
--- a/mm-video/vidc/vdec/inc/decoder_driver_test.h
+++ b/mm-video/vidc/vdec/inc/decoder_driver_test.h
@@ -1,70 +1,70 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 <stdio.h>
-#include <stdlib.h>
-#include "message_queue.h"
-#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <inttypes.h>
-#include <linux/msm_vidc_dec.h>
-#include <pthread.h>
-#include <semaphore.h>
-#include <stdio.h>
-
-struct video_decoder_context
-{
- enum vdec_codec decoder_format;
- enum vdec_output_fromat output_format;
- struct vdec_picsize video_resoultion;
- struct vdec_allocatorproperty input_buffer;
- struct vdec_allocatorproperty output_buffer;
- struct vdec_bufferpayload **ptr_inputbuffer;
- struct vdec_bufferpayload **ptr_outputbuffer;
- struct vdec_output_frameinfo **ptr_respbuffer;
- struct video_queue_context queue_context;
- int video_driver_fd;
-
- FILE * inputBufferFile;
- FILE * outputBufferFile;
-
- pthread_t videothread_id;
- pthread_t asyncthread_id;
- sem_t sem_synchronize;
-};
-
-int init_decoder ( struct video_decoder_context *init_decode );
-int allocate_buffer ( enum vdec_buffer,
- struct video_decoder_context *decode_context
- );
-int free_buffer ( enum vdec_buffer,
- struct video_decoder_context *decode_context
- );
-int start_decoding (struct video_decoder_context *decode_context);
-int stop_decoding (struct video_decoder_context *decode_context);
-int deinit_decoder (struct video_decoder_context *init_decode);
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 <stdio.h>
+#include <stdlib.h>
+#include "message_queue.h"
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <sys/mman.h>
+#include <inttypes.h>
+#include <linux/msm_vidc_dec.h>
+#include <pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+
+struct video_decoder_context
+{
+ enum vdec_codec decoder_format;
+ enum vdec_output_fromat output_format;
+ struct vdec_picsize video_resoultion;
+ struct vdec_allocatorproperty input_buffer;
+ struct vdec_allocatorproperty output_buffer;
+ struct vdec_bufferpayload **ptr_inputbuffer;
+ struct vdec_bufferpayload **ptr_outputbuffer;
+ struct vdec_output_frameinfo **ptr_respbuffer;
+ struct video_queue_context queue_context;
+ int video_driver_fd;
+
+ FILE * inputBufferFile;
+ FILE * outputBufferFile;
+
+ pthread_t videothread_id;
+ pthread_t asyncthread_id;
+ sem_t sem_synchronize;
+};
+
+int init_decoder ( struct video_decoder_context *init_decode );
+int allocate_buffer ( enum vdec_buffer,
+ struct video_decoder_context *decode_context
+ );
+int free_buffer ( enum vdec_buffer,
+ struct video_decoder_context *decode_context
+ );
+int start_decoding (struct video_decoder_context *decode_context);
+int stop_decoding (struct video_decoder_context *decode_context);
+int deinit_decoder (struct video_decoder_context *init_decode);
diff --git a/mm-video/vidc/vdec/inc/frameparser.h b/mm-video/vidc/vdec/inc/frameparser.h
index d7ceccf..1e588a3 100644
--- a/mm-video/vidc/vdec/inc/frameparser.h
+++ b/mm-video/vidc/vdec/inc/frameparser.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -41,10 +41,7 @@ enum codec_type
CODEC_TYPE_H264 = 2,
CODEC_TYPE_VC1 = 3,
CODEC_TYPE_MPEG2 = 4,
-#ifdef _MSM8974_
- CODEC_TYPE_VP8 = 5,
-#endif
- CODEC_TYPE_MAX
+ CODEC_TYPE_MAX = CODEC_TYPE_MPEG2
};
enum state_start_code_parse
diff --git a/mm-video/vidc/vdec/inc/h264_utils.h b/mm-video/vidc/vdec/inc/h264_utils.h
index 8006bb2..9a903b1 100644
--- a/mm-video/vidc/vdec/inc/h264_utils.h
+++ b/mm-video/vidc/vdec/inc/h264_utils.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/vdec/inc/message_queue.h b/mm-video/vidc/vdec/inc/message_queue.h
index d5924e6..7e15724 100644
--- a/mm-video/vidc/vdec/inc/message_queue.h
+++ b/mm-video/vidc/vdec/inc/message_queue.h
@@ -1,78 +1,78 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 QUEUE_H
-#define QUEUE_H
-
-#include <pthread.h>
-#include <semaphore.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Message Queue structure */
-struct video_msgq
-{
- /* Command to be executed */
- unsigned int cmd;
-
- unsigned int status;
-
- /* Client-specific data */
- void *clientdata;
-};
-
-
-/* Thread & Message Queue information */
-struct video_queue_context
-{
- /* Message Queue related members */
- pthread_mutex_t mutex;
- sem_t sem_message;
- int commandq_size;
- int dataq_size;
- struct video_msgq *ptr_dataq;
- struct video_msgq *ptr_cmdq;
- int write_dataq ;
- int read_dataq;
- int write_comq ;
- int read_comq ;
-
-};
-
-int check_if_queue_empty ( unsigned int queuetocheck,void* queuecontext );
-
-struct video_msgq * queue_get_cmd ( void* queuecontext );
-
-int queue_post_cmdq ( void *queuecontext,
- struct video_msgq *post_msg
- );
-
-int queue_post_dataq ( void *queuecontext,
- struct video_msgq *post_msg
- );
-
-#endif /* QUEUE_H */
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 QUEUE_H
+#define QUEUE_H
+
+#include <pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Message Queue structure */
+struct video_msgq
+{
+ /* Command to be executed */
+ unsigned int cmd;
+
+ unsigned int status;
+
+ /* Client-specific data */
+ void *clientdata;
+};
+
+
+/* Thread & Message Queue information */
+struct video_queue_context
+{
+ /* Message Queue related members */
+ pthread_mutex_t mutex;
+ sem_t sem_message;
+ int commandq_size;
+ int dataq_size;
+ struct video_msgq *ptr_dataq;
+ struct video_msgq *ptr_cmdq;
+ int write_dataq ;
+ int read_dataq;
+ int write_comq ;
+ int read_comq ;
+
+};
+
+int check_if_queue_empty ( unsigned int queuetocheck,void* queuecontext );
+
+struct video_msgq * queue_get_cmd ( void* queuecontext );
+
+int queue_post_cmdq ( void *queuecontext,
+ struct video_msgq *post_msg
+ );
+
+int queue_post_dataq ( void *queuecontext,
+ struct video_msgq *post_msg
+ );
+
+#endif /* QUEUE_H */
diff --git a/mm-video/vidc/vdec/inc/mp4_utils.h b/mm-video/vidc/vdec/inc/mp4_utils.h
index 9a435bf..96f9eb2 100644
--- a/mm-video/vidc/vdec/inc/mp4_utils.h
+++ b/mm-video/vidc/vdec/inc/mp4_utils.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -147,6 +147,8 @@ typedef struct
VOP_TYPE vopType;
} mp4_frame_info_type;
+void mp4_fill_aspect_ratio_info(struct vdec_aspectratioinfo *aspect_ratio_info,
+ OMX_QCOM_EXTRADATA_FRAMEINFO *frame_info);
class MP4_Utils {
private:
struct posInfoType {
diff --git a/mm-video/vidc/vdec/inc/omx_vdec.h b/mm-video/vidc/vdec/inc/omx_vdec.h
index 9facadf..443ecc9 100644
--- a/mm-video/vidc/vdec/inc/omx_vdec.h
+++ b/mm-video/vidc/vdec/inc/omx_vdec.h
@@ -1,31 +1,29 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
+Copyright (c) 2010-2012, Code Aurora Forum. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+ 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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_VDEC_H__
#define __OMX_VDEC_H__
@@ -51,28 +49,42 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
static ptrdiff_t x;
#ifdef _ANDROID_
-#ifdef MAX_RES_720P
-#define LOG_TAG "OMX-VDEC-720P"
-#elif MAX_RES_1080P
-#define LOG_TAG "OMX-VDEC-1080P"
-#else
-#define LOG_TAG "OMX-VDEC"
-#endif
-
#ifdef USE_ION
#include <linux/msm_ion.h>
-//#include <binder/MemoryHeapIon.h>
#else
#include <linux/android_pmem.h>
#endif
#include <binder/MemoryHeapBase.h>
#include <ui/ANativeObjectBase.h>
+#include <binder/IServiceManager.h>
extern "C"{
-#include <utils/Log.h>
+#include<utils/Log.h>
}
#include <linux/videodev2.h>
#include <poll.h>
#define TIMEOUT 5000
+#ifdef MAX_RES_720P
+#define LOG_TAG "OMX-VDEC-720P"
+#elif MAX_RES_1080P
+#define LOG_TAG "OMX-VDEC-1080P"
+#else
+#define LOG_TAG "OMX-VDEC"
+#endif
+#ifdef ENABLE_DEBUG_LOW
+#define DEBUG_PRINT_LOW ALOGE
+#else
+#define DEBUG_PRINT_LOW
+#endif
+#ifdef ENABLE_DEBUG_HIGH
+#define DEBUG_PRINT_HIGH ALOGE
+#else
+#define DEBUG_PRINT_HIGH
+#endif
+#ifdef ENABLE_DEBUG_ERROR
+#define DEBUG_PRINT_ERROR ALOGE
+#else
+#define DEBUG_PRINT_ERROR
+#endif
#else //_ANDROID_
#define DEBUG_PRINT_LOW printf
@@ -80,18 +92,16 @@ extern "C"{
#define DEBUG_PRINT_ERROR printf
#endif // _ANDROID_
-#ifdef _MSM8974_
-#define DEBUG_PRINT_LOW
-#define DEBUG_PRINT_HIGH printf
-#define DEBUG_PRINT_ERROR printf
-#endif
-
#if defined (_ANDROID_HONEYCOMB_) || defined (_ANDROID_ICS_)
#include <media/hardware/HardwareAPI.h>
#endif
#include <unistd.h>
+#if defined (_ANDROID_ICS_)
+#include <IQService.h>
+#endif
+
#include <pthread.h>
#ifndef PC_DEBUG
#include <semaphore.h>
@@ -100,7 +110,6 @@ extern "C"{
#include "OMX_QCOMExtns.h"
#include "qc_omx_component.h"
#include <linux/msm_vidc_dec.h>
-#include <media/msm_vidc.h>
#include "frameparser.h"
#ifdef MAX_RES_1080P
#include "mp4_utils.h"
@@ -185,7 +194,6 @@ extern "C" {
#define OMX_INTERLACE_EXTRADATA 0x00020000
#define OMX_TIMEINFO_EXTRADATA 0x00040000
#define OMX_PORTDEF_EXTRADATA 0x00080000
-#define OMX_EXTNUSER_EXTRADATA 0x00100000
#define DRIVER_EXTRADATA_MASK 0x0000FFFF
#define OMX_INTERLACE_EXTRADATA_SIZE ((sizeof(OMX_OTHER_EXTRADATATYPE) +\
@@ -217,18 +225,6 @@ struct vdec_ion
};
#endif
-#ifdef _MSM8974_
-struct extradata_buffer_info {
- int buffer_size;
- char* uaddr;
- int count;
- int size;
-#ifdef USE_ION
- struct vdec_ion ion;
-#endif
-};
-#endif
-
struct video_driver_context
{
int video_driver_fd;
@@ -246,8 +242,6 @@ struct video_driver_context
struct vdec_ion *ip_buf_ion_info;
struct vdec_ion *op_buf_ion_info;
struct vdec_ion h264_mv;
- struct vdec_ion meta_buffer;
- struct vdec_ion meta_buffer_iommu;
#endif
struct vdec_framerate frame_rate;
unsigned extradata;
@@ -255,10 +249,6 @@ struct video_driver_context
char kind[128];
bool idr_only_decoding;
unsigned disable_dmx;
-#ifdef _MSM8974_
- struct extradata_buffer_info extradata_info;
- int num_planes;
-#endif
};
#ifdef _ANDROID_
@@ -391,11 +381,6 @@ public:
void * eglImage);
void complete_pending_buffer_done_cbs();
struct video_driver_context drv_ctx;
-#ifdef _MSM8974_
- OMX_ERRORTYPE allocate_extradata();
- void free_extradata();
- void update_resolution(int width, int height);
-#endif
int m_pipe_in;
int m_pipe_out;
pthread_t msg_thread_id;
@@ -473,7 +458,7 @@ private:
VC1_AP = 2
};
-#ifdef _MSM8974_
+#ifdef _COPPER_
enum v4l2_ports
{
CAPTURE_PORT,
@@ -540,7 +525,7 @@ private:
OMX_ERRORTYPE free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr);
void free_output_buffer_header();
void free_input_buffer_header();
-
+ OMX_ERRORTYPE update_color_format(OMX_COLOR_FORMATTYPE eColorFormat);
OMX_ERRORTYPE allocate_input_heap_buffer(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE **bufferHdr,
OMX_U32 port,
@@ -603,28 +588,14 @@ private:
OMX_ERRORTYPE set_buffer_req(vdec_allocatorproperty *buffer_prop);
OMX_ERRORTYPE start_port_reconfig();
OMX_ERRORTYPE update_picture_resolution();
- int stream_off(OMX_U32 port);
+ void stream_off();
void adjust_timestamp(OMX_S64 &act_timestamp);
void set_frame_rate(OMX_S64 act_timestamp);
- void handle_extradata_secure(OMX_BUFFERHEADERTYPE *p_buf_hdr);
void handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr);
+ OMX_ERRORTYPE enable_extradata(OMX_U32 requested_extradata, bool enable = true);
void print_debug_extradata(OMX_OTHER_EXTRADATATYPE *extra);
-#ifdef _MSM8974_
void append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
OMX_U32 interlaced_format_type);
- OMX_ERRORTYPE enable_extradata(OMX_U32 requested_extradata, bool is_internal,
- bool enable = true);
- void append_frame_info_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- OMX_U32 num_conceal_mb,
- OMX_U32 picture_type,
- OMX_U32 frame_rate,
- struct msm_vidc_panscan_window_payload *panscan_payload,
- struct vdec_aspectratioinfo *aspect_ratio_info);
-#else
- void append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- OMX_U32 interlaced_format_type, OMX_U32 buf_index);
- OMX_ERRORTYPE enable_extradata(OMX_U32 requested_extradata, bool enable = true);
-#endif
void append_frame_info_extradata(OMX_OTHER_EXTRADATATYPE *extra,
OMX_U32 num_conceal_mb,
OMX_U32 picture_type,
@@ -636,8 +607,6 @@ private:
void append_terminator_extradata(OMX_OTHER_EXTRADATATYPE *extra);
OMX_ERRORTYPE update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn);
void append_portdef_extradata(OMX_OTHER_EXTRADATATYPE *extra);
- void append_extn_extradata(OMX_OTHER_EXTRADATATYPE *extra, OMX_OTHER_EXTRADATATYPE *p_extn);
- void append_user_extradata(OMX_OTHER_EXTRADATATYPE *extra, OMX_OTHER_EXTRADATATYPE *p_user);
void insert_demux_addr_offset(OMX_U32 address_offset);
void extract_demux_addr_offsets(OMX_BUFFERHEADERTYPE *buf_hdr);
OMX_ERRORTYPE handle_demux_data(OMX_BUFFERHEADERTYPE *buf_hdr);
@@ -676,8 +645,6 @@ private:
#ifdef MAX_RES_1080P
OMX_ERRORTYPE vdec_alloc_h264_mv();
void vdec_dealloc_h264_mv();
- OMX_ERRORTYPE vdec_alloc_meta_buffers();
- void vdec_dealloc_meta_buffers();
#endif
inline void omx_report_error ()
@@ -701,7 +668,6 @@ private:
//*******************MEMBER VARIABLES *************************
//*************************************************************
pthread_mutex_t m_lock;
- pthread_mutex_t c_lock;
//sem to handle the minimum procesing of commands
sem_t m_cmd_lock;
bool m_error_propogated;
@@ -802,8 +768,6 @@ private:
OMX_U32 h264_last_au_flags;
OMX_U32 m_demux_offsets[8192];
OMX_U32 m_demux_entries;
- OMX_U32 m_disp_hor_size;
- OMX_U32 m_disp_vert_size;
OMX_S64 prev_ts;
bool rst_prev_ts;
@@ -837,16 +801,6 @@ private:
int offset;
};
h264_mv_buffer h264_mv_buff;
-
- struct meta_buffer{
- unsigned char* buffer;
- int size;
- int count;
- int pmem_fd;
- int pmem_fd_iommu;
- int offset;
- };
- meta_buffer meta_buff;
extra_data_handler extra_data_handle;
#ifdef _ANDROID_
DivXDrmDecrypt* iDivXDrmDecrypt;
@@ -855,22 +809,13 @@ private:
omx_time_stamp_reorder time_stamp_dts;
desc_buffer_hdr *m_desc_buffer_ptr;
bool secure_mode;
- bool external_meta_buffer;
- bool external_meta_buffer_iommu;
OMX_QCOM_EXTRADATA_FRAMEINFO *m_extradata;
bool codec_config_flag;
-#ifdef _MSM8974_
+#ifdef _COPPER_
int capture_capability;
int output_capability;
bool streaming[MAX_PORT];
- OMX_CONFIG_RECTTYPE rectangle;
#endif
- bool m_power_hinted;
- OMX_ERRORTYPE power_module_register();
- OMX_ERRORTYPE power_module_deregister();
- bool msg_thread_created;
- bool async_thread_created;
-
unsigned int m_fill_output_msg;
class allocate_color_convert_buf {
public:
@@ -907,9 +852,7 @@ private:
OMX_QCOM_PLATFORM_PRIVATE_ENTRY m_platform_entry_client[MAX_COUNT];
OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO m_pmem_info_client[MAX_COUNT];
OMX_BUFFERHEADERTYPE m_out_mem_ptr_client[MAX_COUNT];
-#ifdef USE_ION
struct vdec_ion op_buf_ion_info[MAX_COUNT];
-#endif
unsigned char *pmem_baseaddress[MAX_COUNT];
int pmem_fd[MAX_COUNT];
struct vidc_heap
@@ -918,12 +861,13 @@ private:
};
struct vidc_heap m_heap_ptr[MAX_COUNT];
};
-#if defined (_MSM8960_) || defined (_MSM8974_)
allocate_color_convert_buf client_buffers;
-#endif
+ static bool m_secure_display; //For qservice
+ int secureDisplay(int mode);
+ int unsecureDisplay(int mode);
};
-#ifdef _MSM8974_
+#ifdef _COPPER_
enum instance_state {
MSM_VIDC_CORE_UNINIT_DONE = 0x0001,
MSM_VIDC_CORE_INIT,
@@ -948,6 +892,6 @@ enum vidc_resposes_id {
MSM_VIDC_DECODER_EVENT_CHANGE,
};
-#endif // _MSM8974_
+#endif // _COPPER_
#endif // __OMX_VDEC_H__
diff --git a/mm-video/vidc/vdec/inc/power_module.h b/mm-video/vidc/vdec/inc/power_module.h
deleted file mode 100644
index 59586a1..0000000
--- a/mm-video/vidc/vdec/inc/power_module.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*-------------------------------------------------------------------------
-Copyright (c) 2012, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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 <hardware/power.h>
-
-class PowerModule
-{
- public:
- static PowerModule *getInstance();
- power_module_t *getPowerModuleHandle();
- private:
- static PowerModule *mPowerModuleInstance;
- power_module_t *mPowerModuleHandle;
- PowerModule() {}
-};
diff --git a/mm-video/vidc/vdec/inc/qtypes.h b/mm-video/vidc/vdec/inc/qtypes.h
index 63126af..707e621 100644
--- a/mm-video/vidc/vdec/inc/qtypes.h
+++ b/mm-video/vidc/vdec/inc/qtypes.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/vdec/inc/queue.h b/mm-video/vidc/vdec/inc/queue.h
index f22e43c..195d9b2 100644
--- a/mm-video/vidc/vdec/inc/queue.h
+++ b/mm-video/vidc/vdec/inc/queue.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/vdec/inc/ts_parser.h b/mm-video/vidc/vdec/inc/ts_parser.h
index 8e884c7..3e03043 100644
--- a/mm-video/vidc/vdec/inc/ts_parser.h
+++ b/mm-video/vidc/vdec/inc/ts_parser.h
@@ -1,88 +1,88 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 __DTSPARSER_H
-#define __DTSPARSER_H
-
-#include "OMX_Core.h"
-#include "OMX_QCOMExtns.h"
-#include "qc_omx_component.h"
-
-#include<stdlib.h>
-
-#include <stdio.h>
-#include <inttypes.h>
-
-#ifdef _ANDROID_
-extern "C"{
-#include<utils/Log.h>
-}
-#else
-#define ALOGE(fmt, args...) fprintf(stderr, fmt, ##args)
-#endif /* _ANDROID_ */
-
-class omx_time_stamp_reorder {
-public:
- omx_time_stamp_reorder();
- ~omx_time_stamp_reorder();
- void set_timestamp_reorder_mode(bool flag);
- void enable_debug_print(bool flag);
- bool insert_timestamp(OMX_BUFFERHEADERTYPE *header);
- bool get_next_timestamp(OMX_BUFFERHEADERTYPE *header, bool is_interlaced);
- bool remove_time_stamp(OMX_TICKS ts, bool is_interlaced);
- void flush_timestamp();
-
-private:
- #define TIME_SZ 64
- typedef struct timestamp {
- OMX_TICKS timestamps;
- bool in_use;
- }timestamp;
- typedef struct time_stamp_list {
- timestamp input_timestamps[TIME_SZ];
- time_stamp_list *next;
- time_stamp_list *prev;
- unsigned int entries_filled;
- }time_stamp_list;
- bool error;
- time_stamp_list *phead,*pcurrent;
- bool get_current_list();
- bool add_new_list();
- bool update_head();
- void delete_list();
- void handle_error()
- {
- ALOGE("Error handler called for TS Parser");
- if (error)
- return;
- error = true;
- delete_list();
- }
- bool reorder_ts;
- bool print_debug;
-};
-#endif
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2012, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 __DTSPARSER_H
+#define __DTSPARSER_H
+
+#include "OMX_Core.h"
+#include "OMX_QCOMExtns.h"
+#include "qc_omx_component.h"
+
+#include<stdlib.h>
+
+#include <stdio.h>
+#include <inttypes.h>
+
+#ifdef _ANDROID_
+extern "C"{
+#include<utils/Log.h>
+}
+#else
+#define ALOGE(fmt, args...) fprintf(stderr, fmt, ##args)
+#endif /* _ANDROID_ */
+
+class omx_time_stamp_reorder {
+public:
+ omx_time_stamp_reorder();
+ ~omx_time_stamp_reorder();
+ void set_timestamp_reorder_mode(bool flag);
+ void enable_debug_print(bool flag);
+ bool insert_timestamp(OMX_BUFFERHEADERTYPE *header);
+ bool get_next_timestamp(OMX_BUFFERHEADERTYPE *header, bool is_interlaced);
+ bool remove_time_stamp(OMX_TICKS ts, bool is_interlaced);
+ void flush_timestamp();
+
+private:
+ #define TIME_SZ 64
+ typedef struct timestamp {
+ OMX_TICKS timestamps;
+ bool in_use;
+ }timestamp;
+ typedef struct time_stamp_list {
+ timestamp input_timestamps[TIME_SZ];
+ time_stamp_list *next;
+ time_stamp_list *prev;
+ unsigned int entries_filled;
+ }time_stamp_list;
+ bool error;
+ time_stamp_list *phead,*pcurrent;
+ bool get_current_list();
+ bool add_new_list();
+ bool update_head();
+ void delete_list();
+ void handle_error()
+ {
+ ALOGE("Error handler called for TS Parser");
+ if (error)
+ return;
+ error = true;
+ delete_list();
+ }
+ bool reorder_ts;
+ bool print_debug;
+};
+#endif
diff --git a/mm-video/vidc/vdec/src/frameparser.cpp b/mm-video/vidc/vdec/src/frameparser.cpp
index df8dc83..ab0f7c1 100644
--- a/mm-video/vidc/vdec/src/frameparser.cpp
+++ b/mm-video/vidc/vdec/src/frameparser.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -43,7 +43,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <stdint.h>
#include "frameparser.h"
-//#include "omx_vdec.h"
#ifdef _ANDROID_
extern "C"{
@@ -74,18 +73,17 @@ static unsigned char VC1_AP_mask_code[4] = {0xFF,0xFF,0xFF,0xFC};
static unsigned char MPEG2_start_code[4] = {0x00, 0x00, 0x01, 0x00};
static unsigned char MPEG2_mask_code[4] = {0xFF, 0xFF, 0xFF, 0xFF};
-frame_parse::frame_parse():mutils(NULL),
- parse_state(A0),
- start_code(NULL),
- mask_code(NULL),
+frame_parse::frame_parse():parse_state(A0),
last_byte_h263(0),
- last_byte(0),
- header_found(false),
- skip_frame_boundary(false),
state_nal(NAL_LENGTH_ACC),
nal_length(0),
accum_length(0),
- bytes_tobeparsed(0)
+ bytes_tobeparsed(0),
+ mutils(NULL),
+ start_code(NULL),
+ mask_code(NULL),
+ header_found(false),
+ skip_frame_boundary(false)
{
}
@@ -127,12 +125,6 @@ int frame_parse::init_start_codes (codec_type codec_type_parse)
start_code = MPEG2_start_code;
mask_code = MPEG2_mask_code;
break;
-#ifdef _MSM8974_
- case CODEC_TYPE_VP8:
- break;
-#endif
- default:
- return -1;
}
return 1;
}
@@ -337,7 +329,6 @@ int frame_parse::parse_sc_frame ( OMX_BUFFERHEADERTYPE *source,
break;
case A4:
case A0:
- case A5:
break;
}
dest_len = dest->nAllocLen - (dest->nFilledLen + dest->nOffset);
@@ -456,9 +447,6 @@ int frame_parse::parse_sc_frame ( OMX_BUFFERHEADERTYPE *source,
parse_state = A0;
}
break;
- case A4:
- case A5:
- break;
}
/*Found the code break*/
diff --git a/mm-video/vidc/vdec/src/h264_utils.cpp b/mm-video/vidc/vdec/src/h264_utils.cpp
index 2cd40c3..6a07a3c 100644
--- a/mm-video/vidc/vdec/src/h264_utils.cpp
+++ b/mm-video/vidc/vdec/src/h264_utils.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -304,7 +304,7 @@ boolean H264_Utils::extract_rbsp(OMX_IN OMX_U8 *buffer,
ALOGE("ERROR: In %s() - line %d", __func__, __LINE__);
return false;
}
- if ((nal_unit->forbidden_zero_bit = (buffer[pos] & 0x80)) != 0)
+ if (nal_unit->forbidden_zero_bit = (buffer[pos] & 0x80))
{
ALOGE("ERROR: In %s() - line %d", __func__, __LINE__);
}
@@ -739,7 +739,7 @@ void h264_stream_parser::aspect_ratio_info()
void h264_stream_parser::hrd_parameters(h264_hrd_param *hrd_param)
{
- OMX_U32 idx;
+ int idx;
ALOGV("hrd_parameters: IN");
hrd_param->cpb_cnt = uev() + 1;
hrd_param->bit_rate_scale = extract_bits(4);
@@ -823,7 +823,7 @@ void h264_stream_parser::parse_sei()
void h264_stream_parser::sei_buffering_period()
{
- OMX_U32 idx;
+ int idx;
OMX_U32 value = 0;
h264_hrd_param *hrd_param = NULL;
ALOGV("@@sei_buffering_period: IN");
@@ -912,7 +912,7 @@ void h264_stream_parser::sei_picture_timing()
ALOGE("sei_picture_timing: pic_struct invalid!");
}
ALOGV("-->num_clock_ts : %u", sei_pic_timing.num_clock_ts);
- for (OMX_U32 i = 0; i < sei_pic_timing.num_clock_ts && more_bits(); i++)
+ for (int i = 0; i < sei_pic_timing.num_clock_ts && more_bits(); i++)
{
sei_pic_timing.clock_ts_flag = extract_bits(1);
if(sei_pic_timing.clock_ts_flag)
@@ -987,7 +987,7 @@ void h264_stream_parser::sei_pan_scan()
pan_scan_param->rect_id = uev();
if (pan_scan_param->rect_id > 0xFF)
{
- ALOGE("sei_pan_scan: ERROR: Invalid rect_id[%lu]!", pan_scan_param->rect_id);
+ ALOGE("sei_pan_scan: ERROR: Invalid rect_id[%u]!", pan_scan_param->rect_id);
pan_scan_param->rect_id = NO_PAN_SCAN_BIT;
return;
}
@@ -1001,12 +1001,12 @@ void h264_stream_parser::sei_pan_scan()
pan_scan_param->cnt = uev() + 1;
if (pan_scan_param->cnt > MAX_PAN_SCAN_RECT)
{
- ALOGE("sei_pan_scan: ERROR: Invalid num of rect [%lu]!", pan_scan_param->cnt);
+ ALOGE("sei_pan_scan: ERROR: Invalid num of rect [%u]!", pan_scan_param->cnt);
pan_scan_param->rect_id = NO_PAN_SCAN_BIT;
return;
}
- for (OMX_U32 i = 0; i < pan_scan_param->cnt; i++)
+ for (int i = 0; i < pan_scan_param->cnt; i++)
{
pan_scan_param->rect_left_offset[i] = sev();
pan_scan_param->rect_right_offset[i] = sev();
@@ -1031,23 +1031,23 @@ void h264_stream_parser::sei_pan_scan()
void h264_stream_parser::print_pan_data(h264_pan_scan *pan_scan_param)
{
- ALOGE("@@print_pan_data: IN");
+ ALOGV("@@print_pan_data: IN");
- ALOGE("-->rect_id : %lu", pan_scan_param->rect_id);
- ALOGE("-->rect_cancel_flag : %u", pan_scan_param->rect_cancel_flag);
+ ALOGV("-->rect_id : %u", pan_scan_param->rect_id);
+ ALOGV("-->rect_cancel_flag : %u", pan_scan_param->rect_cancel_flag);
- ALOGE("-->cnt : %lu", pan_scan_param->cnt);
+ ALOGV("-->cnt : %u", pan_scan_param->cnt);
- for (OMX_U32 i = 0; i < pan_scan_param->cnt; i++)
+ for (int i = 0; i < pan_scan_param->cnt; i++)
{
- ALOGE("-->rect_left_offset : %ld", pan_scan_param->rect_left_offset[i]);
- ALOGE("-->rect_right_offset : %ld", pan_scan_param->rect_right_offset[i]);
- ALOGE("-->rect_top_offset : %ld", pan_scan_param->rect_top_offset[i]);
- ALOGE("-->rect_bottom_offset : %ld", pan_scan_param->rect_bottom_offset[i]);
+ ALOGV("-->rect_left_offset : %d", pan_scan_param->rect_left_offset[i]);
+ ALOGV("-->rect_right_offset : %d", pan_scan_param->rect_right_offset[i]);
+ ALOGV("-->rect_top_offset : %d", pan_scan_param->rect_top_offset[i]);
+ ALOGV("-->rect_bottom_offset : %d", pan_scan_param->rect_bottom_offset[i]);
}
- ALOGE("-->repetition_period : %lu", pan_scan_param->rect_repetition_period);
+ ALOGV("-->repetition_period : %u", pan_scan_param->rect_repetition_period);
- ALOGE("@@print_pan_data: OUT");
+ ALOGV("@@print_pan_data: OUT");
}
void h264_stream_parser::parse_sps()
diff --git a/mm-video/vidc/vdec/src/message_queue.c b/mm-video/vidc/vdec/src/message_queue.c
index a6b491e..8cfa9fe 100644
--- a/mm-video/vidc/vdec/src/message_queue.c
+++ b/mm-video/vidc/vdec/src/message_queue.c
@@ -1,178 +1,178 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "message_queue.h"
-
-int check_if_queue_empty ( unsigned int queuetocheck, void* queuecontext )
-{
- struct video_queue_context *ptr_q = NULL;
- /*
- * queuetocheck - 0 command queue
- * queuetocheck - 1 data queue
- */
- if ( queuecontext == NULL || (queuetocheck > 1 ) )
- {
- return 1;
- }
- ptr_q = (struct video_queue_context *)queuecontext;
-
- if (queuetocheck == 0)
- {
- if (ptr_q->read_comq == ptr_q->write_comq)
- {
- return 1;
- }
- }
- else if (queuetocheck == 1)
- {
- if (ptr_q->write_dataq == ptr_q->read_dataq)
- {
- return 1;
- }
- }
-
- return 0;
-}
-
-
-
-struct video_msgq * queue_get_cmd (void* queuecontext )
-{
- struct video_queue_context *ptr_q = NULL;
- struct video_msgq *pitem = NULL;
-
- if( NULL == queuecontext )
- {
- printf("\n queue_get_cmd: Invalid Input parameter\n");
- return NULL;
- }
-
- ptr_q = (struct video_queue_context *)queuecontext;
-
- /* Wait on the semaphore till it is released */
- sem_wait(&ptr_q->sem_message);
-
- /* Lock the mutex to protect the critical section */
- pthread_mutex_lock(&ptr_q->mutex);
-
- if (ptr_q->read_comq != ptr_q->write_comq)
- {
- pitem = &ptr_q->ptr_cmdq [ptr_q->read_comq];
- ptr_q->read_comq = (ptr_q->read_comq + 1) % \
- ptr_q->commandq_size;
- }
- else if (ptr_q->write_dataq != ptr_q->read_dataq)
- {
- pitem = &ptr_q->ptr_dataq [ptr_q->read_dataq];
- ptr_q->read_dataq = (ptr_q->read_dataq + 1) % \
- ptr_q->dataq_size;
- }
-
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
-
- return pitem;
-}
-
-
-int queue_post_cmdq ( void* queuecontext,
- struct video_msgq *pitem
- )
-{
- struct video_queue_context *ptr_q = NULL;
-
- if (pitem == NULL || queuecontext == NULL)
- {
- return -1;
- }
- ptr_q = (struct video_queue_context *)queuecontext;
-
- /* Lock the mutex to protect the critical section */
- pthread_mutex_lock(&ptr_q->mutex);
-
- if ((ptr_q->write_comq + 1) % ptr_q->commandq_size == ptr_q->read_comq)
- {
- printf("\n QUEUE is FULL");
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
- return 0;
- }
- else
- {
- /* Store the command in the Message Queue & increment write offset */
- memcpy ( &ptr_q->ptr_cmdq [ptr_q->write_comq],pitem, \
- sizeof (struct video_msgq));
- ptr_q->write_comq = (ptr_q->write_comq + 1) % ptr_q->commandq_size;
- }
-
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
-
- /* Post the semaphore */
- sem_post(&ptr_q->sem_message);
- return 1;
-}
-
-
-int queue_post_dataq ( void *queuecontext,
- struct video_msgq *pitem
- )
-{
- struct video_queue_context *ptr_q = NULL;
-
- if (pitem == NULL || queuecontext == NULL)
- {
- return -1;
- }
- ptr_q = (struct video_queue_context *)queuecontext;
-
- /* Lock the mutex to protect the critical section */
- pthread_mutex_lock(&ptr_q->mutex);
-
- if ((ptr_q->write_dataq + 1) % ptr_q->dataq_size == ptr_q->read_dataq)
- {
- printf("\n QUEUE is FULL");
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
- return 0;
- }
- else
- {
- /* Store the command in the Message Queue & increment write offset */
- memcpy ( &ptr_q->ptr_dataq [ptr_q->write_dataq],pitem, \
- sizeof (struct video_msgq));
- ptr_q->write_dataq = (ptr_q->write_dataq + 1) % ptr_q->dataq_size;
- }
-
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
-
- /* Post the semaphore */
- sem_post(&ptr_q->sem_message);
- return 1;
-
-}
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2012, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "message_queue.h"
+
+int check_if_queue_empty ( unsigned int queuetocheck, void* queuecontext )
+{
+ struct video_queue_context *ptr_q = NULL;
+ /*
+ * queuetocheck - 0 command queue
+ * queuetocheck - 1 data queue
+ */
+ if ( queuecontext == NULL || (queuetocheck > 1 ) )
+ {
+ return 1;
+ }
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ if (queuetocheck == 0)
+ {
+ if (ptr_q->read_comq == ptr_q->write_comq)
+ {
+ return 1;
+ }
+ }
+ else if (queuetocheck == 1)
+ {
+ if (ptr_q->write_dataq == ptr_q->read_dataq)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+
+struct video_msgq * queue_get_cmd (void* queuecontext )
+{
+ struct video_queue_context *ptr_q = NULL;
+ struct video_msgq *pitem = NULL;
+
+ if( NULL == queuecontext )
+ {
+ printf("\n queue_get_cmd: Invalid Input parameter\n");
+ return NULL;
+ }
+
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ /* Wait on the semaphore till it is released */
+ sem_wait(&ptr_q->sem_message);
+
+ /* Lock the mutex to protect the critical section */
+ pthread_mutex_lock(&ptr_q->mutex);
+
+ if (ptr_q->read_comq != ptr_q->write_comq)
+ {
+ pitem = &ptr_q->ptr_cmdq [ptr_q->read_comq];
+ ptr_q->read_comq = (ptr_q->read_comq + 1) % \
+ ptr_q->commandq_size;
+ }
+ else if (ptr_q->write_dataq != ptr_q->read_dataq)
+ {
+ pitem = &ptr_q->ptr_dataq [ptr_q->read_dataq];
+ ptr_q->read_dataq = (ptr_q->read_dataq + 1) % \
+ ptr_q->dataq_size;
+ }
+
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+
+ return pitem;
+}
+
+
+int queue_post_cmdq ( void* queuecontext,
+ struct video_msgq *pitem
+ )
+{
+ struct video_queue_context *ptr_q = NULL;
+
+ if (pitem == NULL || queuecontext == NULL)
+ {
+ return -1;
+ }
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ /* Lock the mutex to protect the critical section */
+ pthread_mutex_lock(&ptr_q->mutex);
+
+ if ((ptr_q->write_comq + 1) % ptr_q->commandq_size == ptr_q->read_comq)
+ {
+ printf("\n QUEUE is FULL");
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+ return 0;
+ }
+ else
+ {
+ /* Store the command in the Message Queue & increment write offset */
+ memcpy ( &ptr_q->ptr_cmdq [ptr_q->write_comq],pitem, \
+ sizeof (struct video_msgq));
+ ptr_q->write_comq = (ptr_q->write_comq + 1) % ptr_q->commandq_size;
+ }
+
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+
+ /* Post the semaphore */
+ sem_post(&ptr_q->sem_message);
+ return 1;
+}
+
+
+int queue_post_dataq ( void *queuecontext,
+ struct video_msgq *pitem
+ )
+{
+ struct video_queue_context *ptr_q = NULL;
+
+ if (pitem == NULL || queuecontext == NULL)
+ {
+ return -1;
+ }
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ /* Lock the mutex to protect the critical section */
+ pthread_mutex_lock(&ptr_q->mutex);
+
+ if ((ptr_q->write_dataq + 1) % ptr_q->dataq_size == ptr_q->read_dataq)
+ {
+ printf("\n QUEUE is FULL");
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+ return 0;
+ }
+ else
+ {
+ /* Store the command in the Message Queue & increment write offset */
+ memcpy ( &ptr_q->ptr_dataq [ptr_q->write_dataq],pitem, \
+ sizeof (struct video_msgq));
+ ptr_q->write_dataq = (ptr_q->write_dataq + 1) % ptr_q->dataq_size;
+ }
+
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+
+ /* Post the semaphore */
+ sem_post(&ptr_q->sem_message);
+ return 1;
+
+}
diff --git a/mm-video/vidc/vdec/src/mp4_utils.cpp b/mm-video/vidc/vdec/src/mp4_utils.cpp
index 95335d0..ef63042 100644
--- a/mm-video/vidc/vdec/src/mp4_utils.cpp
+++ b/mm-video/vidc/vdec/src/mp4_utils.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -26,7 +26,7 @@ OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------*/
#include "mp4_utils.h"
-//#include "omx_vdec.h"
+#include "omx_vdec.h"
# include <stdio.h>
#ifdef _ANDROID_
extern "C"{
@@ -300,3 +300,45 @@ bool MP4_Utils::is_notcodec_vop(unsigned char *pbuffer, unsigned int len)
}
return false;
}
+
+void mp4_fill_aspect_ratio_info(struct vdec_aspectratioinfo *aspect_ratio_info,
+ OMX_QCOM_EXTRADATA_FRAMEINFO *frame_info)
+{
+ switch(aspect_ratio_info->aspect_ratio) {
+ case 1 :
+ frame_info->aspectRatio.aspectRatioX = 1;
+ frame_info->aspectRatio.aspectRatioY = 1;
+ break;
+
+ case 2 :
+ frame_info->aspectRatio.aspectRatioX = 12;
+ frame_info->aspectRatio.aspectRatioY = 11;
+ break;
+
+ case 3 :
+ frame_info->aspectRatio.aspectRatioX = 10;
+ frame_info->aspectRatio.aspectRatioY = 11;
+ break;
+
+ case 4 :
+ frame_info->aspectRatio.aspectRatioX = 16;
+ frame_info->aspectRatio.aspectRatioY = 11;
+ break;
+
+ case 5 :
+ frame_info->aspectRatio.aspectRatioX = 40;
+ frame_info->aspectRatio.aspectRatioY = 33;
+ break;
+
+ case 15:
+ frame_info->aspectRatio.aspectRatioX =
+ aspect_ratio_info->par_width;
+ frame_info->aspectRatio.aspectRatioY =
+ aspect_ratio_info->par_height;
+ break;
+
+ default:
+ ALOGE(" Incorrect aspect_ratio = %d",
+ aspect_ratio_info->aspect_ratio);
+ }
+}
diff --git a/mm-video/vidc/vdec/src/omx_vdec.cpp b/mm-video/vidc/vdec/src/omx_vdec.cpp
index 533ac4c..d66d946 100644
--- a/mm-video/vidc/vdec/src/omx_vdec.cpp
+++ b/mm-video/vidc/vdec/src/omx_vdec.cpp
@@ -1,31 +1,29 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
+Copyright (c) 2010-2012, Code Aurora Forum. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+ 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
--------------------------------------------------------------------------*/
/*============================================================================
@@ -40,18 +38,13 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//////////////////////////////////////////////////////////////////////////////
// Include Files
//////////////////////////////////////////////////////////////////////////////
-#define JB_MR1
+
#include <string.h>
#include <pthread.h>
#include <sys/prctl.h>
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
-#ifndef JB_MR1
-#include <ihwc.h>
-#include <binder/IServiceManager.h>
-#endif
-#include "power_module.h"
#include "omx_vdec.h"
#include <fcntl.h>
#include <limits.h>
@@ -70,10 +63,6 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gralloc_priv.h>
#endif
-#if defined (_ANDROID_ICS_)
-#include <qdMetaData.h>
-#endif
-
#ifdef _ANDROID_
#include "DivXDrmDecrypt.h"
#endif //_ANDROID_
@@ -124,11 +113,7 @@ char ouputextradatafilename [] = "/data/extradata";
#ifdef USE_ION
#define MEM_DEVICE "/dev/ion"
- #ifdef MAX_RES_720P
- #define MEM_HEAP_ID ION_CAMERA_HEAP_ID
- #else
#define MEM_HEAP_ID ION_CP_MM_HEAP_ID
- #endif
#elif MAX_RES_720P
#define MEM_DEVICE "/dev/pmem_adsp"
#elif MAX_RES_1080P_EBI
@@ -137,13 +122,6 @@ char ouputextradatafilename [] = "/data/extradata";
#define MEM_DEVICE "/dev/pmem_smipool"
#endif
-
-#ifdef MAX_RES_720P
-#define DEVICE_SCRATCH 0
-#else
-#define DEVICE_SCRATCH 64
-#endif
-
/*
#ifdef _ANDROID_
extern "C"{
@@ -152,6 +130,14 @@ char ouputextradatafilename [] = "/data/extradata";
#endif//_ANDROID_
*/
+#undef DEBUG_PRINT_LOW
+#undef DEBUG_PRINT_HIGH
+#undef DEBUG_PRINT_ERROR
+
+#define DEBUG_PRINT_LOW ALOGV
+#define DEBUG_PRINT_HIGH ALOGV
+#define DEBUG_PRINT_ERROR ALOGE
+
#ifndef _ANDROID_
#include <glib.h>
#define strlcpy g_strlcpy
@@ -160,13 +146,15 @@ char ouputextradatafilename [] = "/data/extradata";
#define Log2(number, power) { OMX_U32 temp = number; power = 0; while( (0 == (temp & 0x1)) && power < 16) { temp >>=0x1; power++; } }
#define Q16ToFraction(q,num,den) { OMX_U32 power; Log2(q,power); num = q >> power; den = 0x1 << (16 - power); }
+bool omx_vdec::m_secure_display = false;
+
void* async_message_thread (void *input)
{
struct vdec_ioctl_msg ioctl_msg;
struct vdec_msginfo vdec_msg;
omx_vdec *omx = reinterpret_cast<omx_vdec*>(input);
int error_code = 0;
- DEBUG_PRINT_HIGH("omx_vdec: Async thread start");
+ DEBUG_PRINT_HIGH("omx_vdec: Async thread start\n");
prctl(PR_SET_NAME, (unsigned long)"VideoDecCallBackThread", 0, 0, 0);
while (1)
{
@@ -189,7 +177,7 @@ void* async_message_thread (void *input)
DEBUG_PRINT_ERROR("\nERROR:Wrong ioctl message");
}
}
- DEBUG_PRINT_HIGH("omx_vdec: Async thread stop");
+ DEBUG_PRINT_HIGH("omx_vdec: Async thread stop\n");
return NULL;
}
@@ -199,7 +187,7 @@ void* message_thread(void *input)
unsigned char id;
int n;
- DEBUG_PRINT_HIGH("omx_vdec: message thread start");
+ DEBUG_PRINT_HIGH("omx_vdec: message thread start\n");
prctl(PR_SET_NAME, (unsigned long)"VideoDecMsgThread", 0, 0, 0);
while (1)
{
@@ -221,16 +209,16 @@ void* message_thread(void *input)
break;
}
}
- DEBUG_PRINT_HIGH("omx_vdec: message thread stop");
+ DEBUG_PRINT_HIGH("omx_vdec: message thread stop\n");
return 0;
}
void post_message(omx_vdec *omx, unsigned char id)
{
int ret_value;
- DEBUG_PRINT_LOW("omx_vdec: post_message %d pipe out%d", id,omx->m_pipe_out);
+ DEBUG_PRINT_LOW("omx_vdec: post_message %d pipe out%d\n", id,omx->m_pipe_out);
ret_value = write(omx->m_pipe_out, &id, 1);
- DEBUG_PRINT_LOW("post_message to pipe done %d",ret_value);
+ DEBUG_PRINT_LOW("post_message to pipe done %d\n",ret_value);
}
// omx_cmd_queue destructor
@@ -264,7 +252,7 @@ bool omx_vdec::omx_cmd_queue::insert_entry(unsigned p1, unsigned p2, unsigned id
else
{
ret = false;
- DEBUG_PRINT_ERROR("\n ERROR: %s()::Command Queue Full", __func__);
+ DEBUG_PRINT_ERROR("ERROR: %s()::Command Queue Full\n", __func__);
}
return ret;
}
@@ -486,8 +474,6 @@ omx_vdec::omx_vdec(): m_state(OMX_StateInvalid),
h264_last_au_ts(LLONG_MAX),
h264_last_au_flags(0),
m_inp_err_count(0),
- m_disp_hor_size(0),
- m_disp_vert_size(0),
#ifdef _ANDROID_
m_heap_ptr(NULL),
m_heap_count(0),
@@ -498,15 +484,12 @@ omx_vdec::omx_vdec(): m_state(OMX_StateInvalid),
m_use_output_pmem(OMX_FALSE),
m_out_mem_region_smi(OMX_FALSE),
m_out_pvt_entry_pmem(OMX_FALSE),
- secure_mode(false),
- external_meta_buffer(false),
- external_meta_buffer_iommu(false)
+ secure_mode(false)
#ifdef _ANDROID_
,iDivXDrmDecrypt(NULL)
#endif
,m_desc_buffer_ptr(NULL)
,m_extradata(NULL)
- ,m_power_hinted(false)
{
/* Assumption is that , to begin with , we have all the frames with decoder */
DEBUG_PRINT_HIGH("In OMX vdec Constructor");
@@ -544,8 +527,6 @@ omx_vdec::omx_vdec(): m_state(OMX_StateInvalid),
memset(&op_buf_rcnfg, 0 ,sizeof(vdec_allocatorproperty));
memset(m_demux_offsets, 0, ( sizeof(OMX_U32) * 8192) );
m_demux_entries = 0;
- msg_thread_created = false;
- async_thread_created = false;
drv_ctx.timestamp_adjust = false;
drv_ctx.video_driver_fd = -1;
m_vendor_config.pData = NULL;
@@ -583,20 +564,10 @@ omx_vdec::~omx_vdec()
if(m_pipe_out) close(m_pipe_out);
m_pipe_in = -1;
m_pipe_out = -1;
- if (msg_thread_created)
- {
- DEBUG_PRINT_HIGH("Waiting on OMX Msg Thread exit");
- pthread_join(msg_thread_id,NULL);
- }
- if (async_thread_created)
- {
- DEBUG_PRINT_HIGH("Waiting on OMX Async Thread exit");
- pthread_join(async_thread_id,NULL);
- }
- DEBUG_PRINT_HIGH("Calling close() on Video Driver");
- close (drv_ctx.video_driver_fd);
- drv_ctx.video_driver_fd = -1;
-
+ DEBUG_PRINT_HIGH("Waiting on OMX Msg Thread exit");
+ pthread_join(msg_thread_id,NULL);
+ DEBUG_PRINT_HIGH("Waiting on OMX Async Thread exit");
+ pthread_join(async_thread_id,NULL);
pthread_mutex_destroy(&m_lock);
sem_destroy(&m_cmd_lock);
#ifdef _ANDROID_
@@ -638,7 +609,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
if(!pThis)
{
- DEBUG_PRINT_ERROR("\n ERROR: %s()::Context is incorrect, bailing out",
+ DEBUG_PRINT_ERROR("ERROR: %s()::Context is incorrect, bailing out\n",
__func__);
return;
}
@@ -686,7 +657,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
{
case OMX_CommandStateSet:
pThis->m_state = (OMX_STATETYPE) p2;
- DEBUG_PRINT_HIGH("OMX_CommandStateSet complete, m_state = %d",
+ DEBUG_PRINT_HIGH("\n OMX_CommandStateSet complete, m_state = %d",
pThis->m_state);
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete, p1, p2, NULL);
@@ -712,7 +683,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_CommandPortDisable:
- DEBUG_PRINT_HIGH("OMX_CommandPortDisable complete for port [%d]", p2);
+ DEBUG_PRINT_HIGH("\n OMX_CommandPortDisable complete for port [%d]", p2);
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_IN_DISABLE_PENDING))
{
@@ -735,7 +706,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
OMX_EventCmdComplete, p1, p2, NULL );
break;
case OMX_CommandPortEnable:
- DEBUG_PRINT_HIGH("OMX_CommandPortEnable complete for port [%d]", p2);
+ DEBUG_PRINT_HIGH("\n OMX_CommandPortEnable complete for port [%d]", p2);
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,\
OMX_EventCmdComplete, p1, p2, NULL );
break;
@@ -749,7 +720,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
}
else
{
- DEBUG_PRINT_ERROR("\n ERROR: %s()::EventHandler is NULL", __func__);
+ DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL\n", __func__);
}
break;
case OMX_COMPONENT_GENERATE_ETB_ARBITRARY:
@@ -844,7 +815,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_EVENT_INPUT_FLUSH:
- DEBUG_PRINT_HIGH("Driver flush i/p Port complete");
+ DEBUG_PRINT_HIGH("\n Driver flush i/p Port complete");
if (!pThis->input_flush_progress)
{
DEBUG_PRINT_ERROR("\n WARNING: Unexpected flush from driver");
@@ -866,7 +837,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
OMX_COMPONENT_INPUT_FLUSH_PENDING))
{
BITMASK_CLEAR (&pThis->m_flags,OMX_COMPONENT_INPUT_FLUSH_PENDING);
- DEBUG_PRINT_LOW("Input Flush completed - Notify Client");
+ DEBUG_PRINT_LOW("\n Input Flush completed - Notify Client");
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandFlush,
OMX_CORE_INPUT_PORT_INDEX,NULL );
@@ -876,7 +847,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
{
if (!pThis->output_flush_progress)
{
- DEBUG_PRINT_LOW("Output flush done hence issue stop");
+ DEBUG_PRINT_LOW("\n Output flush done hence issue stop");
if (ioctl (pThis->drv_ctx.video_driver_fd,
VDEC_IOCTL_CMD_STOP,NULL ) < 0)
{
@@ -895,7 +866,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_EVENT_OUTPUT_FLUSH:
- DEBUG_PRINT_HIGH("Driver flush o/p Port complete");
+ DEBUG_PRINT_HIGH("\n Driver flush o/p Port complete");
if (!pThis->output_flush_progress)
{
DEBUG_PRINT_ERROR("\n WARNING: Unexpected flush from driver");
@@ -916,7 +887,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
if(BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_PENDING))
{
- DEBUG_PRINT_LOW("Notify Output Flush done");
+ DEBUG_PRINT_LOW("\n Notify Output Flush done");
BITMASK_CLEAR (&pThis->m_flags,OMX_COMPONENT_OUTPUT_FLUSH_PENDING);
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandFlush,
@@ -925,7 +896,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
if(BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_IN_DISABLE_PENDING))
{
- DEBUG_PRINT_LOW("Internal flush complete");
+ DEBUG_PRINT_LOW("\n Internal flush complete");
BITMASK_CLEAR (&pThis->m_flags,
OMX_COMPONENT_OUTPUT_FLUSH_IN_DISABLE_PENDING);
if (BITMASK_PRESENT(&pThis->m_flags,
@@ -944,7 +915,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
{
if (!pThis->input_flush_progress)
{
- DEBUG_PRINT_LOW("Input flush done hence issue stop");
+ DEBUG_PRINT_LOW("\n Input flush done hence issue stop");
if (ioctl (pThis->drv_ctx.video_driver_fd,
VDEC_IOCTL_CMD_STOP,NULL ) < 0)
{
@@ -963,7 +934,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_START_DONE:
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_START_DONE");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_START_DONE");
if (pThis->m_cb.EventHandler)
{
@@ -974,10 +945,10 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
}
else
{
- DEBUG_PRINT_LOW("OMX_COMPONENT_GENERATE_START_DONE Success");
+ DEBUG_PRINT_LOW("\n OMX_COMPONENT_GENERATE_START_DONE Success");
if(BITMASK_PRESENT(&pThis->m_flags,OMX_COMPONENT_EXECUTE_PENDING))
{
- DEBUG_PRINT_LOW("Move to executing");
+ DEBUG_PRINT_LOW("\n Move to executing");
// Send the callback now
BITMASK_CLEAR((&pThis->m_flags),OMX_COMPONENT_EXECUTE_PENDING);
pThis->m_state = OMX_StateExecuting;
@@ -999,12 +970,12 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
}
else
{
- DEBUG_PRINT_ERROR("\n Event Handler callback is NULL");
+ DEBUG_PRINT_LOW("\n Event Handler callback is NULL");
}
break;
case OMX_COMPONENT_GENERATE_PAUSE_DONE:
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_PAUSE_DONE");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_PAUSE_DONE");
if (pThis->m_cb.EventHandler)
{
if (p2 != VDEC_S_SUCCESS)
@@ -1017,7 +988,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
pThis->complete_pending_buffer_done_cbs();
if(BITMASK_PRESENT(&pThis->m_flags,OMX_COMPONENT_PAUSE_PENDING))
{
- DEBUG_PRINT_LOW("OMX_COMPONENT_GENERATE_PAUSE_DONE nofity");
+ DEBUG_PRINT_LOW("\n OMX_COMPONENT_GENERATE_PAUSE_DONE nofity");
//Send the callback now
BITMASK_CLEAR((&pThis->m_flags),OMX_COMPONENT_PAUSE_PENDING);
pThis->m_state = OMX_StatePause;
@@ -1035,7 +1006,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_RESUME_DONE:
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_RESUME_DONE");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_RESUME_DONE");
if (pThis->m_cb.EventHandler)
{
if (p2 != VDEC_S_SUCCESS)
@@ -1047,7 +1018,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
{
if(BITMASK_PRESENT(&pThis->m_flags,OMX_COMPONENT_EXECUTE_PENDING))
{
- DEBUG_PRINT_LOW("Moving the decoder to execute state");
+ DEBUG_PRINT_LOW("\n Moving the decoder to execute state");
// Send the callback now
BITMASK_CLEAR((&pThis->m_flags),OMX_COMPONENT_EXECUTE_PENDING);
pThis->m_state = OMX_StateExecuting;
@@ -1065,7 +1036,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_STOP_DONE:
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_STOP_DONE");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_STOP_DONE");
if (pThis->m_cb.EventHandler)
{
if (p2 != VDEC_S_SUCCESS)
@@ -1078,11 +1049,11 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
pThis->complete_pending_buffer_done_cbs();
if(BITMASK_PRESENT(&pThis->m_flags,OMX_COMPONENT_IDLE_PENDING))
{
- DEBUG_PRINT_LOW("OMX_COMPONENT_GENERATE_STOP_DONE Success");
+ DEBUG_PRINT_LOW("\n OMX_COMPONENT_GENERATE_STOP_DONE Success");
// Send the callback now
BITMASK_CLEAR((&pThis->m_flags),OMX_COMPONENT_IDLE_PENDING);
pThis->m_state = OMX_StateIdle;
- DEBUG_PRINT_LOW("Move to Idle State");
+ DEBUG_PRINT_LOW("\n Move to Idle State");
pThis->m_cb.EventHandler(&pThis->m_cmp,pThis->m_app_data,
OMX_EventCmdComplete,OMX_CommandStateSet,
OMX_StateIdle,NULL);
@@ -1097,7 +1068,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_PORT_RECONFIG:
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_PORT_RECONFIG");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_PORT_RECONFIG");
if (pThis->start_port_reconfig() != OMX_ErrorNone)
pThis->omx_report_error();
else
@@ -1132,7 +1103,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_EOS_DONE:
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_EOS_DONE");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_EOS_DONE");
if (pThis->m_cb.EventHandler) {
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data, OMX_EventBufferFlag,
OMX_CORE_OUTPUT_PORT_INDEX, OMX_BUFFERFLAG_EOS, NULL );
@@ -1149,17 +1120,13 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
break;
case OMX_COMPONENT_GENERATE_INFO_PORT_RECONFIG:
{
- DEBUG_PRINT_HIGH("Rxd OMX_COMPONENT_GENERATE_INFO_PORT_RECONFIG");
+ DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_INFO_PORT_RECONFIG");
if (pThis->m_cb.EventHandler) {
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
(OMX_EVENTTYPE)OMX_EventIndexsettingChanged, OMX_CORE_OUTPUT_PORT_INDEX, 0, NULL );
} else {
DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL", __func__);
}
-
- //update power HAL with new width, height and bitrate
- pThis->power_module_deregister();
- pThis->power_module_register();
}
default:
break;
@@ -1201,67 +1168,40 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_ERRORTYPE eRet = OMX_ErrorNone;
struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
unsigned int alignment = 0,buffer_size = 0;
- int is_secure = 0;
- int i = 0;
int fds[2];
int r;
OMX_STRING device_name = "/dev/msm_vidc_dec";
-#ifndef JB_MR1
- sp<IServiceManager> sm;
- sp<hwcService::IHWComposer> hwcBinder = NULL;
-#endif
if(!strncmp(role, "OMX.qcom.video.decoder.avc.secure",OMX_MAX_STRINGNAME_SIZE)){
secure_mode = true;
arbitrary_bytes = false;
role = "OMX.qcom.video.decoder.avc";
device_name = "/dev/msm_vidc_dec_sec";
- is_secure = 1;
- } else if (!strncmp(role, "OMX.qcom.video.decoder.mpeg2.secure",OMX_MAX_STRINGNAME_SIZE)){
- secure_mode = true;
- arbitrary_bytes = false;
- role = "OMX.qcom.video.decoder.mpeg2";
- device_name = "/dev/msm_vidc_dec_sec";
- is_secure = 1;
}
-#ifndef JB_MR1
+
if (secure_mode) {
- sm = defaultServiceManager();
- hwcBinder =
- interface_cast<hwcService::IHWComposer>(sm->getService(String16("display.hwcservice")));
- if (hwcBinder != NULL) {
- hwcBinder->setOpenSecureStart();
- } else {
- DEBUG_PRINT_HIGH("Failed to get ref to hwcBinder, "
- "cannot call secure display start");
+ if (secureDisplay(qService::IQService::START) < 0) {
+ DEBUG_PRINT_HIGH("Sending message to start securing display failed");
}
}
-#endif
- DEBUG_PRINT_HIGH("omx_vdec::component_init(): Start of New Playback : role = %s : DEVICE = %s",
+
+ DEBUG_PRINT_HIGH("\n omx_vdec::component_init(): Start of New Playback : role = %s : DEVICE = %s",
role, device_name);
drv_ctx.video_driver_fd = open(device_name, O_RDWR | O_NONBLOCK);
- DEBUG_PRINT_HIGH("omx_vdec::component_init(): Open returned fd %d, errno %d",
+ DEBUG_PRINT_HIGH("\n omx_vdec::component_init(): Open returned fd %d, errno %d",
drv_ctx.video_driver_fd, errno);
if(drv_ctx.video_driver_fd == 0){
drv_ctx.video_driver_fd = open(device_name, O_RDWR | O_NONBLOCK);
}
- if(is_secure && drv_ctx.video_driver_fd < 0) {
- do {
- usleep(100 * 1000);
- drv_ctx.video_driver_fd = open(device_name, O_RDWR | O_NONBLOCK);
- if (drv_ctx.video_driver_fd > 0) {
- break;
- }
- } while(i++ < 50);
- }
if(drv_ctx.video_driver_fd < 0)
{
- DEBUG_PRINT_ERROR("\n Omx_vdec::Comp Init Returning failure, errno %d", errno);
- return OMX_ErrorInsufficientResources;
+ DEBUG_PRINT_ERROR("Omx_vdec::Comp Init Returning failure, errno %d\n", errno);
+ eRet = OMX_ErrorInsufficientResources;
+ goto cleanup;
}
drv_ctx.frame_rate.fps_numerator = DEFAULT_FPS;
drv_ctx.frame_rate.fps_denominator = 1;
@@ -1312,7 +1252,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_MAX_STRINGNAME_SIZE))
{
strlcpy((char *)m_cRole, "video_decoder.h263",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("H263 Decoder selected");
+ DEBUG_PRINT_LOW("\n H263 Decoder selected");
drv_ctx.decoder_format = VDEC_CODECTYPE_H263;
eCompressionFormat = OMX_VIDEO_CodingH263;
codec_type_parse = CODEC_TYPE_H263;
@@ -1326,7 +1266,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_MAX_STRINGNAME_SIZE))
{
strlcpy((char *)m_cRole, "video_decoder.divx",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW ("DIVX 311 Decoder selected");
+ DEBUG_PRINT_LOW ("\n DIVX 311 Decoder selected");
drv_ctx.decoder_format = VDEC_CODECTYPE_DIVX_3;
eCompressionFormat = (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
codec_type_parse = CODEC_TYPE_DIVX;
@@ -1344,7 +1284,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_MAX_STRINGNAME_SIZE))
{
strlcpy((char *)m_cRole, "video_decoder.divx",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_ERROR ("DIVX 4 Decoder selected");
+ DEBUG_PRINT_ERROR ("\n DIVX 4 Decoder selected");
drv_ctx.decoder_format = VDEC_CODECTYPE_DIVX_4;
eCompressionFormat = (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
codec_type_parse = CODEC_TYPE_DIVX;
@@ -1362,7 +1302,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
OMX_MAX_STRINGNAME_SIZE))
{
strlcpy((char *)m_cRole, "video_decoder.divx",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_ERROR ("DIVX 5/6 Decoder selected");
+ DEBUG_PRINT_ERROR ("\n DIVX 5/6 Decoder selected");
drv_ctx.decoder_format = VDEC_CODECTYPE_DIVX_6;
eCompressionFormat = (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
codec_type_parse = CODEC_TYPE_DIVX;
@@ -1382,7 +1322,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
"OMX.qcom.video.decoder.divx", OMX_MAX_STRINGNAME_SIZE)))
{
strlcpy((char *)m_cRole, "video_decoder.divx",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_ERROR ("DIVX Decoder selected");
+ DEBUG_PRINT_ERROR ("\n DIVX Decoder selected");
drv_ctx.decoder_format = VDEC_CODECTYPE_DIVX_5;
eCompressionFormat = (OMX_VIDEO_CODINGTYPE)QOMX_VIDEO_CodingDivx;
codec_type_parse = CODEC_TYPE_DIVX;
@@ -1521,7 +1461,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
eRet = get_buffer_req(&drv_ctx.op_buf);
m_state = OMX_StateLoaded;
#ifdef DEFAULT_EXTRADATA
- if (eRet == OMX_ErrorNone)
+ if (eRet == OMX_ErrorNone && !secure_mode)
eRet = enable_extradata(DEFAULT_EXTRADATA);
#endif
if ( (codec_type_parse == CODEC_TYPE_VC1) ||
@@ -1568,8 +1508,8 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
}
else
{
- h264_scratch.nAllocLen = drv_ctx.ip_buf.buffer_size - DEVICE_SCRATCH;
- h264_scratch.pBuffer = (OMX_U8 *)malloc (h264_scratch.nAllocLen);
+ h264_scratch.nAllocLen = drv_ctx.ip_buf.buffer_size;
+ h264_scratch.pBuffer = (OMX_U8 *)malloc (drv_ctx.ip_buf.buffer_size);
h264_scratch.nFilledLen = 0;
h264_scratch.nOffset = 0;
@@ -1593,7 +1533,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
if(pipe(fds))
{
- DEBUG_PRINT_ERROR("\n pipe creation failed.");
+ DEBUG_PRINT_ERROR("pipe creation failed\n");
eRet = OMX_ErrorInsufficientResources;
}
else
@@ -1603,7 +1543,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
{
if (pipe (temp1))
{
- DEBUG_PRINT_ERROR("\n pipe creation failed..");
+ DEBUG_PRINT_ERROR("pipe creation failed\n");
return OMX_ErrorInsufficientResources;
}
//close (fds[0]);
@@ -1614,6 +1554,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
m_pipe_in = fds[0];
m_pipe_out = fds[1];
r = pthread_create(&msg_thread_id,0,message_thread,this);
+
if(r < 0)
{
DEBUG_PRINT_ERROR("\n component_init(): message_thread creation failed");
@@ -1621,17 +1562,12 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
}
else
{
- msg_thread_created = true;
r = pthread_create(&async_thread_id,0,async_message_thread,this);
if(r < 0)
{
DEBUG_PRINT_ERROR("\n component_init(): async_message_thread creation failed");
eRet = OMX_ErrorInsufficientResources;
}
- else
- {
- async_thread_created = true;
- }
}
}
}
@@ -1639,31 +1575,28 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
if (eRet != OMX_ErrorNone)
{
DEBUG_PRINT_ERROR("\n Component Init Failed");
- DEBUG_PRINT_HIGH("Calling VDEC_IOCTL_STOP_NEXT_MSG");
+ DEBUG_PRINT_HIGH("\n Calling VDEC_IOCTL_STOP_NEXT_MSG");
(void)ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_STOP_NEXT_MSG,
NULL);
+ DEBUG_PRINT_HIGH("\n Calling close() on Video Driver");
+ close (drv_ctx.video_driver_fd);
+ drv_ctx.video_driver_fd = -1;
}
else
{
- DEBUG_PRINT_HIGH("omx_vdec::component_init() success");
+ DEBUG_PRINT_HIGH("\n omx_vdec::component_init() success");
}
memset(&h264_mv_buff,0,sizeof(struct h264_mv_buffer));
- memset(&meta_buff,0,sizeof(struct meta_buffer));
+
cleanup:
- if (!secure_mode) {
- return eRet;
- }
-#ifndef JB_MR1
- if (hwcBinder != NULL) {
- (eRet == OMX_ErrorNone) ?
- hwcBinder->setOpenSecureEnd() :
- hwcBinder->setCloseSecureEnd();
- } else {
- DEBUG_PRINT_HIGH("hwcBinder not found, "
- "not calling secure end");
+
+ if (secure_mode && (eRet == OMX_ErrorNone)) {
+ if (secureDisplay(qService::IQService::END) < 0) {
+ DEBUG_PRINT_HIGH("sending message to stop securing display failed");
+ }
}
-#endif
+
return eRet;
}
@@ -1692,7 +1625,7 @@ OMX_ERRORTYPE omx_vdec::get_component_version
{
if(m_state == OMX_StateInvalid)
{
- DEBUG_PRINT_ERROR("\n Get Comp Version in Invalid State");
+ DEBUG_PRINT_ERROR("Get Comp Version in Invalid State\n");
return OMX_ErrorInvalidState;
}
/* TBD -- Return the proper version */
@@ -1722,10 +1655,10 @@ OMX_ERRORTYPE omx_vdec::send_command(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_PTR cmdData
)
{
- DEBUG_PRINT_HIGH("send_command: Recieved a Command from Client");
+ DEBUG_PRINT_LOW("\n send_command: Recieved a Command from Client");
if(m_state == OMX_StateInvalid)
{
- DEBUG_PRINT_ERROR("\n ERROR: Send Command in Invalid State");
+ DEBUG_PRINT_ERROR("ERROR: Send Command in Invalid State\n");
return OMX_ErrorInvalidState;
}
if (cmd == OMX_CommandFlush && param1 != OMX_CORE_INPUT_PORT_INDEX
@@ -1737,7 +1670,7 @@ OMX_ERRORTYPE omx_vdec::send_command(OMX_IN OMX_HANDLETYPE hComp,
}
post_event((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
sem_wait(&m_cmd_lock);
- DEBUG_PRINT_HIGH("send_command: Command Processed");
+ DEBUG_PRINT_LOW("\n send_command: Command Processed\n");
return OMX_ErrorNone;
}
@@ -1765,13 +1698,14 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
OMX_STATETYPE eState = (OMX_STATETYPE) param1;
int bFlag = 1,sem_posted = 0;
- DEBUG_PRINT_HIGH("send_command_proxy(): cmd = %d, Current State %d, Expected State %d",
- cmd, m_state, eState);
+ DEBUG_PRINT_LOW("\n send_command_proxy(): cmd = %d", cmd);
+ DEBUG_PRINT_HIGH("\n send_command_proxy(): Current State %d, Expected State %d",
+ m_state, eState);
if(cmd == OMX_CommandStateSet)
{
- DEBUG_PRINT_HIGH("send_command_proxy(): OMX_CommandStateSet issued");
- DEBUG_PRINT_HIGH("Current State %d, Expected State %d", m_state, eState);
+ DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandStateSet issued");
+ DEBUG_PRINT_HIGH("\n Current State %d, Expected State %d", m_state, eState);
/***************************/
/* Current State is Loaded */
/***************************/
@@ -1783,11 +1717,11 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
if(allocate_done() ||
(m_inp_bEnabled == OMX_FALSE && m_out_bEnabled == OMX_FALSE))
{
- DEBUG_PRINT_LOW("send_command_proxy(): Loaded-->Idle");
+ DEBUG_PRINT_LOW("send_command_proxy(): Loaded-->Idle\n");
}
else
{
- DEBUG_PRINT_LOW("send_command_proxy(): Loaded-->Idle-Pending");
+ DEBUG_PRINT_LOW("send_command_proxy(): Loaded-->Idle-Pending\n");
BITMASK_SET(&m_flags, OMX_COMPONENT_IDLE_PENDING);
// Skip the event notification
bFlag = 0;
@@ -1796,7 +1730,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
/* Requesting transition from Loaded to Loaded */
else if(eState == OMX_StateLoaded)
{
- DEBUG_PRINT_ERROR("\n ERROR::send_command_proxy(): Loaded-->Loaded");
+ DEBUG_PRINT_ERROR("ERROR::send_command_proxy(): Loaded-->Loaded\n");
post_event(OMX_EventError,OMX_ErrorSameState,\
OMX_COMPONENT_GENERATE_EVENT);
eRet = OMX_ErrorSameState;
@@ -1806,7 +1740,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
{
/* Since error is None , we will post an event
at the end of this function definition */
- DEBUG_PRINT_LOW("send_command_proxy(): Loaded-->WaitForResources");
+ DEBUG_PRINT_LOW("send_command_proxy(): Loaded-->WaitForResources\n");
}
/* Requesting transition from Loaded to Executing */
else if(eState == OMX_StateExecuting)
@@ -1852,11 +1786,11 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
Since error is None , we will post an event at the end
of this function definition
*/
- DEBUG_PRINT_HIGH("send_command_proxy(): Idle-->Loaded");
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Loaded\n");
}
else
{
- DEBUG_PRINT_HIGH("send_command_proxy(): Idle-->Loaded-Pending");
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Loaded-Pending\n");
BITMASK_SET(&m_flags, OMX_COMPONENT_LOADING_PENDING);
// Skip the event notification
bFlag = 0;
@@ -1865,7 +1799,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
/* Requesting transition from Idle to Executing */
else if(eState == OMX_StateExecuting)
{
- DEBUG_PRINT_HIGH("send_command_proxy(): Idle-->Executing");
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
BITMASK_SET(&m_flags, OMX_COMPONENT_EXECUTE_PENDING);
bFlag = 0;
if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_CMD_START,
@@ -1874,8 +1808,6 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_ERROR("\n VDEC_IOCTL_CMD_START FAILED");
omx_report_error ();
eRet = OMX_ErrorHardware;
- } else {
- power_module_register();
}
}
/* Requesting transition from Idle to Idle */
@@ -1908,7 +1840,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
else
{
BITMASK_SET(&m_flags,OMX_COMPONENT_PAUSE_PENDING);
- DEBUG_PRINT_HIGH("send_command_proxy(): Idle-->Pause");
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Pause\n");
bFlag = 0;
}
}
@@ -1931,14 +1863,14 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
/******************************/
else if(m_state == OMX_StateExecuting)
{
- DEBUG_PRINT_HIGH("Command Recieved in OMX_StateExecuting");
+ DEBUG_PRINT_LOW("\n Command Recieved in OMX_StateExecuting");
/* Requesting transition from Executing to Idle */
if(eState == OMX_StateIdle)
{
/* Since error is None , we will post an event
at the end of this function definition
*/
- DEBUG_PRINT_HIGH("send_command_proxy(): Executing --> Idle");
+ DEBUG_PRINT_LOW("\n send_command_proxy(): Executing --> Idle \n");
BITMASK_SET(&m_flags,OMX_COMPONENT_IDLE_PENDING);
if(!sem_posted)
{
@@ -1951,7 +1883,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
/* Requesting transition from Executing to Paused */
else if(eState == OMX_StatePause)
{
- DEBUG_PRINT_HIGH("PAUSE Command Issued");
+ DEBUG_PRINT_LOW("\n PAUSE Command Issued");
if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_CMD_PAUSE,
NULL) < 0)
{
@@ -1963,7 +1895,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
else
{
BITMASK_SET(&m_flags,OMX_COMPONENT_PAUSE_PENDING);
- DEBUG_PRINT_HIGH("send_command_proxy(): Executing-->Pause");
+ DEBUG_PRINT_LOW("send_command_proxy(): Executing-->Pause\n");
bFlag = 0;
}
}
@@ -2012,7 +1944,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
/* Requesting transition from Pause to Executing */
if(eState == OMX_StateExecuting)
{
- DEBUG_PRINT_HIGH("Pause --> Executing");
+ DEBUG_PRINT_LOW("\n Pause --> Executing \n");
if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_CMD_RESUME,
NULL) < 0)
{
@@ -2024,7 +1956,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
else
{
BITMASK_SET(&m_flags,OMX_COMPONENT_EXECUTE_PENDING);
- DEBUG_PRINT_HIGH("send_command_proxy(): Idle-->Executing");
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
post_event (NULL,VDEC_S_SUCCESS,\
OMX_COMPONENT_GENERATE_RESUME_DONE);
bFlag = 0;
@@ -2035,7 +1967,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
{
/* Since error is None , we will post an event
at the end of this function definition */
- DEBUG_PRINT_HIGH("Pause --> Idle..");
+ DEBUG_PRINT_LOW("\n Pause --> Idle \n");
BITMASK_SET(&m_flags,OMX_COMPONENT_IDLE_PENDING);
if(!sem_posted)
{
@@ -2092,7 +2024,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
{
/* Since error is None , we will post an event
at the end of this function definition */
- DEBUG_PRINT_HIGH("send_command_proxy(): WaitForResources-->Loaded");
+ DEBUG_PRINT_LOW("send_command_proxy(): WaitForResources-->Loaded\n");
}
/* Requesting transition from WaitForResources to WaitForResources */
else if (eState == OMX_StateWaitForResources)
@@ -2153,7 +2085,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
else if (cmd == OMX_CommandFlush)
{
- DEBUG_PRINT_HIGH("send_command_proxy(): OMX_CommandFlush issued "
+ DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandFlush issued"
"with param1: %d", param1);
if(OMX_CORE_INPUT_PORT_INDEX == param1 || OMX_ALL == param1)
{
@@ -2165,7 +2097,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
if (!sem_posted){
sem_posted = 1;
- DEBUG_PRINT_LOW("Set the Semaphore");
+ DEBUG_PRINT_LOW("\n Set the Semaphore");
sem_post (&m_cmd_lock);
execute_omx_flush(param1);
}
@@ -2173,7 +2105,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
else if ( cmd == OMX_CommandPortEnable)
{
- DEBUG_PRINT_HIGH("send_command_proxy(): OMX_CommandPortEnable issued "
+ DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandPortEnable issued"
"with param1: %d", param1);
if(param1 == OMX_CORE_INPUT_PORT_INDEX || param1 == OMX_ALL)
{
@@ -2188,7 +2120,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_HIGH("send_command_proxy(): Disabled-->Enabled Pending");
+ DEBUG_PRINT_LOW("send_command_proxy(): Disabled-->Enabled Pending\n");
BITMASK_SET(&m_flags, OMX_COMPONENT_INPUT_ENABLE_PENDING);
// Skip the event notification
bFlag = 0;
@@ -2196,7 +2128,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
if(param1 == OMX_CORE_OUTPUT_PORT_INDEX || param1 == OMX_ALL)
{
- DEBUG_PRINT_HIGH("Enable output Port command recieved");
+ DEBUG_PRINT_LOW("\n Enable output Port command recieved");
m_out_bEnabled = OMX_TRUE;
if( (m_state == OMX_StateLoaded &&
@@ -2209,7 +2141,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_HIGH("send_command_proxy(): Disabled-->Enabled Pending");
+ DEBUG_PRINT_LOW("send_command_proxy(): Disabled-->Enabled Pending\n");
BITMASK_SET(&m_flags, OMX_COMPONENT_OUTPUT_ENABLE_PENDING);
// Skip the event notification
bFlag = 0;
@@ -2218,7 +2150,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
}
else if (cmd == OMX_CommandPortDisable)
{
- DEBUG_PRINT_HIGH("send_command_proxy(): OMX_CommandPortDisable issued "
+ DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandPortDisable issued"
"with param1: %d", param1);
if(param1 == OMX_CORE_INPUT_PORT_INDEX || param1 == OMX_ALL)
{
@@ -2249,7 +2181,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
if(param1 == OMX_CORE_OUTPUT_PORT_INDEX || param1 == OMX_ALL)
{
m_out_bEnabled = OMX_FALSE;
- DEBUG_PRINT_HIGH("Disable output Port command recieved");
+ DEBUG_PRINT_LOW("\n Disable output Port command recieved");
if((m_state == OMX_StateLoaded || m_state == OMX_StateIdle)
&& release_output_done())
{
@@ -2356,15 +2288,16 @@ bool omx_vdec::execute_output_flush()
/*Generate FBD for all Buffers in the FTBq*/
pthread_mutex_lock(&m_lock);
- DEBUG_PRINT_HIGH("Initiate Output Flush");
+ DEBUG_PRINT_LOW("\n Initiate Output Flush");
while (m_ftb_q.m_size)
{
- DEBUG_PRINT_HIGH("Buffer queue size %d pending buf cnt %d",
+ DEBUG_PRINT_LOW("\n Buffer queue size %d pending buf cnt %d",
m_ftb_q.m_size,pending_output_buffers);
m_ftb_q.pop_entry(&p1,&p2,&ident);
- DEBUG_PRINT_HIGH("ID(%x) P1(%x) P2(%x)", ident, p1, p2);
- if(ident == m_fill_output_msg )
+ DEBUG_PRINT_LOW("\n ID(%x) P1(%x) P2(%x)", ident, p1, p2);
+ if(ident == m_fill_output_msg)
{
+ pending_output_buffers++;
m_cb.FillBufferDone(&m_cmp, m_app_data, (OMX_BUFFERHEADERTYPE *)p2);
}
else if (ident == OMX_COMPONENT_GENERATE_FBD)
@@ -2380,7 +2313,7 @@ bool omx_vdec::execute_output_flush()
prev_ts = LLONG_MAX;
rst_prev_ts = true;
}
- DEBUG_PRINT_HIGH("OMX flush o/p Port complete PenBuf(%d)", pending_output_buffers);
+ DEBUG_PRINT_HIGH("\n OMX flush o/p Port complete PenBuf(%d)", pending_output_buffers);
return bRet;
}
/*=========================================================================
@@ -2404,29 +2337,29 @@ bool omx_vdec::execute_input_flush()
bool bRet = true;
/*Generate EBD for all Buffers in the ETBq*/
- DEBUG_PRINT_HIGH("Initiate Input Flush");
+ DEBUG_PRINT_LOW("\n Initiate Input Flush \n");
pthread_mutex_lock(&m_lock);
- DEBUG_PRINT_LOW("Check if the Queue is empty");
+ DEBUG_PRINT_LOW("\n Check if the Queue is empty \n");
while (m_etb_q.m_size)
{
m_etb_q.pop_entry(&p1,&p2,&ident);
if (ident == OMX_COMPONENT_GENERATE_ETB_ARBITRARY)
{
- DEBUG_PRINT_HIGH("Flush Input Heap Buffer %p",(OMX_BUFFERHEADERTYPE *)p2);
+ DEBUG_PRINT_LOW("\n Flush Input Heap Buffer %p",(OMX_BUFFERHEADERTYPE *)p2);
m_cb.EmptyBufferDone(&m_cmp ,m_app_data, (OMX_BUFFERHEADERTYPE *)p2);
}
else if(ident == OMX_COMPONENT_GENERATE_ETB)
{
pending_input_buffers++;
- DEBUG_PRINT_HIGH("Flush Input OMX_COMPONENT_GENERATE_ETB %p, pending_input_buffers %d",
+ DEBUG_PRINT_LOW("\n Flush Input OMX_COMPONENT_GENERATE_ETB %p, pending_input_buffers %d",
(OMX_BUFFERHEADERTYPE *)p2, pending_input_buffers);
empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p2);
}
else if (ident == OMX_COMPONENT_GENERATE_EBD)
{
- DEBUG_PRINT_HIGH("Flush Input OMX_COMPONENT_GENERATE_EBD %p",
+ DEBUG_PRINT_LOW("\n Flush Input OMX_COMPONENT_GENERATE_EBD %p",
(OMX_BUFFERHEADERTYPE *)p1);
empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p1);
}
@@ -2435,7 +2368,7 @@ bool omx_vdec::execute_input_flush()
/*Check if Heap Buffers are to be flushed*/
if (arbitrary_bytes && !(codec_config_flag))
{
- DEBUG_PRINT_HIGH("Reset all the variables before flusing");
+ DEBUG_PRINT_LOW("\n Reset all the variables before flusing");
h264_scratch.nFilledLen = 0;
nal_count = 0;
look_ahead_nal = false;
@@ -2444,7 +2377,7 @@ bool omx_vdec::execute_input_flush()
h264_last_au_flags = 0;
memset(m_demux_offsets, 0, ( sizeof(OMX_U32) * 8192) );
m_demux_entries = 0;
- DEBUG_PRINT_HIGH("Initialize parser");
+ DEBUG_PRINT_LOW("\n Initialize parser");
if (m_frame_parser.mutils)
{
m_frame_parser.mutils->initialize_frame_checking_environment();
@@ -2488,7 +2421,7 @@ bool omx_vdec::execute_input_flush()
m_timestamp_list.reset_ts_list();
}
#endif
- DEBUG_PRINT_HIGH("OMX flush i/p Port complete PenBuf(%d)", pending_input_buffers);
+ DEBUG_PRINT_HIGH("\n OMX flush i/p Port complete PenBuf(%d)", pending_input_buffers);
return bRet;
}
@@ -2534,7 +2467,7 @@ bool omx_vdec::post_event(unsigned int p1,
}
bRet = true;
- DEBUG_PRINT_LOW("Value of this pointer in post_event %p",this);
+ DEBUG_PRINT_LOW("\n Value of this pointer in post_event 0x%x", p2);
post_message(this, id);
pthread_mutex_unlock(&m_lock);
@@ -2569,7 +2502,7 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_720p(OMX_VIDEO_PARAM_PRO
}
else
{
- DEBUG_PRINT_HIGH("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d",
+ DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n",
profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
@@ -2616,7 +2549,7 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_720p(OMX_VIDEO_PARAM_PRO
#ifdef MAX_RES_1080P
OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PROFILELEVELTYPE *profileLevelType)
{
- OMX_ERRORTYPE eRet = OMX_ErrorNoMore;
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
if(!profileLevelType)
return OMX_ErrorBadParameter;
@@ -2641,7 +2574,7 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PR
}
else
{
- DEBUG_PRINT_HIGH("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d",
+ DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n",
profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
@@ -2695,11 +2628,6 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PR
eRet = OMX_ErrorNoMore;
}
}
- else
- {
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported ret NoMore\n");
- eRet = OMX_ErrorNoMore;
- }
}
else
{
@@ -2730,7 +2658,7 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
- DEBUG_PRINT_LOW("get_parameter:");
+ DEBUG_PRINT_LOW("get_parameter: \n");
if(m_state == OMX_StateInvalid)
{
DEBUG_PRINT_ERROR("Get Param in Invalid State\n");
@@ -2738,7 +2666,7 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
if(paramData == NULL)
{
- DEBUG_PRINT_ERROR("\n Get Param in Invalid paramData");
+ DEBUG_PRINT_LOW("Get Param in Invalid paramData \n");
return OMX_ErrorBadParameter;
}
switch(paramIndex)
@@ -2747,23 +2675,10 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_PARAM_PORTDEFINITIONTYPE *portDefn =
(OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
+ DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamPortDefinition\n");
eRet = update_portdef(portDefn);
if (eRet == OMX_ErrorNone)
m_port_def = *portDefn;
- DEBUG_PRINT_HIGH("Get_parameter: OMX_IndexParamPortDefinition: "
- "nPortIndex (%d), nFrameWidth (%d), nFrameHeight (%d), "
- "nStride (%d), nSliceHeight (%d), nBitrate (%d), xFramerate (0x%x), "
- "nBufferSize (%d), nBufferCountMin (%d), nBufferCountActual (%d), "
- "bBuffersContiguous (%d), nBufferAlignment (%d), "
- "bEnabled (%d), bPopulated (%d), eCompressionFormat (0x%x), "
- "eColorFormat (0x%x)" , (int)portDefn->nPortIndex,
- (int)portDefn->format.video.nFrameWidth, (int)portDefn->format.video.nFrameHeight,
- (int)portDefn->format.video.nStride, (int)portDefn->format.video.nSliceHeight,
- (int)portDefn->format.video.nBitrate, (int)portDefn->format.video.xFramerate,
- (int)portDefn->nBufferSize, (int)portDefn->nBufferCountMin,
- (int)portDefn->nBufferCountActual, (int)portDefn->bBuffersContiguous,
- (int)portDefn->nBufferAlignment, (int)portDefn->bEnabled, (int)portDefn->bPopulated,
- (int)portDefn->format.video.eCompressionFormat, (int)portDefn->format.video.eColorFormat);
break;
}
case OMX_IndexParamVideoInit:
@@ -2782,6 +2697,8 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_VIDEO_PARAM_PORTFORMATTYPE *portFmt =
(OMX_VIDEO_PARAM_PORTFORMATTYPE *)paramData;
+ DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoPortFormat\n");
+
portFmt->nVersion.nVersion = OMX_SPEC_VERSION;
portFmt->nSize = sizeof(portFmt);
@@ -2802,11 +2719,19 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
else if (1 == portFmt->nPortIndex)
{
portFmt->eCompressionFormat = OMX_VIDEO_CodingUnused;
+#ifdef MAX_RES_720P
+ if (0 == portFmt->nIndex)
+ portFmt->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+ else if(1 == portFmt->nIndex)
+ portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
+#endif
+#ifdef MAX_RES_1080P
if(0 == portFmt->nIndex)
portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)
QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
- else if (1 == portFmt->nIndex)
- {
+#endif
+ else if (1 == portFmt->nIndex) {
portFmt->eColorFormat = OMX_COLOR_FormatYUV420Planar;
}
else
@@ -2822,11 +2747,6 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
(int)portFmt->nPortIndex);
eRet = OMX_ErrorBadPortIndex;
}
- DEBUG_PRINT_HIGH("Get_parameter: OMX_IndexParamVideoPortFormat: "
- "nPortIndex (%d), nIndex (%d), eCompressionFormat (0x%x), "
- "eColorFormat (0x%x), xFramerate (0x%x)", (int)portFmt->nPortIndex,
- (int)portFmt->nIndex, (int)portFmt->eCompressionFormat,
- (int)portFmt->eColorFormat, (int)portFmt->xFramerate);
break;
}
/*Component should support this port definition*/
@@ -2946,35 +2866,25 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
#if defined (_ANDROID_HONEYCOMB_) || defined (_ANDROID_ICS_)
case OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage:
{
- DEBUG_PRINT_HIGH("get_parameter: OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage");
+ DEBUG_PRINT_LOW("get_parameter: OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage\n");
GetAndroidNativeBufferUsageParams* nativeBuffersUsage = (GetAndroidNativeBufferUsageParams *) paramData;
if(nativeBuffersUsage->nPortIndex == OMX_CORE_OUTPUT_PORT_INDEX) {
#ifdef USE_ION
-#if defined (MAX_RES_720P)
- nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_CAMERA_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED);
- DEBUG_PRINT_HIGH("ION:720P: nUsage 0x%x",nativeBuffersUsage->nUsage);
-#else
if(secure_mode) {
nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_MM_HEAP | GRALLOC_USAGE_PROTECTED |
- GRALLOC_USAGE_PRIVATE_UNCACHED);
- DEBUG_PRINT_HIGH("ION:secure_mode: nUsage 0x%x",nativeBuffersUsage->nUsage);
+ GRALLOC_USAGE_PRIVATE_CP_BUFFER | GRALLOC_USAGE_PRIVATE_UNCACHED);
} else {
- nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_MM_HEAP |
- GRALLOC_USAGE_PRIVATE_IOMMU_HEAP);
- DEBUG_PRINT_HIGH("ION:non_secure_mode: nUsage 0x%x",nativeBuffersUsage->nUsage);
+ nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_IOMMU_HEAP);
}
-#endif //(MAX_RES_720P)
-#else // USE_ION
+#else
#if defined (MAX_RES_720P) || defined (MAX_RES_1080P_EBI)
nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_ADSP_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED);
- DEBUG_PRINT_HIGH("720P/1080P_EBI: nUsage 0x%x",nativeBuffersUsage->nUsage);
#elif MAX_RES_1080P
nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_SMI_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED);
- DEBUG_PRINT_HIGH("1080P: nUsage 0x%x",nativeBuffersUsage->nUsage);
#endif
-#endif // USE_ION
+#endif
} else {
- DEBUG_PRINT_ERROR("\n get_parameter: OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage failed!");
+ DEBUG_PRINT_HIGH("get_parameter: OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage failed!\n");
eRet = OMX_ErrorBadParameter;
}
}
@@ -2989,7 +2899,7 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
- DEBUG_PRINT_LOW("get_parameter returning WxH(%d x %d) SxSH(%d x %d)",
+ DEBUG_PRINT_LOW("\n get_parameter returning WxH(%d x %d) SxSH(%d x %d)\n",
drv_ctx.video_resolution.frame_width,
drv_ctx.video_resolution.frame_height,
drv_ctx.video_resolution.stride,
@@ -3086,11 +2996,17 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
//TODO: Check if any allocate buffer/use buffer/useNativeBuffer has
//been called.
- DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition H= %d, W = %d",
+ DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition H= %d, W = %d\n",
(int)portDefn->format.video.nFrameHeight,
(int)portDefn->format.video.nFrameWidth);
if(OMX_DirOutput == portDefn->eDir)
{
+ eRet = update_color_format(portDefn->format.video.eColorFormat);
+ if (eRet != OMX_ErrorNone) {
+ DEBUG_PRINT_ERROR("\n Setparam: color format failed for %u",
+ portDefn->format.video.eColorFormat);
+ break;
+ }
DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition OP port");
m_display_id = portDefn->format.video.pNativeWindow;
unsigned int buffer_size;
@@ -3124,7 +3040,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
// Frame rate only should be set if this is a "known value" or to
// activate ts prediction logic (arbitrary mode only) sending input
// timestamps with max value (LLONG_MAX).
- DEBUG_PRINT_LOW("set_parameter: frame rate set by omx client : %d",
+ DEBUG_PRINT_HIGH("set_parameter: frame rate set by omx client : %d",
portDefn->format.video.xFramerate >> 16);
Q16ToFraction(portDefn->format.video.xFramerate, drv_ctx.frame_rate.fps_numerator,
drv_ctx.frame_rate.fps_denominator);
@@ -3149,13 +3065,13 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
frm_int, drv_ctx.frame_rate.fps_numerator /
(float)drv_ctx.frame_rate.fps_denominator);
}
- DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition IP port");
+ DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition IP port\n");
if(drv_ctx.video_resolution.frame_height !=
portDefn->format.video.nFrameHeight ||
drv_ctx.video_resolution.frame_width !=
portDefn->format.video.nFrameWidth)
{
- DEBUG_PRINT_LOW("SetParam IP: WxH(%d x %d)",
+ DEBUG_PRINT_LOW("\n SetParam IP: WxH(%d x %d)\n",
portDefn->format.video.nFrameWidth,
portDefn->format.video.nFrameHeight);
if (portDefn->format.video.nFrameHeight != 0x0 &&
@@ -3180,10 +3096,10 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
}
else if (portDefn->nBufferCountActual >= drv_ctx.ip_buf.mincount
- && portDefn->nBufferSize == (drv_ctx.ip_buf.buffer_size - DEVICE_SCRATCH))
+ && portDefn->nBufferSize == drv_ctx.ip_buf.buffer_size)
{
drv_ctx.ip_buf.actualcount = portDefn->nBufferCountActual;
- drv_ctx.ip_buf.buffer_size = portDefn->nBufferSize + DEVICE_SCRATCH;
+ drv_ctx.ip_buf.buffer_size = portDefn->nBufferSize;
eRet = set_buffer_req(&drv_ctx.ip_buf);
}
else
@@ -3200,62 +3116,19 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
(int)portDefn->nPortIndex);
eRet = OMX_ErrorBadPortIndex;
}
- DEBUG_PRINT_HIGH("Set_parameter: OMX_IndexParamPortDefinition: "
- "nPortIndex (%d), nFrameWidth (%d), nFrameHeight (%d), "
- "nStride (%d), nSliceHeight (%d), nBitrate (%d), xFramerate (0x%x), "
- "nBufferSize (%d), nBufferCountMin (%d), nBufferCountActual (%d), "
- "bBuffersContiguous (%d), nBufferAlignment (%d), "
- "bEnabled (%d), bPopulated (%d), eCompressionFormat (0x%x), "
- "eColorFormat (0x%x)" , (int)portDefn->nPortIndex,
- (int)portDefn->format.video.nFrameWidth, (int)portDefn->format.video.nFrameHeight,
- (int)portDefn->format.video.nStride, (int)portDefn->format.video.nSliceHeight,
- (int)portDefn->format.video.nBitrate, (int)portDefn->format.video.xFramerate,
- (int)portDefn->nBufferSize, (int)portDefn->nBufferCountMin,
- (int)portDefn->nBufferCountActual, (int)portDefn->bBuffersContiguous,
- (int)portDefn->nBufferAlignment, (int)portDefn->bEnabled, (int)portDefn->bPopulated,
- (int)portDefn->format.video.eCompressionFormat, (int)portDefn->format.video.eColorFormat);
}
break;
case OMX_IndexParamVideoPortFormat:
{
OMX_VIDEO_PARAM_PORTFORMATTYPE *portFmt =
(OMX_VIDEO_PARAM_PORTFORMATTYPE *)paramData;
+ DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamVideoPortFormat %d\n",
+ portFmt->eColorFormat);
+
if(1 == portFmt->nPortIndex)
- {
- enum vdec_output_fromat op_format;
- if(portFmt->eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar)
- op_format = VDEC_YUV_FORMAT_NV12;
- else if(portFmt->eColorFormat ==
- QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka ||
- portFmt->eColorFormat == OMX_COLOR_FormatYUV420Planar)
- op_format = VDEC_YUV_FORMAT_TILE_4x2;
- else
- eRet = OMX_ErrorBadParameter;
+ eRet = update_color_format(portFmt->eColorFormat);
- if(eRet == OMX_ErrorNone && drv_ctx.output_format != op_format)
- {
- /*Set the output format*/
- drv_ctx.output_format = op_format;
- ioctl_msg.in = &drv_ctx.output_format;
- ioctl_msg.out = NULL;
- if (ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_SET_OUTPUT_FORMAT,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT_ERROR("\n Set output format failed");
- eRet = OMX_ErrorUnsupportedSetting;
- }
- else {
- eRet = get_buffer_req(&drv_ctx.op_buf);
- }
- }
- if (eRet == OMX_ErrorNone){
- if (!client_buffers.set_color_format(portFmt->eColorFormat)) {
- DEBUG_PRINT_ERROR("\n Set color format failed");
- eRet = OMX_ErrorBadParameter;
- }
- }
- }
- DEBUG_PRINT_HIGH("Set_parameter: OMX_IndexParamVideoPortFormat: "
+ DEBUG_PRINT_HIGH("Set_parameter: OMX_IndexParamVideoPortFormat: "
"nPortIndex (%d), nIndex (%d), eCompressionFormat (0x%x), "
"eColorFormat (0x%x), xFramerate (0x%x)", (int)portFmt->nPortIndex,
(int)portFmt->nIndex, (int)portFmt->eCompressionFormat,
@@ -3267,7 +3140,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_QCOM_PARAM_PORTDEFINITIONTYPE *portFmt =
(OMX_QCOM_PARAM_PORTDEFINITIONTYPE *) paramData;
- DEBUG_PRINT_LOW("set_parameter: OMX_IndexQcomParamPortDefinitionType %d",
+ DEBUG_PRINT_LOW("set_parameter: OMX_IndexQcomParamPortDefinitionType %d\n",
portFmt->nFramePackingFormat);
/* Input port */
@@ -3299,7 +3172,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
else if (portFmt->nPortIndex == OMX_CORE_OUTPUT_PORT_INDEX)
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_IndexQcomParamPortDefinitionType OP Port");
+ DEBUG_PRINT_HIGH("set_parameter: OMX_IndexQcomParamPortDefinitionType OP Port\n");
if( (portFmt->nMemRegion > OMX_QCOM_MemRegionInvalid &&
portFmt->nMemRegion < OMX_QCOM_MemRegionMax) &&
portFmt->nCacheAttr == OMX_QCOM_CacheAttrNone)
@@ -3307,7 +3180,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
m_out_mem_region_smi = OMX_TRUE;
if ((m_out_mem_region_smi && m_out_pvt_entry_pmem))
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_IndexQcomParamPortDefinitionType OP Port: set use_output_pmem");
+ DEBUG_PRINT_HIGH("set_parameter: OMX_IndexQcomParamPortDefinitionType OP Port: out pmem set\n");
m_use_output_pmem = OMX_TRUE;
}
}
@@ -3319,7 +3192,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_PARAM_COMPONENTROLETYPE *comp_role;
comp_role = (OMX_PARAM_COMPONENTROLETYPE *) paramData;
- DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamStandardComponentRole %s",
+ DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamStandardComponentRole %s\n",
comp_role->cRole);
if((m_state == OMX_StateLoaded)&&
@@ -3520,27 +3393,41 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
break;
}
case OMX_QcomIndexParamConcealMBMapExtraData:
- {
+ if(!secure_mode)
eRet = enable_extradata(VDEC_EXTRADATA_MB_ERROR_MAP,
((QOMX_ENABLETYPE *)paramData)->bEnable);
+ else {
+ DEBUG_PRINT_ERROR("\n secure mode setting not supported");
+ eRet = OMX_ErrorUnsupportedSetting;
}
break;
case OMX_QcomIndexParamFrameInfoExtraData:
{
+ if(!secure_mode)
eRet = enable_extradata(OMX_FRAMEINFO_EXTRADATA,
((QOMX_ENABLETYPE *)paramData)->bEnable);
+ else {
+ DEBUG_PRINT_ERROR("\n secure mode setting not supported");
+ eRet = OMX_ErrorUnsupportedSetting;
}
break;
+ }
case OMX_QcomIndexParamInterlaceExtraData:
- {
+ if(!secure_mode)
eRet = enable_extradata(OMX_INTERLACE_EXTRADATA,
((QOMX_ENABLETYPE *)paramData)->bEnable);
+ else {
+ DEBUG_PRINT_ERROR("\n secure mode setting not supported");
+ eRet = OMX_ErrorUnsupportedSetting;
}
break;
case OMX_QcomIndexParamH264TimeInfo:
- {
+ if(!secure_mode)
eRet = enable_extradata(OMX_TIMEINFO_EXTRADATA,
((QOMX_ENABLETYPE *)paramData)->bEnable);
+ else {
+ DEBUG_PRINT_ERROR("\n secure mode setting not supported");
+ eRet = OMX_ErrorUnsupportedSetting;
}
break;
case OMX_QcomIndexParamVideoDivx:
@@ -3556,7 +3443,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
break;
case OMX_QcomIndexPlatformPvt:
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexPlatformPvt OP Port");
+ DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexPlatformPvt OP Port\n");
OMX_QCOM_PLATFORMPRIVATE_EXTN* entryType = (OMX_QCOM_PLATFORMPRIVATE_EXTN *) paramData;
if (entryType->type != OMX_QCOM_PLATFORM_PRIVATE_PMEM)
{
@@ -3568,7 +3455,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
m_out_pvt_entry_pmem = OMX_TRUE;
if ((m_out_mem_region_smi && m_out_pvt_entry_pmem))
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexPlatformPvt OP Port: use output pmem set");
+ DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexPlatformPvt OP Port: out pmem set\n");
m_use_output_pmem = OMX_TRUE;
}
}
@@ -3612,7 +3499,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
(extradataIndexType->bEnabled == OMX_TRUE) &&
(extradataIndexType->nPortIndex == 1))
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamIndexExtraDataType SmoothStreaming");
+ DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamIndexExtraDataType SmoothStreaming\n");
eRet = enable_extradata(OMX_PORTDEF_EXTRADATA, extradataIndexType->bEnabled);
// Set smooth streaming parameter
int rc = ioctl(drv_ctx.video_driver_fd,
@@ -3625,18 +3512,6 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
}
break;
-
- case OMX_QcomIndexParamEnableSmoothStreaming:
- {
-
- int rc = ioctl(drv_ctx.video_driver_fd,
- VDEC_IOCTL_SET_CONT_ON_RECONFIG);
- if(rc < 0) {
- DEBUG_PRINT_ERROR("Failed to enable Smooth Streaming on driver.");
- eRet = OMX_ErrorHardware;
- }
- }
- break;
#endif
#if defined (_ANDROID_HONEYCOMB_) || defined (_ANDROID_ICS_)
/* Need to allow following two set_parameters even in Idle
@@ -3675,12 +3550,6 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
}
break;
- case OMX_QcomIndexEnableExtnUserData:
- {
- eRet = enable_extradata(OMX_EXTNUSER_EXTRADATA,
- ((QOMX_ENABLETYPE *)paramData)->bEnable);
- }
- break;
default:
{
DEBUG_PRINT_ERROR("Setparameter: unknown param %d\n", paramIndex);
@@ -3784,7 +3653,7 @@ OMX_ERRORTYPE omx_vdec::get_config(OMX_IN OMX_HANDLETYPE hComp,
(OMX_QCOM_EXTRADATA_FRAMEINFO *) configData;
if(m_extradata == NULL){
- DEBUG_PRINT_LOW("get_config: m_extradata not set. "
+ DEBUG_PRINT_ERROR("get_config: m_extradata not set. "
"Aspect Ratio information missing!!");
}
else {
@@ -3833,7 +3702,7 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_VIDEO_CONFIG_NALSIZE *pNal;
- DEBUG_PRINT_LOW("Set Config Called");
+ DEBUG_PRINT_LOW("\n Set Config Called");
if (m_state == OMX_StateExecuting)
{
@@ -3844,10 +3713,10 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
if (configIndex == OMX_IndexVendorVideoExtraData)
{
OMX_VENDOR_EXTRADATATYPE *config = (OMX_VENDOR_EXTRADATATYPE *) configData;
- DEBUG_PRINT_LOW("Index OMX_IndexVendorVideoExtraData called");
+ DEBUG_PRINT_LOW("\n Index OMX_IndexVendorVideoExtraData called");
if (!strcmp(drv_ctx.kind, "OMX.qcom.video.decoder.avc"))
{
- DEBUG_PRINT_LOW("Index OMX_IndexVendorVideoExtraData AVC");
+ DEBUG_PRINT_LOW("\n Index OMX_IndexVendorVideoExtraData AVC");
OMX_U32 extra_size;
// Parsing done here for the AVC atom is definitely not generic
// Currently this piece of code is working, but certainly
@@ -3880,7 +3749,7 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
// case where SPS+PPS is sent as part of set_config
pDestBuf = m_vendor_config.pData;
- DEBUG_PRINT_LOW("Rxd SPS+PPS nPortIndex[%d] len[%d] data[0x%x]",
+ DEBUG_PRINT_LOW("Rxd SPS+PPS nPortIndex[%d] len[%d] data[0x%x]\n",
m_vendor_config.nPortIndex,
m_vendor_config.nDataSize,
m_vendor_config.pData);
@@ -3967,7 +3836,7 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
pNal = reinterpret_cast < OMX_VIDEO_CONFIG_NALSIZE * >(configData);
nal_length = pNal->nNaluBytes;
m_frame_parser.init_nal_length(nal_length);
- DEBUG_PRINT_LOW("OMX_IndexConfigVideoNalSize called with Size %d",nal_length);
+ DEBUG_PRINT_LOW("\n OMX_IndexConfigVideoNalSize called with Size %d",nal_length);
return ret;
}
@@ -4021,7 +3890,7 @@ OMX_ERRORTYPE omx_vdec::get_extension_index(OMX_IN OMX_HANDLETYPE hComp,
*indexType = (OMX_INDEXTYPE)OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage;
}
#endif
- else {
+ else {
DEBUG_PRINT_ERROR("Extension: %s not implemented\n", paramName);
return OMX_ErrorNotImplemented;
}
@@ -4045,7 +3914,7 @@ OMX_ERRORTYPE omx_vdec::get_state(OMX_IN OMX_HANDLETYPE hComp,
OMX_OUT OMX_STATETYPE* state)
{
*state = m_state;
- DEBUG_PRINT_LOW("get_state: Returning the state %d",*state);
+ DEBUG_PRINT_LOW("get_state: Returning the state %d\n",*state);
return OMX_ErrorNone;
}
@@ -4109,17 +3978,7 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
if (!m_out_mem_ptr) {
DEBUG_PRINT_HIGH("Use_op_buf:Allocating output headers");
eRet = allocate_output_headers();
-
#ifdef MAX_RES_1080P
- if(secure_mode)
- {
- eRet = vdec_alloc_meta_buffers();
- if (eRet) {
- DEBUG_PRINT_ERROR("ERROR in allocating meta buffers\n");
- return OMX_ErrorInsufficientResources;
- }
- }
-
if(drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
//allocate H264_mv_buffer
@@ -4186,12 +4045,6 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
drv_ctx.ptr_outputbuffer[i].bufferaddr = buff;
drv_ctx.ptr_outputbuffer[i].mmaped_size =
drv_ctx.ptr_outputbuffer[i].buffer_len = drv_ctx.op_buf.buffer_size;
-#if defined(_ANDROID_ICS_)
- if (drv_ctx.interlace != VDEC_InterlaceFrameProgressive) {
- int enable = 1;
- setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
- }
-#endif
} else
#endif
@@ -4298,7 +4151,7 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
ioctl_msg.in = &setbuffers;
ioctl_msg.out = NULL;
- DEBUG_PRINT_HIGH("Set the Output Buffer Idx: %d Addr: %x, pmem_fd=%0x%x", i,
+ DEBUG_PRINT_HIGH("\n Set the Output Buffer Idx: %d Addr: %x, pmem_fd=%0x%x", i,
drv_ctx.ptr_outputbuffer[i],drv_ctx.ptr_outputbuffer[i].pmem_fd );
if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_SET_BUFFER,
&ioctl_msg) < 0)
@@ -4342,7 +4195,7 @@ OMX_ERRORTYPE omx_vdec::use_input_heap_buffers(
OMX_IN OMX_U32 bytes,
OMX_IN OMX_U8* buffer)
{
- DEBUG_PRINT_LOW("Inside %s, %p", __FUNCTION__, buffer);
+ DEBUG_PRINT_LOW("Inside %s, %p\n", __FUNCTION__, buffer);
OMX_ERRORTYPE eRet = OMX_ErrorNone;
if(!m_inp_heap_ptr)
m_inp_heap_ptr = (OMX_BUFFERHEADERTYPE*)
@@ -4368,7 +4221,7 @@ OMX_ERRORTYPE omx_vdec::use_input_heap_buffers(
m_inp_heap_ptr[m_in_alloc_cnt].nOutputPortIndex = (OMX_U32) OMX_DirMax;
*bufferHdr = &m_inp_heap_ptr[m_in_alloc_cnt];
eRet = allocate_input_buffer(hComp, &m_phdr_pmem_ptr[m_in_alloc_cnt], port, appData, bytes);
- DEBUG_PRINT_HIGH("Heap buffer(%p) Pmem buffer(%p)", *bufferHdr, m_phdr_pmem_ptr[m_in_alloc_cnt]);
+ DEBUG_PRINT_HIGH("\n Heap buffer(%p) Pmem buffer(%p)", *bufferHdr, m_phdr_pmem_ptr[m_in_alloc_cnt]);
if (!m_input_free_q.insert_entry((unsigned)m_phdr_pmem_ptr[m_in_alloc_cnt], NULL, NULL))
{
DEBUG_PRINT_ERROR("\nERROR:Free_q is full");
@@ -4488,11 +4341,11 @@ OMX_ERRORTYPE omx_vdec::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
}
index = bufferHdr - m_inp_mem_ptr;
- DEBUG_PRINT_LOW("Free Input Buffer index = %d",index);
+ DEBUG_PRINT_LOW("\n Free Input Buffer index = %d",index);
if (index < drv_ctx.ip_buf.actualcount && drv_ctx.ptr_inputbuffer)
{
- DEBUG_PRINT_LOW("Free Input Buffer index = %d",index);
+ DEBUG_PRINT_LOW("\n Free Input Buffer index = %d",index);
if (drv_ctx.ptr_inputbuffer[index].pmem_fd > 0)
{
struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
@@ -4509,9 +4362,9 @@ OMX_ERRORTYPE omx_vdec::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
DEBUG_PRINT_ERROR("\nVDEC_IOCTL_FREE_BUFFER returned error %d", ioctl_r);
}
if (!secure_mode) {
- DEBUG_PRINT_LOW("unmap the input buffer fd=%d",
+ DEBUG_PRINT_LOW("\n unmap the input buffer fd=%d",
drv_ctx.ptr_inputbuffer[index].pmem_fd);
- DEBUG_PRINT_LOW("unmap the input buffer size=%d address = %d",
+ DEBUG_PRINT_LOW("\n unmap the input buffer size=%d address = %d",
drv_ctx.ptr_inputbuffer[index].mmaped_size,
drv_ctx.ptr_inputbuffer[index].bufferaddr);
munmap (drv_ctx.ptr_inputbuffer[index].bufferaddr,
@@ -4545,12 +4398,12 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
}
index = bufferHdr - m_out_mem_ptr;
- DEBUG_PRINT_LOW("Free ouput Buffer index = %d",index);
+ DEBUG_PRINT_LOW("\n Free ouput Buffer index = %d",index);
if (index < drv_ctx.op_buf.actualcount
&& drv_ctx.ptr_outputbuffer)
{
- DEBUG_PRINT_LOW("Free ouput Buffer index = %d addr = %x", index,
+ DEBUG_PRINT_LOW("\n Free ouput Buffer index = %d addr = %x", index,
drv_ctx.ptr_outputbuffer[index].bufferaddr);
struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
@@ -4560,10 +4413,10 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
sizeof (vdec_bufferpayload));
ioctl_msg.in = &setbuffers;
ioctl_msg.out = NULL;
- DEBUG_PRINT_LOW("Release the Output Buffer");
+ DEBUG_PRINT_LOW("\nRelease the Output Buffer");
if (ioctl (drv_ctx.video_driver_fd, VDEC_IOCTL_FREE_BUFFER,
&ioctl_msg) < 0)
- DEBUG_PRINT_ERROR("\n Release output buffer failed in VCD");
+ DEBUG_PRINT_ERROR("\nRelease output buffer failed in VCD");
#ifdef _ANDROID_
if(m_enable_android_native_buffers) {
@@ -4579,19 +4432,19 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
if (drv_ctx.ptr_outputbuffer[index].pmem_fd > 0 && !ouput_egl_buffers && !m_use_output_pmem)
{
if(!secure_mode) {
- DEBUG_PRINT_LOW("unmap the output buffer fd = %d",
+ DEBUG_PRINT_LOW("\n unmap the output buffer fd = %d",
drv_ctx.ptr_outputbuffer[index].pmem_fd);
- DEBUG_PRINT_LOW("unmap the ouput buffer size=%d address = %d",
+ DEBUG_PRINT_LOW("\n unmap the ouput buffer size=%d address = %d",
drv_ctx.ptr_outputbuffer[index].mmaped_size,
drv_ctx.ptr_outputbuffer[index].bufferaddr);
munmap (drv_ctx.ptr_outputbuffer[index].bufferaddr,
drv_ctx.ptr_outputbuffer[index].mmaped_size);
}
- close (drv_ctx.ptr_outputbuffer[index].pmem_fd);
- drv_ctx.ptr_outputbuffer[index].pmem_fd = -1;
#ifdef USE_ION
free_ion_memory(&drv_ctx.op_buf_ion_info[index]);
#endif
+ close (drv_ctx.ptr_outputbuffer[index].pmem_fd);
+ drv_ctx.ptr_outputbuffer[index].pmem_fd = -1;
#ifdef _ANDROID_
m_heap_ptr[index].video_heap_ptr = NULL;
m_heap_count = m_heap_count - 1;
@@ -4607,10 +4460,6 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
#endif
}
#ifdef MAX_RES_1080P
- if(secure_mode)
- {
- vdec_dealloc_meta_buffers();
- }
if(drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
vdec_dealloc_h264_mv();
@@ -4659,7 +4508,7 @@ OMX_ERRORTYPE omx_vdec::allocate_input_heap_buffer(OMX_HANDLETYPE hComp,
{
if(BITMASK_ABSENT(&m_heap_inp_bm_count,i))
{
- DEBUG_PRINT_LOW("Free Input Buffer Index %d",i);
+ DEBUG_PRINT_LOW("\n Free Input Buffer Index %d",i);
break;
}
}
@@ -4680,12 +4529,12 @@ OMX_ERRORTYPE omx_vdec::allocate_input_heap_buffer(OMX_HANDLETYPE hComp,
input->pBuffer = (OMX_U8 *)buf_addr;
input->nSize = sizeof(OMX_BUFFERHEADERTYPE);
input->nVersion.nVersion = OMX_SPEC_VERSION;
- input->nAllocLen = drv_ctx.ip_buf.buffer_size - DEVICE_SCRATCH;
+ input->nAllocLen = drv_ctx.ip_buf.buffer_size;
input->pAppPrivate = appData;
input->nInputPortIndex = OMX_CORE_INPUT_PORT_INDEX;
- DEBUG_PRINT_LOW("Address of Heap Buffer %p",*bufferHdr );
+ DEBUG_PRINT_LOW("\n Address of Heap Buffer %p",*bufferHdr );
eRet = allocate_input_buffer(hComp,&m_phdr_pmem_ptr [i],port,appData,bytes);
- DEBUG_PRINT_LOW("Address of Pmem Buffer %p",m_phdr_pmem_ptr [i] );
+ DEBUG_PRINT_LOW("\n Address of Pmem Buffer %p",m_phdr_pmem_ptr [i] );
/*Add the Buffers to freeq*/
if (!m_input_free_q.insert_entry((unsigned)m_phdr_pmem_ptr [i],NULL,NULL))
{
@@ -4733,16 +4582,16 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer(
unsigned char *buf_addr = NULL;
int pmem_fd = -1;
- if((bytes + DEVICE_SCRATCH) != drv_ctx.ip_buf.buffer_size)
+ if(bytes != drv_ctx.ip_buf.buffer_size)
{
- DEBUG_PRINT_LOW("Requested Size is wrong %d epected is %d",
+ DEBUG_PRINT_LOW("\n Requested Size is wrong %d epected is %d",
bytes, drv_ctx.ip_buf.buffer_size);
//return OMX_ErrorBadParameter;
}
if(!m_inp_mem_ptr)
{
- DEBUG_PRINT_HIGH("Allocate i/p buffer Header: Cnt(%d) Sz(%d)",
+ DEBUG_PRINT_HIGH("\n Allocate i/p buffer Header: Cnt(%d) Sz(%d)",
drv_ctx.ip_buf.actualcount,
drv_ctx.ip_buf.buffer_size);
@@ -4784,20 +4633,20 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer(
{
if(BITMASK_ABSENT(&m_inp_bm_count,i))
{
- DEBUG_PRINT_LOW("Free Input Buffer Index %d",i);
+ DEBUG_PRINT_LOW("\n Free Input Buffer Index %d",i);
break;
}
}
if(i < drv_ctx.ip_buf.actualcount)
{
- DEBUG_PRINT_LOW("Allocate input Buffer");
+ DEBUG_PRINT_LOW("\n Allocate input Buffer");
#ifdef USE_ION
drv_ctx.ip_buf_ion_info[i].ion_device_fd = alloc_map_ion_memory(
drv_ctx.ip_buf.buffer_size,drv_ctx.op_buf.alignment,
&drv_ctx.ip_buf_ion_info[i].ion_alloc_data,
- &drv_ctx.ip_buf_ion_info[i].fd_ion_data,ION_FLAG_CACHED);
+ &drv_ctx.ip_buf_ion_info[i].fd_ion_data,ION_FLAG_CACHED);
if(drv_ctx.ip_buf_ion_info[i].ion_device_fd < 0) {
return OMX_ErrorInsufficientResources;
}
@@ -4870,14 +4719,14 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer(
input = *bufferHdr;
BITMASK_SET(&m_inp_bm_count,i);
- DEBUG_PRINT_LOW("Buffer address %p of pmem",*bufferHdr);
+ DEBUG_PRINT_LOW("\n Buffer address %p of pmem",*bufferHdr);
if (secure_mode)
input->pBuffer = (OMX_U8 *)drv_ctx.ptr_inputbuffer [i].pmem_fd;
else
input->pBuffer = (OMX_U8 *)buf_addr;
input->nSize = sizeof(OMX_BUFFERHEADERTYPE);
input->nVersion.nVersion = OMX_SPEC_VERSION;
- input->nAllocLen = drv_ctx.ip_buf.buffer_size - DEVICE_SCRATCH;
+ input->nAllocLen = drv_ctx.ip_buf.buffer_size;
input->pAppPrivate = appData;
input->nInputPortIndex = OMX_CORE_INPUT_PORT_INDEX;
input->pInputPortPrivate = (void *)&drv_ctx.ptr_inputbuffer [i];
@@ -4941,11 +4790,11 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
if (!m_out_mem_ptr)
{
- DEBUG_PRINT_HIGH("Allocate o/p buffer Header: Cnt(%d) Sz(%d)",
+ DEBUG_PRINT_HIGH("\n Allocate o/p buffer Header: Cnt(%d) Sz(%d)",
drv_ctx.op_buf.actualcount,
drv_ctx.op_buf.buffer_size);
- DEBUG_PRINT_LOW("Allocating First Output Buffer(%d)",
+ DEBUG_PRINT_LOW("Allocating First Output Buffer(%d)\n",
drv_ctx.op_buf.actualcount);
nBufHdrSize = drv_ctx.op_buf.actualcount *
@@ -4958,11 +4807,11 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
nPlatformEntrySize = drv_ctx.op_buf.actualcount *
sizeof(OMX_QCOM_PLATFORM_PRIVATE_ENTRY);
- DEBUG_PRINT_LOW("TotalBufHdr %d BufHdrSize %d PMEM %d PL %d",nBufHdrSize,
+ DEBUG_PRINT_LOW("TotalBufHdr %d BufHdrSize %d PMEM %d PL %d\n",nBufHdrSize,
sizeof(OMX_BUFFERHEADERTYPE),
nPMEMInfoSize,
nPlatformListSize);
- DEBUG_PRINT_LOW("PE %d OutputBuffer Count %d",nPlatformEntrySize,
+ DEBUG_PRINT_LOW("PE %d OutputBuffer Count %d \n",nPlatformEntrySize,
drv_ctx.op_buf.actualcount);
m_out_mem_ptr = (OMX_BUFFERHEADERTYPE *)calloc(nBufHdrSize,1);
@@ -4990,9 +4839,9 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
if(m_out_mem_ptr && pPtr && drv_ctx.ptr_outputbuffer
&& drv_ctx.ptr_respbuffer
#ifdef _ANDROID_
- && m_heap_ptr
+ && m_heap_ptr
#endif
- )
+ )
{
drv_ctx.ptr_outputbuffer[0].mmaped_size =
(drv_ctx.op_buf.buffer_size *
@@ -5007,11 +4856,11 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
pPlatformEntry = m_platform_entry;
pPMEMInfo = m_pmem_info;
- DEBUG_PRINT_LOW("Memory Allocation Succeeded for OUT port%p",m_out_mem_ptr);
+ DEBUG_PRINT_LOW("Memory Allocation Succeeded for OUT port%p\n",m_out_mem_ptr);
// Settting the entire storage nicely
- DEBUG_PRINT_LOW("bHdr %p OutMem %p PE %p",bufHdr, m_out_mem_ptr,pPlatformEntry);
- DEBUG_PRINT_LOW("Pmem Info = %p",pPMEMInfo);
+ DEBUG_PRINT_LOW("bHdr %p OutMem %p PE %p\n",bufHdr, m_out_mem_ptr,pPlatformEntry);
+ DEBUG_PRINT_LOW(" Pmem Info = %p \n",pPMEMInfo);
for(i=0; i < drv_ctx.op_buf.actualcount ; i++)
{
bufHdr->nSize = sizeof(OMX_BUFFERHEADERTYPE);
@@ -5023,7 +4872,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
bufHdr->nOutputPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
// Platform specific PMEM Information
// Initialize the Platform Entry
- //DEBUG_PRINT_LOW("Initializing the Platform Entry for %d",i);
+ //DEBUG_PRINT_LOW("Initializing the Platform Entry for %d\n",i);
pPlatformEntry->type = OMX_QCOM_PLATFORM_PRIVATE_PMEM;
pPlatformEntry->entry = pPMEMInfo;
// Initialize the Platform List
@@ -5053,15 +4902,6 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
pPlatformList++;
}
#ifdef MAX_RES_1080P
- if(eRet == OMX_ErrorNone && secure_mode)
- {
- eRet = vdec_alloc_meta_buffers();
- if (eRet) {
- DEBUG_PRINT_ERROR("ERROR in allocating meta buffers\n");
- return OMX_ErrorInsufficientResources;
- }
- }
-
if(eRet == OMX_ErrorNone && drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
//Allocate the h264_mv_buffer
@@ -5099,8 +4939,8 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
}
#ifdef USE_ION
if (drv_ctx.op_buf_ion_info) {
- DEBUG_PRINT_LOW("Free o/p ion context");
- free(drv_ctx.op_buf_ion_info);
+ DEBUG_PRINT_LOW("\n Free o/p ion context");
+ free(drv_ctx.op_buf_ion_info);
drv_ctx.op_buf_ion_info = NULL;
}
#endif
@@ -5112,14 +4952,14 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
{
if(BITMASK_ABSENT(&m_out_bm_count,i))
{
- DEBUG_PRINT_LOW("Found a Free Output Buffer Index %d",i);
+ DEBUG_PRINT_LOW("\n Found a Free Output Buffer Index %d",i);
break;
}
}
if (i < drv_ctx.op_buf.actualcount)
{
- DEBUG_PRINT_LOW("Allocate Output Buffer");
+ DEBUG_PRINT_LOW("\n Allocate Output Buffer");
#ifdef USE_ION
drv_ctx.op_buf_ion_info[i].ion_device_fd = alloc_map_ion_memory(
@@ -5215,7 +5055,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
ioctl_msg.in = &setbuffers;
ioctl_msg.out = NULL;
- DEBUG_PRINT_LOW("Set the Output Buffer Idx: %d Addr: %x", i, drv_ctx.ptr_outputbuffer[i]);
+ DEBUG_PRINT_LOW("\n Set the Output Buffer Idx: %d Addr: %x", i, drv_ctx.ptr_outputbuffer[i]);
if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_SET_BUFFER,
&ioctl_msg) < 0)
{
@@ -5263,7 +5103,7 @@ OMX_ERRORTYPE omx_vdec::allocate_buffer(OMX_IN OMX_HANDLETYPE hC
unsigned i = 0;
OMX_ERRORTYPE eRet = OMX_ErrorNone; // OMX return type
- DEBUG_PRINT_LOW("Allocate buffer on port %d", (int)port);
+ DEBUG_PRINT_LOW("\n Allocate buffer on port %d \n", (int)port);
if(m_state == OMX_StateInvalid)
{
DEBUG_PRINT_ERROR("Allocate Buf in Invalid State\n");
@@ -5324,7 +5164,7 @@ OMX_ERRORTYPE omx_vdec::allocate_buffer(OMX_IN OMX_HANDLETYPE hC
}
}
}
- DEBUG_PRINT_LOW("Allocate Buffer exit with ret Code %d",eRet);
+ DEBUG_PRINT_LOW("Allocate Buffer exit with ret Code %d\n",eRet);
return eRet;
}
@@ -5349,17 +5189,17 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned int nPortIndex;
- DEBUG_PRINT_LOW("In for decoder free_buffer");
+ DEBUG_PRINT_LOW("In for decoder free_buffer \n");
if(m_state == OMX_StateIdle &&
(BITMASK_PRESENT(&m_flags ,OMX_COMPONENT_LOADING_PENDING)))
{
- DEBUG_PRINT_LOW(" free buffer while Component in Loading pending");
+ DEBUG_PRINT_LOW(" free buffer while Component in Loading pending\n");
}
else if((m_inp_bEnabled == OMX_FALSE && port == OMX_CORE_INPUT_PORT_INDEX)||
(m_out_bEnabled == OMX_FALSE && port == OMX_CORE_OUTPUT_PORT_INDEX))
{
- DEBUG_PRINT_LOW("Free Buffer while port %d disabled", port);
+ DEBUG_PRINT_LOW("Free Buffer while port %d disabled\n", port);
}
else if(m_state == OMX_StateExecuting || m_state == OMX_StatePause)
{
@@ -5386,7 +5226,7 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
else
nPortIndex = buffer - m_inp_heap_ptr;
- DEBUG_PRINT_LOW("free_buffer on i/p port - Port idx %d", nPortIndex);
+ DEBUG_PRINT_LOW("free_buffer on i/p port - Port idx %d \n", nPortIndex);
if(nPortIndex < drv_ctx.ip_buf.actualcount)
{
// Clear the bit associated with it.
@@ -5395,7 +5235,7 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
if (input_use_buffer == true)
{
- DEBUG_PRINT_LOW("Free pmem Buffer index %d",nPortIndex);
+ DEBUG_PRINT_LOW("\n Free pmem Buffer index %d",nPortIndex);
if(m_phdr_pmem_ptr)
free_input_buffer(m_phdr_pmem_ptr[nPortIndex]);
}
@@ -5415,7 +5255,7 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
/*Free the Buffer Header*/
if (release_input_done())
{
- DEBUG_PRINT_HIGH("ALL input buffers are freed/released");
+ DEBUG_PRINT_HIGH("\n ALL input buffers are freed/released");
free_input_buffer_header();
}
}
@@ -5428,7 +5268,7 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
if(BITMASK_PRESENT((&m_flags),OMX_COMPONENT_INPUT_DISABLE_PENDING)
&& release_input_done())
{
- DEBUG_PRINT_LOW("MOVING TO DISABLED STATE");
+ DEBUG_PRINT_LOW("MOVING TO DISABLED STATE \n");
BITMASK_CLEAR((&m_flags),OMX_COMPONENT_INPUT_DISABLE_PENDING);
post_event(OMX_CommandPortDisable,
OMX_CORE_INPUT_PORT_INDEX,
@@ -5441,7 +5281,7 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
nPortIndex = buffer - client_buffers.get_il_buf_hdr();
if(nPortIndex < drv_ctx.op_buf.actualcount)
{
- DEBUG_PRINT_LOW("free_buffer on o/p port - Port idx %d", nPortIndex);
+ DEBUG_PRINT_LOW("free_buffer on o/p port - Port idx %d \n", nPortIndex);
// Clear the bit associated with it.
BITMASK_CLEAR(&m_out_bm_count,nPortIndex);
m_out_bPopulated = OMX_FALSE;
@@ -5460,9 +5300,9 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
if(BITMASK_PRESENT((&m_flags),OMX_COMPONENT_OUTPUT_DISABLE_PENDING)
&& release_output_done())
{
- DEBUG_PRINT_LOW("FreeBuffer : If any Disable event pending,post it");
+ DEBUG_PRINT_LOW("FreeBuffer : If any Disable event pending,post it\n");
- DEBUG_PRINT_LOW("MOVING TO DISABLED STATE");
+ DEBUG_PRINT_LOW("MOVING TO DISABLED STATE \n");
BITMASK_CLEAR((&m_flags),OMX_COMPONENT_OUTPUT_DISABLE_PENDING);
post_event(OMX_CommandPortDisable,
@@ -5659,7 +5499,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
if (!arbitrary_bytes && (buffer->nFilledLen == 0) &&
((buffer->nFlags & OMX_BUFFERFLAG_EOS) == 0))
{
- DEBUG_PRINT_HIGH("return zero legth buffer");
+ DEBUG_PRINT_HIGH("\n return zero legth buffer");
post_event ((unsigned int)buffer,VDEC_S_SUCCESS,
OMX_COMPONENT_GENERATE_EBD);
return OMX_ErrorNone;
@@ -5674,10 +5514,10 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
not_coded_vop = mp4_headerparser.is_notcodec_vop(
(buffer->pBuffer + buffer->nOffset),buffer->nFilledLen);
if(not_coded_vop) {
- DEBUG_PRINT_HIGH("Found Not coded vop len %d frame number %d",
+ DEBUG_PRINT_HIGH("\n Found Not coded vop len %d frame number %d",
buffer->nFilledLen,frame_count);
if(buffer->nFlags & OMX_BUFFERFLAG_EOS){
- DEBUG_PRINT_HIGH("Eos and Not coded Vop set len to zero");
+ DEBUG_PRINT_HIGH("\n Eos and Not coded Vop set len to zero");
not_coded_vop = false;
buffer->nFilledLen = 0;
}
@@ -5690,7 +5530,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
#endif
)
{
- DEBUG_PRINT_LOW("Flush in progress return buffer ");
+ DEBUG_PRINT_LOW("\n Flush in progress return buffer ");
post_event ((unsigned int)buffer,VDEC_S_SUCCESS,
OMX_COMPONENT_GENERATE_EBD);
return OMX_ErrorNone;
@@ -5703,7 +5543,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("ETBProxy: bufhdr = %p, bufhdr->pBuffer = %p", buffer, buffer->pBuffer);
+ DEBUG_PRINT_LOW("\n ETBProxy: bufhdr = %p, bufhdr->pBuffer = %p", buffer, buffer->pBuffer);
/*for use buffer we need to memcpy the data*/
temp_buffer->buffer_len = buffer->nFilledLen;
@@ -5765,12 +5605,12 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
{
if(arbitrary_bytes)
{
- DEBUG_PRINT_LOW("Inserting TIMESTAMP (%lld) into queue", buffer->nTimeStamp);
+ DEBUG_PRINT_LOW("\n Inserting TIMESTAMP (%lld) into queue", buffer->nTimeStamp);
m_timestamp_list.insert_ts(buffer->nTimeStamp);
}
else if(!arbitrary_bytes && !(buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG))
{
- DEBUG_PRINT_LOW("Inserting TIMESTAMP (%lld) into queue", buffer->nTimeStamp);
+ DEBUG_PRINT_LOW("\n Inserting TIMESTAMP (%lld) into queue", buffer->nTimeStamp);
m_timestamp_list.insert_ts(buffer->nTimeStamp);
}
}
@@ -5782,8 +5622,8 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
fwrite((const char *)temp_buffer->bufferaddr,
temp_buffer->buffer_len,1,inputBufferFile1);
}
-
#endif
+
if(buffer->nFlags & QOMX_VIDEO_BUFFERFLAG_EOSEQ)
{
frameinfo.flags |= QOMX_VIDEO_BUFFERFLAG_EOSEQ;
@@ -5792,7 +5632,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
if (temp_buffer->buffer_len == 0 || (buffer->nFlags & OMX_BUFFERFLAG_EOS))
{
- DEBUG_PRINT_HIGH("Rxd i/p EOS, Notify Driver that EOS has been reached");
+ DEBUG_PRINT_HIGH("\n Rxd i/p EOS, Notify Driver that EOS has been reached");
frameinfo.flags |= VDEC_BUFFERFLAG_EOS;
h264_scratch.nFilledLen = 0;
nal_count = 0;
@@ -5817,7 +5657,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
DEBUG_PRINT_ERROR("\nERROR:empty_this_buffer_proxy VDEC_IOCTL_DECODE_FRAME failed");
if (!arbitrary_bytes)
{
- DEBUG_PRINT_LOW("Return failed buffer");
+ DEBUG_PRINT_LOW("\n Return failed buffer");
post_event ((unsigned int)buffer,VDEC_S_SUCCESS,
OMX_COMPONENT_GENERATE_EBD);
}
@@ -5906,12 +5746,12 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer_proxy(
drv_ctx.op_buf.actualcount) )
return OMX_ErrorBadParameter;
- DEBUG_PRINT_LOW("FTBProxy: bufhdr = %p, bufhdr->pBuffer = %p",
+ DEBUG_PRINT_LOW("\n FTBProxy: bufhdr = %p, bufhdr->pBuffer = %p",
bufferAdd, bufferAdd->pBuffer);
/*Return back the output buffer to client*/
if(m_out_bEnabled != OMX_TRUE || output_flush_progress == true)
{
- DEBUG_PRINT_LOW("Output Buffers return flush/disable condition");
+ DEBUG_PRINT_LOW("\n Output Buffers return flush/disable condition");
buffer->nFilledLen = 0;
m_cb.FillBufferDone (hComp,m_app_data,buffer);
return OMX_ErrorNone;
@@ -5971,7 +5811,7 @@ OMX_ERRORTYPE omx_vdec::set_callbacks(OMX_IN OMX_HANDLETYPE hComp,
{
m_cb = *callbacks;
- DEBUG_PRINT_LOW("Callbacks Set %p %p %p",m_cb.EmptyBufferDone,\
+ DEBUG_PRINT_LOW("\n Callbacks Set %p %p %p",m_cb.EmptyBufferDone,\
m_cb.EventHandler,m_cb.FillBufferDone);
m_app_data = appData;
return OMX_ErrorNotImplemented;
@@ -5993,10 +5833,6 @@ RETURN VALUE
========================================================================== */
OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
{
-#ifndef JB_MR1
- sp<IServiceManager> sm;
- sp<hwcService::IHWComposer> hwcBinder = NULL;
-#endif
#ifdef _ANDROID_
if(iDivXDrmDecrypt)
{
@@ -6013,25 +5849,19 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_HIGH("Playback Ended - PASSED");
+ DEBUG_PRINT_HIGH("\n Playback Ended - PASSED");
}
-#ifndef JB_MR1
+
if (secure_mode) {
- sm = defaultServiceManager();
- hwcBinder =
- interface_cast<hwcService::IHWComposer>(sm->getService(String16("display.hwcservice")));
- if (hwcBinder != NULL) {
- hwcBinder->setCloseSecureStart();
- } else {
- DEBUG_PRINT_HIGH("Failed to get hwcbinder, "
- "failed to call close secure start");
+ if (unsecureDisplay(qService::IQService::START) < 0) {
+ DEBUG_PRINT_HIGH("Failed to send message to unsecure display START");
}
}
-#endif
+
/*Check if the output buffers have to be cleaned up*/
if(m_out_mem_ptr)
{
- DEBUG_PRINT_LOW("Freeing the Output Memory");
+ DEBUG_PRINT_LOW("Freeing the Output Memory\n");
for (i=0; i < drv_ctx.op_buf.actualcount; i++ )
{
free_output_buffer (&m_out_mem_ptr[i]);
@@ -6041,7 +5871,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
/*Check if the input buffers have to be cleaned up*/
if(m_inp_mem_ptr || m_inp_heap_ptr)
{
- DEBUG_PRINT_LOW("Freeing the Input Memory");
+ DEBUG_PRINT_LOW("Freeing the Input Memory\n");
for (i=0; i<drv_ctx.ip_buf.actualcount; i++ )
{
if (m_inp_mem_ptr)
@@ -6061,7 +5891,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
if (h264_parser)
{
delete h264_parser;
- h264_parser = NULL;
+ h264_parser = NULL;
}
if(m_platform_list)
@@ -6089,9 +5919,10 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
}
#endif
- DEBUG_PRINT_LOW("Calling VDEC_IOCTL_STOP_NEXT_MSG");
+ DEBUG_PRINT_LOW("\n Calling VDEC_IOCTL_STOP_NEXT_MSG");
(void)ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_STOP_NEXT_MSG,
NULL);
+ DEBUG_PRINT_HIGH("\n Close the driver instance");
#ifdef _ANDROID_
/* get strong count gets the refernce count of the pmem, the count will
* be incremented by our kernal driver and surface flinger, by the time
@@ -6108,6 +5939,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
m_heap_count = 0;
}
#endif // _ANDROID_
+ close(drv_ctx.video_driver_fd);
#ifdef INPUT_BUFFER_LOG
fclose (inputBufferFile1);
#endif
@@ -6117,18 +5949,14 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
#ifdef OUTPUT_EXTRADATA_LOG
fclose (outputExtradataFile);
#endif
- power_module_deregister();
- DEBUG_PRINT_HIGH("omx_vdec::component_deinit() complete");
-#ifndef JB_MR1
- if (secure_mode) {
- if (hwcBinder != NULL) {
- hwcBinder->setCloseSecureEnd();
- } else {
- DEBUG_PRINT_HIGH("Failed to get hwcbinder, "
- "failed to call close secure start");
+
+ if (secure_mode) {
+ if (unsecureDisplay(qService::IQService::END) < 0) {
+ DEBUG_PRINT_HIGH("Failed to send message to unsecure display STOP");
}
- }
-#endif
+ }
+
+ DEBUG_PRINT_HIGH("\n omx_vdec::component_deinit() complete");
return OMX_ErrorNone;
}
@@ -6162,7 +5990,7 @@ OMX_ERRORTYPE omx_vdec::use_EGL_image(OMX_IN OMX_HANDLETYPE hCom
#else
int fd = -1, offset = 0;
#endif
- DEBUG_PRINT_HIGH("use EGL image support for decoder");
+ DEBUG_PRINT_HIGH("\nuse EGL image support for decoder");
if (!bufferHdr || !eglImage|| port != OMX_CORE_OUTPUT_PORT_INDEX) {
DEBUG_PRINT_ERROR("\n ");
}
@@ -6234,7 +6062,7 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
if((0 == index) && role)
{
strlcpy((char *)role, "video_decoder.mpeg4",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s",role);
+ DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
}
else
{
@@ -6246,7 +6074,7 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
if((0 == index) && role)
{
strlcpy((char *)role, "video_decoder.mpeg2",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s",role);
+ DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
}
else
{
@@ -6258,11 +6086,11 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
if((0 == index) && role)
{
strlcpy((char *)role, "video_decoder.h263",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s",role);
+ DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
}
else
{
- DEBUG_PRINT_LOW("No more roles");
+ DEBUG_PRINT_LOW("\n No more roles \n");
eRet = OMX_ErrorNoMore;
}
}
@@ -6277,11 +6105,11 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
if((0 == index) && role)
{
strlcpy((char *)role, "video_decoder.divx",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s",role);
+ DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
}
else
{
- DEBUG_PRINT_LOW("No more roles");
+ DEBUG_PRINT_LOW("\n No more roles \n");
eRet = OMX_ErrorNoMore;
}
}
@@ -6290,11 +6118,11 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
if((0 == index) && role)
{
strlcpy((char *)role, "video_decoder.avc",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s",role);
+ DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
}
else
{
- DEBUG_PRINT_LOW("No more roles");
+ DEBUG_PRINT_LOW("\n No more roles \n");
eRet = OMX_ErrorNoMore;
}
}
@@ -6305,17 +6133,17 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
if((0 == index) && role)
{
strlcpy((char *)role, "video_decoder.vc1",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s",role);
+ DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
}
else
{
- DEBUG_PRINT_LOW("No more roles");
+ DEBUG_PRINT_LOW("\n No more roles \n");
eRet = OMX_ErrorNoMore;
}
}
else
{
- DEBUG_PRINT_ERROR("\nERROR:Querying Role on Unknown Component");
+ DEBUG_PRINT_ERROR("\nERROR:Querying Role on Unknown Component\n");
eRet = OMX_ErrorInvalidComponentName;
}
return eRet;
@@ -6493,7 +6321,7 @@ bool omx_vdec::release_output_done(void)
bool bRet = false;
unsigned i=0,j=0;
- DEBUG_PRINT_LOW("Value of m_out_mem_ptr %p",m_inp_mem_ptr);
+ DEBUG_PRINT_LOW("\n Value of m_out_mem_ptr %p",m_inp_mem_ptr);
if(m_out_mem_ptr)
{
for(;j < drv_ctx.op_buf.actualcount ; j++)
@@ -6535,7 +6363,7 @@ bool omx_vdec::release_input_done(void)
bool bRet = false;
unsigned i=0,j=0;
- DEBUG_PRINT_LOW("Value of m_inp_mem_ptr %p",m_inp_mem_ptr);
+ DEBUG_PRINT_LOW("\n Value of m_inp_mem_ptr %p",m_inp_mem_ptr);
if(m_inp_mem_ptr)
{
for(;j<drv_ctx.ip_buf.actualcount;j++)
@@ -6601,13 +6429,13 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
}
#endif
- DEBUG_PRINT_LOW("fill_buffer_done: bufhdr = %p, bufhdr->pBuffer = %p",
+ DEBUG_PRINT_LOW("\n fill_buffer_done: bufhdr = %p, bufhdr->pBuffer = %p",
buffer, buffer->pBuffer);
pending_output_buffers --;
if (buffer->nFlags & OMX_BUFFERFLAG_EOS)
{
- DEBUG_PRINT_HIGH("Output EOS has been reached");
+ DEBUG_PRINT_HIGH("\n Output EOS has been reached");
if (!output_flush_progress)
post_event(NULL,NULL,OMX_COMPONENT_GENERATE_EOS_DONE);
@@ -6624,7 +6452,7 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
}
}
- DEBUG_PRINT_LOW("In fill Buffer done call address %p ",buffer);
+ DEBUG_PRINT_LOW("\n In fill Buffer done call address %p ",buffer);
#ifdef OUTPUT_BUFFER_LOG
if (outputBufferFile1)
{
@@ -6648,12 +6476,7 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
if (buffer->nFilledLen > 0)
{
if (client_extradata)
- {
- if(secure_mode)
- handle_extradata_secure(buffer);
- else
- handle_extradata(buffer);
- }
+ handle_extradata(buffer);
if (client_extradata & OMX_TIMEINFO_EXTRADATA)
// Keep min timestamp interval to handle corrupted bit stream scenario
set_frame_rate(buffer->nTimeStamp);
@@ -6698,7 +6521,7 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
while(p_extra &&
(OMX_U8*)p_extra < (pBuffer + buffer->nAllocLen) )
{
- DEBUG_PRINT_LOW("WRITING extradata, size=%d,type=%d",p_extra->nSize, p_extra->eType);
+ DEBUG_PRINT_LOW("\nWRITING extradata, size=%d,type=%d",p_extra->nSize, p_extra->eType);
fwrite (p_extra,1,p_extra->nSize,outputExtradataFile);
if (p_extra->eType == OMX_ExtraDataNone)
{
@@ -6717,7 +6540,7 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
pPMEMInfo = (OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO *)
((OMX_QCOM_PLATFORM_PRIVATE_LIST *)
buffer->pPlatformPrivate)->entryList->entry;
- DEBUG_PRINT_LOW("Before FBD callback Accessed Pmeminfo %d",pPMEMInfo->pmem_fd);
+ DEBUG_PRINT_LOW("\n Before FBD callback Accessed Pmeminfo %d",pPMEMInfo->pmem_fd);
OMX_BUFFERHEADERTYPE *il_buffer;
il_buffer = client_buffers.get_il_buf_hdr(buffer);
if (il_buffer)
@@ -6727,7 +6550,7 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("After Fill Buffer Done callback %d",pPMEMInfo->pmem_fd);
+ DEBUG_PRINT_LOW("\n After Fill Buffer Done callback %d",pPMEMInfo->pmem_fd);
}
else
{
@@ -6747,7 +6570,7 @@ OMX_ERRORTYPE omx_vdec::empty_buffer_done(OMX_HANDLETYPE hComp,
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("empty_buffer_done: bufhdr = %p, bufhdr->pBuffer = %p",
+ DEBUG_PRINT_LOW("\n empty_buffer_done: bufhdr = %p, bufhdr->pBuffer = %p",
buffer, buffer->pBuffer);
pending_input_buffers--;
@@ -6755,7 +6578,7 @@ OMX_ERRORTYPE omx_vdec::empty_buffer_done(OMX_HANDLETYPE hComp,
{
if (pdest_frame == NULL && input_flush_progress == false)
{
- DEBUG_PRINT_LOW("Push input from buffer done address of Buffer %p",buffer);
+ DEBUG_PRINT_LOW("\n Push input from buffer done address of Buffer %p",buffer);
pdest_frame = buffer;
buffer->nFilledLen = 0;
buffer->nTimeStamp = LLONG_MAX;
@@ -6763,7 +6586,7 @@ OMX_ERRORTYPE omx_vdec::empty_buffer_done(OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_LOW("Push buffer into freeq address of Buffer %p",buffer);
+ DEBUG_PRINT_LOW("\n Push buffer into freeq address of Buffer %p",buffer);
buffer->nFilledLen = 0;
if (!m_input_free_q.insert_entry((unsigned)buffer,NULL,NULL))
{
@@ -6807,7 +6630,7 @@ int omx_vdec::async_message_process (void *context, void* message)
{
OMX_TICKS expected_ts = 0;
omx->m_timestamp_list.pop_min_ts(expected_ts);
- DEBUG_PRINT_LOW("Current timestamp (%lld),Popped TIMESTAMP (%lld) from list",
+ DEBUG_PRINT_LOW("\n Current timestamp (%lld),Popped TIMESTAMP (%lld) from list",
vdec_msg->msgdata.output_frame.time_stamp, expected_ts);
if (vdec_msg->msgdata.output_frame.time_stamp != expected_ts)
@@ -6878,7 +6701,7 @@ int omx_vdec::async_message_process (void *context, void* message)
*timestamp = vdec_msg->msgdata.output_frame.time_stamp;
omx->post_event ((unsigned int)timestamp, vdec_msg->status_code,
OMX_COMPONENT_GENERATE_INFO_FIELD_DROPPED);
- DEBUG_PRINT_HIGH("Field dropped time stamp is %lld",
+ DEBUG_PRINT_HIGH("\nField dropped time stamp is %lld",
vdec_msg->msgdata.output_frame.time_stamp);
}
break;
@@ -6938,6 +6761,7 @@ int omx_vdec::async_message_process (void *context, void* message)
output_respbuf->aspect_ratio_info =
vdec_msg->msgdata.output_frame.aspect_ratio_info;
+
if (omx->output_use_buffer)
memcpy ( omxhdr->pBuffer,
(vdec_msg->msgdata.output_frame.bufferaddr +
@@ -6957,13 +6781,13 @@ int omx_vdec::async_message_process (void *context, void* message)
OMX_COMPONENT_GENERATE_HARDWARE_ERROR);
break;
case VDEC_MSG_EVT_CONFIG_CHANGED:
- DEBUG_PRINT_HIGH("Port settings changed");
+ DEBUG_PRINT_HIGH("\n Port settings changed");
omx->post_event ((unsigned int)omxhdr,vdec_msg->status_code,
OMX_COMPONENT_GENERATE_PORT_RECONFIG);
break;
case VDEC_MSG_EVT_INFO_CONFIG_CHANGED:
{
- DEBUG_PRINT_HIGH("Port settings changed info");
+ DEBUG_PRINT_HIGH("\n Port settings changed info");
// get_buffer_req and populate port defn structure
OMX_ERRORTYPE eRet = OMX_ErrorNone;
omx->m_port_def.nPortIndex = 1;
@@ -6984,14 +6808,14 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy_arbitrary (
)
{
unsigned address,p2,id;
- DEBUG_PRINT_LOW("Empty this arbitrary");
+ DEBUG_PRINT_LOW("\n Empty this arbitrary");
if (buffer == NULL)
{
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("ETBProxyArb: bufhdr = %p, bufhdr->pBuffer = %p", buffer, buffer->pBuffer);
- DEBUG_PRINT_LOW("ETBProxyArb: nFilledLen %u, flags %d, timestamp %u",
+ DEBUG_PRINT_LOW("\n ETBProxyArb: bufhdr = %p, bufhdr->pBuffer = %p", buffer, buffer->pBuffer);
+ DEBUG_PRINT_LOW("\n ETBProxyArb: nFilledLen %u, flags %d, timestamp %u",
buffer->nFilledLen, buffer->nFlags, (unsigned)buffer->nTimeStamp);
/* return zero length and not an EOS buffer */
@@ -6999,21 +6823,21 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy_arbitrary (
if ((input_flush_progress == true) || ((buffer->nFilledLen == 0) &&
((buffer->nFlags & OMX_BUFFERFLAG_EOS) == 0)))
{
- DEBUG_PRINT_HIGH("return zero legth buffer or flush in progress");
+ DEBUG_PRINT_HIGH("\n return zero legth buffer or flush in progress");
m_cb.EmptyBufferDone (hComp,m_app_data,buffer);
return OMX_ErrorNone;
}
if (psource_frame == NULL)
{
- DEBUG_PRINT_LOW("Set Buffer as source Buffer %p time stamp %d",buffer,buffer->nTimeStamp);
+ DEBUG_PRINT_LOW("\n Set Buffer as source Buffer %p time stamp %d",buffer,buffer->nTimeStamp);
psource_frame = buffer;
- DEBUG_PRINT_LOW("Try to Push One Input Buffer ");
+ DEBUG_PRINT_LOW("\n Try to Push One Input Buffer ");
push_input_buffer (hComp);
}
else
{
- DEBUG_PRINT_LOW("Push the source buffer into pendingq %p",buffer);
+ DEBUG_PRINT_LOW("\n Push the source buffer into pendingq %p",buffer);
if (!m_input_pending_q.insert_entry((unsigned)buffer,NULL,NULL))
{
return OMX_ErrorBadParameter;
@@ -7034,28 +6858,28 @@ OMX_ERRORTYPE omx_vdec::push_input_buffer (OMX_HANDLETYPE hComp)
/*Check if we have a destination buffer*/
if (pdest_frame == NULL)
{
- DEBUG_PRINT_LOW("Get a Destination buffer from the queue");
+ DEBUG_PRINT_LOW("\n Get a Destination buffer from the queue");
if (m_input_free_q.m_size)
{
m_input_free_q.pop_entry(&address,&p2,&id);
pdest_frame = (OMX_BUFFERHEADERTYPE *)address;
pdest_frame->nFilledLen = 0;
pdest_frame->nTimeStamp = LLONG_MAX;
- DEBUG_PRINT_LOW("Address of Pmem Buffer %p",pdest_frame);
+ DEBUG_PRINT_LOW("\n Address of Pmem Buffer %p",pdest_frame);
}
}
/*Check if we have a destination buffer*/
if (psource_frame == NULL)
{
- DEBUG_PRINT_LOW("Get a source buffer from the queue");
+ DEBUG_PRINT_LOW("\n Get a source buffer from the queue");
if (m_input_pending_q.m_size)
{
m_input_pending_q.pop_entry(&address,&p2,&id);
psource_frame = (OMX_BUFFERHEADERTYPE *)address;
- DEBUG_PRINT_LOW("Next source Buffer %p time stamp %d",psource_frame,
+ DEBUG_PRINT_LOW("\n Next source Buffer %p time stamp %d",psource_frame,
psource_frame->nTimeStamp);
- DEBUG_PRINT_LOW("Next source Buffer flag %d length %d",
+ DEBUG_PRINT_LOW("\n Next source Buffer flag %d length %d",
psource_frame->nFlags,psource_frame->nFilledLen);
}
@@ -7096,7 +6920,7 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
OMX_BOOL generate_ebd = OMX_TRUE;
unsigned address,p2,id;
- DEBUG_PRINT_LOW("Start Parsing the bit stream address %p TimeStamp %d",
+ DEBUG_PRINT_LOW("\n Start Parsing the bit stream address %p TimeStamp %d",
psource_frame,psource_frame->nTimeStamp);
if (m_frame_parser.parse_sc_frame(psource_frame,
pdest_frame,&partial_frame) == -1)
@@ -7107,15 +6931,15 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
if (partial_frame == 0)
{
- DEBUG_PRINT_LOW("Frame size %d source %p frame count %d",
+ DEBUG_PRINT_LOW("\n Frame size %d source %p frame count %d",
pdest_frame->nFilledLen,psource_frame,frame_count);
- DEBUG_PRINT_LOW("TimeStamp updated %d",pdest_frame->nTimeStamp);
+ DEBUG_PRINT_LOW("\n TimeStamp updated %d",pdest_frame->nTimeStamp);
/*First Parsed buffer will have only header Hence skip*/
if (frame_count == 0)
{
- DEBUG_PRINT_LOW("H263/MPEG4 Codec First Frame ");
+ DEBUG_PRINT_LOW("\n H263/MPEG4 Codec First Frame ");
#ifdef MAX_RES_1080P
if(codec_type_parse == CODEC_TYPE_MPEG4 ||
codec_type_parse == CODEC_TYPE_DIVX) {
@@ -7157,7 +6981,7 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("Not a Complete Frame %d",pdest_frame->nFilledLen);
+ DEBUG_PRINT_LOW("\n Not a Complete Frame %d",pdest_frame->nFilledLen);
/*Check if Destination Buffer is full*/
if (pdest_frame->nAllocLen ==
pdest_frame->nFilledLen + pdest_frame->nOffset)
@@ -7174,9 +6998,9 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
if (pdest_frame)
{
pdest_frame->nFlags |= psource_frame->nFlags;
- DEBUG_PRINT_LOW("Frame Found start Decoding Size =%d TimeStamp = %x",
+ DEBUG_PRINT_LOW("\n Frame Found start Decoding Size =%d TimeStamp = %x",
pdest_frame->nFilledLen,pdest_frame->nTimeStamp);
- DEBUG_PRINT_LOW("Found a frame size = %d number = %d",
+ DEBUG_PRINT_LOW("\n Found a frame size = %d number = %d",
pdest_frame->nFilledLen,frame_count++);
/*Push the frame to the Decoder*/
if (empty_this_buffer_proxy(hComp,pdest_frame) != OMX_ErrorNone)
@@ -7188,24 +7012,24 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("Last frame in else dest addr") ;
+ DEBUG_PRINT_LOW("\n Last frame in else dest addr") ;
generate_ebd = OMX_FALSE;
}
}
if(generate_ebd)
{
- DEBUG_PRINT_LOW("Buffer Consumed return back to client %p",psource_frame);
+ DEBUG_PRINT_LOW("\n Buffer Consumed return back to client %p",psource_frame);
m_cb.EmptyBufferDone (hComp,m_app_data,psource_frame);
psource_frame = NULL;
if (m_input_pending_q.m_size)
{
- DEBUG_PRINT_LOW("Pull Next source Buffer %p",psource_frame);
+ DEBUG_PRINT_LOW("\n Pull Next source Buffer %p",psource_frame);
m_input_pending_q.pop_entry(&address,&p2,&id);
psource_frame = (OMX_BUFFERHEADERTYPE *) address;
- DEBUG_PRINT_LOW("Next source Buffer %p time stamp %d",psource_frame,
+ DEBUG_PRINT_LOW("\n Next source Buffer %p time stamp %d",psource_frame,
psource_frame->nTimeStamp);
- DEBUG_PRINT_LOW("Next source Buffer flag %d length %d",
+ DEBUG_PRINT_LOW("\n Next source Buffer flag %d length %d",
psource_frame->nFlags,psource_frame->nFilledLen);
}
}
@@ -7225,9 +7049,9 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
DEBUG_PRINT_ERROR("\nERROR:H.264 Scratch Buffer not allocated");
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("Pending h264_scratch.nFilledLen %d "
+ DEBUG_PRINT_LOW("\n Pending h264_scratch.nFilledLen %d "
"look_ahead_nal %d", h264_scratch.nFilledLen, look_ahead_nal);
- DEBUG_PRINT_LOW("Pending pdest_frame->nFilledLen %d",pdest_frame->nFilledLen);
+ DEBUG_PRINT_LOW("\n Pending pdest_frame->nFilledLen %d",pdest_frame->nFilledLen);
if (h264_scratch.nFilledLen && look_ahead_nal)
{
look_ahead_nal = false;
@@ -7237,7 +7061,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
memcpy ((pdest_frame->pBuffer + pdest_frame->nFilledLen),
h264_scratch.pBuffer,h264_scratch.nFilledLen);
pdest_frame->nFilledLen += h264_scratch.nFilledLen;
- DEBUG_PRINT_LOW("Copy the previous NAL (h264 scratch) into Dest frame");
+ DEBUG_PRINT_LOW("\n Copy the previous NAL (h264 scratch) into Dest frame");
h264_scratch.nFilledLen = 0;
}
else
@@ -7248,7 +7072,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
if (nal_length == 0)
{
- DEBUG_PRINT_LOW("Zero NAL, hence parse using start code");
+ DEBUG_PRINT_LOW("\n Zero NAL, hence parse using start code");
if (m_frame_parser.parse_sc_frame(psource_frame,
&h264_scratch,&partial_frame) == -1)
{
@@ -7258,7 +7082,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("Non-zero NAL length clip, hence parse with NAL size %d ",nal_length);
+ DEBUG_PRINT_LOW("\n Non-zero NAL length clip, hence parse with NAL size %d ",nal_length);
if (m_frame_parser.parse_h264_nallength(psource_frame,
&h264_scratch,&partial_frame) == -1)
{
@@ -7271,14 +7095,14 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
{
if (nal_count == 0 && h264_scratch.nFilledLen == 0)
{
- DEBUG_PRINT_LOW("First NAL with Zero Length, hence Skip");
+ DEBUG_PRINT_LOW("\n First NAL with Zero Length, hence Skip");
nal_count++;
h264_scratch.nTimeStamp = psource_frame->nTimeStamp;
h264_scratch.nFlags = psource_frame->nFlags;
}
else
{
- DEBUG_PRINT_LOW("Parsed New NAL Length = %d",h264_scratch.nFilledLen);
+ DEBUG_PRINT_LOW("\n Parsed New NAL Length = %d",h264_scratch.nFilledLen);
if(h264_scratch.nFilledLen)
{
h264_parser->parse_nal((OMX_U8*)h264_scratch.pBuffer, h264_scratch.nFilledLen,
@@ -7323,7 +7147,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
if ( (pdest_frame->nAllocLen - pdest_frame->nFilledLen) >=
h264_scratch.nFilledLen)
{
- DEBUG_PRINT_LOW("Not a NewFrame Copy into Dest len %d",
+ DEBUG_PRINT_LOW("\n Not a NewFrame Copy into Dest len %d",
h264_scratch.nFilledLen);
memcpy ((pdest_frame->pBuffer + pdest_frame->nFilledLen),
h264_scratch.pBuffer,h264_scratch.nFilledLen);
@@ -7334,21 +7158,21 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_ERROR("\n Error:2: Destination buffer overflow for H264");
+ DEBUG_PRINT_LOW("\n Error:2: Destination buffer overflow for H264");
return OMX_ErrorBadParameter;
}
}
else
{
look_ahead_nal = true;
- DEBUG_PRINT_LOW("Frame Found start Decoding Size =%d TimeStamp = %x",
+ DEBUG_PRINT_LOW("\n Frame Found start Decoding Size =%d TimeStamp = %x",
pdest_frame->nFilledLen,pdest_frame->nTimeStamp);
- DEBUG_PRINT_LOW("Found a frame size = %d number = %d",
+ DEBUG_PRINT_LOW("\n Found a frame size = %d number = %d",
pdest_frame->nFilledLen,frame_count++);
if (pdest_frame->nFilledLen == 0)
{
- DEBUG_PRINT_LOW("Copy the Current Frame since and push it");
+ DEBUG_PRINT_LOW("\n Copy the Current Frame since and push it");
look_ahead_nal = false;
if ( (pdest_frame->nAllocLen - pdest_frame->nFilledLen) >=
h264_scratch.nFilledLen)
@@ -7368,7 +7192,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
{
if(psource_frame->nFilledLen || h264_scratch.nFilledLen)
{
- DEBUG_PRINT_LOW("Reset the EOS Flag");
+ DEBUG_PRINT_LOW("\n Reset the EOS Flag");
pdest_frame->nFlags &= ~OMX_BUFFERFLAG_EOS;
}
/*Push the frame to the Decoder*/
@@ -7382,7 +7206,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
{
m_input_free_q.pop_entry(&address,&p2,&id);
pdest_frame = (OMX_BUFFERHEADERTYPE *) address;
- DEBUG_PRINT_LOW("Pop the next pdest_buffer %p",pdest_frame);
+ DEBUG_PRINT_LOW("\n Pop the next pdest_buffer %p",pdest_frame);
pdest_frame->nFilledLen = 0;
pdest_frame->nFlags = 0;
pdest_frame->nTimeStamp = LLONG_MAX;
@@ -7393,7 +7217,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("Not a Complete Frame, pdest_frame->nFilledLen %d",pdest_frame->nFilledLen);
+ DEBUG_PRINT_LOW("\n Not a Complete Frame, pdest_frame->nFilledLen %d",pdest_frame->nFilledLen);
/*Check if Destination Buffer is full*/
if (h264_scratch.nAllocLen ==
h264_scratch.nFilledLen + h264_scratch.nOffset)
@@ -7405,13 +7229,13 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
if (!psource_frame->nFilledLen)
{
- DEBUG_PRINT_LOW("Buffer Consumed return source %p back to client",psource_frame);
+ DEBUG_PRINT_LOW("\n Buffer Consumed return source %p back to client",psource_frame);
if (psource_frame->nFlags & OMX_BUFFERFLAG_EOS)
{
if (pdest_frame)
{
- DEBUG_PRINT_LOW("EOS Reached Pass Last Buffer");
+ DEBUG_PRINT_LOW("\n EOS Reached Pass Last Buffer");
if ( (pdest_frame->nAllocLen - pdest_frame->nFilledLen) >=
h264_scratch.nFilledLen)
{
@@ -7437,7 +7261,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
#endif
DEBUG_PRINT_LOW("pdest_frame->nFilledLen = %d, nFlags = 0x%x, TimeStamp = %x",
pdest_frame->nFilledLen, pdest_frame->nFlags, pdest_frame->nTimeStamp);
- DEBUG_PRINT_LOW("Push AU frame number %d to driver", frame_count++);
+ DEBUG_PRINT_LOW("\n Push AU frame number %d to driver", frame_count++);
#ifndef PROCESS_EXTRADATA_IN_OUTPUT_PORT
if (client_extradata & OMX_TIMEINFO_EXTRADATA)
{
@@ -7456,7 +7280,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("Last frame in else dest addr %p size %d",
+ DEBUG_PRINT_LOW("\n Last frame in else dest addr %p size %d",
pdest_frame,h264_scratch.nFilledLen);
generate_ebd = OMX_FALSE;
}
@@ -7468,10 +7292,10 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
psource_frame = NULL;
if (m_input_pending_q.m_size)
{
- DEBUG_PRINT_LOW("Pull Next source Buffer %p",psource_frame);
+ DEBUG_PRINT_LOW("\n Pull Next source Buffer %p",psource_frame);
m_input_pending_q.pop_entry(&address,&p2,&id);
psource_frame = (OMX_BUFFERHEADERTYPE *) address;
- DEBUG_PRINT_LOW("Next source Buffer flag %d src length %d",
+ DEBUG_PRINT_LOW("\nNext source Buffer flag %d src length %d",
psource_frame->nFlags,psource_frame->nFilledLen);
}
}
@@ -7487,10 +7311,10 @@ OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp)
if(first_frame == 0)
{
first_frame = 1;
- DEBUG_PRINT_LOW("First i/p buffer for VC1 arbitrary bytes");
+ DEBUG_PRINT_LOW("\nFirst i/p buffer for VC1 arbitrary bytes\n");
if(!m_vendor_config.pData)
{
- DEBUG_PRINT_LOW("Check profile type in 1st source buffer");
+ DEBUG_PRINT_LOW("\nCheck profile type in 1st source buffer\n");
buf = psource_frame->pBuffer;
buf_len = psource_frame->nFilledLen;
@@ -7505,7 +7329,7 @@ OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_ERROR("\nInvalid sequence layer in first buffer");
+ DEBUG_PRINT_ERROR("\nInvalid sequence layer in first buffer\n");
return OMX_ErrorStreamCorrupt;
}
}
@@ -7518,7 +7342,7 @@ OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp)
if(dest_len < m_vendor_config.nDataSize)
{
- DEBUG_PRINT_ERROR("\nDestination buffer full");
+ DEBUG_PRINT_ERROR("\nDestination buffer full\n");
return OMX_ErrorBadParameter;
}
else
@@ -7532,7 +7356,7 @@ OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp)
switch(m_vc1_profile)
{
case VC1_AP:
- DEBUG_PRINT_LOW("VC1 AP, hence parse using frame start code");
+ DEBUG_PRINT_LOW("\n VC1 AP, hence parse using frame start code");
if (push_input_sc_codec(hComp) != OMX_ErrorNone)
{
DEBUG_PRINT_ERROR("\n Error In Parsing VC1 AP start code");
@@ -7542,7 +7366,7 @@ OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp)
case VC1_SP_MP_RCV:
default:
- DEBUG_PRINT_ERROR("\n Unsupported VC1 profile in ArbitraryBytes Mode");
+ DEBUG_PRINT_ERROR("\n Unsupported VC1 profile in ArbitraryBytes Mode\n");
return OMX_ErrorBadParameter;
}
return OMX_ErrorNone;
@@ -7572,7 +7396,7 @@ bool omx_vdec::align_pmem_buffers(int pmem_fd, OMX_U32 buffer_size,
#ifdef USE_ION
int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
OMX_U32 alignment, struct ion_allocation_data *alloc_data,
- struct ion_fd_data *fd_data,int flag)
+ struct ion_fd_data *fd_data,int flag)
{
int fd = -EINVAL;
int rc = -EINVAL;
@@ -7582,7 +7406,6 @@ int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
DEBUG_PRINT_ERROR("Invalid arguments to alloc_map_ion_memory\n");
return -EINVAL;
}
-
ion_dev_flag = O_RDONLY;
fd = open (MEM_DEVICE, ion_dev_flag);
if (fd < 0) {
@@ -7590,36 +7413,23 @@ int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
return fd;
}
alloc_data->flags = 0;
- if(!secure_mode && (flag & ION_FLAG_CACHED))
+ if (!secure_mode && (flag & ION_FLAG_CACHED))
{
- alloc_data->flags |= ION_FLAG_CACHED;
+ alloc_data->flags |= ION_FLAG_CACHED;
}
-
alloc_data->len = buffer_size;
alloc_data->align = clip2(alignment);
if (alloc_data->align < 4096)
{
alloc_data->align = 4096;
}
+
if(secure_mode) {
- if(external_meta_buffer) {
- alloc_data->heap_mask = ION_HEAP(ION_CP_MFC_HEAP_ID);
- alloc_data->flags |= ION_SECURE;
- } else if (external_meta_buffer_iommu) {
- alloc_data->heap_mask = ION_HEAP(ION_IOMMU_HEAP_ID);
- } else {
- alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
- alloc_data->flags |= ION_SECURE;
- }
- } else {
-#ifdef MAX_RES_720P
- alloc_data->len = (buffer_size + (alloc_data->align - 1)) & ~(alloc_data->align - 1);
alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
-#else
- alloc_data->heap_mask = (ION_HEAP(MEM_HEAP_ID) | ION_HEAP(ION_IOMMU_HEAP_ID));
-#endif
+ alloc_data->flags |= ION_SECURE;
+ } else {
+ alloc_data->heap_mask = (ION_HEAP(ION_IOMMU_HEAP_ID));
}
-
rc = ioctl(fd,ION_IOC_ALLOC,alloc_data);
if (rc || !alloc_data->handle) {
DEBUG_PRINT_ERROR("\n ION ALLOC memory failed ");
@@ -7640,10 +7450,7 @@ int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
close(fd);
fd = -ENOMEM;
}
- DEBUG_PRINT_HIGH("ION: alloc_data: handle(0x%X), len(%u), align(%u), "
- "flags(0x%x), fd_data: handle(0x%x), fd(0x%x)",
- alloc_data->handle, alloc_data->len, alloc_data->align,
- alloc_data->flags, fd_data->handle, fd_data->fd);
+
return fd;
}
@@ -7653,10 +7460,6 @@ void omx_vdec::free_ion_memory(struct vdec_ion *buf_ion_info) {
DEBUG_PRINT_ERROR("\n ION: free called with invalid fd/allocdata");
return;
}
- DEBUG_PRINT_HIGH("ION: free: handle(0x%X), len(%u), fd(0x%x)",
- buf_ion_info->ion_alloc_data.handle,
- buf_ion_info->ion_alloc_data.len,
- buf_ion_info->fd_ion_data.fd);
if(ioctl(buf_ion_info->ion_device_fd,ION_IOC_FREE,
&buf_ion_info->ion_alloc_data.handle)) {
DEBUG_PRINT_ERROR("\n ION: free failed" );
@@ -7669,7 +7472,7 @@ void omx_vdec::free_ion_memory(struct vdec_ion *buf_ion_info) {
#endif
void omx_vdec::free_output_buffer_header()
{
- DEBUG_PRINT_HIGH("ALL output buffers are freed/released");
+ DEBUG_PRINT_HIGH("\n ALL output buffers are freed/released");
output_use_buffer = false;
ouput_egl_buffers = false;
@@ -7697,8 +7500,8 @@ void omx_vdec::free_output_buffer_header()
}
#ifdef USE_ION
if (drv_ctx.op_buf_ion_info) {
- DEBUG_PRINT_LOW("Free o/p ion context");
- free(drv_ctx.op_buf_ion_info);
+ DEBUG_PRINT_LOW("\n Free o/p ion context");
+ free(drv_ctx.op_buf_ion_info);
drv_ctx.op_buf_ion_info = NULL;
}
#endif
@@ -7711,41 +7514,41 @@ void omx_vdec::free_input_buffer_header()
{
if (m_frame_parser.mutils)
{
- DEBUG_PRINT_LOW("Free utils parser");
+ DEBUG_PRINT_LOW("\n Free utils parser");
delete (m_frame_parser.mutils);
m_frame_parser.mutils = NULL;
}
if (m_inp_heap_ptr)
{
- DEBUG_PRINT_LOW("Free input Heap Pointer");
+ DEBUG_PRINT_LOW("\n Free input Heap Pointer");
free (m_inp_heap_ptr);
m_inp_heap_ptr = NULL;
}
if (m_phdr_pmem_ptr)
{
- DEBUG_PRINT_LOW("Free input pmem header Pointer");
+ DEBUG_PRINT_LOW("\n Free input pmem header Pointer");
free (m_phdr_pmem_ptr);
m_phdr_pmem_ptr = NULL;
}
}
if (m_inp_mem_ptr)
{
- DEBUG_PRINT_LOW("Free input pmem Pointer area");
+ DEBUG_PRINT_LOW("\n Free input pmem Pointer area");
free (m_inp_mem_ptr);
m_inp_mem_ptr = NULL;
}
if (drv_ctx.ptr_inputbuffer)
{
- DEBUG_PRINT_LOW("Free Driver Context pointer");
+ DEBUG_PRINT_LOW("\n Free Driver Context pointer");
free (drv_ctx.ptr_inputbuffer);
drv_ctx.ptr_inputbuffer = NULL;
}
#ifdef USE_ION
if (drv_ctx.ip_buf_ion_info) {
- DEBUG_PRINT_LOW("Free ion context");
- free(drv_ctx.ip_buf_ion_info);
+ DEBUG_PRINT_LOW("\n Free ion context");
+ free(drv_ctx.ip_buf_ion_info);
drv_ctx.ip_buf_ion_info = NULL;
}
#endif
@@ -7782,7 +7585,7 @@ OMX_ERRORTYPE omx_vdec::get_buffer_req(vdec_allocatorproperty *buffer_prop)
if (client_extradata & OMX_PORTDEF_EXTRADATA)
{
extra_data_size += OMX_PORTDEF_EXTRADATA_SIZE;
- DEBUG_PRINT_HIGH("Smooth streaming enabled extra_data_size=%d",
+ DEBUG_PRINT_HIGH("Smooth streaming enabled extra_data_size=%d\n",
extra_data_size);
}
if (extra_data_size)
@@ -7858,20 +7661,18 @@ OMX_ERRORTYPE omx_vdec::start_port_reconfig()
if (drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
{
DEBUG_PRINT_HIGH("Interlace format detected (%x)!", drv_ctx.interlace);
- client_extradata |= OMX_INTERLACE_EXTRADATA;
+ if(!secure_mode)
+ client_extradata |= OMX_INTERLACE_EXTRADATA;
+ else {
+ DEBUG_PRINT_ERROR("secure mode interlaced format not supported");
+ eRet = OMX_ErrorUnsupportedSetting;
+ }
}
in_reconfig = true;
op_buf_rcnfg.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
eRet = get_buffer_req(&op_buf_rcnfg);
}
}
-
- if (eRet == OMX_ErrorNone) {
- //update power HAL with new width, height and bitrate
- power_module_deregister();
- power_module_register();
- }
-
return eRet;
}
@@ -7896,7 +7697,7 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
{
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("omx_vdec::update_portdef");
+ DEBUG_PRINT_LOW("omx_vdec::update_portdef\n");
portDefn->nVersion.nVersion = OMX_SPEC_VERSION;
portDefn->nSize = sizeof(portDefn);
portDefn->eDomain = OMX_PortDomainVideo;
@@ -7912,7 +7713,7 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
portDefn->eDir = OMX_DirInput;
portDefn->nBufferCountActual = drv_ctx.ip_buf.actualcount;
portDefn->nBufferCountMin = drv_ctx.ip_buf.mincount;
- portDefn->nBufferSize = drv_ctx.ip_buf.buffer_size - DEVICE_SCRATCH;
+ portDefn->nBufferSize = drv_ctx.ip_buf.buffer_size;
portDefn->format.video.eColorFormat = OMX_COLOR_FormatUnused;
portDefn->format.video.eCompressionFormat = eCompressionFormat;
portDefn->bEnabled = m_inp_bEnabled;
@@ -7923,7 +7724,7 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
portDefn->eDir = OMX_DirOutput;
if (update_picture_resolution() != OMX_ErrorNone)
{
- DEBUG_PRINT_ERROR("update_picture_resolution failed \n");
+ ALOGE(" update_picture_resolution failed \n");
return OMX_ErrorHardware;
}
if (!client_buffers.update_buffer_req()) {
@@ -7967,16 +7768,13 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
portDefn->format.video.nFrameWidth = drv_ctx.video_resolution.frame_width;
portDefn->format.video.nStride = drv_ctx.video_resolution.stride;
portDefn->format.video.nSliceHeight = drv_ctx.video_resolution.scan_lines;
- DEBUG_PRINT_LOW("update_portdef: PortIndex = %u, Width = %d Height = %d "
- "Stride = %u SliceHeight = %u output format = 0x%x, eColorFormat = 0x%x",
- portDefn->nPortIndex,
- portDefn->format.video.nFrameHeight,
+ DEBUG_PRINT_LOW("update_portdef Width = %d Height = %d Stride = %u"
+ "SliceHeight = %u \n", portDefn->format.video.nFrameHeight,
portDefn->format.video.nFrameWidth,
portDefn->format.video.nStride,
- portDefn->format.video.nSliceHeight,
- drv_ctx.output_format,
- portDefn->format.video.eColorFormat);
+ portDefn->format.video.nSliceHeight);
return eRet;
+
}
OMX_ERRORTYPE omx_vdec::allocate_output_headers()
@@ -7986,7 +7784,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers()
unsigned i= 0;
if(!m_out_mem_ptr) {
- DEBUG_PRINT_HIGH("Use o/p buffer case - Header List allocation");
+ DEBUG_PRINT_HIGH("\n Use o/p buffer case - Header List allocation");
int nBufHdrSize = 0;
int nPlatformEntrySize = 0;
int nPlatformListSize = 0;
@@ -7995,7 +7793,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers()
OMX_QCOM_PLATFORM_PRIVATE_ENTRY *pPlatformEntry;
OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO *pPMEMInfo;
- DEBUG_PRINT_LOW("Setting First Output Buffer(%d)",
+ DEBUG_PRINT_LOW("Setting First Output Buffer(%d)\n",
drv_ctx.op_buf.actualcount);
nBufHdrSize = drv_ctx.op_buf.actualcount *
sizeof(OMX_BUFFERHEADERTYPE);
@@ -8007,11 +7805,11 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers()
nPlatformEntrySize = drv_ctx.op_buf.actualcount *
sizeof(OMX_QCOM_PLATFORM_PRIVATE_ENTRY);
- DEBUG_PRINT_LOW("TotalBufHdr %d BufHdrSize %d PMEM %d PL %d",nBufHdrSize,
+ DEBUG_PRINT_LOW("TotalBufHdr %d BufHdrSize %d PMEM %d PL %d\n",nBufHdrSize,
sizeof(OMX_BUFFERHEADERTYPE),
nPMEMInfoSize,
nPlatformListSize);
- DEBUG_PRINT_LOW("PE %d bmSize %d ",nPlatformEntrySize,
+ DEBUG_PRINT_LOW("PE %d bmSize %d \n",nPlatformEntrySize,
m_out_bm_count);
m_out_mem_ptr = (OMX_BUFFERHEADERTYPE *)calloc(nBufHdrSize,1);
// Alloc mem for platform specific info
@@ -8042,12 +7840,12 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers()
pPlatformEntry = m_platform_entry;
pPMEMInfo = m_pmem_info;
- DEBUG_PRINT_LOW("Memory Allocation Succeeded for OUT port%p",m_out_mem_ptr);
+ DEBUG_PRINT_LOW("Memory Allocation Succeeded for OUT port%p\n",m_out_mem_ptr);
// Settting the entire storage nicely
- DEBUG_PRINT_LOW("bHdr %p OutMem %p PE %p",bufHdr,
+ DEBUG_PRINT_LOW("bHdr %p OutMem %p PE %p\n",bufHdr,
m_out_mem_ptr,pPlatformEntry);
- DEBUG_PRINT_LOW(" Pmem Info = %p ",pPMEMInfo);
+ DEBUG_PRINT_LOW(" Pmem Info = %p \n",pPMEMInfo);
for(i=0; i < drv_ctx.op_buf.actualcount ; i++)
{
bufHdr->nSize = sizeof(OMX_BUFFERHEADERTYPE);
@@ -8108,8 +7906,8 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers()
}
#ifdef USE_ION
if (drv_ctx.op_buf_ion_info) {
- DEBUG_PRINT_LOW("Free o/p ion context");
- free(drv_ctx.op_buf_ion_info);
+ DEBUG_PRINT_LOW("\n Free o/p ion context");
+ free(drv_ctx.op_buf_ion_info);
drv_ctx.op_buf_ion_info = NULL;
}
#endif
@@ -8254,216 +8052,16 @@ void omx_vdec::adjust_timestamp(OMX_S64 &act_timestamp)
}
}
-void omx_vdec::handle_extradata_secure(OMX_BUFFERHEADERTYPE *p_buf_hdr)
-{
- OMX_OTHER_EXTRADATATYPE *p_extra = NULL, *p_sei = NULL, *p_vui = NULL, *p_extn_user[32];
- struct vdec_output_frameinfo *output_respbuf;
- OMX_U32 num_conceal_MB = 0;
- OMX_S64 ts_in_sei = 0;
- OMX_U32 frame_rate = 0;
- OMX_U32 extn_user_data_cnt = 0;
-
- OMX_U32 index = p_buf_hdr - m_out_mem_ptr;
- OMX_U8 *meta_buffer_virtual = (OMX_U8 *)meta_buff.buffer;
-
-
- p_extra = (OMX_OTHER_EXTRADATATYPE *)
- ((unsigned)(meta_buffer_virtual +
- index * drv_ctx.op_buf.meta_buffer_size + 3)&(~3));
-
- //mapping of ouput buffer to the corresponding meta buffer
- output_respbuf = (struct vdec_output_frameinfo *)\
- p_buf_hdr->pOutputPortPrivate;
- output_respbuf->metadata_info.metabufaddr = (OMX_U8 *)p_extra;
- output_respbuf->metadata_info.size =
- drv_ctx.op_buf.meta_buffer_size;
-
- meta_buffer_virtual = (OMX_U8 *)p_extra;
-
- if (drv_ctx.extradata && (p_buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA))
- {
- // Process driver extradata
- while(p_extra && p_extra->eType != VDEC_EXTRADATA_NONE)
- {
- DEBUG_PRINT_LOW("handle_extradata_secure : pBuf(%p) BufTS(%lld) Type(%x) DataSz(%u)",
- p_buf_hdr, p_buf_hdr->nTimeStamp, p_extra->eType, p_extra->nDataSize);
- if (p_extra->nSize < p_extra->nDataSize)
- {
- DEBUG_PRINT_ERROR(" \n Corrupt metadata Buffer size %d payload size %d",
- p_extra->nSize, p_extra->nDataSize);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- if((OMX_U8*)p_extra > (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size) ||
- p_extra->nDataSize == 0 || p_extra->nSize == 0)
- p_extra = NULL;
- continue;
- }
- if (p_extra->eType == VDEC_EXTRADATA_MB_ERROR_MAP)
- {
- if (client_extradata & OMX_FRAMEINFO_EXTRADATA)
- num_conceal_MB = count_MB_in_extradata(p_extra);
- if (client_extradata & VDEC_EXTRADATA_MB_ERROR_MAP)
- // Map driver extradata to corresponding OMX type
- p_extra->eType = (OMX_EXTRADATATYPE)OMX_ExtraDataConcealMB;
- else
- p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
-#ifdef _ANDROID_
- if (m_debug_concealedmb) {
- DEBUG_PRINT_HIGH("Concealed MB percentage is %u", num_conceal_MB);
- }
-#endif /* _ANDROID_ */
- }
- else if (p_extra->eType == VDEC_EXTRADATA_SEI)
- {
- p_sei = p_extra;
-#ifdef MAX_RES_1080P
- h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
-#endif
- p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
- }
- else if (p_extra->eType == VDEC_EXTRADATA_VUI)
- {
- p_vui = p_extra;
-#ifdef MAX_RES_1080P
- h264_parser->parse_nal((OMX_U8*)p_vui->data, p_vui->nDataSize, NALU_TYPE_VUI, false);
-#endif
- p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
- }
- else if (p_extra->eType == VDEC_EXTRADATA_EXT_DATA)
- {
- OMX_U8 *data_ptr = (OMX_U8*)p_extra->data;
- OMX_U32 value = 0;
- p_extn_user[extn_user_data_cnt] = p_extra;
- extn_user_data_cnt++;
- if((*data_ptr & 0xf0) == 0x20)
- {
- value = ((*data_ptr) & 0x01);
- data_ptr++;
- if (value)
- data_ptr += 3;
- value = *((OMX_U32*)data_ptr);
- value = ((value << 24) | (((value >> 8)<<24)>>8) |
- (((value >> 16)<<24)>>16) | (value >> 24));
- m_disp_hor_size = (value & 0xfffc0000)>>18;
- m_disp_vert_size = (value & 0x0001fff8)>>3;
- DEBUG_PRINT_LOW("Display Vertical Size = %d Display Horizontal Size = %d",
- m_disp_vert_size, m_disp_hor_size);
- }
- }
- else if (p_extra->eType == VDEC_EXTRADATA_USER_DATA)
- {
- p_extn_user[extn_user_data_cnt] = p_extra;
- extn_user_data_cnt++;
- }
- print_debug_extradata(p_extra);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
-
- if((OMX_U8*)p_extra > (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size) ||
- p_extra->nDataSize == 0 || p_extra->nSize == 0)
- p_extra = NULL;
- }
- if (!(client_extradata & VDEC_EXTRADATA_MB_ERROR_MAP))
- {
- //moving p_extra to the starting location of the metadata buffer
- p_extra = (OMX_OTHER_EXTRADATATYPE *)meta_buffer_virtual;
- // Driver extradata is only exposed if MB map is requested by client,
- // otherwise can be overwritten by omx extradata.
- p_buf_hdr->nFlags &= ~OMX_BUFFERFLAG_EXTRADATA;
- }
- }
-
- if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
- {
- if (client_extradata & OMX_TIMEINFO_EXTRADATA)
- {
- if (p_vui)
- h264_parser->parse_nal((OMX_U8*)p_vui->data, p_vui->nDataSize, NALU_TYPE_VUI, false);
- if (p_sei)
- h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
- ts_in_sei = h264_parser->process_ts_with_sei_vui(p_buf_hdr->nTimeStamp);
- if (!VALID_TS(p_buf_hdr->nTimeStamp))
- p_buf_hdr->nTimeStamp = ts_in_sei;
- }
- else if ((client_extradata & OMX_FRAMEINFO_EXTRADATA) && p_sei)
- // If timeinfo is present frame info from SEI is already processed
- h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
- }
-
- if (client_extradata & OMX_EXTNUSER_EXTRADATA && p_extra)
- {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
- for(int i = 0; i < extn_user_data_cnt; i++)
- {
- if (((OMX_U8*)p_extra + p_extn_user[i]->nSize) <
- (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size))
- {
- if (p_extn_user[i]->eType == VDEC_EXTRADATA_EXT_DATA)
- {
- append_extn_extradata(p_extra, p_extn_user[i]);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- else if (p_extn_user[i]->eType == VDEC_EXTRADATA_USER_DATA)
- {
- append_user_extradata(p_extra, p_extn_user[i]);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- }
- }
- }
- if ((client_extradata & OMX_INTERLACE_EXTRADATA) && p_extra &&
- ((OMX_U8*)p_extra + OMX_INTERLACE_EXTRADATA_SIZE) <
- (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size))
- {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
- append_interlace_extradata(p_extra,
- ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->interlaced_format, index);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- if (client_extradata & OMX_FRAMEINFO_EXTRADATA && p_extra &&
- ((OMX_U8*)p_extra + OMX_FRAMEINFO_EXTRADATA_SIZE) <
- (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size))
- {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
- /* vui extra data (frame_rate) information */
- if (h264_parser)
- h264_parser->get_frame_rate(&frame_rate);
- append_frame_info_extradata(p_extra, num_conceal_MB,
- ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->pic_type,
- p_buf_hdr->nTimeStamp, frame_rate,
- &((struct vdec_output_frameinfo *)
- p_buf_hdr->pOutputPortPrivate)->aspect_ratio_info);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- if ((client_extradata & OMX_PORTDEF_EXTRADATA) &&
- p_extra != NULL &&
- ((OMX_U8*)p_extra + OMX_PORTDEF_EXTRADATA_SIZE) <
- (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size))
- {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
- append_portdef_extradata(p_extra);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- if (p_buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA)
- if (p_extra &&
- ((OMX_U8*)p_extra + OMX_FRAMEINFO_EXTRADATA_SIZE) <
- (meta_buffer_virtual + drv_ctx.op_buf.meta_buffer_size))
- append_terminator_extradata(p_extra);
- else
- {
- DEBUG_PRINT_ERROR("ERROR: Terminator extradata cannot be added");
- p_buf_hdr->nFlags &= ~OMX_BUFFERFLAG_EXTRADATA;
- }
-}
-
void omx_vdec::handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr)
{
- OMX_OTHER_EXTRADATATYPE *p_extra = NULL, *p_sei = NULL, *p_vui = NULL, *p_extn_user[32];
+ OMX_OTHER_EXTRADATATYPE *p_extra = NULL, *p_sei = NULL, *p_vui = NULL;
OMX_U32 num_conceal_MB = 0;
OMX_S64 ts_in_sei = 0;
OMX_U32 frame_rate = 0;
- OMX_U32 extn_user_data_cnt = 0;
OMX_U32 index = p_buf_hdr - m_out_mem_ptr;
OMX_U8* pBuffer = (OMX_U8 *)drv_ctx.ptr_outputbuffer[index].bufferaddr;
+
p_extra = (OMX_OTHER_EXTRADATATYPE *)
((unsigned)(pBuffer + p_buf_hdr->nOffset +
p_buf_hdr->nFilledLen + 3)&(~3));
@@ -8517,32 +8115,6 @@ void omx_vdec::handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr)
#endif
p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
}
- else if (p_extra->eType == VDEC_EXTRADATA_EXT_DATA)
- {
- OMX_U8 *data_ptr = (OMX_U8*)p_extra->data;
- OMX_U32 value = 0;
- p_extn_user[extn_user_data_cnt] = p_extra;
- extn_user_data_cnt++;
- if((*data_ptr & 0xf0) == 0x20)
- {
- value = ((*data_ptr) & 0x01);
- data_ptr++;
- if (value)
- data_ptr += 3;
- value = *((OMX_U32*)data_ptr);
- value = ((value << 24) | (((value >> 8)<<24)>>8) |
- (((value >> 16)<<24)>>16) | (value >> 24));
- m_disp_hor_size = (value & 0xfffc0000)>>18;
- m_disp_vert_size = (value & 0x0001fff8)>>3;
- DEBUG_PRINT_LOW("Display Vertical Size = %d Display Horizontal Size = %d",
- m_disp_vert_size, m_disp_hor_size);
- }
- }
- else if (p_extra->eType == VDEC_EXTRADATA_USER_DATA)
- {
- p_extn_user[extn_user_data_cnt] = p_extra;
- extn_user_data_cnt++;
- }
print_debug_extradata(p_extra);
p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
if ((OMX_U8*)p_extra > (pBuffer + p_buf_hdr->nAllocLen) ||
@@ -8578,34 +8150,13 @@ void omx_vdec::handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr)
h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
}
#endif
- if (client_extradata & OMX_EXTNUSER_EXTRADATA && p_extra)
- {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
- for(int i = 0; i < extn_user_data_cnt; i++)
- {
- if (((OMX_U8*)p_extra + p_extn_user[i]->nSize) <
- (pBuffer + p_buf_hdr->nAllocLen))
- {
- if (p_extn_user[i]->eType == VDEC_EXTRADATA_EXT_DATA)
- {
- append_extn_extradata(p_extra, p_extn_user[i]);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- else if (p_extn_user[i]->eType == VDEC_EXTRADATA_USER_DATA)
- {
- append_user_extradata(p_extra, p_extn_user[i]);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
- }
- }
- }
- }
- if ((client_extradata & OMX_INTERLACE_EXTRADATA) && p_extra &&
+ if ((client_extradata & OMX_INTERLACE_EXTRADATA) && p_extra &&
((OMX_U8*)p_extra + OMX_INTERLACE_EXTRADATA_SIZE) <
(pBuffer + p_buf_hdr->nAllocLen))
{
p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
append_interlace_extradata(p_extra,
- ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->interlaced_format, index);
+ ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->interlaced_format);
p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
}
if (client_extradata & OMX_FRAMEINFO_EXTRADATA && p_extra &&
@@ -8674,17 +8225,8 @@ OMX_ERRORTYPE omx_vdec::enable_extradata(OMX_U32 requested_extradata, bool enabl
}
driver_extradata = requested_extradata & DRIVER_EXTRADATA_MASK;
-
- if(secure_mode)
- driver_extradata = driver_extradata | VDEC_EXTRADATA_EXT_BUFFER;
-
if (requested_extradata & OMX_FRAMEINFO_EXTRADATA)
driver_extradata |= VDEC_EXTRADATA_MB_ERROR_MAP; // Required for conceal MB frame info
- if (drv_ctx.decoder_format == VDEC_CODECTYPE_MPEG2)
- {
- driver_extradata |= ((requested_extradata & OMX_EXTNUSER_EXTRADATA)?
- VDEC_EXTRADATA_EXT_DATA | VDEC_EXTRADATA_USER_DATA : 0);
- }
#ifdef PROCESS_EXTRADATA_IN_OUTPUT_PORT
if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
@@ -8716,7 +8258,7 @@ OMX_ERRORTYPE omx_vdec::enable_extradata(OMX_U32 requested_extradata, bool enabl
drv_ctx.op_buf.buffer_size += extradata_size;
// align the buffer size
drv_ctx.op_buf.buffer_size = (drv_ctx.op_buf.buffer_size + drv_ctx.op_buf.alignment - 1)&(~(drv_ctx.op_buf.alignment - 1));
- DEBUG_PRINT_LOW("Aligned buffer size with exreadata = %d", drv_ctx.op_buf.buffer_size);
+ DEBUG_PRINT_LOW("Aligned buffer size with exreadata = %d\n", drv_ctx.op_buf.buffer_size);
if (!(client_extradata & ~DRIVER_EXTRADATA_MASK)) // If no omx extradata is required remove space for terminator
drv_ctx.op_buf.buffer_size -= sizeof(OMX_OTHER_EXTRADATATYPE);
ret = set_buffer_req(&drv_ctx.op_buf);
@@ -8822,17 +8364,10 @@ void omx_vdec::print_debug_extradata(OMX_OTHER_EXTRADATATYPE *extra)
}
void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- OMX_U32 interlaced_format_type, OMX_U32 buf_index)
+ OMX_U32 interlaced_format_type)
{
OMX_STREAMINTERLACEFORMAT *interlace_format;
OMX_U32 mbaff = 0;
-#if defined(_ANDROID_ICS_)
- OMX_U32 enable = 0;
- private_handle_t *handle = NULL;
- handle = (private_handle_t *)native_buffer[buf_index].nativehandle;
- if(!handle)
- DEBUG_PRINT_LOW("%s: Native Buffer handle is NULL",__func__);
-#endif
extra->nSize = OMX_INTERLACE_EXTRADATA_SIZE;
extra->nVersion.nVersion = OMX_SPEC_VERSION;
extra->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
@@ -8848,25 +8383,12 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
interlace_format->bInterlaceFormat = OMX_FALSE;
interlace_format->nInterlaceFormats = OMX_InterlaceFrameProgressive;
drv_ctx.interlace = VDEC_InterlaceFrameProgressive;
-#if defined(_ANDROID_ICS_)
- if(handle)
- {
- setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
- }
-#endif
}
else
{
interlace_format->bInterlaceFormat = OMX_TRUE;
interlace_format->nInterlaceFormats = OMX_InterlaceInterleaveFrameTopFieldFirst;
drv_ctx.interlace = VDEC_InterlaceInterleaveFrameTopFieldFirst;
-#if defined(_ANDROID_ICS_)
- enable = 1;
- if(handle)
- {
- setMetaData(handle, PP_PARAM_INTERLACED, (void*)&enable);
- }
-#endif
}
print_debug_extradata(extra);
}
@@ -8905,21 +8427,12 @@ void omx_vdec::append_frame_info_extradata(OMX_OTHER_EXTRADATATYPE *extra,
frame_info->interlaceType = OMX_QCOM_InterlaceFrameProgressive;
memset(&frame_info->panScan,0,sizeof(frame_info->panScan));
memset(&frame_info->aspectRatio, 0, sizeof(frame_info->aspectRatio));
- memset(&frame_info->displayAspectRatio, 0, sizeof(frame_info->displayAspectRatio));
if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
h264_parser->fill_pan_scan_data(&frame_info->panScan, timestamp);
}
fill_aspect_ratio_info(aspect_ratio_info, frame_info);
- if (drv_ctx.decoder_format == VDEC_CODECTYPE_MPEG2)
- {
- if (m_disp_hor_size && m_disp_vert_size)
- {
- frame_info->displayAspectRatio.displayHorizontalSize = m_disp_hor_size;
- frame_info->displayAspectRatio.displayVerticalSize = m_disp_vert_size;
- }
- }
frame_info->nConcealedMacroblocks = num_conceal_mb;
frame_info->nFrameRate = frame_rate;
print_debug_extradata(extra);
@@ -8930,74 +8443,29 @@ void omx_vdec::fill_aspect_ratio_info(
OMX_QCOM_EXTRADATA_FRAMEINFO *frame_info)
{
m_extradata = frame_info;
- if(drv_ctx.decoder_format == VDEC_CODECTYPE_MPEG2)
+
+ m_extradata->aspectRatio.aspectRatioX = 0;
+ m_extradata->aspectRatio.aspectRatioY = 0;
+
+ if(drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
- switch(aspect_ratio_info->aspect_ratio)
- {
- case 1:
- m_extradata->aspectRatio.aspectRatioX = 1;
- m_extradata->aspectRatio.aspectRatioY = 1;
- break;
- case 2:
- if (m_disp_hor_size && m_disp_vert_size)
- {
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width *
- m_disp_vert_size;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height *
- m_disp_hor_size;
- }
- else
- {
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width *
- drv_ctx.video_resolution.frame_height;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height *
- drv_ctx.video_resolution.frame_width;
- }
- break;
- case 3:
- if (m_disp_hor_size && m_disp_vert_size)
- {
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width *
- m_disp_vert_size;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height *
- m_disp_hor_size;
- }
- else
- {
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width *
- drv_ctx.video_resolution.frame_height;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height *
- drv_ctx.video_resolution.frame_width;
- }
- break;
- case 4:
- if (m_disp_hor_size && m_disp_vert_size)
- {
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width *
- m_disp_vert_size;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height *
- m_disp_hor_size;
- }
- else
- {
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width *
- drv_ctx.video_resolution.frame_height;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height *
- drv_ctx.video_resolution.frame_width;
- }
- break;
- default:
- m_extradata->aspectRatio.aspectRatioX = 1;
- m_extradata->aspectRatio.aspectRatioY = 1;
- }
+ h264_parser->fill_aspect_ratio_info(&m_extradata->aspectRatio);
}
- else
+#ifdef MAX_RES_1080P
+ else if(drv_ctx.decoder_format == VDEC_CODECTYPE_MPEG4 ||
+ drv_ctx.decoder_format == VDEC_CODECTYPE_DIVX_3 ||
+ drv_ctx.decoder_format == VDEC_CODECTYPE_DIVX_4 ||
+ drv_ctx.decoder_format == VDEC_CODECTYPE_DIVX_5 ||
+ drv_ctx.decoder_format == VDEC_CODECTYPE_DIVX_6)
{
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height;
+ mp4_fill_aspect_ratio_info(aspect_ratio_info,m_extradata);
+ }
+#endif
+ if(m_extradata->aspectRatio.aspectRatioX == 0 ||
+ m_extradata->aspectRatio.aspectRatioY == 0) {
+ m_extradata->aspectRatio.aspectRatioX = 1;
+ m_extradata->aspectRatio.aspectRatioY = 1;
}
- DEBUG_PRINT_LOW("aspectRatioX %d aspectRatioX %d", m_extradata->aspectRatio.aspectRatioX,
- m_extradata->aspectRatio.aspectRatioY);
}
void omx_vdec::append_portdef_extradata(OMX_OTHER_EXTRADATATYPE *extra)
@@ -9011,36 +8479,12 @@ void omx_vdec::append_portdef_extradata(OMX_OTHER_EXTRADATATYPE *extra)
portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *)extra->data;
*portDefn = m_port_def;
DEBUG_PRINT_LOW("append_portdef_extradata height = %u width = %u stride = %u"
- "sliceheight = %u",portDefn->format.video.nFrameHeight,
+ "sliceheight = %u \n",portDefn->format.video.nFrameHeight,
portDefn->format.video.nFrameWidth,
portDefn->format.video.nStride,
portDefn->format.video.nSliceHeight);
}
-void omx_vdec::append_extn_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- OMX_OTHER_EXTRADATATYPE *p_extn)
-{
- extra->nDataSize = p_extn->nDataSize;
- extra->nSize = (sizeof(OMX_OTHER_EXTRADATATYPE) + extra->nDataSize);
- extra->nVersion.nVersion = OMX_SPEC_VERSION;
- extra->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
- extra->eType = (OMX_EXTRADATATYPE)OMX_ExtraDataMP2ExtnData;
- if (extra->data && p_extn->data && extra->nDataSize)
- memcpy(extra->data, p_extn->data, extra->nDataSize);
-}
-
-void omx_vdec::append_user_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- OMX_OTHER_EXTRADATATYPE *p_user)
-{
- extra->nDataSize = p_user->nDataSize;
- extra->nSize = (sizeof(OMX_OTHER_EXTRADATATYPE) + extra->nDataSize);
- extra->nVersion.nVersion = OMX_SPEC_VERSION;
- extra->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
- extra->eType = (OMX_EXTRADATATYPE)OMX_ExtraDataMP2UserData;
- if (extra->data && p_user->data && extra->nDataSize)
- memcpy(extra->data, p_user->data, extra->nDataSize);
-}
-
void omx_vdec::append_terminator_extradata(OMX_OTHER_EXTRADATATYPE *extra)
{
extra->nSize = sizeof(OMX_OTHER_EXTRADATATYPE);
@@ -9097,7 +8541,6 @@ void omx_vdec::extract_demux_addr_offsets(OMX_BUFFERHEADERTYPE *buf_hdr)
OMX_U32 bytes_to_parse = buf_hdr->nFilledLen;
OMX_U8 *buf = buf_hdr->pBuffer + buf_hdr->nOffset;
OMX_U32 index = 0;
- OMX_U32 prev_sc_index = 0;
m_demux_entries = 0;
@@ -9108,18 +8551,12 @@ void omx_vdec::extract_demux_addr_offsets(OMX_BUFFERHEADERTYPE *buf_hdr)
((buf[index] == 0x00) && (buf[index+1] == 0x00) &&
(buf[index+2] == 0x01)) )
{
- if ((((index+3) - prev_sc_index) <= 4) && m_demux_entries)
- {
- DEBUG_PRINT_ERROR("FOUND Consecutive start Code, Hence skip one");
- m_demux_entries--;
- }
//Found start code, insert address offset
insert_demux_addr_offset(index);
if (buf[index+2] == 0x01) // 3 byte start code
index += 3;
else //4 byte start code
index += 4;
- prev_sc_index = index;
}
else
index++;
@@ -9223,140 +8660,6 @@ OMX_ERRORTYPE omx_vdec::handle_demux_data(OMX_BUFFERHEADERTYPE *p_buf_hdr)
}
#ifdef MAX_RES_1080P
-
-OMX_ERRORTYPE omx_vdec::vdec_alloc_meta_buffers()
-{
- OMX_U32 pmem_fd = -1, pmem_fd_iommu = -1;
- OMX_U32 size, alignment;
- void *buf_addr = NULL;
- struct vdec_ioctl_msg ioctl_msg;
-#ifndef USE_ION
- struct pmem_allocation allocation;
-#endif
- struct vdec_meta_buffers meta_buffer;
-
- memset ((unsigned char*)&meta_buffer,0,sizeof (struct vdec_meta_buffers));
-
- //we already have meta buffer size.
- size = drv_ctx.op_buf.meta_buffer_size * drv_ctx.op_buf.actualcount;
- alignment = 8192;
-
-
-#ifdef USE_ION
- external_meta_buffer = true;
- drv_ctx.meta_buffer.ion_device_fd = alloc_map_ion_memory(
- size, 8192,
- &drv_ctx.meta_buffer.ion_alloc_data,
- &drv_ctx.meta_buffer.fd_ion_data, 0);
- if (drv_ctx.meta_buffer.ion_device_fd < 0) {
- external_meta_buffer = false;
- return OMX_ErrorInsufficientResources;
- }
- external_meta_buffer = false;
- pmem_fd = drv_ctx.meta_buffer.fd_ion_data.fd;
-
- external_meta_buffer_iommu = true;
- drv_ctx.meta_buffer_iommu.ion_device_fd = alloc_map_ion_memory(
- size, 8192,
- &drv_ctx.meta_buffer_iommu.ion_alloc_data,
- &drv_ctx.meta_buffer_iommu.fd_ion_data, 0);
- if (drv_ctx.meta_buffer_iommu.ion_device_fd < 0) {
- external_meta_buffer_iommu = false;
- return OMX_ErrorInsufficientResources;
- }
- external_meta_buffer_iommu = false;
- pmem_fd_iommu = drv_ctx.meta_buffer_iommu.fd_ion_data.fd;
-#else
- allocation.size = size;
- allocation.align = clip2(alignment);
- if (allocation.align != 8192)
- allocation.align = 8192;
-
- pmem_fd = open(MEM_DEVICE, O_RDWR);
-
- if ((int)(pmem_fd) < 0)
- return OMX_ErrorInsufficientResources;
-
- if (ioctl(pmem_fd, PMEM_ALLOCATE_ALIGNED, &allocation) < 0)
- {
- DEBUG_PRINT_ERROR("\n Aligment(%u) failed with pmem driver Sz(%lu)",
- allocation.align, allocation.size);
- return OMX_ErrorInsufficientResources;
- }
-#endif
-
- buf_addr = mmap(NULL, size,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, pmem_fd_iommu, 0);
-
- if (buf_addr == (void*) MAP_FAILED)
- {
- close(pmem_fd);
- close(pmem_fd_iommu);
-#ifdef USE_ION
- free_ion_memory(&drv_ctx.meta_buffer);
- free_ion_memory(&drv_ctx.meta_buffer_iommu);
-#endif
- pmem_fd = -1;
- pmem_fd_iommu = -1;
- DEBUG_PRINT_ERROR("Error returned in allocating recon buffers buf_addr: %p\n",buf_addr);
- return OMX_ErrorInsufficientResources;
- }
-
- meta_buffer.size = size;
- meta_buffer.count = drv_ctx.op_buf.actualcount;
- meta_buffer.pmem_fd = pmem_fd;
- meta_buffer.pmem_fd_iommu = pmem_fd_iommu;
- meta_buffer.offset = 0;
-
- ioctl_msg.in = (void*)&meta_buffer;
- ioctl_msg.out = NULL;
-
- if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_SET_META_BUFFERS, (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT_ERROR("Failed to set the meta_buffers\n");
- return OMX_ErrorInsufficientResources;
- }
-
- meta_buff.buffer = (unsigned char *) buf_addr;
- meta_buff.size = size;
- meta_buff.count = drv_ctx.op_buf.actualcount;
- meta_buff.offset = 0;
- meta_buff.pmem_fd = pmem_fd;
- meta_buff.pmem_fd_iommu = pmem_fd_iommu;
- DEBUG_PRINT_HIGH("Saving virt:%p, FD: %d and FD_IOMMU %d of size %d count: %d", meta_buff.buffer,
- meta_buff.pmem_fd, meta_buff.pmem_fd_iommu, meta_buff.size, drv_ctx.op_buf.actualcount);
- return OMX_ErrorNone;
-}
-
-void omx_vdec::vdec_dealloc_meta_buffers()
-{
- if(meta_buff.pmem_fd > 0)
- {
- if(ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_FREE_META_BUFFERS,NULL) < 0)
- DEBUG_PRINT_ERROR("VDEC_IOCTL_FREE_META_BUFFERS failed");
- close(meta_buff.pmem_fd);
-#ifdef USE_ION
- free_ion_memory(&drv_ctx.meta_buffer);
-#endif
- }
- if(meta_buff.pmem_fd_iommu > 0)
- {
- munmap(meta_buff.buffer, meta_buff.size);
- close(meta_buff.pmem_fd_iommu);
-#ifdef USE_ION
- free_ion_memory(&drv_ctx.meta_buffer_iommu);
-#endif
- DEBUG_PRINT_LOW("Cleaning Meta buffer of size %d",meta_buff.size);
- meta_buff.pmem_fd = -1;
- meta_buff.pmem_fd_iommu = -1;
- meta_buff.offset = 0;
- meta_buff.size = 0;
- meta_buff.count = 0;
- meta_buff.buffer = NULL;
- }
-}
-
OMX_ERRORTYPE omx_vdec::vdec_alloc_h264_mv()
{
OMX_U32 pmem_fd = -1;
@@ -9388,7 +8691,7 @@ OMX_ERRORTYPE omx_vdec::vdec_alloc_h264_mv()
size = mv_buff_size.size * drv_ctx.op_buf.actualcount;
alignment = mv_buff_size.alignment;
- DEBUG_PRINT_LOW("Entered vdec_alloc_h264_mv act_width: %d, act_height: %d, size: %d, alignment %d",
+ DEBUG_PRINT_LOW("Entered vdec_alloc_h264_mv act_width: %d, act_height: %d, size: %d, alignment %d\n",
drv_ctx.video_resolution.frame_width, drv_ctx.video_resolution.frame_height,size,alignment);
@@ -9436,7 +8739,7 @@ OMX_ERRORTYPE omx_vdec::vdec_alloc_h264_mv()
}
} else
buf_addr =(unsigned char *) (pmem_fd + 1234);
- DEBUG_PRINT_LOW("Allocated virt:%p, FD: %d of size %d count: %d", buf_addr,
+ DEBUG_PRINT_LOW("\n Allocated virt:%p, FD: %d of size %d count: %d \n", buf_addr,
pmem_fd, size, drv_ctx.op_buf.actualcount);
h264_mv.size = size;
@@ -9458,7 +8761,7 @@ OMX_ERRORTYPE omx_vdec::vdec_alloc_h264_mv()
h264_mv_buff.count = drv_ctx.op_buf.actualcount;
h264_mv_buff.offset = 0;
h264_mv_buff.pmem_fd = pmem_fd;
- DEBUG_PRINT_LOW("Saving virt:%p, FD: %d of size %d count: %d", h264_mv_buff.buffer,
+ DEBUG_PRINT_LOW("\n Saving virt:%p, FD: %d of size %d count: %d \n", h264_mv_buff.buffer,
h264_mv_buff.pmem_fd, h264_mv_buff.size, drv_ctx.op_buf.actualcount);
return OMX_ErrorNone;
}
@@ -9475,7 +8778,7 @@ void omx_vdec::vdec_dealloc_h264_mv()
#ifdef USE_ION
free_ion_memory(&drv_ctx.h264_mv);
#endif
- DEBUG_PRINT_LOW("Cleaning H264_MV buffer of size %d",h264_mv_buff.size);
+ DEBUG_PRINT_LOW("\n Cleaning H264_MV buffer of size %d \n",h264_mv_buff.size);
h264_mv_buff.pmem_fd = -1;
h264_mv_buff.offset = 0;
h264_mv_buff.size = 0;
@@ -9507,71 +8810,6 @@ OMX_ERRORTYPE omx_vdec::createDivxDrmContext()
}
#endif //_ANDROID_
-OMX_ERRORTYPE omx_vdec::power_module_register()
-{
- char powerHintMetadata[512];
-
- if (m_power_hinted) {
- return OMX_ErrorBadParameter; //need a proper error code
- }
-
- PowerModule * pm = PowerModule::getInstance();
-
- if (pm == NULL) {
- DEBUG_PRINT_ERROR("failed to get power module instance");
- return OMX_ErrorBadParameter;
- }
-
- power_module_t * ph = pm->getPowerModuleHandle();
-
- if (ph == NULL) {
- DEBUG_PRINT_ERROR("failed to get power module handle");
- return OMX_ErrorBadParameter;
- }
-
- if (ph->powerHint) {
- snprintf(powerHintMetadata, sizeof(powerHintMetadata) - 1,
- "state=1;framewidth=%u;frameheight=%u;bitrate=%u",
- m_port_def.format.video.nFrameWidth, m_port_def.format.video.nFrameHeight,
- m_port_def.format.video.nBitrate);
- powerHintMetadata[sizeof(powerHintMetadata) - 1] = '\0';
-
- ph->powerHint(ph, POWER_HINT_VIDEO_DECODE, (void *)powerHintMetadata);
- m_power_hinted = true;
- } else {
- DEBUG_PRINT_ERROR("No hint called for register");
- }
- return OMX_ErrorNone;
-}
-
-OMX_ERRORTYPE omx_vdec::power_module_deregister()
-{
- if (!m_power_hinted) {
- return OMX_ErrorBadParameter; //need a proper error code
- }
-
- PowerModule * pm = PowerModule::getInstance();
-
- if (pm == NULL) {
- DEBUG_PRINT_ERROR("failed to get power module instance");
- return OMX_ErrorBadParameter;
- }
-
- power_module_t * ph = pm->getPowerModuleHandle();
-
- if (ph == NULL) {
- DEBUG_PRINT_ERROR("failed to get power module handle");
- return OMX_ErrorBadParameter;
- }
-
- if (ph->powerHint) {
- ph->powerHint(ph, POWER_HINT_VIDEO_DECODE, (void *)"state=0");
- m_power_hinted = false;
- } else {
- DEBUG_PRINT_ERROR("No hint called for deregister");
- }
- return OMX_ErrorNone;
-}
omx_vdec::allocate_color_convert_buf::allocate_color_convert_buf()
{
enabled = false;
@@ -9666,11 +8904,11 @@ bool omx_vdec::allocate_color_convert_buf::set_color_format(
status = false;
}
if (status && (drv_color_format != dest_color_format)) {
- DEBUG_PRINT_ERROR("");
if (dest_color_format != OMX_COLOR_FormatYUV420Planar) {
DEBUG_PRINT_ERROR("\n Unsupported color format for c2d");
status = false;
} else {
+ DEBUG_PRINT_HIGH("\n Planar color format set");
ColorFormat = OMX_COLOR_FormatYUV420Planar;
if (enabled)
c2d.destroy();
@@ -9904,3 +9142,85 @@ bool omx_vdec::allocate_color_convert_buf::get_color_format(OMX_COLOR_FORMATTYPE
}
return status;
}
+
+int omx_vdec::secureDisplay(int mode) {
+ if (m_secure_display == true) {
+ return 0;
+ }
+
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<qService::IQService> displayBinder =
+ interface_cast<qService::IQService>(sm->getService(String16("display.qservice")));
+
+ if (displayBinder != NULL) {
+ displayBinder->securing(mode);
+ if (mode == qService::IQService::END) {
+ m_secure_display = true;
+ }
+ }
+ else {
+ DEBUG_PRINT_ERROR("secureDisplay(%d) display.qservice unavailable", mode);
+ }
+ return 0;
+}
+
+int omx_vdec::unsecureDisplay(int mode) {
+ if (m_secure_display == false) {
+ return 0;
+ }
+
+ if (mode == qService::IQService::END) {
+ m_secure_display = false;
+ }
+
+ sp<IServiceManager> sm = defaultServiceManager();
+ sp<qService::IQService> displayBinder =
+ interface_cast<qService::IQService>(sm->getService(String16("display.qservice")));
+
+ if (displayBinder != NULL)
+ displayBinder->unsecuring(mode);
+ else
+ DEBUG_PRINT_ERROR("unsecureDisplay(%d) display.qservice unavailable", mode);
+ return 0;
+}
+
+OMX_ERRORTYPE omx_vdec::update_color_format(OMX_COLOR_FORMATTYPE eColorFormat)
+{
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ enum vdec_output_fromat op_format;
+ if(eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar)
+ op_format = VDEC_YUV_FORMAT_NV12;
+ else if(eColorFormat ==
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka ||
+ eColorFormat == OMX_COLOR_FormatYUV420Planar)
+ op_format = VDEC_YUV_FORMAT_TILE_4x2;
+ else
+ eRet = OMX_ErrorBadParameter;
+
+ if(eRet == OMX_ErrorNone && drv_ctx.output_format != op_format) {
+ /*Set the output format*/
+ drv_ctx.output_format = op_format;
+ ioctl_msg.in = &drv_ctx.output_format;
+ ioctl_msg.out = NULL;
+ if (ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_SET_OUTPUT_FORMAT,
+ (void*)&ioctl_msg) < 0) {
+ DEBUG_PRINT_ERROR("\n Set output format failed for %u with err %s",
+ eColorFormat, strerror(errno));
+ eRet = OMX_ErrorUnsupportedSetting;
+ }
+ else
+ eRet = get_buffer_req(&drv_ctx.op_buf);
+ }
+ if (eRet == OMX_ErrorNone){
+ if (!client_buffers.set_color_format(eColorFormat)) {
+ DEBUG_PRINT_ERROR("\n Set color format failed for %u", eColorFormat);
+ eRet = OMX_ErrorBadParameter;
+ }
+ }
+ if (!client_buffers.update_buffer_req()) {
+ DEBUG_PRINT_ERROR("\n Update bufreq in color format failed for %u", eColorFormat);
+ eRet = OMX_ErrorBadParameter;
+ }
+ return eRet;
+}
diff --git a/mm-video/vidc/vdec/src/omx_vdec_msm8974.cpp b/mm-video/vidc/vdec/src/omx_vdec_copper.cpp
index 7a152c6..cfa9e78 100644
--- a/mm-video/vidc/vdec/src/omx_vdec_msm8974.cpp
+++ b/mm-video/vidc/vdec/src/omx_vdec_copper.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -48,7 +48,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "omx_vdec.h"
#include <fcntl.h>
#include <limits.h>
-#include <media/msm_media_info.h>
#ifndef _ANDROID_
#include <sys/ioctl.h>
@@ -64,10 +63,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gralloc_priv.h>
#endif
-#if defined (_ANDROID_ICS_)
-#include <qdMetaData.h>
-#endif
-
#ifdef _ANDROID_
#include "DivXDrmDecrypt.h"
#endif //_ANDROID_
@@ -113,7 +108,6 @@ char ouputextradatafilename [] = "/data/extradata";
#define VC1_STRUCT_A_POS 12
#define VC1_STRUCT_B_POS 24
#define VC1_SEQ_LAYER_SIZE 36
-#define POLL_TIMEOUT 0x7fffffff
#define MEM_DEVICE "/dev/ion"
#define MEM_HEAP_ID ION_CP_MM_HEAP_ID
@@ -124,135 +118,90 @@ char ouputextradatafilename [] = "/data/extradata";
}
#endif//_ANDROID_
-#define SZ_4K 0x1000
-#define SZ_1M 0x100000
-
#define Log2(number, power) { OMX_U32 temp = number; power = 0; while( (0 == (temp & 0x1)) && power < 16) { temp >>=0x1; power++; } }
#define Q16ToFraction(q,num,den) { OMX_U32 power; Log2(q,power); num = q >> power; den = 0x1 << (16 - power); }
-#define EXTRADATA_IDX(__num_planes) (__num_planes - 1)
-#define DEFAULT_EXTRADATA (OMX_INTERLACE_EXTRADATA)
void* async_message_thread (void *input)
{
+ struct vdec_ioctl_msg ioctl_msg;
+ struct vdec_msginfo vdec_msg;
OMX_BUFFERHEADERTYPE *buffer;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
+ struct v4l2_plane plane;
struct pollfd pfd;
- struct v4l2_buffer v4l2_buf;
- memset((void *)&v4l2_buf,0,sizeof(v4l2_buf));
- struct v4l2_event dqevent;
- omx_vdec *omx = reinterpret_cast<omx_vdec*>(input);
+ struct v4l2_buffer v4l2_buf ={0};
+ struct v4l2_event dqevent;
pfd.events = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM | POLLRDBAND | POLLPRI;
+ omx_vdec *omx = reinterpret_cast<omx_vdec*>(input);
pfd.fd = omx->drv_ctx.video_driver_fd;
- int error_code = 0,rc=0,bytes_read = 0,bytes_written = 0;
+ int error_code = 0,rc=0;
DEBUG_PRINT_HIGH("omx_vdec: Async thread start\n");
prctl(PR_SET_NAME, (unsigned long)"VideoDecCallBackThread", 0, 0, 0);
while (1)
{
- rc = poll(&pfd, 1, POLL_TIMEOUT);
- if (!rc) {
- DEBUG_PRINT_ERROR("Poll timedout\n");
- break;
- } else if (rc < 0) {
- DEBUG_PRINT_ERROR("Error while polling: %d\n", rc);
- break;
- }
- if ((pfd.revents & POLLIN) || (pfd.revents & POLLRDNORM)) {
- struct vdec_msginfo vdec_msg;
- v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- v4l2_buf.memory = V4L2_MEMORY_USERPTR;
- v4l2_buf.length = omx->drv_ctx.num_planes;
- v4l2_buf.m.planes = plane;
- while(!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) {
- vdec_msg.msgcode=VDEC_MSG_RESP_OUTPUT_BUFFER_DONE;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- vdec_msg.msgdata.output_frame.client_data=(void*)&v4l2_buf;
- vdec_msg.msgdata.output_frame.len=plane[0].bytesused;
- vdec_msg.msgdata.output_frame.bufferaddr=(void*)plane[0].m.userptr;
- vdec_msg.msgdata.output_frame.time_stamp= ((uint64_t)v4l2_buf.timestamp.tv_sec * (uint64_t)1000000) +
- (uint64_t)v4l2_buf.timestamp.tv_usec;
- if (vdec_msg.msgdata.output_frame.len) {
- vdec_msg.msgdata.output_frame.framesize.left = plane[0].reserved[2];
- vdec_msg.msgdata.output_frame.framesize.top = plane[0].reserved[3];
- vdec_msg.msgdata.output_frame.framesize.right = plane[0].reserved[4];
- vdec_msg.msgdata.output_frame.framesize.bottom = plane[0].reserved[5];
- }
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- }
- }
- if((pfd.revents & POLLOUT) || (pfd.revents & POLLWRNORM)) {
- struct vdec_msginfo vdec_msg;
- v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- v4l2_buf.memory = V4L2_MEMORY_USERPTR;
- v4l2_buf.length = 1;
- v4l2_buf.m.planes = plane;
- while(!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) {
- vdec_msg.msgcode=VDEC_MSG_RESP_INPUT_BUFFER_DONE;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- vdec_msg.msgdata.input_frame_clientdata=(void*)&v4l2_buf;
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- }
- }
- if (pfd.revents & POLLPRI){
- rc = ioctl(pfd.fd, VIDIOC_DQEVENT, &dqevent);
- if(dqevent.type == V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_INSUFFICIENT ) {
- struct vdec_msginfo vdec_msg;
- vdec_msg.msgcode=VDEC_MSG_EVT_CONFIG_CHANGED;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- DEBUG_PRINT_HIGH("\n VIDC Port Reconfig recieved \n");
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- } else if(dqevent.type == V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_SUFFICIENT ) {
- struct vdec_msginfo vdec_msg;
- vdec_msg.msgcode=VDEC_MSG_EVT_INFO_CONFIG_CHANGED;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- DEBUG_PRINT_HIGH("\n VIDC Port Reconfig recieved \n");
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- } else if (dqevent.type == V4L2_EVENT_MSM_VIDC_FLUSH_DONE) {
- struct vdec_msginfo vdec_msg;
- vdec_msg.msgcode=VDEC_MSG_RESP_FLUSH_INPUT_DONE;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- DEBUG_PRINT_HIGH("\n VIDC Flush Done Recieved \n");
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- vdec_msg.msgcode=VDEC_MSG_RESP_FLUSH_OUTPUT_DONE;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- DEBUG_PRINT_HIGH("\n VIDC Flush Done Recieved \n");
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- } else if (dqevent.type == V4L2_EVENT_MSM_VIDC_CLOSE_DONE) {
- DEBUG_PRINT_HIGH("\n VIDC Close Done Recieved and async_message_thread Exited \n");
- break;
- } else if(dqevent.type == V4L2_EVENT_MSM_VIDC_SYS_ERROR) {
- struct vdec_msginfo vdec_msg;
- vdec_msg.msgcode=VDEC_MSG_EVT_HW_ERROR;
- vdec_msg.status_code=VDEC_S_SUCCESS;
- DEBUG_PRINT_HIGH("\n SYS Error Recieved \n");
- if (omx->async_message_process(input,&vdec_msg) < 0) {
- DEBUG_PRINT_HIGH("\n async_message_thread Exited \n");
- break;
- }
- } else {
- DEBUG_PRINT_HIGH("\n VIDC Some Event recieved \n");
- continue;
- }
- }
+ rc = poll(&pfd, 1, TIMEOUT);
+ if (!rc) {
+ printf("Poll timedout\n");
+ break;
+ } else if (rc < 0) {
+ printf("Error while polling: %d\n", rc);
+ break;
+ }
+ if ((pfd.revents & POLLIN) || (pfd.revents & POLLRDNORM)) {
+ v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ v4l2_buf.memory = V4L2_MEMORY_USERPTR;
+ v4l2_buf.length = 1;
+ v4l2_buf.m.planes = &plane;
+ rc = ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf);
+ if (rc) {
+ /*TODO: How to handle this case */
+ printf("Failed to dequeue buf: %d from capture capability\n", rc);
+ break;
+ }
+ vdec_msg.msgcode=VDEC_MSG_RESP_OUTPUT_BUFFER_DONE;
+ vdec_msg.status_code=VDEC_S_SUCCESS;
+ vdec_msg.msgdata.output_frame.client_data=(void*)&v4l2_buf;
+ vdec_msg.msgdata.output_frame.len=plane.bytesused;
+ vdec_msg.msgdata.output_frame.bufferaddr=(void*)plane.m.userptr;
+ }
+ else if((pfd.revents & POLLOUT) || (pfd.revents & POLLWRNORM)) {
+ v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ v4l2_buf.memory = V4L2_MEMORY_USERPTR;
+ v4l2_buf.m.planes = &plane;
+ rc = ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf);
+ if (rc) {
+ /*TODO: How to handle this case */
+ printf("Failed to dequeue buf: %d from output capability\n", rc);
+ break;
+ }
+ vdec_msg.msgcode=VDEC_MSG_RESP_INPUT_BUFFER_DONE;
+ vdec_msg.status_code=VDEC_S_SUCCESS;
+ vdec_msg.msgdata.input_frame_clientdata=(void*)&v4l2_buf;
+ } else if (pfd.revents & POLLPRI){
+ rc = ioctl(pfd.fd, VIDIOC_DQEVENT, &dqevent);
+ if(dqevent.u.data[0] == MSM_VIDC_DECODER_EVENT_CHANGE){
+ vdec_msg.msgcode=VDEC_MSG_EVT_CONFIG_CHANGED;
+ vdec_msg.status_code=VDEC_S_SUCCESS;
+ printf("\n VIDC Port Reconfig recieved \n");
+ } else if (dqevent.u.data[0] == MSM_VIDC_DECODER_FLUSH_DONE){
+ vdec_msg.msgcode=VDEC_MSG_RESP_FLUSH_OUTPUT_DONE;
+ vdec_msg.status_code=VDEC_S_SUCCESS;
+ printf("\n VIDC Flush Done Recieved \n");
+ } else
+ printf("\n VIDC Some Event recieved \n");
+ } else if (pfd.revents & POLLERR){
+ printf("\n async_message_thread Exited \n");
+ break;
+ } else{
+ /*TODO: How to handle this case */
+ continue;
+ }
+
+ if (omx->async_message_process(input,&vdec_msg) < 0) {
+ printf("\n async_message_thread Exited \n");
+ break;
+ }
}
- DEBUG_PRINT_HIGH("omx_vdec: Async thread stop\n");
+ DEBUG_PRINT_HIGH("omx_vdec: Async thread stop\n");
return NULL;
}
@@ -474,7 +423,7 @@ void *get_omx_component_factory_fn(void)
VideoHeap::VideoHeap(int devicefd, size_t size, void* base,
struct ion_handle *handle, int ionMapfd)
{
-// ionInit(devicefd, base, size, 0 , MEM_DEVICE,handle,ionMapfd);
+ ionInit(devicefd, base, size, 0 , MEM_DEVICE,handle,ionMapfd);
}
#else
VideoHeap::VideoHeap(int fd, size_t size, void* base)
@@ -497,69 +446,70 @@ PARAMETERS
RETURN VALUE
None.
========================================================================== */
-omx_vdec::omx_vdec(): m_error_propogated(false),
- m_state(OMX_StateInvalid),
- m_app_data(NULL),
- m_inp_mem_ptr(NULL),
- m_out_mem_ptr(NULL),
- m_inp_err_count(0),
- input_flush_progress (false),
- output_flush_progress (false),
- input_use_buffer (false),
- output_use_buffer (false),
- ouput_egl_buffers(false),
- m_use_output_pmem(OMX_FALSE),
- m_out_mem_region_smi(OMX_FALSE),
- m_out_pvt_entry_pmem(OMX_FALSE),
- pending_input_buffers(0),
- pending_output_buffers(0),
- m_out_bm_count(0),
- m_inp_bm_count(0),
- m_inp_bPopulated(OMX_FALSE),
- m_out_bPopulated(OMX_FALSE),
- m_flags(0),
+omx_vdec::omx_vdec(): m_state(OMX_StateInvalid),
+ m_app_data(NULL),
+ m_inp_mem_ptr(NULL),
+ m_out_mem_ptr(NULL),
+ m_phdr_pmem_ptr(NULL),
+ pending_input_buffers(0),
+ pending_output_buffers(0),
+ m_out_bm_count(0),
+ m_inp_bm_count(0),
+ m_inp_bPopulated(OMX_FALSE),
+ m_out_bPopulated(OMX_FALSE),
+ m_flags(0),
+ m_inp_bEnabled(OMX_TRUE),
+ m_out_bEnabled(OMX_TRUE),
+ m_platform_list(NULL),
+ m_platform_entry(NULL),
+ m_pmem_info(NULL),
+ output_flush_progress (false),
+ input_flush_progress (false),
+ input_use_buffer (false),
+ output_use_buffer (false),
+ arbitrary_bytes (true),
+ psource_frame (NULL),
+ pdest_frame (NULL),
+ m_inp_heap_ptr (NULL),
+ m_heap_inp_bm_count (0),
+ codec_type_parse ((codec_type)0),
+ first_frame_meta (true),
+ frame_count (0),
+ nal_length(0),
+ nal_count (0),
+ look_ahead_nal (false),
+ first_frame(0),
+ first_buffer(NULL),
+ first_frame_size (0),
+ m_error_propogated(false),
+ m_device_file_ptr(NULL),
+ m_vc1_profile((vc1_profile_type)0),
+ prev_ts(LLONG_MAX),
+ rst_prev_ts(true),
+ frm_int(0),
+ m_in_alloc_cnt(0),
+ m_display_id(NULL),
+ ouput_egl_buffers(false),
+ h264_parser(NULL),
+ client_extradata(0),
+ h264_last_au_ts(LLONG_MAX),
+ h264_last_au_flags(0),
+ m_inp_err_count(0),
#ifdef _ANDROID_
- m_heap_ptr(NULL),
+ m_heap_ptr(NULL),
+ m_enable_android_native_buffers(OMX_FALSE),
+ m_use_android_native_buffers(OMX_FALSE),
#endif
- m_inp_bEnabled(OMX_TRUE),
- m_out_bEnabled(OMX_TRUE),
- m_in_alloc_cnt(0),
- m_platform_list(NULL),
- m_platform_entry(NULL),
- m_pmem_info(NULL),
- arbitrary_bytes (true),
- psource_frame (NULL),
- pdest_frame (NULL),
- m_inp_heap_ptr (NULL),
- m_phdr_pmem_ptr(NULL),
- m_heap_inp_bm_count (0),
- codec_type_parse ((codec_type)0),
- first_frame_meta (true),
- frame_count (0),
- nal_count (0),
- nal_length(0),
- look_ahead_nal (false),
- first_frame(0),
- first_buffer(NULL),
- first_frame_size (0),
- m_device_file_ptr(NULL),
- m_vc1_profile((vc1_profile_type)0),
- h264_last_au_ts(LLONG_MAX),
- h264_last_au_flags(0),
- prev_ts(LLONG_MAX),
- rst_prev_ts(true),
- frm_int(0),
- in_reconfig(false),
- m_display_id(NULL),
- h264_parser(NULL),
- client_extradata(0),
+ in_reconfig(false),
+ m_use_output_pmem(OMX_FALSE),
+ m_out_mem_region_smi(OMX_FALSE),
+ m_out_pvt_entry_pmem(OMX_FALSE),
+ secure_mode(false)
#ifdef _ANDROID_
- m_enable_android_native_buffers(OMX_FALSE),
- m_use_android_native_buffers(OMX_FALSE),
- iDivXDrmDecrypt(NULL),
+ ,iDivXDrmDecrypt(NULL)
#endif
- m_desc_buffer_ptr(NULL),
- secure_mode(false)
+ ,m_desc_buffer_ptr(NULL)
+ ,streaming({false, false})
{
/* Assumption is that , to begin with , we have all the frames with decoder */
DEBUG_PRINT_HIGH("In OMX vdec Constructor");
@@ -573,17 +523,16 @@ omx_vdec::omx_vdec(): m_error_propogated(false),
dec_time.start();
proc_frms = latency = 0;
}
- property_value[0] = '\0';
+ property_value[0] = NULL;
property_get("vidc.dec.debug.ts", property_value, "0");
m_debug_timestamp = atoi(property_value);
DEBUG_PRINT_HIGH("vidc.dec.debug.ts value is %d",m_debug_timestamp);
if (m_debug_timestamp)
{
time_stamp_dts.set_timestamp_reorder_mode(true);
- time_stamp_dts.enable_debug_print(true);
}
- property_value[0] = '\0';
+ property_value[0] = NULL;
property_get("vidc.dec.debug.concealedmb", property_value, "0");
m_debug_concealedmb = atoi(property_value);
DEBUG_PRINT_HIGH("vidc.dec.debug.concealedmb value is %d",m_debug_concealedmb);
@@ -594,92 +543,24 @@ omx_vdec::omx_vdec(): m_error_propogated(false),
memset (&drv_ctx,0,sizeof(drv_ctx));
memset (&h264_scratch,0,sizeof (OMX_BUFFERHEADERTYPE));
memset (m_hwdevice_name,0,sizeof(m_hwdevice_name));
+ memset(&op_buf_rcnfg, 0 ,sizeof(vdec_allocatorproperty));
memset(m_demux_offsets, 0, ( sizeof(OMX_U32) * 8192) );
m_demux_entries = 0;
- memset(&drv_ctx.extradata_info, 0, sizeof(drv_ctx.extradata_info));
drv_ctx.timestamp_adjust = false;
drv_ctx.video_driver_fd = -1;
m_vendor_config.pData = NULL;
pthread_mutex_init(&m_lock, NULL);
- pthread_mutex_init(&c_lock, NULL);
sem_init(&m_cmd_lock,0,0);
- streaming[CAPTURE_PORT] =
- streaming[OUTPUT_PORT] = false;
#ifdef _ANDROID_
char extradata_value[PROPERTY_VALUE_MAX] = {0};
property_get("vidc.dec.debug.extradata", extradata_value, "0");
m_debug_extradata = atoi(extradata_value);
DEBUG_PRINT_HIGH("vidc.dec.debug.extradata value is %d",m_debug_extradata);
#endif
- m_fill_output_msg = OMX_COMPONENT_GENERATE_FTB;
- client_buffers.set_vdec_client(this);
-}
-
-static const int event_type[] = {
- V4L2_EVENT_MSM_VIDC_FLUSH_DONE,
- V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_SUFFICIENT,
- V4L2_EVENT_MSM_VIDC_PORT_SETTINGS_CHANGED_INSUFFICIENT,
- V4L2_EVENT_MSM_VIDC_CLOSE_DONE,
- V4L2_EVENT_MSM_VIDC_SYS_ERROR
-};
-
-static OMX_ERRORTYPE subscribe_to_events(int fd)
-{
- OMX_ERRORTYPE eRet = OMX_ErrorNone;
- struct v4l2_event_subscription sub;
- int array_sz = sizeof(event_type)/sizeof(int);
- int i,rc;
- if (fd < 0) {
- printf("Invalid input: %d\n", fd);
- return OMX_ErrorBadParameter;
- }
- for (i = 0; i < array_sz; ++i) {
- memset(&sub, 0, sizeof(sub));
- sub.type = event_type[i];
- rc = ioctl(fd, VIDIOC_SUBSCRIBE_EVENT, &sub);
- if (rc) {
- printf("Failed to subscribe event: 0x%x\n", sub.type);
- break;
- }
- }
- if (i < array_sz) {
- for (--i; i >=0 ; i--) {
- memset(&sub, 0, sizeof(sub));
- sub.type = event_type[i];
- rc = ioctl(fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub);
- if (rc)
- printf("Failed to unsubscribe event: 0x%x\n", sub.type);
- }
- eRet = OMX_ErrorNotImplemented;
- }
- return eRet;
}
-static OMX_ERRORTYPE unsubscribe_to_events(int fd)
-{
- OMX_ERRORTYPE eRet = OMX_ErrorNone;
- struct v4l2_event_subscription sub;
- int array_sz = sizeof(event_type)/sizeof(int);
- int i,rc;
- if (fd < 0) {
- printf("Invalid input: %d\n", fd);
- return OMX_ErrorBadParameter;
- }
-
- for (i = 0; i < array_sz; ++i) {
- memset(&sub, 0, sizeof(sub));
- sub.type = event_type[i];
- rc = ioctl(fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub);
- if (rc) {
- printf("Failed to unsubscribe event: 0x%x\n", sub.type);
- break;
- }
- }
- return eRet;
-}
-
/* ======================================================================
FUNCTION
omx_vdec::~omx_vdec
@@ -696,7 +577,6 @@ RETURN VALUE
omx_vdec::~omx_vdec()
{
m_pmem_info = NULL;
- struct v4l2_decoder_cmd dec;
DEBUG_PRINT_HIGH("In OMX vdec Destructor");
if(m_pipe_in) close(m_pipe_in);
if(m_pipe_out) close(m_pipe_out);
@@ -705,16 +585,9 @@ omx_vdec::~omx_vdec()
DEBUG_PRINT_HIGH("Waiting on OMX Msg Thread exit");
pthread_join(msg_thread_id,NULL);
DEBUG_PRINT_HIGH("Waiting on OMX Async Thread exit");
- dec.cmd = V4L2_DEC_CMD_STOP;
- if (ioctl(drv_ctx.video_driver_fd, VIDIOC_DECODER_CMD, &dec))
- {
- DEBUG_PRINT_ERROR("\n STOP Command failed\n");
- }
pthread_join(async_thread_id,NULL);
- unsubscribe_to_events(drv_ctx.video_driver_fd);
close(drv_ctx.video_driver_fd);
pthread_mutex_destroy(&m_lock);
- pthread_mutex_destroy(&c_lock);
sem_destroy(&m_cmd_lock);
if (perf_flag)
{
@@ -724,18 +597,6 @@ omx_vdec::~omx_vdec()
DEBUG_PRINT_HIGH("Exit OMX vdec Destructor");
}
-int release_buffers(omx_vdec* obj, enum vdec_buffer buffer_type) {
- struct v4l2_requestbuffers bufreq;
- int rc = 0;
- if (buffer_type == VDEC_BUFFER_TYPE_OUTPUT){
- bufreq.memory = V4L2_MEMORY_USERPTR;
- bufreq.count = 0;
- bufreq.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- rc = ioctl(obj->drv_ctx.video_driver_fd,VIDIOC_REQBUFS, &bufreq);
- }
- return rc;
-}
-
/* ======================================================================
FUNCTION
omx_vdec::OMXCntrlProcessMsgCb
@@ -757,8 +618,8 @@ RETURN VALUE
========================================================================== */
void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
{
- signed p1; // Parameter - 1
- signed p2; // Parameter - 2
+ unsigned p1; // Parameter - 1
+ unsigned p2; // Parameter - 2
unsigned ident;
unsigned qsize=0; // qsize
omx_vdec *pThis = (omx_vdec *) ctxt;
@@ -778,7 +639,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
qsize = pThis->m_cmd_q.m_size;
if(qsize)
{
- pThis->m_cmd_q.pop_entry((unsigned *)&p1, (unsigned *)&p2, &ident);
+ pThis->m_cmd_q.pop_entry(&p1,&p2,&ident);
}
if (qsize == 0 && pThis->m_state != OMX_StatePause)
@@ -786,7 +647,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
qsize = pThis->m_ftb_q.m_size;
if (qsize)
{
- pThis->m_ftb_q.pop_entry((unsigned *)&p1, (unsigned *)&p2, &ident);
+ pThis->m_ftb_q.pop_entry(&p1,&p2,&ident);
}
}
@@ -795,7 +656,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
qsize = pThis->m_etb_q.m_size;
if (qsize)
{
- pThis->m_etb_q.pop_entry((unsigned *)&p1, (unsigned *)&p2, &ident);
+ pThis->m_etb_q.pop_entry(&p1,&p2,&ident);
}
}
pthread_mutex_unlock(&pThis->m_lock);
@@ -834,7 +695,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
else
{
pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
- OMX_EventError, p2, (OMX_U32)NULL, NULL );
+ OMX_EventError, p2, NULL, NULL );
}
break;
@@ -848,11 +709,10 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
}
if (p2 == OMX_CORE_OUTPUT_PORT_INDEX && pThis->in_reconfig)
{
+ pThis->op_buf_rcnfg.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
OMX_ERRORTYPE eRet = OMX_ErrorNone;
- pThis->stream_off(OMX_CORE_OUTPUT_PORT_INDEX);
- if(release_buffers(pThis, VDEC_BUFFER_TYPE_OUTPUT))
- DEBUG_PRINT_HIGH("Failed to release output buffers\n");
- OMX_ERRORTYPE eRet1 = pThis->get_buffer_req(&pThis->drv_ctx.op_buf);
+ pThis->stream_off();
+ OMX_ERRORTYPE eRet1 = pThis->get_buffer_req(&pThis->op_buf_rcnfg);
pThis->in_reconfig = false;
if(eRet != OMX_ErrorNone)
{
@@ -1004,17 +864,15 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
if (BITMASK_PRESENT(&pThis->m_flags,
OMX_COMPONENT_IDLE_PENDING))
{
- if(pThis->stream_off(OMX_CORE_INPUT_PORT_INDEX)) {
- DEBUG_PRINT_ERROR("\n Failed to call streamoff on OUTPUT Port \n");
- pThis->omx_report_error ();
- } else {
- pThis->streaming[OUTPUT_PORT] = false;
- }
if (!pThis->output_flush_progress)
{
- DEBUG_PRINT_LOW("\n Input flush done hence issue stop");
- pThis->post_event ((unsigned int)NULL, VDEC_S_SUCCESS,\
- OMX_COMPONENT_GENERATE_STOP_DONE);
+ DEBUG_PRINT_LOW("\n Output flush done hence issue stop");
+ if (/*ioctl (pThis->drv_ctx.video_driver_fd,
+ VDEC_IOCTL_CMD_STOP,NULL ) < 0*/0)
+ {
+ DEBUG_PRINT_ERROR("\n VDEC_IOCTL_CMD_STOP failed");
+ pThis->omx_report_error ();
+ }
}
}
}
@@ -1074,17 +932,15 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
if (BITMASK_PRESENT(&pThis->m_flags ,OMX_COMPONENT_IDLE_PENDING))
{
- if(pThis->stream_off(OMX_CORE_OUTPUT_PORT_INDEX)) {
- DEBUG_PRINT_ERROR("\n Failed to call streamoff on CAPTURE Port \n");
- pThis->omx_report_error ();
- break;
- }
- pThis->streaming[CAPTURE_PORT] = false;
if (!pThis->input_flush_progress)
{
- DEBUG_PRINT_LOW("\n Output flush done hence issue stop");
- pThis->post_event ((unsigned int)NULL, VDEC_S_SUCCESS,\
- OMX_COMPONENT_GENERATE_STOP_DONE);
+ DEBUG_PRINT_LOW("\n Input flush done hence issue stop");
+ if (/*ioctl (pThis->drv_ctx.video_driver_fd,
+ VDEC_IOCTL_CMD_STOP,NULL ) < */0)
+ {
+ DEBUG_PRINT_ERROR("\n VDEC_IOCTL_CMD_STOP failed");
+ pThis->omx_report_error ();
+ }
}
}
}
@@ -1232,32 +1088,35 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
case OMX_COMPONENT_GENERATE_PORT_RECONFIG:
DEBUG_PRINT_HIGH("\n Rxd OMX_COMPONENT_GENERATE_PORT_RECONFIG");
-
- if (p2 == OMX_IndexParamPortDefinition) {
- pThis->in_reconfig = true;
- }
- if (pThis->m_cb.EventHandler) {
- pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
- OMX_EventPortSettingsChanged, p1, p2, NULL );
- } else {
- DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL", __func__);
- }
-
- if (pThis->drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
+ if (pThis->start_port_reconfig() != OMX_ErrorNone)
+ pThis->omx_report_error();
+ else
{
- OMX_INTERLACETYPE format = (OMX_INTERLACETYPE)-1;
- OMX_EVENTTYPE event = (OMX_EVENTTYPE)OMX_EventIndexsettingChanged;
- if (pThis->drv_ctx.interlace == VDEC_InterlaceInterleaveFrameTopFieldFirst)
- format = OMX_InterlaceInterleaveFrameTopFieldFirst;
- else if (pThis->drv_ctx.interlace == VDEC_InterlaceInterleaveFrameBottomFieldFirst)
- format = OMX_InterlaceInterleaveFrameBottomFieldFirst;
- else //unsupported interlace format; raise a error
- event = OMX_EventError;
- if (pThis->m_cb.EventHandler) {
- pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
- event, format, 0, NULL );
- } else {
- DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL", __func__);
+ if (pThis->in_reconfig)
+ {
+ if (pThis->m_cb.EventHandler) {
+ pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
+ OMX_EventPortSettingsChanged, OMX_CORE_OUTPUT_PORT_INDEX, 0, NULL );
+ } else {
+ DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL", __func__);
+ }
+ }
+ if (pThis->drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
+ {
+ OMX_INTERLACETYPE format = (OMX_INTERLACETYPE)-1;
+ OMX_EVENTTYPE event = (OMX_EVENTTYPE)OMX_EventIndexsettingChanged;
+ if (pThis->drv_ctx.interlace == VDEC_InterlaceInterleaveFrameTopFieldFirst)
+ format = OMX_InterlaceInterleaveFrameTopFieldFirst;
+ else if (pThis->drv_ctx.interlace == VDEC_InterlaceInterleaveFrameBottomFieldFirst)
+ format = OMX_InterlaceInterleaveFrameBottomFieldFirst;
+ else //unsupported interlace format; raise a error
+ event = OMX_EventError;
+ if (pThis->m_cb.EventHandler) {
+ pThis->m_cb.EventHandler(&pThis->m_cmp, pThis->m_app_data,
+ event, format, 0, NULL );
+ } else {
+ DEBUG_PRINT_ERROR("ERROR: %s()::EventHandler is NULL", __func__);
+ }
}
}
break;
@@ -1302,17 +1161,7 @@ void omx_vdec::process_event_cb(void *ctxt, unsigned char id)
}
-void omx_vdec::update_resolution(int width, int height)
-{
- drv_ctx.video_resolution.frame_height = height;
- drv_ctx.video_resolution.frame_width = width;
- drv_ctx.video_resolution.scan_lines = height;
- drv_ctx.video_resolution.stride = width;
- rectangle.nLeft = 0;
- rectangle.nTop = 0;
- rectangle.nWidth = drv_ctx.video_resolution.frame_width;
- rectangle.nHeight = drv_ctx.video_resolution.frame_height;
-}
+
/* ======================================================================
FUNCTION
@@ -1336,21 +1185,15 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
struct v4l2_fmtdesc fdesc;
struct v4l2_format fmt;
struct v4l2_requestbuffers bufreq;
- struct v4l2_control control;
unsigned int alignment = 0,buffer_size = 0;
int fds[2];
int r,ret=0;
bool codec_ambiguous = false;
- OMX_STRING device_name = (OMX_STRING)"/dev/video32";
- if(!strncmp(role, "OMX.qcom.video.decoder.avc.secure",OMX_MAX_STRINGNAME_SIZE)){
- struct v4l2_control control;
- secure_mode = true;
- arbitrary_bytes = false;
- role = (OMX_STRING)"OMX.qcom.video.decoder.avc";
- }
+ OMX_STRING device_name = "/dev/video32";
drv_ctx.video_driver_fd = open("/dev/video32", O_RDWR);
@@ -1369,12 +1212,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
drv_ctx.frame_rate.fps_numerator = DEFAULT_FPS;
drv_ctx.frame_rate.fps_denominator = 1;
- ret = pthread_create(&async_thread_id,0,async_message_thread,this);
- if(ret < 0) {
- close(drv_ctx.video_driver_fd);
- DEBUG_PRINT_ERROR("\n Failed to create async_message_thread \n");
- return OMX_ErrorInsufficientResources;
- }
#ifdef INPUT_BUFFER_LOG
strcpy(inputfilename, INPUT_BUFFER_FILE_NAME);
@@ -1388,7 +1225,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
// Copy the role information which provides the decoder kind
strlcpy(drv_ctx.kind,role,128);
-
if(!strncmp(drv_ctx.kind,"OMX.qcom.video.decoder.mpeg4",\
OMX_MAX_STRINGNAME_SIZE))
{
@@ -1397,7 +1233,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
drv_ctx.timestamp_adjust = true;
drv_ctx.decoder_format = VDEC_CODECTYPE_MPEG4;
eCompressionFormat = OMX_VIDEO_CodingMPEG4;
- output_capability=V4L2_PIX_FMT_MPEG4;
/*Initialize Start Code for MPEG4*/
codec_type_parse = CODEC_TYPE_MPEG4;
m_frame_parser.init_start_codes (codec_type_parse);
@@ -1411,7 +1246,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
strlcpy((char *)m_cRole, "video_decoder.mpeg2",\
OMX_MAX_STRINGNAME_SIZE);
drv_ctx.decoder_format = VDEC_CODECTYPE_MPEG2;
- output_capability = V4L2_PIX_FMT_MPEG2;
eCompressionFormat = OMX_VIDEO_CodingMPEG2;
/*Initialize Start Code for MPEG2*/
codec_type_parse = CODEC_TYPE_MPEG2;
@@ -1427,7 +1261,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
DEBUG_PRINT_LOW("\n H263 Decoder selected");
drv_ctx.decoder_format = VDEC_CODECTYPE_H263;
eCompressionFormat = OMX_VIDEO_CodingH263;
- output_capability = V4L2_PIX_FMT_H263;
codec_type_parse = CODEC_TYPE_H263;
m_frame_parser.init_start_codes (codec_type_parse);
#ifdef INPUT_BUFFER_LOG
@@ -1445,11 +1278,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
codec_type_parse = CODEC_TYPE_DIVX;
m_frame_parser.init_start_codes (codec_type_parse);
- eRet = createDivxDrmContext();
- if (eRet != OMX_ErrorNone) {
- DEBUG_PRINT_ERROR("createDivxDrmContext Failed");
- return eRet;
- }
}
else if(!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.divx4",\
OMX_MAX_STRINGNAME_SIZE))
@@ -1463,11 +1291,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
codec_ambiguous = true;
m_frame_parser.init_start_codes (codec_type_parse);
- eRet = createDivxDrmContext();
- if (eRet != OMX_ErrorNone) {
- DEBUG_PRINT_ERROR("createDivxDrmContext Failed");
- return eRet;
- }
}
else if(!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.divx",\
OMX_MAX_STRINGNAME_SIZE))
@@ -1481,12 +1304,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
codec_ambiguous = true;
m_frame_parser.init_start_codes (codec_type_parse);
- eRet = createDivxDrmContext();
- if (eRet != OMX_ErrorNone) {
- DEBUG_PRINT_ERROR("createDivxDrmContext Failed");
- return eRet;
- }
-
}
else if(!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.avc",\
OMX_MAX_STRINGNAME_SIZE))
@@ -1509,7 +1326,6 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
drv_ctx.decoder_format = VDEC_CODECTYPE_VC1;
eCompressionFormat = OMX_VIDEO_CodingWMV;
codec_type_parse = CODEC_TYPE_VC1;
- output_capability = V4L2_PIX_FMT_VC1_ANNEX_G;
m_frame_parser.init_start_codes (codec_type_parse);
#ifdef INPUT_BUFFER_LOG
strcat(inputfilename, "vc1");
@@ -1522,21 +1338,11 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
drv_ctx.decoder_format = VDEC_CODECTYPE_VC1_RCV;
eCompressionFormat = OMX_VIDEO_CodingWMV;
codec_type_parse = CODEC_TYPE_VC1;
- output_capability = V4L2_PIX_FMT_VC1_ANNEX_L;
m_frame_parser.init_start_codes (codec_type_parse);
#ifdef INPUT_BUFFER_LOG
strcat(inputfilename, "vc1");
#endif
}
- else if(!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.vp8", \
- OMX_MAX_STRINGNAME_SIZE))
- {
- strlcpy((char *)m_cRole, "video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- output_capability=V4L2_PIX_FMT_VP8;
- eCompressionFormat = OMX_VIDEO_CodingVPX;
- codec_type_parse = CODEC_TYPE_VP8;
- arbitrary_bytes = false;
- }
else
{
DEBUG_PRINT_ERROR("\nERROR:Unknown Component\n");
@@ -1548,28 +1354,24 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
if (eRet == OMX_ErrorNone)
{
- drv_ctx.output_format = VDEC_YUV_FORMAT_NV12;
- OMX_COLOR_FORMATTYPE dest_color_format = (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
- if (!client_buffers.set_color_format(dest_color_format)) {
- DEBUG_PRINT_ERROR("\n Setting color format failed");
- eRet = OMX_ErrorInsufficientResources;
- }
-
+ drv_ctx.output_format = VDEC_YUV_FORMAT_TILE_4x2;
capture_capability= V4L2_PIX_FMT_NV12;
- ret = subscribe_to_events(drv_ctx.video_driver_fd);
+
+ struct v4l2_event_subscription sub;
+ sub.type=V4L2_EVENT_ALL;
+ ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_SUBSCRIBE_EVENT, &sub);
if (ret) {
- DEBUG_PRINT_ERROR("\n Subscribe Event Failed \n");
- return OMX_ErrorInsufficientResources;
+ printf("\n Subscribe Event Failed \n");
+ return OMX_ErrorInsufficientResources;
}
struct v4l2_capability cap;
ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_QUERYCAP, &cap);
if (ret) {
- DEBUG_PRINT_ERROR("Failed to query capabilities\n");
+ printf("Failed to query capabilities\n");
/*TODO: How to handle this case */
} else {
- DEBUG_PRINT_HIGH("Capabilities: driver_name = %s, card = %s, bus_info = %s,"
+ printf("Capabilities: driver_name = %s, card = %s, bus_info = %s,"
" version = %d, capabilities = %x\n", cap.driver, cap.card,
cap.bus_info, cap.version, cap.capabilities);
}
@@ -1577,7 +1379,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
fdesc.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
fdesc.index=0;
while (ioctl(drv_ctx.video_driver_fd, VIDIOC_ENUM_FMT, &fdesc) == 0) {
- DEBUG_PRINT_HIGH("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
+ printf("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
fdesc.pixelformat, fdesc.flags);
fdesc.index++;
}
@@ -1585,11 +1387,13 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
fdesc.index=0;
while (ioctl(drv_ctx.video_driver_fd, VIDIOC_ENUM_FMT, &fdesc) == 0) {
- DEBUG_PRINT_HIGH("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
+ printf("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
fdesc.pixelformat, fdesc.flags);
fdesc.index++;
}
- update_resolution(320, 240);
+
+ drv_ctx.video_resolution.frame_height=drv_ctx.video_resolution.scan_lines=240;
+ drv_ctx.video_resolution.frame_width=drv_ctx.video_resolution.stride=320;
fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height;
fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width;
@@ -1597,23 +1401,23 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
if (ret) {
/*TODO: How to handle this case */
- DEBUG_PRINT_ERROR("Failed to set format on output port\n");
+ printf("Failed to set format on capture port\n");
}
- DEBUG_PRINT_HIGH("\n Set Format was successful \n ");
+ printf("\n Set Format was successful \n ");
if (codec_ambiguous) {
if (output_capability == V4L2_PIX_FMT_DIVX) {
struct v4l2_control divx_ctrl;
if (drv_ctx.decoder_format == VDEC_CODECTYPE_DIVX_4) {
- divx_ctrl.value = V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_4;
+ divx_ctrl.id = V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_4;
} else if (drv_ctx.decoder_format == VDEC_CODECTYPE_DIVX_5) {
- divx_ctrl.value = V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_5;
+ divx_ctrl.id = V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_5;
} else {
- divx_ctrl.value = V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_6;
+ divx_ctrl.id = V4L2_MPEG_VIDC_VIDEO_DIVX_FORMAT_5;
}
- divx_ctrl.id = V4L2_CID_MPEG_VIDC_VIDEO_DIVX_FORMAT;
- ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &divx_ctrl);
+ divx_ctrl.value = V4L2_CID_MPEG_VIDC_VIDEO_DIVX_FORMAT;
+ ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &fmt);
if (ret) {
DEBUG_PRINT_ERROR("Failed to set divx version\n");
}
@@ -1625,51 +1429,32 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height;
fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width;
- fmt.fmt.pix_mp.pixelformat = capture_capability;
+ fmt.fmt.pix_mp.pixelformat = output_capability;
ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
if (ret) {
/*TODO: How to handle this case */
- DEBUG_PRINT_ERROR("Failed to set format on capture port\n");
+ printf("Failed to set format on capture port\n");
}
- DEBUG_PRINT_HIGH("\n Set Format was successful \n ");
- if(secure_mode){
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_SECURE;
- control.value = 1;
- DEBUG_PRINT_LOW("Omx_vdec:: calling to open secure device %d\n", ret);
- ret=ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL,&control);
- if (ret) {
- DEBUG_PRINT_ERROR("Omx_vdec:: Unable to open secure device %d\n", ret);
- close(drv_ctx.video_driver_fd);
- return OMX_ErrorInsufficientResources;
- }
- }
+ printf("\n Set Format was successful \n ");
/*Get the Buffer requirements for input and output ports*/
drv_ctx.ip_buf.buffer_type = VDEC_BUFFER_TYPE_INPUT;
drv_ctx.op_buf.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
- if (secure_mode) {
- drv_ctx.op_buf.alignment=SZ_1M;
- drv_ctx.ip_buf.alignment=SZ_1M;
- } else {
- drv_ctx.op_buf.alignment=SZ_4K;
- drv_ctx.ip_buf.alignment=SZ_4K;
- }
+ drv_ctx.op_buf.alignment=4096;
+ drv_ctx.ip_buf.alignment=4096;
drv_ctx.interlace = VDEC_InterlaceFrameProgressive;
drv_ctx.extradata = 0;
- drv_ctx.picture_order = VDEC_ORDER_DISPLAY;
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_OUTPUT_ORDER;
- control.value = V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DISPLAY;
- ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control);
+ drv_ctx.picture_order = VDEC_ORDER_DECODE;
drv_ctx.idr_only_decoding = 0;
- m_state = OMX_StateLoaded;
+ m_state = OMX_StateLoaded;
+ eRet=get_buffer_req(&drv_ctx.ip_buf);
+ printf("Input Buffer Size =%d \n ",drv_ctx.ip_buf.buffer_size);
+
#ifdef DEFAULT_EXTRADATA
- if (eRet == OMX_ErrorNone && !secure_mode)
- enable_extradata(DEFAULT_EXTRADATA, true, true);
+ if (eRet == OMX_ErrorNone && !secure_mode)
+ eRet = enable_extradata(DEFAULT_EXTRADATA);
#endif
- eRet=get_buffer_req(&drv_ctx.ip_buf);
- DEBUG_PRINT_HIGH("Input Buffer Size =%d \n ",drv_ctx.ip_buf.buffer_size);
- get_buffer_req(&drv_ctx.op_buf);
if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
{
if (m_frame_parser.mutils == NULL)
@@ -1752,6 +1537,7 @@ OMX_ERRORTYPE omx_vdec::component_init(OMX_STRING role)
{
DEBUG_PRINT_HIGH("\n omx_vdec::component_init() success");
}
+
//memset(&h264_mv_buff,0,sizeof(struct h264_mv_buffer));
return eRet;
}
@@ -1821,7 +1607,7 @@ OMX_ERRORTYPE omx_vdec::send_command(OMX_IN OMX_HANDLETYPE hComp,
&& param1 != OMX_CORE_OUTPUT_PORT_INDEX && param1 != OMX_ALL)
{
DEBUG_PRINT_ERROR("\n send_command(): ERROR OMX_CommandFlush "
- "to invalid port: %lu", param1);
+ "to invalid port: %d", param1);
return OMX_ErrorBadPortIndex;
}
post_event((unsigned)cmd,(unsigned)param1,OMX_COMPONENT_GENERATE_COMMAND);
@@ -1960,7 +1746,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
bFlag = 1;
DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
m_state=OMX_StateExecuting;
- DEBUG_PRINT_HIGH("Stream On CAPTURE Was successful\n");
+ printf("Stream On CAPTURE Was successful\n");
}
/* Requesting transition from Idle to Idle */
else if(eState == OMX_StateIdle)
@@ -2018,26 +1804,64 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_LOW("\n Command Recieved in OMX_StateExecuting");
/* Requesting transition from Executing to Idle */
if(eState == OMX_StateIdle)
- {
- /* Since error is None , we will post an event
- at the end of this function definition
- */
- DEBUG_PRINT_LOW("\n send_command_proxy(): Executing --> Idle \n");
- BITMASK_SET(&m_flags,OMX_COMPONENT_IDLE_PENDING);
- if(!sem_posted)
- {
- sem_posted = 1;
- sem_post (&m_cmd_lock);
- execute_omx_flush(OMX_ALL);
- }
- bFlag = 0;
- }
+ {
+ /* Since error is None , we will post an event
+ at the end of this function definition
+ */
+ DEBUG_PRINT_LOW("\n send_command_proxy(): Executing --> Idle \n");
+ //BITMASK_SET(&m_flags,OMX_COMPONENT_IDLE_PENDING);
+ if(!sem_posted)
+ {
+ sem_posted = 1;
+ sem_post (&m_cmd_lock);
+ execute_omx_flush(OMX_ALL);
+ }
+ bFlag = 1;
+ int rc=0;
+ enum v4l2_buf_type btype;
+ btype = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_STREAMOFF, &btype);
+ if (rc) {
+ /*TODO: How to handle this case */
+ printf("\n Failed to call streamoff on OUTPUT Port \n");
+ } else {
+ streaming[OUTPUT_PORT] = false;
+ }
+ btype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_STREAMOFF, &btype);
+ if (rc) {
+ /*TODO: How to handle this case */
+ printf("\n Failed to call streamoff on CAPTURE Port \n");
+ } else {
+ streaming[CAPTURE_PORT] = false;
+ }
+ struct v4l2_event_subscription sub;
+ sub.type=V4L2_EVENT_ALL;
+ ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub);
+ if (ret) {
+ printf("\n Subscribe Event Failed \n");
+ eRet = OMX_ErrorHardware;
+ }
+ m_state == OMX_StateIdle;
+ }
/* Requesting transition from Executing to Paused */
else if(eState == OMX_StatePause)
{
DEBUG_PRINT_LOW("\n PAUSE Command Issued");
- m_state = OMX_StatePause;
- bFlag = 1;
+ if (/*ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_CMD_PAUSE,
+ NULL) < */0)
+ {
+ DEBUG_PRINT_ERROR("\n Error In Pause State");
+ post_event(OMX_EventError,OMX_ErrorHardware,\
+ OMX_COMPONENT_GENERATE_EVENT);
+ eRet = OMX_ErrorHardware;
+ }
+ else
+ {
+ BITMASK_SET(&m_flags,OMX_COMPONENT_PAUSE_PENDING);
+ DEBUG_PRINT_LOW("send_command_proxy(): Executing-->Pause\n");
+ bFlag = 0;
+ }
}
/* Requesting transition from Executing to Loaded */
else if(eState == OMX_StateLoaded)
@@ -2085,8 +1909,22 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
if(eState == OMX_StateExecuting)
{
DEBUG_PRINT_LOW("\n Pause --> Executing \n");
- m_state = OMX_StateExecuting;
- bFlag = 1;
+ if (/*ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_CMD_RESUME,
+ NULL) < */0)
+ {
+ DEBUG_PRINT_ERROR("\n VDEC_IOCTL_CMD_RESUME failed");
+ post_event(OMX_EventError,OMX_ErrorHardware,\
+ OMX_COMPONENT_GENERATE_EVENT);
+ eRet = OMX_ErrorHardware;
+ }
+ else
+ {
+ BITMASK_SET(&m_flags,OMX_COMPONENT_EXECUTE_PENDING);
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
+ post_event (NULL,VDEC_S_SUCCESS,\
+ OMX_COMPONENT_GENERATE_RESUME_DONE);
+ bFlag = 0;
+ }
}
/* Requesting transition from Pause to Idle */
else if(eState == OMX_StateIdle)
@@ -2212,7 +2050,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
else if (cmd == OMX_CommandFlush)
{
DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandFlush issued"
- "with param1: %lu", param1);
+ "with param1: %d", param1);
if(OMX_CORE_INPUT_PORT_INDEX == param1 || OMX_ALL == param1)
{
BITMASK_SET(&m_flags, OMX_COMPONENT_INPUT_FLUSH_PENDING);
@@ -2232,7 +2070,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
else if ( cmd == OMX_CommandPortEnable)
{
DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandPortEnable issued"
- "with param1: %lu", param1);
+ "with param1: %d", param1);
if(param1 == OMX_CORE_INPUT_PORT_INDEX || param1 == OMX_ALL)
{
m_inp_bEnabled = OMX_TRUE;
@@ -2277,7 +2115,7 @@ OMX_ERRORTYPE omx_vdec::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
else if (cmd == OMX_CommandPortDisable)
{
DEBUG_PRINT_HIGH("\n send_command_proxy(): OMX_CommandPortDisable issued"
- "with param1: %lu", param1);
+ "with param1: %d", param1);
if(param1 == OMX_CORE_INPUT_PORT_INDEX || param1 == OMX_ALL)
{
m_inp_bEnabled = OMX_FALSE;
@@ -2366,36 +2204,31 @@ RETURN VALUE
========================================================================== */
bool omx_vdec::execute_omx_flush(OMX_U32 flushType)
{
+ struct vdec_ioctl_msg ioctl_msg = {NULL, NULL};
+ enum vdec_bufferflush flush_dir;
bool bRet = false;
- struct v4l2_plane plane;
- struct v4l2_buffer v4l2_buf;
- struct v4l2_decoder_cmd dec;
- DEBUG_PRINT_LOW("in %s", __func__);
- memset((void *)&v4l2_buf,0,sizeof(v4l2_buf));
- dec.cmd = V4L2_DEC_QCOM_CMD_FLUSH;
switch (flushType)
{
case OMX_CORE_INPUT_PORT_INDEX:
input_flush_progress = true;
- dec.flags = V4L2_DEC_QCOM_CMD_FLUSH_OUTPUT;
+ flush_dir = VDEC_FLUSH_TYPE_INPUT;
break;
case OMX_CORE_OUTPUT_PORT_INDEX:
output_flush_progress = true;
- dec.flags = V4L2_DEC_QCOM_CMD_FLUSH_CAPTURE;
+ flush_dir = VDEC_FLUSH_TYPE_OUTPUT;
break;
default:
input_flush_progress = true;
output_flush_progress = true;
- dec.flags = V4L2_DEC_QCOM_CMD_FLUSH_OUTPUT |
- V4L2_DEC_QCOM_CMD_FLUSH_CAPTURE;
+ flush_dir = VDEC_FLUSH_TYPE_ALL;
}
-
- if (ioctl(drv_ctx.video_driver_fd, VIDIOC_DECODER_CMD, &dec))
+ ioctl_msg.in = &flush_dir;
+ ioctl_msg.out = NULL;
+ if (/*ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_CMD_FLUSH, &ioctl_msg) < */0)
{
- DEBUG_PRINT_ERROR("\n Flush Port (%lu) Failed ", flushType);
+ DEBUG_PRINT_ERROR("\n Flush Port (%d) Failed ", (int)flush_dir);
bRet = false;
}
-
return bRet;
}
/*=========================================================================
@@ -2426,9 +2259,10 @@ bool omx_vdec::execute_output_flush()
m_ftb_q.m_size,pending_output_buffers);
m_ftb_q.pop_entry(&p1,&p2,&ident);
DEBUG_PRINT_LOW("\n ID(%x) P1(%x) P2(%x)", ident, p1, p2);
- if(ident == m_fill_output_msg )
+ if(ident == OMX_COMPONENT_GENERATE_FTB )
{
- m_cb.FillBufferDone(&m_cmp, m_app_data, (OMX_BUFFERHEADERTYPE *)p2);
+ pending_output_buffers++;
+ fill_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p2);
}
else if (ident == OMX_COMPONENT_GENERATE_FBD)
{
@@ -2528,8 +2362,7 @@ bool omx_vdec::execute_input_flush()
if (pdest_frame)
{
pdest_frame->nFilledLen = 0;
- m_input_free_q.insert_entry((unsigned) pdest_frame, (unsigned int)NULL,
- (unsigned int)NULL);
+ m_input_free_q.insert_entry((unsigned) pdest_frame,NULL,NULL);
pdest_frame = NULL;
}
m_frame_parser.flush();
@@ -2576,7 +2409,7 @@ bool omx_vdec::post_event(unsigned int p1,
pthread_mutex_lock(&m_lock);
- if (id == m_fill_output_msg ||
+ if (id == OMX_COMPONENT_GENERATE_FTB ||
id == OMX_COMPONENT_GENERATE_FBD)
{
m_ftb_q.insert_entry(p1,p2,id);
@@ -2603,7 +2436,7 @@ bool omx_vdec::post_event(unsigned int p1,
OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PROFILELEVELTYPE *profileLevelType)
{
- OMX_ERRORTYPE eRet = OMX_ErrorNoMore;
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
if(!profileLevelType)
return OMX_ErrorBadParameter;
@@ -2642,7 +2475,7 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PR
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %lu\n", profileLevelType->nProfileIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n", profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
}
@@ -2660,14 +2493,10 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PR
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %lu\n", profileLevelType->nProfileIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n", profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
}
- else if (!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.vp8",OMX_MAX_STRINGNAME_SIZE))
- {
- eRet = OMX_ErrorNoMore;
- }
else if (!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.mpeg2",OMX_MAX_STRINGNAME_SIZE))
{
if (profileLevelType->nProfileIndex == 0)
@@ -2682,14 +2511,14 @@ OMX_ERRORTYPE omx_vdec::get_supported_profile_level_for_1080p(OMX_VIDEO_PARAM_PR
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %lu\n", profileLevelType->nProfileIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n", profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
}
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported should be queries on Input port only %lu\n", profileLevelType->nPortIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported should be queries on Input port only %d\n", profileLevelType->nPortIndex);
eRet = OMX_ErrorBadPortIndex;
}
return eRet;
@@ -2726,7 +2555,7 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_LOW("Get Param in Invalid paramData \n");
return OMX_ErrorBadParameter;
}
- switch((unsigned long)paramIndex)
+ switch(paramIndex)
{
case OMX_IndexParamPortDefinition:
{
@@ -2778,17 +2607,15 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
portFmt->eCompressionFormat = OMX_VIDEO_CodingUnused;
if(0 == portFmt->nIndex)
- portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
- else if (1 == portFmt->nIndex)
- portFmt->eColorFormat = OMX_COLOR_FormatYUV420Planar;
+ portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
else
{
DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoPortFormat:"\
" NoMore Color formats\n");
eRet = OMX_ErrorNoMore;
}
- ALOGE("returning %d\n", portFmt->eColorFormat);
+ portFmt->eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
}
else
{
@@ -2918,9 +2745,7 @@ OMX_ERRORTYPE omx_vdec::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_MM_HEAP | GRALLOC_USAGE_PROTECTED |
GRALLOC_USAGE_PRIVATE_UNCACHED);
} else {
- nativeBuffersUsage->nUsage =
- (GRALLOC_USAGE_PRIVATE_IOMMU_HEAP |
- GRALLOC_USAGE_PRIVATE_UNCACHED);
+ nativeBuffersUsage->nUsage = (GRALLOC_USAGE_PRIVATE_MM_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED);
}
} else {
DEBUG_PRINT_HIGH("get_parameter: OMX_GoogleAndroidIndexGetAndroidNativeBufferUsage failed!\n");
@@ -2998,8 +2823,8 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_PTR paramData)
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
- int ret=0;
- struct v4l2_format fmt;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+
if(m_state == OMX_StateInvalid)
{
DEBUG_PRINT_ERROR("Set Param in Invalid State\n");
@@ -3018,7 +2843,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_ERROR("Set Param in Invalid State \n");
return OMX_ErrorIncorrectStateOperation;
}
- switch((unsigned long)paramIndex)
+ switch(paramIndex)
{
case OMX_IndexParamPortDefinition:
{
@@ -3033,27 +2858,21 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamPortDefinition OP port\n");
m_display_id = portDefn->format.video.pNativeWindow;
- unsigned int buffer_size;
- if (!client_buffers.get_buffer_req(buffer_size)) {
- DEBUG_PRINT_ERROR("\n Error in getting buffer requirements");
+ if ( portDefn->nBufferCountActual >= drv_ctx.op_buf.mincount &&
+ portDefn->nBufferSize >= drv_ctx.op_buf.buffer_size )
+ {
+ drv_ctx.op_buf.actualcount = portDefn->nBufferCountActual;
+ drv_ctx.op_buf.buffer_size = portDefn->nBufferSize;
+ eRet = set_buffer_req(&drv_ctx.op_buf);
+ if (eRet == OMX_ErrorNone)
+ m_port_def = *portDefn;
+ }
+ else
+ {
+ DEBUG_PRINT_ERROR("ERROR: OP Requirements(#%d: %u) Requested(#%d: %u)\n",
+ drv_ctx.op_buf.mincount, drv_ctx.op_buf.buffer_size,
+ portDefn->nBufferCountActual, portDefn->nBufferSize);
eRet = OMX_ErrorBadParameter;
- } else {
- if ( portDefn->nBufferCountActual >= drv_ctx.op_buf.mincount &&
- portDefn->nBufferSize >= drv_ctx.op_buf.buffer_size )
- {
- drv_ctx.op_buf.actualcount = portDefn->nBufferCountActual;
- drv_ctx.op_buf.buffer_size = portDefn->nBufferSize;
- eRet = set_buffer_req(&drv_ctx.op_buf);
- if (eRet == OMX_ErrorNone)
- m_port_def = *portDefn;
- }
- else
- {
- DEBUG_PRINT_ERROR("ERROR: OP Requirements(#%d: %u) Requested(#%lu: %lu)\n",
- drv_ctx.op_buf.mincount, drv_ctx.op_buf.buffer_size,
- portDefn->nBufferCountActual, portDefn->nBufferSize);
- eRet = OMX_ErrorBadParameter;
- }
}
}
else if(OMX_DirInput == portDefn->eDir)
@@ -3064,7 +2883,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
// Frame rate only should be set if this is a "known value" or to
// activate ts prediction logic (arbitrary mode only) sending input
// timestamps with max value (LLONG_MAX).
- DEBUG_PRINT_HIGH("set_parameter: frame rate set by omx client : %lu",
+ DEBUG_PRINT_HIGH("set_parameter: frame rate set by omx client : %d",
portDefn->format.video.xFramerate >> 16);
Q16ToFraction(portDefn->format.video.xFramerate, drv_ctx.frame_rate.fps_numerator,
drv_ctx.frame_rate.fps_denominator);
@@ -3079,6 +2898,12 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
drv_ctx.frame_rate.fps_denominator = 1;
frm_int = drv_ctx.frame_rate.fps_denominator * 1e6 /
drv_ctx.frame_rate.fps_numerator;
+ ioctl_msg.in = &drv_ctx.frame_rate;
+ if (/*ioctl (drv_ctx.video_driver_fd, VDEC_IOCTL_SET_FRAME_RATE,
+ (void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("Setting frame rate to driver failed");
+ }
DEBUG_PRINT_LOW("set_parameter: frm_int(%u) fps(%.2f)",
frm_int, drv_ctx.frame_rate.fps_numerator /
(float)drv_ctx.frame_rate.fps_denominator);
@@ -3095,15 +2920,16 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
if (portDefn->format.video.nFrameHeight != 0x0 &&
portDefn->format.video.nFrameWidth != 0x0)
{
- update_resolution(portDefn->format.video.nFrameWidth,
- portDefn->format.video.nFrameHeight);
- fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height;
- fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width;
- fmt.fmt.pix_mp.pixelformat = output_capability;
- DEBUG_PRINT_LOW("\n fmt.fmt.pix_mp.height = %d , fmt.fmt.pix_mp.width = %d \n",fmt.fmt.pix_mp.height,fmt.fmt.pix_mp.width);
- ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
- if (ret)
+ drv_ctx.video_resolution.frame_height =
+ drv_ctx.video_resolution.scan_lines =
+ portDefn->format.video.nFrameHeight;
+ drv_ctx.video_resolution.frame_width =
+ drv_ctx.video_resolution.stride =
+ portDefn->format.video.nFrameWidth;
+ ioctl_msg.in = &drv_ctx.video_resolution;
+ ioctl_msg.out = NULL;
+ if (/*ioctl (drv_ctx.video_driver_fd, VDEC_IOCTL_SET_PICRES,
+ (void*)&ioctl_msg) < */0)
{
DEBUG_PRINT_ERROR("\n Set Resolution failed");
eRet = OMX_ErrorUnsupportedSetting;
@@ -3113,17 +2939,15 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
}
else if (portDefn->nBufferCountActual >= drv_ctx.ip_buf.mincount
- || portDefn->nBufferSize != drv_ctx.ip_buf.buffer_size)
+ && portDefn->nBufferSize == drv_ctx.ip_buf.buffer_size)
{
- vdec_allocatorproperty *buffer_prop = &drv_ctx.ip_buf;
drv_ctx.ip_buf.actualcount = portDefn->nBufferCountActual;
- drv_ctx.ip_buf.buffer_size = (portDefn->nBufferSize + buffer_prop->alignment - 1) &
- (~(buffer_prop->alignment - 1));
- eRet = set_buffer_req(buffer_prop);
+ drv_ctx.ip_buf.buffer_size = portDefn->nBufferSize;
+ eRet = set_buffer_req(&drv_ctx.ip_buf);
}
else
{
- DEBUG_PRINT_ERROR("ERROR: IP Requirements(#%d: %u) Requested(#%lu: %lu)\n",
+ DEBUG_PRINT_ERROR("ERROR: IP Requirements(#%d: %u) Requested(#%d: %u)\n",
drv_ctx.ip_buf.mincount, drv_ctx.ip_buf.buffer_size,
portDefn->nBufferCountActual, portDefn->nBufferSize);
eRet = OMX_ErrorBadParameter;
@@ -3148,43 +2972,34 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
if(1 == portFmt->nPortIndex)
{
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height;
- fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width;
- fmt.fmt.pix_mp.pixelformat = capture_capability;
- enum vdec_output_fromat op_format;
- if((portFmt->eColorFormat == (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m) ||
- (portFmt->eColorFormat == OMX_COLOR_FormatYUV420Planar))
- op_format = (enum vdec_output_fromat)VDEC_YUV_FORMAT_NV12;
- else if(portFmt->eColorFormat ==
- (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka)
- op_format = VDEC_YUV_FORMAT_TILE_4x2;
- else
- eRet = OMX_ErrorBadParameter;
+ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height;
+ fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width;
+ fmt.fmt.pix_mp.pixelformat = capture_capability;
+ enum vdec_output_fromat op_format;
+ if(portFmt->eColorFormat == OMX_COLOR_FormatYUV420SemiPlanar)
+ op_format = VDEC_YUV_FORMAT_NV12;
+ else if(portFmt->eColorFormat ==
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka)
+ op_format = VDEC_YUV_FORMAT_TILE_4x2;
+ else
+ eRet = OMX_ErrorBadParameter;
- if(eRet == OMX_ErrorNone)
- {
- drv_ctx.output_format = op_format;
- ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
- if(ret)
- {
- DEBUG_PRINT_ERROR("\n Set output format failed");
- eRet = OMX_ErrorUnsupportedSetting;
- /*TODO: How to handle this case */
- }
- else
- {
- eRet = get_buffer_req(&drv_ctx.op_buf);
- }
- }
- if (eRet == OMX_ErrorNone){
- if (!client_buffers.set_color_format(portFmt->eColorFormat)) {
- DEBUG_PRINT_ERROR("\n Set color format failed");
- eRet = OMX_ErrorBadParameter;
+ if(eRet == OMX_ErrorNone)
+ {
+ drv_ctx.output_format = op_format;
+ ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
+ if(ret)
+ {
+ DEBUG_PRINT_ERROR("\n Set output format failed");
+ eRet = OMX_ErrorUnsupportedSetting;
+ /*TODO: How to handle this case */
}
- }
+ else
+ {
+ eRet = get_buffer_req(&drv_ctx.op_buf);
+ }
+ }
}
}
break;
@@ -3216,7 +3031,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_ERROR("Setparameter: unknown FramePacking format %lu\n",
+ DEBUG_PRINT_ERROR("Setparameter: unknown FramePacking format %d\n",
portFmt->nFramePackingFormat);
eRet = OMX_ErrorUnsupportedSetting;
}
@@ -3333,19 +3148,6 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
eRet =OMX_ErrorUnsupportedSetting;
}
}
- else if(!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.vp8",OMX_MAX_STRINGNAME_SIZE))
- {
- if(!strncmp((const char*)comp_role->cRole,"video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE) ||
- (!strncmp((const char*)comp_role->cRole,"video_decoder.vpx",OMX_MAX_STRINGNAME_SIZE)))
- {
- strlcpy((char*)m_cRole,"video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- }
- else
- {
- DEBUG_PRINT_ERROR("Setparameter: unknown Index %s\n", comp_role->cRole);
- eRet = OMX_ErrorUnsupportedSetting;
- }
- }
else
{
DEBUG_PRINT_ERROR("Setparameter: unknown param %s\n", drv_ctx.kind);
@@ -3417,35 +3219,35 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
QOMX_VIDEO_DECODER_PICTURE_ORDER *pictureOrder =
(QOMX_VIDEO_DECODER_PICTURE_ORDER *)paramData;
- struct v4l2_control control;
- int pic_order,rc=0;
+ enum vdec_output_order pic_order = VDEC_ORDER_DISPLAY;
DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamVideoDecoderPictureOrder %d\n",
pictureOrder->eOutputPictureOrder);
- if (pictureOrder->eOutputPictureOrder == QOMX_VIDEO_DISPLAY_ORDER) {
- pic_order = V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DISPLAY;
- }
- else if (pictureOrder->eOutputPictureOrder == QOMX_VIDEO_DECODE_ORDER){
- pic_order = V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DECODE;
+ if (pictureOrder->eOutputPictureOrder == QOMX_VIDEO_DISPLAY_ORDER)
+ pic_order = VDEC_ORDER_DISPLAY;
+ else if (pictureOrder->eOutputPictureOrder == QOMX_VIDEO_DECODE_ORDER){
+ pic_order = VDEC_ORDER_DECODE;
time_stamp_dts.set_timestamp_reorder_mode(false);
- }
- else
- eRet = OMX_ErrorBadParameter;
- if (eRet == OMX_ErrorNone)
- {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_OUTPUT_ORDER;
- control.value = pic_order;
- rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control);
- if(rc)
- {
- DEBUG_PRINT_ERROR("\n Set picture order failed");
- eRet = OMX_ErrorUnsupportedSetting;
- }
- }
- break;
- }
+ }
+ else
+ eRet = OMX_ErrorBadParameter;
+
+ if (eRet == OMX_ErrorNone && pic_order != drv_ctx.picture_order)
+ {
+ drv_ctx.picture_order = pic_order;
+ // ioctl_msg.in = &drv_ctx.picture_order;
+ //ioctl_msg.out = NULL;
+ if (/*ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_SET_PICTURE_ORDER,
+ (void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\n Set picture order failed");
+ eRet = OMX_ErrorUnsupportedSetting;
+ }
+ }
+ break;
+ }
case OMX_QcomIndexParamConcealMBMapExtraData:
if(!secure_mode)
- eRet = enable_extradata(VDEC_EXTRADATA_MB_ERROR_MAP, false,
+ eRet = enable_extradata(VDEC_EXTRADATA_MB_ERROR_MAP,
((QOMX_ENABLETYPE *)paramData)->bEnable);
else {
DEBUG_PRINT_ERROR("\n secure mode setting not supported");
@@ -3455,7 +3257,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
case OMX_QcomIndexParamFrameInfoExtraData:
{
if(!secure_mode)
- eRet = enable_extradata(OMX_FRAMEINFO_EXTRADATA, false,
+ eRet = enable_extradata(OMX_FRAMEINFO_EXTRADATA,
((QOMX_ENABLETYPE *)paramData)->bEnable);
else {
DEBUG_PRINT_ERROR("\n secure mode setting not supported");
@@ -3465,7 +3267,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
case OMX_QcomIndexParamInterlaceExtraData:
if(!secure_mode)
- eRet = enable_extradata(OMX_INTERLACE_EXTRADATA, false,
+ eRet = enable_extradata(OMX_INTERLACE_EXTRADATA,
((QOMX_ENABLETYPE *)paramData)->bEnable);
else {
DEBUG_PRINT_ERROR("\n secure mode setting not supported");
@@ -3474,7 +3276,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
break;
case OMX_QcomIndexParamH264TimeInfo:
if(!secure_mode)
- eRet = enable_extradata(OMX_TIMEINFO_EXTRADATA, false,
+ eRet = enable_extradata(OMX_TIMEINFO_EXTRADATA,
((QOMX_ENABLETYPE *)paramData)->bEnable);
else {
DEBUG_PRINT_ERROR("\n secure mode setting not supported");
@@ -3484,6 +3286,10 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
case OMX_QcomIndexParamVideoDivx:
{
QOMX_VIDEO_PARAM_DIVXTYPE* divXType = (QOMX_VIDEO_PARAM_DIVXTYPE *) paramData;
+
+#if 0
+ createDivxDrmContext( divXType->pDrmHandle );
+#endif
}
break;
case OMX_QcomIndexPlatformPvt:
@@ -3509,28 +3315,15 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
break;
case OMX_QcomIndexParamVideoSyncFrameDecodingMode:
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamVideoSyncFrameDecodingMode");
- DEBUG_PRINT_HIGH("set idr only decoding for thumbnail mode");
- struct v4l2_control control;
- int rc;
- drv_ctx.idr_only_decoding = 1;
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_OUTPUT_ORDER;
- control.value = V4L2_MPEG_VIDC_VIDEO_OUTPUT_ORDER_DECODE;
- rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control);
- if(rc)
- {
- DEBUG_PRINT_ERROR("\n Set picture order failed");
- eRet = OMX_ErrorUnsupportedSetting;
- } else {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE;
- control.value = V4L2_MPEG_VIDC_VIDEO_SYNC_FRAME_DECODE_ENABLE;
- rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control);
- if(rc)
- {
- DEBUG_PRINT_ERROR("\n Sync frame setting failed");
- eRet = OMX_ErrorUnsupportedSetting;
- }
- }
+ DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamVideoSyncFrameDecodingMode");
+ DEBUG_PRINT_HIGH("set idr only decoding for thumbnail mode");
+ drv_ctx.idr_only_decoding = 1;
+ int rc; //= ioctl(drv_ctx.video_driver_fd,
+ // VDEC_IOCTL_SET_IDR_ONLY_DECODING);
+ if(rc < 0) {
+ DEBUG_PRINT_ERROR("Failed to set IDR only decoding on driver.");
+ eRet = OMX_ErrorHardware;
+ }
}
break;
@@ -3543,25 +3336,19 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
(extradataIndexType->nPortIndex == 1))
{
DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamIndexExtraDataType SmoothStreaming\n");
- eRet = enable_extradata(OMX_PORTDEF_EXTRADATA, false, extradataIndexType->bEnabled);
-
+ eRet = enable_extradata(OMX_PORTDEF_EXTRADATA, extradataIndexType->bEnabled);
+ // Set smooth streaming parameter
+ int rc;// = ioctl(drv_ctx.video_driver_fd,
+ // VDEC_IOCTL_SET_CONT_ON_RECONFIG);
+ if(rc < 0) {
+ DEBUG_PRINT_ERROR("Failed to enable Smooth Streaming on driver.");
+ eRet = OMX_ErrorHardware;
+ }
}
}
}
break;
- case OMX_QcomIndexParamEnableSmoothStreaming:
- {
- struct v4l2_control control;
- struct v4l2_format fmt;
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_CONTINUE_DATA_TRANSFER;
- control.value = 1;
- int rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL,&control);
- if(rc < 0) {
- DEBUG_PRINT_ERROR("Failed to enable Smooth Streaming on driver.");
- eRet = OMX_ErrorHardware;
- }
- }
- break;
+
#if defined (_ANDROID_HONEYCOMB_) || defined (_ANDROID_ICS_)
/* Need to allow following two set_parameters even in Idle
* state. This is ANDROID architecture which is not in sync
@@ -3583,7 +3370,7 @@ OMX_ERRORTYPE omx_vdec::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
case OMX_QcomIndexParamEnableTimeStampReorder:
{
QOMX_INDEXTIMESTAMPREORDER *reorder = (QOMX_INDEXTIMESTAMPREORDER *)paramData;
- if (drv_ctx.picture_order == (vdec_output_order)QOMX_VIDEO_DISPLAY_ORDER) {
+ if (drv_ctx.picture_order == QOMX_VIDEO_DISPLAY_ORDER) {
if (reorder->bEnable == OMX_TRUE) {
frm_int =0;
time_stamp_dts.set_timestamp_reorder_mode(true);
@@ -3634,7 +3421,7 @@ OMX_ERRORTYPE omx_vdec::get_config(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorInvalidState;
}
- switch ((unsigned long)configIndex)
+ switch (configIndex)
{
case OMX_QcomIndexConfigInterlaced:
{
@@ -3674,8 +3461,13 @@ OMX_ERRORTYPE omx_vdec::get_config(OMX_IN OMX_HANDLETYPE hComp,
}
case OMX_QcomIndexQueryNumberOfVideoDecInstance:
{
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
QOMX_VIDEO_QUERY_DECODER_INSTANCES *decoderinstances =
(QOMX_VIDEO_QUERY_DECODER_INSTANCES*)configData;
+ //ioctl_msg.out = (void*)&decoderinstances->nNumOfInstances;
+ //(void)(ioctl(drv_ctx.video_driver_fd,
+ //VDEC_IOCTL_GET_NUMBER_INSTANCES,&ioctl_msg));
+
decoderinstances->nNumOfInstances = 16;
/*TODO: How to handle this case */
break;
@@ -3694,12 +3486,6 @@ OMX_ERRORTYPE omx_vdec::get_config(OMX_IN OMX_HANDLETYPE hComp,
}
break;
}
- case OMX_IndexConfigCommonOutputCrop:
- {
- OMX_CONFIG_RECTTYPE *rect = (OMX_CONFIG_RECTTYPE *) configData;
- memcpy(rect, &rectangle, sizeof(OMX_CONFIG_RECTTYPE));
- break;
- }
default:
{
DEBUG_PRINT_ERROR("get_config: unknown param %d\n",configIndex);
@@ -3745,7 +3531,7 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
return ret;
}
- if (configIndex == (OMX_INDEXTYPE)OMX_IndexVendorVideoExtraData)
+ if (configIndex == OMX_IndexVendorVideoExtraData)
{
OMX_VENDOR_EXTRADATATYPE *config = (OMX_VENDOR_EXTRADATATYPE *) configData;
DEBUG_PRINT_LOW("\n Index OMX_IndexVendorVideoExtraData called");
@@ -3796,7 +3582,7 @@ OMX_ERRORTYPE omx_vdec::set_config(OMX_IN OMX_HANDLETYPE hComp,
len |= *(pSrcBuf + 1);
psize = (uint8 *) & len;
memcpy(pDestBuf + nal_length, pSrcBuf + 2,len);
- for (unsigned int i = 0; i < nal_length; i++)
+ for (int i = 0; i < nal_length; i++)
{
pDestBuf[i] = psize[nal_length - 1 - i];
}
@@ -3989,50 +3775,6 @@ RETURN VALUE
true/false
========================================================================== */
-OMX_ERRORTYPE omx_vdec::allocate_extradata()
-{
-#ifdef USE_ION
- if (drv_ctx.extradata_info.buffer_size) {
- if (drv_ctx.extradata_info.ion.ion_alloc_data.handle) {
- munmap((void *)drv_ctx.extradata_info.uaddr, drv_ctx.extradata_info.size);
- close(drv_ctx.extradata_info.ion.fd_ion_data.fd);
- free_ion_memory(&drv_ctx.extradata_info.ion);
- }
- drv_ctx.extradata_info.size = (drv_ctx.extradata_info.size + 4095) & (~4095);
- drv_ctx.extradata_info.ion.ion_device_fd = alloc_map_ion_memory(
- drv_ctx.extradata_info.count * drv_ctx.extradata_info.size, 4096,
- &drv_ctx.extradata_info.ion.ion_alloc_data,
- &drv_ctx.extradata_info.ion.fd_ion_data, 0);
- if (drv_ctx.extradata_info.ion.ion_device_fd < 0) {
- DEBUG_PRINT_ERROR("Failed to alloc extradata memory\n");
- return OMX_ErrorInsufficientResources;
- }
- drv_ctx.extradata_info.uaddr = (char *)mmap(NULL,
- drv_ctx.extradata_info.size,
- PROT_READ|PROT_WRITE, MAP_SHARED,
- drv_ctx.extradata_info.ion.fd_ion_data.fd , 0);
- if (drv_ctx.extradata_info.uaddr == MAP_FAILED) {
- DEBUG_PRINT_ERROR("Failed to map extradata memory\n");
- close(drv_ctx.extradata_info.ion.fd_ion_data.fd);
- free_ion_memory(&drv_ctx.extradata_info.ion);
- return OMX_ErrorInsufficientResources;
- }
- }
-#endif
- return OMX_ErrorNone;
-}
-
-void omx_vdec::free_extradata() {
-#ifdef USE_ION
- if (drv_ctx.extradata_info.uaddr) {
- munmap((void *)drv_ctx.extradata_info.uaddr, drv_ctx.extradata_info.size);
- close(drv_ctx.extradata_info.ion.fd_ion_data.fd);
- free_ion_memory(&drv_ctx.extradata_info.ion);
- }
- memset(&drv_ctx.extradata_info, 0, sizeof(drv_ctx.extradata_info));
-#endif
-}
-
OMX_ERRORTYPE omx_vdec::use_output_buffer(
OMX_IN OMX_HANDLETYPE hComp,
OMX_INOUT OMX_BUFFERHEADERTYPE** bufferHdr,
@@ -4044,19 +3786,14 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
OMX_ERRORTYPE eRet = OMX_ErrorNone;
OMX_BUFFERHEADERTYPE *bufHdr= NULL; // buffer header
unsigned i= 0; // Temporary counter
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
struct vdec_setbuffer_cmd setbuffers;
OMX_PTR privateAppData = NULL;
private_handle_t *handle = NULL;
OMX_U8 *buff = buffer;
- struct v4l2_buffer buf;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
- int extra_idx = 0;
-
if (!m_out_mem_ptr) {
DEBUG_PRINT_HIGH("Use_op_buf:Allocating output headers");
eRet = allocate_output_headers();
- if (eRet == OMX_ErrorNone)
- eRet = allocate_extradata();
}
if (eRet == OMX_ErrorNone) {
@@ -4069,39 +3806,29 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
}
if(i >= drv_ctx.op_buf.actualcount) {
- DEBUG_PRINT_ERROR("Already using %d o/p buffers\n", drv_ctx.op_buf.actualcount);
eRet = OMX_ErrorInsufficientResources;
}
if (eRet == OMX_ErrorNone) {
#if defined(_ANDROID_HONEYCOMB_) || defined(_ANDROID_ICS_)
if(m_enable_android_native_buffers) {
- if (m_use_android_native_buffers) {
- UseAndroidNativeBufferParams *params = (UseAndroidNativeBufferParams *)appData;
- sp<android_native_buffer_t> nBuf = params->nativeBuffer;
- handle = (private_handle_t *)nBuf->handle;
- privateAppData = params->pAppPrivate;
- } else {
- handle = (private_handle_t *)buff;
- privateAppData = appData;
+ if(m_use_android_native_buffers) {
+ UseAndroidNativeBufferParams *params = (UseAndroidNativeBufferParams *)appData;
+ sp<android_native_buffer_t> nBuf = params->nativeBuffer;
+ handle = (private_handle_t *)nBuf->handle;
+ privateAppData = params->pAppPrivate;
}
-
- if ((OMX_U32)handle->size < drv_ctx.op_buf.buffer_size) {
- DEBUG_PRINT_ERROR("Insufficient sized buffer given for playback,"
- " expected %u, got %lu",
- drv_ctx.op_buf.buffer_size, (OMX_U32)handle->size);
- return OMX_ErrorBadParameter;
- }
-
- if (!m_use_android_native_buffers) {
- if (!secure_mode) {
- buff = (OMX_U8*)mmap(0, handle->size,
- PROT_READ|PROT_WRITE, MAP_SHARED, handle->fd, 0);
- if (buff == MAP_FAILED) {
- DEBUG_PRINT_ERROR("Failed to mmap pmem with fd = %d, size = %d", handle->fd, handle->size);
- return OMX_ErrorInsufficientResources;
- }
- }
+ else {
+ handle = (private_handle_t *)buff;
+ if(!secure_mode) {
+ buff = (OMX_U8*)mmap(0, handle->size,
+ PROT_READ|PROT_WRITE, MAP_SHARED, handle->fd, 0);
+ if (buff == MAP_FAILED) {
+ DEBUG_PRINT_ERROR("Failed to mmap pmem with fd = %d, size = %d", handle->fd, handle->size);
+ return OMX_ErrorInsufficientResources;
+ }
+ }
+ privateAppData = appData;
}
if(!handle) {
DEBUG_PRINT_ERROR("Native Buffer handle is NULL");
@@ -4120,9 +3847,8 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
drv_ctx.op_buf_ion_info[i].ion_device_fd = alloc_map_ion_memory(
drv_ctx.op_buf.buffer_size,drv_ctx.op_buf.alignment,
&drv_ctx.op_buf_ion_info[i].ion_alloc_data,
- &drv_ctx.op_buf_ion_info[i].fd_ion_data, secure_mode ? ION_SECURE : 0);
+ &drv_ctx.op_buf_ion_info[i].fd_ion_data, 0);
if(drv_ctx.op_buf_ion_info[i].ion_device_fd < 0) {
- DEBUG_PRINT_ERROR("ION device fd is bad %d\n", drv_ctx.op_buf_ion_info[i].ion_device_fd);
return OMX_ErrorInsufficientResources;
}
drv_ctx.ptr_outputbuffer[i].pmem_fd = \
@@ -4132,17 +3858,14 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
open (MEM_DEVICE,O_RDWR);
if (drv_ctx.ptr_outputbuffer[i].pmem_fd < 0) {
- DEBUG_PRINT_ERROR("ION/pmem buffer fd is bad %d\n", drv_ctx.ptr_outputbuffer[i].pmem_fd);
return OMX_ErrorInsufficientResources;
}
- /* FIXME: why is this code even here? We already open MEM_DEVICE a few lines above */
if(drv_ctx.ptr_outputbuffer[i].pmem_fd == 0)
{
drv_ctx.ptr_outputbuffer[i].pmem_fd = \
open (MEM_DEVICE,O_RDWR);
if (drv_ctx.ptr_outputbuffer[i].pmem_fd < 0) {
- DEBUG_PRINT_ERROR("ION/pmem buffer fd is bad %d\n", drv_ctx.ptr_outputbuffer[i].pmem_fd);
return OMX_ErrorInsufficientResources;
}
}
@@ -4166,7 +3889,6 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
#ifdef USE_ION
free_ion_memory(&drv_ctx.op_buf_ion_info[i]);
#endif
- DEBUG_PRINT_ERROR("Unable to mmap output buffer\n");
return OMX_ErrorInsufficientResources;
}
}
@@ -4213,61 +3935,20 @@ OMX_ERRORTYPE omx_vdec::use_output_buffer(
memcpy (&setbuffers.buffer,&drv_ctx.ptr_outputbuffer[i],
sizeof (vdec_bufferpayload));
- DEBUG_PRINT_HIGH("\n Set the Output Buffer Idx: %d Addr: %p, pmem_fd=0x%x", i,
- drv_ctx.ptr_outputbuffer[i].bufferaddr,
- drv_ctx.ptr_outputbuffer[i].pmem_fd );
-
- buf.index = i;
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- buf.memory = V4L2_MEMORY_USERPTR;
- plane[0].length = drv_ctx.op_buf.buffer_size;
- plane[0].m.userptr = (unsigned long)drv_ctx.ptr_outputbuffer[i].bufferaddr -
- (unsigned long)drv_ctx.ptr_outputbuffer[i].offset;
- plane[0].reserved[0] = drv_ctx.ptr_outputbuffer[i].pmem_fd;
- plane[0].reserved[1] = drv_ctx.ptr_outputbuffer[i].offset;
- plane[0].data_offset = 0;
- extra_idx = EXTRADATA_IDX(drv_ctx.num_planes);
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- plane[extra_idx].length = drv_ctx.extradata_info.buffer_size;
- plane[extra_idx].m.userptr = (long unsigned int) (drv_ctx.extradata_info.uaddr + i * drv_ctx.extradata_info.buffer_size);
-#ifdef USE_ION
- plane[extra_idx].reserved[0] = drv_ctx.extradata_info.ion.fd_ion_data.fd;
-#endif
- plane[extra_idx].reserved[1] = i * drv_ctx.extradata_info.buffer_size;
- plane[extra_idx].data_offset = 0;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index is more than allowed: %d\n", extra_idx);
- return OMX_ErrorBadParameter;
- }
- buf.m.planes = plane;
- buf.length = drv_ctx.num_planes;
-
- DEBUG_PRINT_LOW("\n Set the Output Buffer Idx: %d Addr: %x", i, drv_ctx.ptr_outputbuffer[i]);
-
- if (ioctl(drv_ctx.video_driver_fd, VIDIOC_PREPARE_BUF, &buf)) {
- DEBUG_PRINT_ERROR("Failed to prepare bufs\n");
- /*TODO: How to handle this case */
- return OMX_ErrorInsufficientResources;
- }
-
- if (i == (drv_ctx.op_buf.actualcount -1) && !streaming[CAPTURE_PORT]) {
- enum v4l2_buf_type buf_type;
- buf_type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- if (ioctl(drv_ctx.video_driver_fd, VIDIOC_STREAMON,&buf_type)) {
- return OMX_ErrorInsufficientResources;
- } else {
- streaming[CAPTURE_PORT] = true;
- DEBUG_PRINT_LOW("\n STREAMON Successful \n ");
- }
- }
-
+ // ioctl_msg.in = &setbuffers;
+ // ioctl_msg.out = NULL;
+
+ DEBUG_PRINT_HIGH("\n Set the Output Buffer Idx: %d Addr: %x, pmem_fd=%0x%x", i,
+ drv_ctx.ptr_outputbuffer[i],drv_ctx.ptr_outputbuffer[i].pmem_fd );
+ // if (ioctl (drv_ctx.video_driver_fd,VDEC_IOCTL_SET_BUFFER,
+ // &ioctl_msg) < 0)
+ // {
+ // DEBUG_PRINT_ERROR("\n Set output buffer failed");
+ // return OMX_ErrorInsufficientResources;
+ // }
+ // found an empty buffer at i
(*bufferHdr)->nAllocLen = drv_ctx.op_buf.buffer_size;
- if (m_enable_android_native_buffers) {
- DEBUG_PRINT_LOW("setting pBuffer to private_handle_t %p", handle);
- (*bufferHdr)->pBuffer = (OMX_U8 *)handle;
- } else {
- (*bufferHdr)->pBuffer = buff;
- }
+ (*bufferHdr)->pBuffer = buff;
(*bufferHdr)->pAppPrivate = privateAppData;
BITMASK_SET(&m_out_bm_count,i);
}
@@ -4323,8 +4004,7 @@ OMX_ERRORTYPE omx_vdec::use_input_heap_buffers(
*bufferHdr = &m_inp_heap_ptr[m_in_alloc_cnt];
eRet = allocate_input_buffer(hComp, &m_phdr_pmem_ptr[m_in_alloc_cnt], port, appData, bytes);
DEBUG_PRINT_HIGH("\n Heap buffer(%p) Pmem buffer(%p)", *bufferHdr, m_phdr_pmem_ptr[m_in_alloc_cnt]);
- if (!m_input_free_q.insert_entry((unsigned)m_phdr_pmem_ptr[m_in_alloc_cnt],
- (unsigned)NULL, (unsigned)NULL))
+ if (!m_input_free_q.insert_entry((unsigned)m_phdr_pmem_ptr[m_in_alloc_cnt], NULL, NULL))
{
DEBUG_PRINT_ERROR("\nERROR:Free_q is full");
return OMX_ErrorInsufficientResources;
@@ -4363,6 +4043,7 @@ OMX_ERRORTYPE omx_vdec::use_buffer(
{
OMX_ERRORTYPE error = OMX_ErrorNone;
struct vdec_setbuffer_cmd setbuffers;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
if (bufferHdr == NULL || bytes == 0)
{
@@ -4445,10 +4126,20 @@ OMX_ERRORTYPE omx_vdec::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
DEBUG_PRINT_LOW("\n Free Input Buffer index = %d",index);
if (drv_ctx.ptr_inputbuffer[index].pmem_fd > 0)
{
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
struct vdec_setbuffer_cmd setbuffers;
setbuffers.buffer_type = VDEC_BUFFER_TYPE_INPUT;
memcpy (&setbuffers.buffer,&drv_ctx.ptr_inputbuffer[index],
sizeof (vdec_bufferpayload));
+ ioctl_msg.in = &setbuffers;
+ ioctl_msg.out = NULL;
+ int ioctl_r; //= ioctl (drv_ctx.video_driver_fd,
+ // VDEC_IOCTL_FREE_BUFFER, &ioctl_msg);
+ if (ioctl_r < 0)
+ {
+ DEBUG_PRINT_ERROR("\nVDEC_IOCTL_FREE_BUFFER returned error %d", ioctl_r);
+ }
+
DEBUG_PRINT_LOW("\n unmap the input buffer fd=%d",
drv_ctx.ptr_inputbuffer[index].pmem_fd);
DEBUG_PRINT_LOW("\n unmap the input buffer size=%d address = %d",
@@ -4491,10 +4182,18 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
DEBUG_PRINT_LOW("\n Free ouput Buffer index = %d addr = %x", index,
drv_ctx.ptr_outputbuffer[index].bufferaddr);
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
struct vdec_setbuffer_cmd setbuffers;
setbuffers.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
memcpy (&setbuffers.buffer,&drv_ctx.ptr_outputbuffer[index],
sizeof (vdec_bufferpayload));
+ ioctl_msg.in = &setbuffers;
+ ioctl_msg.out = NULL;
+ DEBUG_PRINT_LOW("\nRelease the Output Buffer");
+ if (/*ioctl (drv_ctx.video_driver_fd, VDEC_IOCTL_FREE_BUFFER,
+ &ioctl_msg) < */0)
+ DEBUG_PRINT_ERROR("\nRelease output buffer failed in VCD");
+
#ifdef _ANDROID_
if(m_enable_android_native_buffers) {
if(drv_ctx.ptr_outputbuffer[index].pmem_fd > 0) {
@@ -4509,10 +4208,10 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
DEBUG_PRINT_LOW("\n unmap the output buffer fd = %d",
drv_ctx.ptr_outputbuffer[0].pmem_fd);
DEBUG_PRINT_LOW("\n unmap the ouput buffer size=%d address = %d",
- drv_ctx.ptr_outputbuffer[0].mmaped_size * drv_ctx.op_buf.actualcount,
+ drv_ctx.ptr_outputbuffer[0].mmaped_size,
drv_ctx.ptr_outputbuffer[0].bufferaddr);
munmap (drv_ctx.ptr_outputbuffer[0].bufferaddr,
- drv_ctx.ptr_outputbuffer[0].mmaped_size * drv_ctx.op_buf.actualcount);
+ drv_ctx.ptr_outputbuffer[0].mmaped_size);
close (drv_ctx.ptr_outputbuffer[0].pmem_fd);
drv_ctx.ptr_outputbuffer[0].pmem_fd = -1;
#ifdef USE_ION
@@ -4522,9 +4221,6 @@ OMX_ERRORTYPE omx_vdec::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
#ifdef _ANDROID_
}
#endif
- if (release_output_done()) {
- free_extradata();
- }
}
return OMX_ErrorNone;
@@ -4595,10 +4291,9 @@ OMX_ERRORTYPE omx_vdec::allocate_input_heap_buffer(OMX_HANDLETYPE hComp,
input->nInputPortIndex = OMX_CORE_INPUT_PORT_INDEX;
DEBUG_PRINT_LOW("\n Address of Heap Buffer %p",*bufferHdr );
eRet = allocate_input_buffer(hComp,&m_phdr_pmem_ptr [i],port,appData,bytes);
- DEBUG_PRINT_LOW("\n Address of Pmem Buffer %p",m_phdr_pmem_ptr[i]);
+ DEBUG_PRINT_LOW("\n Address of Pmem Buffer %p",m_phdr_pmem_ptr [i] );
/*Add the Buffers to freeq*/
- if (!m_input_free_q.insert_entry((unsigned)m_phdr_pmem_ptr[i],
- (unsigned)NULL, (unsigned)NULL))
+ if (!m_input_free_q.insert_entry((unsigned)m_phdr_pmem_ptr [i],NULL,NULL))
{
DEBUG_PRINT_ERROR("\nERROR:Free_q is full");
return OMX_ErrorInsufficientResources;
@@ -4639,6 +4334,7 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer(
OMX_ERRORTYPE eRet = OMX_ErrorNone;
struct vdec_setbuffer_cmd setbuffers;
OMX_BUFFERHEADERTYPE *input = NULL;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
unsigned i = 0;
unsigned char *buf_addr = NULL;
int pmem_fd = -1;
@@ -4709,7 +4405,7 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer(
drv_ctx.ip_buf_ion_info[i].ion_device_fd = alloc_map_ion_memory(
drv_ctx.ip_buf.buffer_size,drv_ctx.op_buf.alignment,
&drv_ctx.ip_buf_ion_info[i].ion_alloc_data,
- &drv_ctx.ip_buf_ion_info[i].fd_ion_data, secure_mode ? ION_SECURE : 0);
+ &drv_ctx.ip_buf_ion_info[i].fd_ion_data, 0);
if(drv_ctx.ip_buf_ion_info[i].ion_device_fd < 0) {
return OMX_ErrorInsufficientResources;
}
@@ -4780,12 +4476,12 @@ OMX_ERRORTYPE omx_vdec::allocate_input_buffer(
buf.m.planes = &plane;
buf.length = 1;
- DEBUG_PRINT_LOW("\n Set the input Buffer Idx: %d Addr: %x", i, drv_ctx.ptr_inputbuffer[i]);
+ DEBUG_PRINT_LOW("\n Set the Output Buffer Idx: %d Addr: %x", i, drv_ctx.ptr_inputbuffer[i]);
rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_PREPARE_BUF, &buf);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to prepare bufs\n");
+ printf("Failed to prepare bufs\n");
/*TODO: How to handle this case */
return OMX_ErrorInsufficientResources;
}
@@ -4842,8 +4538,8 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
OMX_ERRORTYPE eRet = OMX_ErrorNone;
OMX_BUFFERHEADERTYPE *bufHdr= NULL; // buffer header
unsigned i= 0; // Temporary counter
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
struct vdec_setbuffer_cmd setbuffers;
- int extra_idx = 0;
#ifdef USE_ION
int ion_device_fd =-1;
struct ion_allocation_data ion_alloc_data;
@@ -4887,7 +4583,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
ion_device_fd = alloc_map_ion_memory(
drv_ctx.op_buf.buffer_size * drv_ctx.op_buf.actualcount,
drv_ctx.op_buf.alignment,
- &ion_alloc_data, &fd_ion_data, secure_mode ? ION_SECURE : 0);
+ &ion_alloc_data, &fd_ion_data, 0);
if (ion_device_fd < 0) {
return OMX_ErrorInsufficientResources;
}
@@ -5003,7 +4699,6 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
bufHdr->pPlatformPrivate = pPlatformList;
drv_ctx.ptr_outputbuffer[i].pmem_fd = pmem_fd;
- m_pmem_info[i].pmem_fd = pmem_fd;
#ifdef USE_ION
drv_ctx.op_buf_ion_info[i].ion_device_fd = ion_device_fd;
drv_ctx.op_buf_ion_info[i].ion_alloc_data = ion_alloc_data;
@@ -5030,7 +4725,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
}
else
{
- DEBUG_PRINT_ERROR("Output buf mem alloc failed[0x%p][0x%p]\n",\
+ DEBUG_PRINT_ERROR("Output buf mem alloc failed[0x%x][0x%x]\n",\
m_out_mem_ptr, pPtr);
if(m_out_mem_ptr)
{
@@ -5061,8 +4756,6 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
#endif
eRet = OMX_ErrorInsufficientResources;
}
- if (eRet == OMX_ErrorNone)
- eRet = allocate_extradata();
}
for(i=0; i< drv_ctx.op_buf.actualcount; i++)
@@ -5079,7 +4772,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
if(i < drv_ctx.op_buf.actualcount)
{
struct v4l2_buffer buf;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
+ struct v4l2_plane plane;
int rc;
m_pmem_info[i].offset = drv_ctx.ptr_outputbuffer[i].offset;
@@ -5095,33 +4788,20 @@ OMX_ERRORTYPE omx_vdec::allocate_output_buffer(
buf.index = i;
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
buf.memory = V4L2_MEMORY_USERPTR;
- plane[0].length = drv_ctx.op_buf.buffer_size;
- plane[0].m.userptr = (unsigned long)drv_ctx.ptr_outputbuffer[i].bufferaddr -
- (unsigned long)drv_ctx.ptr_outputbuffer[i].offset;
-#ifdef USE_ION
- plane[0].reserved[0] = drv_ctx.op_buf_ion_info[i].fd_ion_data.fd;
-#endif
- plane[0].reserved[1] = drv_ctx.ptr_outputbuffer[i].offset;
- plane[0].data_offset = 0;
- extra_idx = EXTRADATA_IDX(drv_ctx.num_planes);
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- plane[extra_idx].length = drv_ctx.extradata_info.buffer_size;
- plane[extra_idx].m.userptr = (long unsigned int) (drv_ctx.extradata_info.uaddr + i * drv_ctx.extradata_info.buffer_size);
+ plane.length = drv_ctx.op_buf.buffer_size;
+ plane.m.userptr = (unsigned long)(drv_ctx.ptr_outputbuffer[i].bufferaddr-drv_ctx.ptr_outputbuffer[i].offset);
#ifdef USE_ION
- plane[extra_idx].reserved[0] = drv_ctx.extradata_info.ion.fd_ion_data.fd;
+ plane.reserved[0] = drv_ctx.op_buf_ion_info[i].fd_ion_data.fd;
#endif
- plane[extra_idx].reserved[1] = i * drv_ctx.extradata_info.buffer_size;
- plane[extra_idx].data_offset = 0;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index higher than allowed: %d\n", extra_idx);
- return OMX_ErrorBadParameter;
- }
- buf.m.planes = plane;
- buf.length = drv_ctx.num_planes;
- DEBUG_PRINT_LOW("\n Set the Output Buffer Idx: %d Addr: %p", i, drv_ctx.ptr_outputbuffer[i].bufferaddr);
- rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_PREPARE_BUF, &buf);
- if (rc) {
- /*TODO: How to handle this case */
+ plane.reserved[1] = drv_ctx.ptr_outputbuffer[i].offset;
+ plane.data_offset = 0;
+ buf.m.planes = &plane;
+ buf.length = 1;
+
+ DEBUG_PRINT_LOW("\n Set the Output Buffer Idx: %d Addr: %x", i, drv_ctx.ptr_outputbuffer[i]);
+ rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_PREPARE_BUF, &buf);
+ if (rc) {
+ /*TODO: How to handle this case */
return OMX_ErrorInsufficientResources;
}
@@ -5196,8 +4876,7 @@ OMX_ERRORTYPE omx_vdec::allocate_buffer(OMX_IN OMX_HANDLETYPE hC
}
else if(port == OMX_CORE_OUTPUT_PORT_INDEX)
{
- eRet = client_buffers.allocate_buffers_color_convert(hComp,bufferHdr,port,
- appData,bytes);
+ eRet = allocate_output_buffer(hComp,bufferHdr,port,appData,bytes);
}
else
{
@@ -5271,7 +4950,7 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
else if((m_inp_bEnabled == OMX_FALSE && port == OMX_CORE_INPUT_PORT_INDEX)||
(m_out_bEnabled == OMX_FALSE && port == OMX_CORE_OUTPUT_PORT_INDEX))
{
- DEBUG_PRINT_LOW("Free Buffer while port %lu disabled\n", port);
+ DEBUG_PRINT_LOW("Free Buffer while port %d disabled\n", port);
}
else if(m_state == OMX_StateExecuting || m_state == OMX_StatePause)
{
@@ -5350,14 +5029,14 @@ OMX_ERRORTYPE omx_vdec::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
else if(port == OMX_CORE_OUTPUT_PORT_INDEX)
{
// check if the buffer is valid
- nPortIndex = buffer - client_buffers.get_il_buf_hdr();
+ nPortIndex = buffer - (OMX_BUFFERHEADERTYPE*)m_out_mem_ptr;
if(nPortIndex < drv_ctx.op_buf.actualcount)
{
DEBUG_PRINT_LOW("free_buffer on o/p port - Port idx %d \n", nPortIndex);
// Clear the bit associated with it.
BITMASK_CLEAR(&m_out_bm_count,nPortIndex);
m_out_bPopulated = OMX_FALSE;
- client_buffers.free_output_buffer (buffer);
+ free_output_buffer (buffer);
if (release_output_done())
{
@@ -5442,7 +5121,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
if (buffer->nInputPortIndex != OMX_CORE_INPUT_PORT_INDEX)
{
- DEBUG_PRINT_ERROR("\nERROR:ETB invalid port in header %lu", buffer->nInputPortIndex);
+ DEBUG_PRINT_ERROR("\nERROR:ETB invalid port in header %d", buffer->nInputPortIndex);
return OMX_ErrorBadPortIndex;
}
@@ -5479,7 +5158,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
m_inp_mem_ptr[nBufferIndex].nTimeStamp = m_inp_heap_ptr[nBufferIndex].nTimeStamp;
m_inp_mem_ptr[nBufferIndex].nFlags = m_inp_heap_ptr[nBufferIndex].nFlags;
buffer = &m_inp_mem_ptr[nBufferIndex];
- DEBUG_PRINT_LOW("Non-Arbitrary mode - buffer address is: malloc %p, pmem%p in Index %d, buffer %p of size %lu",
+ DEBUG_PRINT_LOW("Non-Arbitrary mode - buffer address is: malloc %p, pmem%p in Index %d, buffer %p of size %d",
&m_inp_heap_ptr[nBufferIndex], &m_inp_mem_ptr[nBufferIndex],nBufferIndex, buffer, buffer->nFilledLen);
}
else{
@@ -5532,6 +5211,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
OMX_ERRORTYPE ret = OMX_ErrorNone;
struct vdec_input_frameinfo frameinfo;
struct vdec_bufferpayload *temp_buffer;
+ struct vdec_ioctl_msg ioctl_msg;
struct vdec_seqheader seq_header;
bool port_setting_changed = true;
bool not_coded_vop = false;
@@ -5573,7 +5253,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
not_coded_vop = mp4_headerparser.is_notcodec_vop(
(buffer->pBuffer + buffer->nOffset),buffer->nFilledLen);
if(not_coded_vop) {
- DEBUG_PRINT_HIGH("\n Found Not coded vop len %lu frame number %u",
+ DEBUG_PRINT_HIGH("\n Found Not coded vop len %d frame number %d",
buffer->nFilledLen,frame_count);
if(buffer->nFlags & OMX_BUFFERFLAG_EOS){
DEBUG_PRINT_HIGH("\n Eos and Not coded Vop set len to zero");
@@ -5643,7 +5323,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
extract_demux_addr_offsets(buffer);
}
- DEBUG_PRINT_LOW("ETB: handle_demux_data - entries=%lu",m_demux_entries);
+ DEBUG_PRINT_LOW("ETB: handle_demux_data - entries=%d",m_demux_entries);
handle_demux_data(buffer);
frameinfo.desc_addr = (OMX_U8 *)m_desc_buffer_ptr[nPortIndex].buf_addr;
frameinfo.desc_size = m_desc_buffer_ptr[nPortIndex].desc_data_size;
@@ -5704,15 +5384,13 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
memset(m_demux_offsets, 0, ( sizeof(OMX_U32) * 8192) );
m_demux_entries = 0;
}
- struct v4l2_buffer buf;
- struct v4l2_plane plane;
- memset( (void *)&buf, 0, sizeof(buf));
- memset( (void *)&plane, 0, sizeof(plane));
- int rc;
- unsigned long print_count;
+ struct v4l2_buffer buf = {0};
+ struct v4l2_plane plane;
+ int rc;
+ unsigned long print_count;
if (temp_buffer->buffer_len == 0 || (buffer->nFlags & OMX_BUFFERFLAG_EOS))
{ buf.flags = V4L2_BUF_FLAG_EOS;
- DEBUG_PRINT_HIGH("\n INPUT EOS reached \n") ;
+ printf("\n INPUT EOS reached \n") ;
}
OMX_ERRORTYPE eRet = OMX_ErrorNone;
buf.index = nPortIndex;
@@ -5720,41 +5398,29 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE h
buf.memory = V4L2_MEMORY_USERPTR;
plane.bytesused = temp_buffer->buffer_len;
plane.length = drv_ctx.ip_buf.buffer_size;
- plane.m.userptr = (unsigned long)temp_buffer->bufferaddr -
- (unsigned long)temp_buffer->offset;
+ plane.m.userptr = (unsigned long)(temp_buffer->bufferaddr-temp_buffer->offset);
plane.reserved[0] = temp_buffer->pmem_fd;
plane.reserved[1] = temp_buffer->offset;
plane.data_offset = 0;
buf.m.planes = &plane;
buf.length = 1;
- if (frameinfo.timestamp >= LLONG_MAX) {
- buf.flags |= V4L2_QCOM_BUF_TIMESTAMP_INVALID;
- }
- //assumption is that timestamp is in milliseconds
- buf.timestamp.tv_sec = frameinfo.timestamp / 1000000;
- buf.timestamp.tv_usec = (frameinfo.timestamp % 1000000);
- buf.flags |= (buffer->nFlags & OMX_BUFFERFLAG_CODECCONFIG) ? V4L2_QCOM_BUF_FLAG_CODECCONFIG: 0;
-
rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_QBUF, &buf);
- if(rc)
- {
- DEBUG_PRINT_ERROR("Failed to qbuf Input buffer to driver\n");
- return OMX_ErrorHardware;
- }
if(!streaming[OUTPUT_PORT])
{
enum v4l2_buf_type buf_type;
int ret,r;
-
buf_type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
ret=ioctl(drv_ctx.video_driver_fd, VIDIOC_STREAMON,&buf_type);
if(!ret) {
- DEBUG_PRINT_HIGH("Streamon on OUTPUT Plane was successful \n");
+ printf("Streamon on OUTPUT Plane was successful \n");
streaming[OUTPUT_PORT] = true;
+ ret = pthread_create(&async_thread_id,0,async_message_thread,this);
+ if(ret < 0)
+ printf("\n Failed to create async_message_thread \n");
} else{
/*TODO: How to handle this case */
- DEBUG_PRINT_ERROR(" \n Failed to call streamon on OUTPUT \n");
+ printf(" \n Failed to call streamon on OUTPUT \n");
}
}
DEBUG_PRINT_LOW("[ETBP] pBuf(%p) nTS(%lld) Sz(%d)",
@@ -5795,20 +5461,19 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorIncorrectStateOperation;
}
- if (buffer == NULL ||
- ((buffer - client_buffers.get_il_buf_hdr()) >= drv_ctx.op_buf.actualcount))
+ if (buffer == NULL || ((buffer - m_out_mem_ptr) >= drv_ctx.op_buf.actualcount))
{
return OMX_ErrorBadParameter;
}
if (buffer->nOutputPortIndex != OMX_CORE_OUTPUT_PORT_INDEX)
{
- DEBUG_PRINT_ERROR("\nERROR:FTB invalid port in header %lu", buffer->nOutputPortIndex);
+ DEBUG_PRINT_ERROR("\nERROR:FTB invalid port in header %d", buffer->nOutputPortIndex);
return OMX_ErrorBadPortIndex;
}
DEBUG_PRINT_LOW("[FTB] bufhdr = %p, bufhdr->pBuffer = %p", buffer, buffer->pBuffer);
- post_event((unsigned) hComp, (unsigned)buffer, m_fill_output_msg);
+ post_event((unsigned) hComp, (unsigned)buffer,OMX_COMPONENT_GENERATE_FTB);
return OMX_ErrorNone;
}
/* ======================================================================
@@ -5831,15 +5496,17 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer_proxy(
OMX_IN OMX_BUFFERHEADERTYPE* bufferAdd)
{
OMX_ERRORTYPE nRet = OMX_ErrorNone;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
OMX_BUFFERHEADERTYPE *buffer = bufferAdd;
unsigned nPortIndex = 0;
struct vdec_fillbuffer_cmd fillbuffer;
struct vdec_bufferpayload *ptr_outputbuffer = NULL;
struct vdec_output_frameinfo *ptr_respbuffer = NULL;
- nPortIndex = buffer-((OMX_BUFFERHEADERTYPE *)client_buffers.get_il_buf_hdr());
+ nPortIndex = buffer-((OMX_BUFFERHEADERTYPE *)m_out_mem_ptr);
- if (bufferAdd == NULL || nPortIndex > drv_ctx.op_buf.actualcount)
+ if (bufferAdd == NULL || ((buffer - m_out_mem_ptr) >
+ drv_ctx.op_buf.actualcount) )
return OMX_ErrorBadParameter;
DEBUG_PRINT_LOW("\n FTBProxy: bufhdr = %p, bufhdr->pBuffer = %p",
@@ -5853,7 +5520,6 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer_proxy(
return OMX_ErrorNone;
}
pending_output_buffers++;
- buffer = client_buffers.get_dr_buf_hdr(bufferAdd);
ptr_respbuffer = (struct vdec_output_frameinfo*)buffer->pOutputPortPrivate;
if (ptr_respbuffer)
{
@@ -5869,49 +5535,31 @@ OMX_ERRORTYPE omx_vdec::fill_this_buffer_proxy(
return OMX_ErrorBadParameter;
}
- /* memcpy (&fillbuffer.buffer,ptr_outputbuffer,
+ // memcpy (&fillbuffer.buffer,ptr_outputbuffer,\
sizeof(struct vdec_bufferpayload));
- fillbuffer.client_data = bufferAdd;*/
+ // fillbuffer.client_data = bufferAdd;
int rc = 0;
- struct v4l2_buffer buf;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
- memset( (void *)&buf, 0, sizeof(buf));
- memset( (void *)plane, 0, (sizeof(struct v4l2_plane)*VIDEO_MAX_PLANES));
- int extra_idx = 0;
-
- buf.index = nPortIndex;
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- buf.memory = V4L2_MEMORY_USERPTR;
- plane[0].bytesused = buffer->nFilledLen;
- plane[0].length = drv_ctx.op_buf.buffer_size;
- plane[0].m.userptr =
- (unsigned long)drv_ctx.ptr_outputbuffer[nPortIndex].bufferaddr -
- (unsigned long)drv_ctx.ptr_outputbuffer[nPortIndex].offset;
- plane[0].reserved[0] = drv_ctx.ptr_outputbuffer[nPortIndex].pmem_fd;
- plane[0].reserved[1] = drv_ctx.ptr_outputbuffer[nPortIndex].offset;
- plane[0].data_offset = 0;
- extra_idx = EXTRADATA_IDX(drv_ctx.num_planes);
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- plane[extra_idx].bytesused = 0;
- plane[extra_idx].length = drv_ctx.extradata_info.buffer_size;
- plane[extra_idx].m.userptr = (long unsigned int) (drv_ctx.extradata_info.uaddr + nPortIndex * drv_ctx.extradata_info.buffer_size);
-#ifdef USE_ION
- plane[extra_idx].reserved[0] = drv_ctx.extradata_info.ion.fd_ion_data.fd;
-#endif
- plane[extra_idx].reserved[1] = nPortIndex * drv_ctx.extradata_info.buffer_size;
- plane[extra_idx].data_offset = 0;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index higher than expected: %d\n", extra_idx);
- return OMX_ErrorBadParameter;
- }
- buf.m.planes = plane;
- buf.length = drv_ctx.num_planes;
- rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_QBUF, &buf);
- if (rc) {
- /*TODO: How to handle this case */
- DEBUG_PRINT_ERROR("Failed to qbuf to driver");
- }
+ struct v4l2_buffer buf={0};
+ struct v4l2_plane plane;
+
+ buf.index = nPortIndex;
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ buf.memory = V4L2_MEMORY_USERPTR;
+ plane.bytesused = buffer->nFilledLen;
+ plane.length = drv_ctx.op_buf.buffer_size;
+ plane.m.userptr = (unsigned long)(drv_ctx.ptr_outputbuffer[nPortIndex].bufferaddr-drv_ctx.ptr_outputbuffer[nPortIndex].offset);
+ plane.reserved[0] = drv_ctx.ptr_outputbuffer[nPortIndex].pmem_fd;
+ plane.reserved[1] = drv_ctx.ptr_outputbuffer[nPortIndex].offset;
+ plane.data_offset = 0;
+ buf.m.planes = &plane;
+ buf.length = 1;
+
+ rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_QBUF, &buf);
+ if (rc) {
+ /*TODO: How to handle this case */
+ printf("Failed to qbuf to driver");
+ }
//m_cb.FillBufferDone (hComp,m_app_data,buffer);
// pending_output_buffers--;
// return OMX_ErrorBadParameter;
@@ -5969,7 +5617,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
}
#endif //_ANDROID_
- unsigned i = 0;
+ int i = 0;
if (OMX_StateLoaded != m_state)
{
DEBUG_PRINT_ERROR("WARNING:Rxd DeInit,OMX not in LOADED state %d\n",\
@@ -5985,7 +5633,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
if(m_out_mem_ptr)
{
DEBUG_PRINT_LOW("Freeing the Output Memory\n");
- for (i = 0; i < drv_ctx.op_buf.actualcount; i++ )
+ for (i=0; i < drv_ctx.op_buf.actualcount; i++ )
{
free_output_buffer (&m_out_mem_ptr[i]);
}
@@ -5995,7 +5643,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
if(m_inp_mem_ptr || m_inp_heap_ptr)
{
DEBUG_PRINT_LOW("Freeing the Input Memory\n");
- for (i = 0; i<drv_ctx.ip_buf.actualcount; i++ )
+ for (i=0; i<drv_ctx.ip_buf.actualcount; i++ )
{
if (m_inp_mem_ptr)
free_input_buffer (i,&m_inp_mem_ptr[i]);
@@ -6051,8 +5699,7 @@ OMX_ERRORTYPE omx_vdec::component_deinit(OMX_IN OMX_HANDLETYPE hComp)
fclose (inputBufferFile1);
#endif
#ifdef OUTPUT_BUFFER_LOG
- if (outputBufferFile1)
- fclose (outputBufferFile1);
+ fclose (outputBufferFile1);
#endif
#ifdef OUTPUT_EXTRADATA_LOG
fclose (outputExtradataFile);
@@ -6240,19 +5887,6 @@ OMX_ERRORTYPE omx_vdec::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
eRet = OMX_ErrorNoMore;
}
}
- else if(!strncmp(drv_ctx.kind, "OMX.qcom.video.decoder.vp8",OMX_MAX_STRINGNAME_SIZE))
- {
- if((0 == index) && role)
- {
- strlcpy((char *)role, "video_decoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
- }
- else
- {
- DEBUG_PRINT_LOW("\n No more roles \n");
- eRet = OMX_ErrorNoMore;
- }
- }
else
{
DEBUG_PRINT_ERROR("\nERROR:Querying Role on Unknown Component\n");
@@ -6524,8 +6158,7 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
{
DEBUG_PRINT_HIGH("\n Output EOS has been reached");
if (!output_flush_progress)
- post_event((unsigned)NULL, (unsigned)NULL,
- OMX_COMPONENT_GENERATE_EOS_DONE);
+ post_event(NULL,NULL,OMX_COMPONENT_GENERATE_EOS_DONE);
if (psource_frame)
{
@@ -6535,70 +6168,33 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
if (pdest_frame)
{
pdest_frame->nFilledLen = 0;
- m_input_free_q.insert_entry((unsigned) pdest_frame,(unsigned)NULL,
- (unsigned)NULL);
+ m_input_free_q.insert_entry((unsigned) pdest_frame,NULL,NULL);
pdest_frame = NULL;
}
}
DEBUG_PRINT_LOW("\n In fill Buffer done call address %p ",buffer);
#ifdef OUTPUT_BUFFER_LOG
- if (outputBufferFile1 && buffer->nFilledLen)
- {
- int buf_index = buffer - m_out_mem_ptr;
- int stride = drv_ctx.video_resolution.stride;
- int scanlines = drv_ctx.video_resolution.scan_lines;
- char *temp = (char *)drv_ctx.ptr_outputbuffer[buf_index].bufferaddr;
- int i;
- int bytes_written = 0;
- for (i = 0; i < drv_ctx.video_resolution.frame_height; i++) {
- bytes_written = fwrite(temp, drv_ctx.video_resolution.frame_width, 1, outputBufferFile1);
- temp += stride;
- }
- temp = (char *)drv_ctx.ptr_outputbuffer[buf_index].bufferaddr + stride * scanlines;
- int stride_c = stride;
- for(i = 0; i < drv_ctx.video_resolution.frame_height/2; i++) {
- bytes_written += fwrite(temp, drv_ctx.video_resolution.frame_width, 1, outputBufferFile1);
- temp += stride_c;
- }
+ if (outputBufferFile1)
+ {
+ fwrite (buffer->pBuffer,1,buffer->nFilledLen,
+ outputBufferFile1);
}
#endif
/* For use buffer we need to copy the data */
if (!output_flush_progress)
{
- /* This is the error check for non-recoverable errros */
- if (buffer->nFilledLen > 0)
- time_stamp_dts.get_next_timestamp(buffer,
- (drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
- ?true:false);
- else {
- m_inp_err_count++;
- time_stamp_dts.remove_time_stamp(
- buffer->nTimeStamp,
- (drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
- ?true:false);
- }
- if (m_debug_timestamp)
- {
- {
- OMX_TICKS expected_ts = 0;
- m_timestamp_list.pop_min_ts(expected_ts);
- DEBUG_PRINT_LOW("\n Current timestamp (%lld),Popped TIMESTAMP (%lld) from list",
- buffer->nTimeStamp, expected_ts);
-
- if (buffer->nTimeStamp != expected_ts)
- {
- DEBUG_PRINT_ERROR("\n ERROR in omx_vdec::async_message_process timestamp Check");
- }
- }
- }
+ time_stamp_dts.get_next_timestamp(buffer,
+ (drv_ctx.interlace != VDEC_InterlaceFrameProgressive)
+ ?true:false);
}
if (m_cb.FillBufferDone)
{
if (buffer->nFilledLen > 0)
{
- handle_extradata(buffer);
+ if (client_extradata)
+ handle_extradata(buffer);
if (client_extradata & OMX_TIMEINFO_EXTRADATA)
// Keep min timestamp interval to handle corrupted bit stream scenario
set_frame_rate(buffer->nTimeStamp);
@@ -6657,16 +6253,9 @@ OMX_ERRORTYPE omx_vdec::fill_buffer_done(OMX_HANDLETYPE hComp,
pPMEMInfo = (OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO *)
((OMX_QCOM_PLATFORM_PRIVATE_LIST *)
buffer->pPlatformPrivate)->entryList->entry;
- DEBUG_PRINT_LOW("\n Before FBD callback Accessed Pmeminfo %lu",pPMEMInfo->pmem_fd);
- OMX_BUFFERHEADERTYPE *il_buffer;
- il_buffer = client_buffers.get_il_buf_hdr(buffer);
- if (il_buffer)
- m_cb.FillBufferDone (hComp,m_app_data,il_buffer);
- else {
- DEBUG_PRINT_ERROR("Invalid buffer address from get_il_buf_hdr");
- return OMX_ErrorBadParameter;
- }
- DEBUG_PRINT_LOW("\n After Fill Buffer Done callback %lu",pPMEMInfo->pmem_fd);
+ DEBUG_PRINT_LOW("\n Before FBD callback Accessed Pmeminfo %d",pPMEMInfo->pmem_fd);
+ m_cb.FillBufferDone (hComp,m_app_data,buffer);
+ DEBUG_PRINT_LOW("\n After Fill Buffer Done callback %d",pPMEMInfo->pmem_fd);
}
else
{
@@ -6704,8 +6293,7 @@ OMX_ERRORTYPE omx_vdec::empty_buffer_done(OMX_HANDLETYPE hComp,
{
DEBUG_PRINT_LOW("\n Push buffer into freeq address of Buffer %p",buffer);
buffer->nFilledLen = 0;
- if (!m_input_free_q.insert_entry((unsigned)buffer,
- (unsigned)NULL, (unsigned)NULL))
+ if (!m_input_free_q.insert_entry((unsigned)buffer,NULL,NULL))
{
DEBUG_PRINT_ERROR("\nERROR:i/p free Queue is FULL Error");
}
@@ -6722,12 +6310,13 @@ OMX_ERRORTYPE omx_vdec::empty_buffer_done(OMX_HANDLETYPE hComp,
return OMX_ErrorNone;
}
+
int omx_vdec::async_message_process (void *context, void* message)
{
omx_vdec* omx = NULL;
struct vdec_msginfo *vdec_msg = NULL;
OMX_BUFFERHEADERTYPE* omxhdr = NULL;
- struct v4l2_buffer *v4l2_buf_ptr = NULL;
+ struct v4l2_buffer *v4l2_buf_ptr=NULL;
struct vdec_output_frameinfo *output_respbuf = NULL;
int rc=1;
if (context == NULL || message == NULL)
@@ -6739,47 +6328,66 @@ int omx_vdec::async_message_process (void *context, void* message)
omx = reinterpret_cast<omx_vdec*>(context);
+#ifdef _ANDROID_
+ if (omx->m_debug_timestamp)
+ {
+ if ( (vdec_msg->msgcode == VDEC_MSG_RESP_OUTPUT_BUFFER_DONE) &&
+ !(omx->output_flush_progress) )
+ {
+ OMX_TICKS expected_ts = 0;
+ omx->m_timestamp_list.pop_min_ts(expected_ts);
+ DEBUG_PRINT_LOW("\n Current timestamp (%lld),Popped TIMESTAMP (%lld) from list",
+ vdec_msg->msgdata.output_frame.time_stamp, expected_ts);
+
+ if (vdec_msg->msgdata.output_frame.time_stamp != expected_ts)
+ {
+ DEBUG_PRINT_ERROR("\n ERROR in omx_vdec::async_message_process timestamp Check");
+ }
+ }
+ }
+#endif
+
switch (vdec_msg->msgcode)
{
case VDEC_MSG_EVT_HW_ERROR:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_HARDWARE_ERROR);
break;
case VDEC_MSG_RESP_START_DONE:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_START_DONE);
break;
case VDEC_MSG_RESP_STOP_DONE:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_STOP_DONE);
break;
case VDEC_MSG_RESP_RESUME_DONE:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_RESUME_DONE);
break;
case VDEC_MSG_RESP_PAUSE_DONE:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_PAUSE_DONE);
break;
case VDEC_MSG_RESP_FLUSH_INPUT_DONE:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_EVENT_INPUT_FLUSH);
break;
case VDEC_MSG_RESP_FLUSH_OUTPUT_DONE:
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
+ omx->post_event (NULL,vdec_msg->status_code,\
OMX_COMPONENT_GENERATE_EVENT_OUTPUT_FLUSH);
break;
case VDEC_MSG_RESP_INPUT_FLUSHED:
case VDEC_MSG_RESP_INPUT_BUFFER_DONE:
- /* omxhdr = (OMX_BUFFERHEADERTYPE* )
- vdec_msg->msgdata.input_frame_clientdata; */
+ // omxhdr = (OMX_BUFFERHEADERTYPE* ) \
+ // vdec_msg->msgdata.input_frame_clientdata;
v4l2_buf_ptr = (v4l2_buffer*)vdec_msg->msgdata.input_frame_clientdata;
omxhdr=omx->m_inp_mem_ptr+v4l2_buf_ptr->index;
@@ -6822,7 +6430,7 @@ int omx_vdec::async_message_process (void *context, void* message)
{
omxhdr->nFilledLen = vdec_msg->msgdata.output_frame.len;
omxhdr->nOffset = vdec_msg->msgdata.output_frame.offset;
- omxhdr->nTimeStamp = vdec_msg->msgdata.output_frame.time_stamp;
+ omxhdr->nTimeStamp = omx->m_out_mem_ptr[v4l2_buf_ptr->index].nTimeStamp;
omxhdr->nFlags = omx->m_out_mem_ptr[v4l2_buf_ptr->index].nFlags;
if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_EOS)
@@ -6830,46 +6438,29 @@ int omx_vdec::async_message_process (void *context, void* message)
omxhdr->nFlags |= OMX_BUFFERFLAG_EOS;
//rc = -1;
}
- if (v4l2_buf_ptr->flags & V4L2_QCOM_BUF_FLAG_EOSEQ)
- {
- omxhdr->nFlags |= QOMX_VIDEO_BUFFERFLAG_EOSEQ;
- }
- vdec_msg->msgdata.output_frame.bufferaddr =
- omx->drv_ctx.ptr_outputbuffer[v4l2_buf_ptr->index].bufferaddr;
- if (omxhdr->nFilledLen && (((unsigned)omx->rectangle.nLeft !=
- vdec_msg->msgdata.output_frame.framesize.left)
- || ((unsigned)omx->rectangle.nTop != vdec_msg->msgdata.output_frame.framesize.top)
- || (omx->rectangle.nWidth != vdec_msg->msgdata.output_frame.framesize.right)
- || (omx->rectangle.nHeight != vdec_msg->msgdata.output_frame.framesize.bottom))) {
- omx->rectangle.nLeft = vdec_msg->msgdata.output_frame.framesize.left;
- omx->rectangle.nTop = vdec_msg->msgdata.output_frame.framesize.top;
- omx->rectangle.nWidth = vdec_msg->msgdata.output_frame.framesize.right;
- omx->rectangle.nHeight = vdec_msg->msgdata.output_frame.framesize.bottom;
- DEBUG_PRINT_HIGH("\n Crop information has changed\n");
- omx->post_event (OMX_CORE_OUTPUT_PORT_INDEX, OMX_IndexConfigCommonOutputCrop,
- OMX_COMPONENT_GENERATE_PORT_RECONFIG);
- }
+ vdec_msg->msgdata.output_frame.bufferaddr=omx->drv_ctx.ptr_outputbuffer[v4l2_buf_ptr->index].bufferaddr;
output_respbuf = (struct vdec_output_frameinfo *)\
omxhdr->pOutputPortPrivate;
+ // output_respbuf->framesize.bottom =
+ // vdec_msg->msgdata.output_frame.framesize.bottom;
+ // output_respbuf->framesize.left =
+ // vdec_msg->msgdata.output_frame.framesize.left;
+ // output_respbuf->framesize.right =
+ // vdec_msg->msgdata.output_frame.framesize.right;
+ // output_respbuf->framesize.top =
+ // vdec_msg->msgdata.output_frame.framesize.top;
output_respbuf->len = vdec_msg->msgdata.output_frame.len;
output_respbuf->offset = vdec_msg->msgdata.output_frame.offset;
- if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_KEYFRAME)
- {
- output_respbuf->pic_type = PICTURE_TYPE_I;
- }
- if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_PFRAME)
- {
- output_respbuf->pic_type = PICTURE_TYPE_P;
- }
- if (v4l2_buf_ptr->flags & V4L2_BUF_FLAG_BFRAME) {
- output_respbuf->pic_type = PICTURE_TYPE_B;
- }
+ // output_respbuf->time_stamp = vdec_msg->msgdata.output_frame.time_stamp;
+ // output_respbuf->flags = vdec_msg->msgdata.output_frame.flags;
+ // output_respbuf->pic_type = vdec_msg->msgdata.output_frame.pic_type;
+ // output_respbuf->interlaced_format = vdec_msg->msgdata.output_frame.interlaced_format;
if (omx->output_use_buffer)
- memcpy ( omxhdr->pBuffer, (void *)
- ((unsigned long)vdec_msg->msgdata.output_frame.bufferaddr +
- (unsigned long)vdec_msg->msgdata.output_frame.offset),
- vdec_msg->msgdata.output_frame.len);
+ memcpy ( omxhdr->pBuffer,
+ (vdec_msg->msgdata.output_frame.bufferaddr +
+ vdec_msg->msgdata.output_frame.offset),
+ vdec_msg->msgdata.output_frame.len );
}
else
omxhdr->nFilledLen = 0;
@@ -6877,33 +6468,26 @@ int omx_vdec::async_message_process (void *context, void* message)
OMX_COMPONENT_GENERATE_FBD);
}
else if (vdec_msg->msgdata.output_frame.flags & OMX_BUFFERFLAG_EOS)
- omx->post_event ((unsigned int)NULL, vdec_msg->status_code,
+ omx->post_event (NULL, vdec_msg->status_code,
OMX_COMPONENT_GENERATE_EOS_DONE);
else
- omx->post_event ((unsigned int)NULL, vdec_msg->status_code,
+ omx->post_event (NULL, vdec_msg->status_code,
OMX_COMPONENT_GENERATE_HARDWARE_ERROR);
break;
case VDEC_MSG_EVT_CONFIG_CHANGED:
DEBUG_PRINT_HIGH("\n Port settings changed");
- omx->post_event (OMX_CORE_OUTPUT_PORT_INDEX, OMX_IndexParamPortDefinition,
- OMX_COMPONENT_GENERATE_PORT_RECONFIG);
+ omx->post_event ((unsigned int)omxhdr,vdec_msg->status_code,
+ OMX_COMPONENT_GENERATE_PORT_RECONFIG);
break;
case VDEC_MSG_EVT_INFO_CONFIG_CHANGED:
{
DEBUG_PRINT_HIGH("\n Port settings changed info");
// get_buffer_req and populate port defn structure
OMX_ERRORTYPE eRet = OMX_ErrorNone;
- struct v4l2_format fmt;
- int ret;
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- ret = ioctl(omx->drv_ctx.video_driver_fd, VIDIOC_G_FMT, &fmt);
- omx->update_resolution(fmt.fmt.pix_mp.width, fmt.fmt.pix_mp.height);
- omx->drv_ctx.video_resolution.stride = fmt.fmt.pix_mp.plane_fmt[0].bytesperline;
- omx->drv_ctx.video_resolution.scan_lines = fmt.fmt.pix_mp.plane_fmt[0].reserved[0];
omx->m_port_def.nPortIndex = 1;
eRet = omx->update_portdef(&(omx->m_port_def));
- omx->post_event ((unsigned)NULL, vdec_msg->status_code,\
- OMX_COMPONENT_GENERATE_INFO_PORT_RECONFIG);
+ omx->post_event ((unsigned int)omxhdr,vdec_msg->status_code,
+ OMX_COMPONENT_GENERATE_INFO_PORT_RECONFIG);
break;
}
default:
@@ -6925,8 +6509,8 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy_arbitrary (
return OMX_ErrorBadParameter;
}
DEBUG_PRINT_LOW("\n ETBProxyArb: bufhdr = %p, bufhdr->pBuffer = %p", buffer, buffer->pBuffer);
- DEBUG_PRINT_LOW("\n ETBProxyArb: nFilledLen %lu, flags %lu, timestamp %lld",
- buffer->nFilledLen, buffer->nFlags, buffer->nTimeStamp);
+ DEBUG_PRINT_LOW("\n ETBProxyArb: nFilledLen %u, flags %d, timestamp %u",
+ buffer->nFilledLen, buffer->nFlags, (unsigned)buffer->nTimeStamp);
/* return zero length and not an EOS buffer */
/* return buffer if input flush in progress */
@@ -6940,7 +6524,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy_arbitrary (
if (psource_frame == NULL)
{
- DEBUG_PRINT_LOW("\n Set Buffer as source Buffer %p time stamp %lld",buffer,buffer->nTimeStamp);
+ DEBUG_PRINT_LOW("\n Set Buffer as source Buffer %p time stamp %d",buffer,buffer->nTimeStamp);
psource_frame = buffer;
DEBUG_PRINT_LOW("\n Try to Push One Input Buffer ");
push_input_buffer (hComp);
@@ -6948,8 +6532,7 @@ OMX_ERRORTYPE omx_vdec::empty_this_buffer_proxy_arbitrary (
else
{
DEBUG_PRINT_LOW("\n Push the source buffer into pendingq %p",buffer);
- if (!m_input_pending_q.insert_entry((unsigned)buffer, (unsigned)NULL,
- (unsigned)NULL))
+ if (!m_input_pending_q.insert_entry((unsigned)buffer,NULL,NULL))
{
return OMX_ErrorBadParameter;
}
@@ -6988,9 +6571,9 @@ OMX_ERRORTYPE omx_vdec::push_input_buffer (OMX_HANDLETYPE hComp)
{
m_input_pending_q.pop_entry(&address,&p2,&id);
psource_frame = (OMX_BUFFERHEADERTYPE *)address;
- DEBUG_PRINT_LOW("\n Next source Buffer %p time stamp %lld",psource_frame,
+ DEBUG_PRINT_LOW("\n Next source Buffer %p time stamp %d",psource_frame,
psource_frame->nTimeStamp);
- DEBUG_PRINT_LOW("\n Next source Buffer flag %lu length %lu",
+ DEBUG_PRINT_LOW("\n Next source Buffer flag %d length %d",
psource_frame->nFlags,psource_frame->nFilledLen);
}
@@ -7013,8 +6596,6 @@ OMX_ERRORTYPE omx_vdec::push_input_buffer (OMX_HANDLETYPE hComp)
case CODEC_TYPE_VC1:
ret = push_input_vc1(hComp);
break;
- default:
- break;
}
if (ret != OMX_ErrorNone)
{
@@ -7031,9 +6612,9 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
{
OMX_U32 partial_frame = 1;
OMX_BOOL generate_ebd = OMX_TRUE;
- unsigned address = 0, p2 = 0, id = 0;
+ unsigned address,p2,id;
- DEBUG_PRINT_LOW("\n Start Parsing the bit stream address %p TimeStamp %lld",
+ DEBUG_PRINT_LOW("\n Start Parsing the bit stream address %p TimeStamp %d",
psource_frame,psource_frame->nTimeStamp);
if (m_frame_parser.parse_sc_frame(psource_frame,
pdest_frame,&partial_frame) == -1)
@@ -7044,11 +6625,11 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
if (partial_frame == 0)
{
- DEBUG_PRINT_LOW("\n Frame size %lu source %p frame count %d",
+ DEBUG_PRINT_LOW("\n Frame size %d source %p frame count %d",
pdest_frame->nFilledLen,psource_frame,frame_count);
- DEBUG_PRINT_LOW("\n TimeStamp updated %lld", pdest_frame->nTimeStamp);
+ DEBUG_PRINT_LOW("\n TimeStamp updated %d",pdest_frame->nTimeStamp);
/*First Parsed buffer will have only header Hence skip*/
if (frame_count == 0)
{
@@ -7087,15 +6668,14 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
else if(!(psource_frame->nFlags & OMX_BUFFERFLAG_EOS))
{
DEBUG_PRINT_ERROR("\nZero len buffer return back to POOL");
- m_input_free_q.insert_entry((unsigned) pdest_frame, (unsigned)NULL,
- (unsigned)NULL);
+ m_input_free_q.insert_entry((unsigned) pdest_frame,NULL,NULL);
pdest_frame = NULL;
}
}
}
else
{
- DEBUG_PRINT_LOW("\n Not a Complete Frame %lu",pdest_frame->nFilledLen);
+ DEBUG_PRINT_LOW("\n Not a Complete Frame %d",pdest_frame->nFilledLen);
/*Check if Destination Buffer is full*/
if (pdest_frame->nAllocLen ==
pdest_frame->nFilledLen + pdest_frame->nOffset)
@@ -7112,9 +6692,9 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
if (pdest_frame)
{
pdest_frame->nFlags |= psource_frame->nFlags;
- DEBUG_PRINT_LOW("\n Frame Found start Decoding Size =%lu TimeStamp = %lld",
+ DEBUG_PRINT_LOW("\n Frame Found start Decoding Size =%d TimeStamp = %x",
pdest_frame->nFilledLen,pdest_frame->nTimeStamp);
- DEBUG_PRINT_LOW("\n Found a frame size = %lu number = %d",
+ DEBUG_PRINT_LOW("\n Found a frame size = %d number = %d",
pdest_frame->nFilledLen,frame_count++);
/*Push the frame to the Decoder*/
if (empty_this_buffer_proxy(hComp,pdest_frame) != OMX_ErrorNone)
@@ -7141,9 +6721,9 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
DEBUG_PRINT_LOW("\n Pull Next source Buffer %p",psource_frame);
m_input_pending_q.pop_entry(&address,&p2,&id);
psource_frame = (OMX_BUFFERHEADERTYPE *) address;
- DEBUG_PRINT_LOW("\n Next source Buffer %p time stamp %lld",psource_frame,
+ DEBUG_PRINT_LOW("\n Next source Buffer %p time stamp %d",psource_frame,
psource_frame->nTimeStamp);
- DEBUG_PRINT_LOW("\n Next source Buffer flag %lu length %lu",
+ DEBUG_PRINT_LOW("\n Next source Buffer flag %d length %d",
psource_frame->nFlags,psource_frame->nFilledLen);
}
}
@@ -7154,7 +6734,7 @@ OMX_ERRORTYPE omx_vdec::push_input_sc_codec(OMX_HANDLETYPE hComp)
OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
{
OMX_U32 partial_frame = 1;
- unsigned address = 0, p2 = 0, id = 0;
+ unsigned address,p2,id;
OMX_BOOL isNewFrame = OMX_FALSE;
OMX_BOOL generate_ebd = OMX_TRUE;
@@ -7163,9 +6743,9 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
DEBUG_PRINT_ERROR("\nERROR:H.264 Scratch Buffer not allocated");
return OMX_ErrorBadParameter;
}
- DEBUG_PRINT_LOW("\n Pending h264_scratch.nFilledLen %lu "
+ DEBUG_PRINT_LOW("\n Pending h264_scratch.nFilledLen %d "
"look_ahead_nal %d", h264_scratch.nFilledLen, look_ahead_nal);
- DEBUG_PRINT_LOW("\n Pending pdest_frame->nFilledLen %lu",pdest_frame->nFilledLen);
+ DEBUG_PRINT_LOW("\n Pending pdest_frame->nFilledLen %d",pdest_frame->nFilledLen);
if (h264_scratch.nFilledLen && look_ahead_nal)
{
look_ahead_nal = false;
@@ -7216,7 +6796,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("\n Parsed New NAL Length = %lu",h264_scratch.nFilledLen);
+ DEBUG_PRINT_LOW("\n Parsed New NAL Length = %d",h264_scratch.nFilledLen);
if(h264_scratch.nFilledLen)
{
h264_parser->parse_nal((OMX_U8*)h264_scratch.pBuffer, h264_scratch.nFilledLen,
@@ -7261,7 +6841,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
if ( (pdest_frame->nAllocLen - pdest_frame->nFilledLen) >=
h264_scratch.nFilledLen)
{
- DEBUG_PRINT_LOW("\n Not a NewFrame Copy into Dest len %lu",
+ DEBUG_PRINT_LOW("\n Not a NewFrame Copy into Dest len %d",
h264_scratch.nFilledLen);
memcpy ((pdest_frame->pBuffer + pdest_frame->nFilledLen),
h264_scratch.pBuffer,h264_scratch.nFilledLen);
@@ -7279,9 +6859,9 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
else
{
look_ahead_nal = true;
- DEBUG_PRINT_LOW("\n Frame Found start Decoding Size =%lu TimeStamp = %llx",
+ DEBUG_PRINT_LOW("\n Frame Found start Decoding Size =%d TimeStamp = %x",
pdest_frame->nFilledLen,pdest_frame->nTimeStamp);
- DEBUG_PRINT_LOW("\n Found a frame size = %lu number = %d",
+ DEBUG_PRINT_LOW("\n Found a frame size = %d number = %d",
pdest_frame->nFilledLen,frame_count++);
if (pdest_frame->nFilledLen == 0)
@@ -7331,7 +6911,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("\n Not a Complete Frame, pdest_frame->nFilledLen %lu",pdest_frame->nFilledLen);
+ DEBUG_PRINT_LOW("\n Not a Complete Frame, pdest_frame->nFilledLen %d",pdest_frame->nFilledLen);
/*Check if Destination Buffer is full*/
if (h264_scratch.nAllocLen ==
h264_scratch.nFilledLen + h264_scratch.nOffset)
@@ -7366,7 +6946,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
pdest_frame->nTimeStamp = h264_scratch.nTimeStamp;
pdest_frame->nFlags = h264_scratch.nFlags | psource_frame->nFlags;
- DEBUG_PRINT_LOW("\n pdest_frame->nFilledLen =%lu TimeStamp = %llx",
+ DEBUG_PRINT_LOW("\n pdest_frame->nFilledLen =%d TimeStamp = %x",
pdest_frame->nFilledLen,pdest_frame->nTimeStamp);
DEBUG_PRINT_LOW("\n Push AU frame number %d to driver", frame_count++);
#ifndef PROCESS_EXTRADATA_IN_OUTPUT_PORT
@@ -7387,7 +6967,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
}
else
{
- DEBUG_PRINT_LOW("\n Last frame in else dest addr %p size %lu",
+ DEBUG_PRINT_LOW("\n Last frame in else dest addr %p size %d",
pdest_frame,h264_scratch.nFilledLen);
generate_ebd = OMX_FALSE;
}
@@ -7402,7 +6982,7 @@ OMX_ERRORTYPE omx_vdec::push_input_h264 (OMX_HANDLETYPE hComp)
DEBUG_PRINT_LOW("\n Pull Next source Buffer %p",psource_frame);
m_input_pending_q.pop_entry(&address,&p2,&id);
psource_frame = (OMX_BUFFERHEADERTYPE *) address;
- DEBUG_PRINT_LOW("\nNext source Buffer flag %lu src length %lu",
+ DEBUG_PRINT_LOW("\nNext source Buffer flag %d src length %d",
psource_frame->nFlags,psource_frame->nFilledLen);
}
}
@@ -7479,26 +7059,6 @@ OMX_ERRORTYPE omx_vdec::push_input_vc1 (OMX_HANDLETYPE hComp)
return OMX_ErrorNone;
}
-#ifndef USE_ION
-bool omx_vdec::align_pmem_buffers(int pmem_fd, OMX_U32 buffer_size,
- OMX_U32 alignment)
-{
- struct pmem_allocation allocation;
- allocation.size = buffer_size;
- allocation.align = clip2(alignment);
- if (allocation.align < 4096)
- {
- allocation.align = 4096;
- }
- if (ioctl(pmem_fd, PMEM_ALLOCATE_ALIGNED, &allocation) < 0)
- {
- DEBUG_PRINT_ERROR("\n Aligment(%u) failed with pmem driver Sz(%lu)",
- allocation.align, allocation.size);
- return false;
- }
- return true;
-}
-#endif
#ifdef USE_ION
int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
OMX_U32 alignment, struct ion_allocation_data *alloc_data,
@@ -7529,12 +7089,12 @@ int omx_vdec::alloc_map_ion_memory(OMX_U32 buffer_size,
{
alloc_data->align = 4096;
}
- if ((secure_mode) && (flag & ION_SECURE))
- alloc_data->flags |= ION_SECURE;
-
- alloc_data->heap_mask = ION_HEAP(ION_IOMMU_HEAP_ID);
- if (secure_mode)
- alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
+ if(secure_mode) {
+ alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
+ alloc_data->flags |= ION_SECURE;
+ } else {
+ alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
+ }
rc = ioctl(fd,ION_IOC_ALLOC,alloc_data);
if (rc || !alloc_data->handle) {
DEBUG_PRINT_ERROR("\n ION ALLOC memory failed ");
@@ -7574,6 +7134,25 @@ void omx_vdec::free_ion_memory(struct vdec_ion *buf_ion_info) {
buf_ion_info->ion_alloc_data.handle = NULL;
buf_ion_info->fd_ion_data.fd = -1;
}
+#else
+bool omx_vdec::align_pmem_buffers(int pmem_fd, OMX_U32 buffer_size,
+ OMX_U32 alignment)
+{
+ struct pmem_allocation allocation;
+ allocation.size = buffer_size;
+ allocation.align = clip2(alignment);
+ if (allocation.align < 4096)
+ {
+ allocation.align = 4096;
+ }
+ if (ioctl(pmem_fd, PMEM_ALLOCATE_ALIGNED, &allocation) < 0)
+ {
+ DEBUG_PRINT_ERROR("\n Aligment(%u) failed with pmem driver Sz(%lu)",
+ allocation.align, allocation.size);
+ return false;
+ }
+ return true;
+}
#endif
void omx_vdec::free_output_buffer_header()
{
@@ -7658,60 +7237,34 @@ void omx_vdec::free_input_buffer_header()
}
#endif
}
-
-int omx_vdec::stream_off(OMX_U32 port)
+void omx_vdec::stream_off()
{
+ int rc=0;
enum v4l2_buf_type btype;
- int rc = 0;
- enum v4l2_ports v4l2_port = OUTPUT_PORT;
-
- if (port == OMX_CORE_INPUT_PORT_INDEX) {
- btype = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- v4l2_port = OUTPUT_PORT;
- } else if (port == OMX_CORE_OUTPUT_PORT_INDEX) {
- btype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- v4l2_port = CAPTURE_PORT;
- } else if (port == OMX_ALL) {
- int rc_input = stream_off(OMX_CORE_INPUT_PORT_INDEX);
- int rc_output = stream_off(OMX_CORE_OUTPUT_PORT_INDEX);
-
- if (!rc_input)
- return rc_input;
- else
- return rc_output;
- }
-
- if (!streaming[v4l2_port]) {
- // already streamed off, warn and move on
- DEBUG_PRINT_HIGH("Warning: Attempting to stream off on %d port,"
- " which is already streamed off", v4l2_port);
- return 0;
- }
-
- DEBUG_PRINT_HIGH("Streaming off %d port", v4l2_port);
-
+ btype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_STREAMOFF, &btype);
if (rc) {
/*TODO: How to handle this case */
- DEBUG_PRINT_ERROR("Failed to call streamoff on %d Port \n", v4l2_port);
+ printf("\n Failed to call streamoff on OUTPUT Port \n");
} else {
- streaming[v4l2_port] = false;
+ streaming[CAPTURE_PORT] = false;
}
-
- return rc;
}
OMX_ERRORTYPE omx_vdec::get_buffer_req(vdec_allocatorproperty *buffer_prop)
{
OMX_ERRORTYPE eRet = OMX_ErrorNone;
struct v4l2_requestbuffers bufreq;
- unsigned int buf_size = 0, extra_data_size = 0, client_extra_data_size = 0;
+ unsigned int buf_size = 0, extra_data_size = 0;
struct v4l2_format fmt;
- int ret = 0;
+ int ret;
DEBUG_PRINT_LOW("GetBufReq IN: ActCnt(%d) Size(%d)",
buffer_prop->actualcount, buffer_prop->buffer_size);
bufreq.memory = V4L2_MEMORY_USERPTR;
- bufreq.count = 1;
+ if(in_reconfig == true)
+ bufreq.count = 0;
+ else
+ bufreq.count = 2;
if(buffer_prop->buffer_type == VDEC_BUFFER_TYPE_INPUT){
bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
fmt.type =V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
@@ -7735,7 +7288,7 @@ OMX_ERRORTYPE omx_vdec::get_buffer_req(vdec_allocatorproperty *buffer_prop)
{
buffer_prop->actualcount = bufreq.count;
buffer_prop->mincount = bufreq.count;
- DEBUG_PRINT_HIGH("Count = %d \n ",bufreq.count);
+ printf("Count = %d \n ",bufreq.count);
}
DEBUG_PRINT_LOW("GetBufReq IN: ActCnt(%d) Size(%d)",
buffer_prop->actualcount, buffer_prop->buffer_size);
@@ -7745,10 +7298,10 @@ OMX_ERRORTYPE omx_vdec::get_buffer_req(vdec_allocatorproperty *buffer_prop)
ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_G_FMT, &fmt);
- update_resolution(fmt.fmt.pix_mp.width, fmt.fmt.pix_mp.height);
- if (fmt.type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
- drv_ctx.num_planes = fmt.fmt.pix_mp.num_planes;
- DEBUG_PRINT_HIGH("Buffer Size = %d \n ",fmt.fmt.pix_mp.plane_fmt[0].sizeimage);
+ drv_ctx.video_resolution.frame_height = fmt.fmt.pix_mp.height;
+ drv_ctx.video_resolution.frame_width = fmt.fmt.pix_mp.width;
+
+ printf("Buffer Size = %d \n ",fmt.fmt.pix_mp.plane_fmt[0].sizeimage);
if(ret)
{
@@ -7758,43 +7311,33 @@ OMX_ERRORTYPE omx_vdec::get_buffer_req(vdec_allocatorproperty *buffer_prop)
}
else
{
- int extra_idx = 0;
buffer_prop->buffer_size = fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
buf_size = buffer_prop->buffer_size;
- extra_idx = EXTRADATA_IDX(drv_ctx.num_planes);
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- extra_data_size = fmt.fmt.pix_mp.plane_fmt[extra_idx].sizeimage;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index is more than allowed: %d\n", extra_idx);
- return OMX_ErrorBadParameter;
- }
if (client_extradata & OMX_FRAMEINFO_EXTRADATA)
{
DEBUG_PRINT_HIGH("Frame info extra data enabled!");
- client_extra_data_size += OMX_FRAMEINFO_EXTRADATA_SIZE;
+ extra_data_size += OMX_FRAMEINFO_EXTRADATA_SIZE;
}
if (client_extradata & OMX_INTERLACE_EXTRADATA)
{
- client_extra_data_size += OMX_INTERLACE_EXTRADATA_SIZE;
+ DEBUG_PRINT_HIGH("Interlace extra data enabled!");
+ extra_data_size += OMX_INTERLACE_EXTRADATA_SIZE;
}
if (client_extradata & OMX_PORTDEF_EXTRADATA)
{
- client_extra_data_size += OMX_PORTDEF_EXTRADATA_SIZE;
- DEBUG_PRINT_HIGH("Smooth streaming enabled extra_data_size=%d\n",
- client_extra_data_size);
+ extra_data_size += OMX_PORTDEF_EXTRADATA_SIZE;
+ DEBUG_PRINT_HIGH("Smooth streaming enabled extra_data_size=%d\n",
+ extra_data_size);
}
- if (client_extra_data_size)
+ if (extra_data_size)
{
- client_extra_data_size += sizeof(OMX_OTHER_EXTRADATATYPE); //Space for terminator
+ extra_data_size += sizeof(OMX_OTHER_EXTRADATATYPE); //Space for terminator
buf_size = ((buf_size + 3)&(~3)); //Align extradata start address to 64Bit
}
- drv_ctx.extradata_info.size = buffer_prop->actualcount * extra_data_size;
- drv_ctx.extradata_info.count = buffer_prop->actualcount;
- drv_ctx.extradata_info.buffer_size = extra_data_size;
- buf_size += client_extra_data_size;
+ buf_size += extra_data_size;
buf_size = (buf_size + buffer_prop->alignment - 1)&(~(buffer_prop->alignment - 1));
DEBUG_PRINT_LOW("GetBufReq UPDATE: ActCnt(%d) Size(%d) BufSize(%d)",
- buffer_prop->actualcount, buffer_prop->buffer_size, buf_size);
+ buffer_prop->actualcount, buffer_prop->buffer_size, buf_size);
if (in_reconfig) // BufReq will be set to driver when port is disabled
buffer_prop->buffer_size = buf_size;
else if (buf_size != buffer_prop->buffer_size)
@@ -7813,7 +7356,6 @@ OMX_ERRORTYPE omx_vdec::set_buffer_req(vdec_allocatorproperty *buffer_prop)
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned buf_size = 0;
struct v4l2_format fmt;
- struct v4l2_requestbuffers bufreq;
int ret;
DEBUG_PRINT_LOW("SetBufReq IN: ActCnt(%d) Size(%d)",
buffer_prop->actualcount, buffer_prop->buffer_size);
@@ -7828,58 +7370,51 @@ OMX_ERRORTYPE omx_vdec::set_buffer_req(vdec_allocatorproperty *buffer_prop)
{
fmt.fmt.pix_mp.height = drv_ctx.video_resolution.frame_height;
fmt.fmt.pix_mp.width = drv_ctx.video_resolution.frame_width;
-
- if (buffer_prop->buffer_type == VDEC_BUFFER_TYPE_INPUT){
- fmt.type =V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- fmt.fmt.pix_mp.pixelformat = output_capability;
- } else if (buffer_prop->buffer_type == VDEC_BUFFER_TYPE_OUTPUT) {
- fmt.type =V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- fmt.fmt.pix_mp.pixelformat = capture_capability;
- } else {eRet = OMX_ErrorBadParameter;}
-
- ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
- if (ret)
+ if(buffer_prop->buffer_type == VDEC_BUFFER_TYPE_INPUT){
+ fmt.type =V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ fmt.fmt.pix_mp.pixelformat = output_capability;
+ }else if (buffer_prop->buffer_type == VDEC_BUFFER_TYPE_OUTPUT){
+fmt.type =V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ fmt.fmt.pix_mp.pixelformat = capture_capability;
+} else {eRet = OMX_ErrorBadParameter;}
+ ret = ioctl(drv_ctx.video_driver_fd, VIDIOC_S_FMT, &fmt);
+ if(ret)
{
/*TODO: How to handle this case */
- DEBUG_PRINT_ERROR("Setting buffer requirements (format) failed %d", ret);
+ DEBUG_PRINT_ERROR("Setting buffer requirements failed");
eRet = OMX_ErrorInsufficientResources;
}
-
- bufreq.memory = V4L2_MEMORY_USERPTR;
- bufreq.count = buffer_prop->actualcount;
- if(buffer_prop->buffer_type == VDEC_BUFFER_TYPE_INPUT) {
- bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- } else if (buffer_prop->buffer_type == VDEC_BUFFER_TYPE_OUTPUT) {
- bufreq.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- } else {eRet = OMX_ErrorBadParameter;}
-
- if (eRet==OMX_ErrorNone) {
- ret = ioctl(drv_ctx.video_driver_fd,VIDIOC_REQBUFS, &bufreq);
- }
-
- if (ret)
- {
- DEBUG_PRINT_ERROR("Setting buffer requirements (reqbufs) failed %d", ret);
- /*TODO: How to handle this case */
- eRet = OMX_ErrorInsufficientResources;
- } else if (bufreq.count < buffer_prop->actualcount) {
- DEBUG_PRINT_ERROR("Driver refused to change the number of buffers"
- " on v4l2 port %d to %d (prefers %d)", bufreq.type,
- buffer_prop->actualcount, bufreq.count);
- eRet = OMX_ErrorInsufficientResources;
- } else {
- if (!client_buffers.update_buffer_req()) {
- DEBUG_PRINT_ERROR("Setting c2D buffer requirements failed");
- eRet = OMX_ErrorInsufficientResources;
- }
- }
}
return eRet;
}
+OMX_ERRORTYPE omx_vdec::start_port_reconfig()
+{
+ struct vdec_ioctl_msg ioctl_msg = {NULL, NULL};
+ OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ enum v4l2_buf_type btype;
+ int rc = 0,i;
+ struct v4l2_plane plane;
+ struct v4l2_buffer v4l2_buf ={0};
+ struct v4l2_decoder_cmd dec;
+ dec.cmd = V4L2_DEC_CMD_STOP;
+ rc = ioctl(drv_ctx.video_driver_fd, VIDIOC_DECODER_CMD, &dec);
+ btype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ in_reconfig = true;
+ return eRet;
+}
+
OMX_ERRORTYPE omx_vdec::update_picture_resolution()
{
+ struct vdec_ioctl_msg ioctl_msg = {NULL, NULL};
OMX_ERRORTYPE eRet = OMX_ErrorNone;
+ ioctl_msg.in = NULL;
+ ioctl_msg.out = &drv_ctx.video_resolution;
+ if (/*ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_GET_PICRES, &ioctl_msg)*/0)
+ {
+ DEBUG_PRINT_ERROR("Error VDEC_IOCTL_GET_PICRES");
+ eRet = OMX_ErrorHardware;
+ }
return eRet;
}
@@ -7914,30 +7449,36 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
}
else if (1 == portDefn->nPortIndex)
{
- unsigned int buf_size = 0;
- if (!client_buffers.update_buffer_req()) {
- DEBUG_PRINT_ERROR("\n client_buffers.update_buffer_req Failed");
- return OMX_ErrorHardware;
+ portDefn->eDir = OMX_DirOutput;
+ eRet=get_buffer_req(&drv_ctx.op_buf);
+ if (in_reconfig)
+ {
+ portDefn->nBufferCountActual = op_buf_rcnfg.actualcount;
+ portDefn->nBufferCountMin = op_buf_rcnfg.mincount;
+ portDefn->nBufferSize = op_buf_rcnfg.buffer_size;
}
- if (!client_buffers.get_buffer_req(buf_size)) {
- DEBUG_PRINT_ERROR("\n update buffer requirements");
- return OMX_ErrorHardware;
+ else
+ {
+ portDefn->nBufferCountActual = drv_ctx.op_buf.actualcount;
+ portDefn->nBufferCountMin = drv_ctx.op_buf.mincount;
+ portDefn->nBufferSize = drv_ctx.op_buf.buffer_size;
}
- portDefn->nBufferSize = buf_size;
- portDefn->eDir = OMX_DirOutput;
- portDefn->nBufferCountActual = drv_ctx.op_buf.actualcount;
- portDefn->nBufferCountMin = drv_ctx.op_buf.mincount;
portDefn->format.video.eCompressionFormat = OMX_VIDEO_CodingUnused;
portDefn->bEnabled = m_out_bEnabled;
portDefn->bPopulated = m_out_bPopulated;
- if (!client_buffers.get_color_format(portDefn->format.video.eColorFormat)) {
- DEBUG_PRINT_ERROR("\n Error in getting color format");
- return OMX_ErrorHardware;
+ if (drv_ctx.output_format == VDEC_YUV_FORMAT_NV12)
+ portDefn->format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
+ else if (drv_ctx.output_format == VDEC_YUV_FORMAT_TILE_4x2)
+ portDefn->format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)
+ QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
+ else
+ {
+ DEBUG_PRINT_ERROR("ERROR: Color format unknown: %x\n", drv_ctx.output_format);
}
}
else
{
- portDefn->eDir = OMX_DirMax;
+ portDefn->eDir = OMX_DirMax;
DEBUG_PRINT_LOW(" get_parameter: Bad Port idx %d",
(int)portDefn->nPortIndex);
eRet = OMX_ErrorBadPortIndex;
@@ -7946,9 +7487,9 @@ OMX_ERRORTYPE omx_vdec::update_portdef(OMX_PARAM_PORTDEFINITIONTYPE *portDefn)
portDefn->format.video.nFrameWidth = drv_ctx.video_resolution.frame_width;
portDefn->format.video.nStride = drv_ctx.video_resolution.stride;
portDefn->format.video.nSliceHeight = drv_ctx.video_resolution.scan_lines;
- DEBUG_PRINT_ERROR("update_portdef Width = %lu Height = %lu Stride = %ld"
- " SliceHeight = %lu \n", portDefn->format.video.nFrameWidth,
- portDefn->format.video.nFrameHeight,
+ DEBUG_PRINT_LOW("update_portdef Width = %d Height = %d Stride = %u"
+ "SliceHeight = %u \n", portDefn->format.video.nFrameHeight,
+ portDefn->format.video.nFrameWidth,
portDefn->format.video.nStride,
portDefn->format.video.nSliceHeight);
return eRet;
@@ -8060,7 +7601,7 @@ OMX_ERRORTYPE omx_vdec::allocate_output_headers()
}
else
{
- DEBUG_PRINT_ERROR("Output buf mem alloc failed[0x%p][0x%p]\n",\
+ DEBUG_PRINT_ERROR("Output buf mem alloc failed[0x%x][0x%x]\n",\
m_out_mem_ptr, pPtr);
if(m_out_mem_ptr)
{
@@ -8171,6 +7712,7 @@ void omx_vdec::complete_pending_buffer_done_cbs()
void omx_vdec::set_frame_rate(OMX_S64 act_timestamp)
{
OMX_U32 new_frame_interval = 0;
+ struct vdec_ioctl_msg ioctl_msg = {NULL, NULL};
if (VALID_TS(act_timestamp) && VALID_TS(prev_ts) && act_timestamp != prev_ts
&& (((act_timestamp > prev_ts )? act_timestamp - prev_ts: prev_ts-act_timestamp)>2000))
{
@@ -8184,9 +7726,15 @@ void omx_vdec::set_frame_rate(OMX_S64 act_timestamp)
{
drv_ctx.frame_rate.fps_numerator = 1e6;
drv_ctx.frame_rate.fps_denominator = frm_int;
- DEBUG_PRINT_LOW("set_frame_rate: frm_int(%lu) fps(%f)",
+ DEBUG_PRINT_LOW("set_frame_rate: frm_int(%u) fps(%f)",
frm_int, drv_ctx.frame_rate.fps_numerator /
(float)drv_ctx.frame_rate.fps_denominator);
+ ioctl_msg.in = &drv_ctx.frame_rate;
+ if (/*ioctl (drv_ctx.video_driver_fd, VDEC_IOCTL_SET_FRAME_RATE,
+ (void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("Setting frame rate failed");
+ }
}
}
}
@@ -8227,168 +7775,203 @@ void omx_vdec::handle_extradata(OMX_BUFFERHEADERTYPE *p_buf_hdr)
{
OMX_OTHER_EXTRADATATYPE *p_extra = NULL, *p_sei = NULL, *p_vui = NULL;
OMX_U32 num_conceal_MB = 0;
+ OMX_S64 ts_in_sei = 0;
OMX_U32 frame_rate = 0;
- int consumed_len = 0;
- OMX_U32 num_MB_in_frame;
- OMX_U32 recovery_sei_flags = 1;
- int buf_index = p_buf_hdr - m_out_mem_ptr;
- struct msm_vidc_panscan_window_payload *panscan_payload = NULL;
- OMX_U8 *pBuffer = (OMX_U8 *)(drv_ctx.ptr_outputbuffer[buf_index].bufferaddr) +
- p_buf_hdr->nOffset;
- if (!drv_ctx.extradata_info.uaddr) {
- return;
- }
p_extra = (OMX_OTHER_EXTRADATATYPE *)
- ((unsigned)(pBuffer + p_buf_hdr->nOffset + p_buf_hdr->nFilledLen + 3)&(~3));
- char *p_extradata = drv_ctx.extradata_info.uaddr + buf_index * drv_ctx.extradata_info.buffer_size;
- if ((OMX_U8*)p_extra > (pBuffer + p_buf_hdr->nAllocLen))
+ ((unsigned)(p_buf_hdr->pBuffer + p_buf_hdr->nOffset +
+ p_buf_hdr->nFilledLen + 3)&(~3));
+ if ((OMX_U8*)p_extra > (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen))
p_extra = NULL;
- OMX_OTHER_EXTRADATATYPE *data = (struct OMX_OTHER_EXTRADATATYPE *)p_extradata;
- if (data) {
- while((consumed_len < drv_ctx.extradata_info.buffer_size)
- && (data->eType != (OMX_EXTRADATATYPE)EXTRADATA_NONE)) {
- if ((consumed_len + data->nSize) > drv_ctx.extradata_info.buffer_size) {
- DEBUG_PRINT_LOW("Invalid extra data size");
- break;
- }
- switch((unsigned long)data->eType) {
- case EXTRADATA_INTERLACE_VIDEO:
- struct msm_vidc_interlace_payload *payload;
- payload = (struct msm_vidc_interlace_payload *)data->data;
- if (payload->format != INTERLACE_FRAME_PROGRESSIVE) {
- int enable = 1;
- OMX_U32 mbaff = 0;
- mbaff = (h264_parser)? (h264_parser->is_mbaff()): false;
- if ((payload->format == INTERLACE_FRAME_PROGRESSIVE) && !mbaff)
- drv_ctx.interlace = VDEC_InterlaceFrameProgressive;
- else
- drv_ctx.interlace = VDEC_InterlaceInterleaveFrameTopFieldFirst;
- }
- if (!secure_mode && (client_extradata & OMX_INTERLACE_EXTRADATA)) {
- append_interlace_extradata(p_extra, payload->format);
- p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
+ if (drv_ctx.extradata && (p_buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA))
+ {
+ // Process driver extradata
+ while(p_extra && p_extra->eType != VDEC_EXTRADATA_NONE)
+ {
+ DEBUG_PRINT_LOW("handle_extradata : pBuf(%p) BufTS(%lld) Type(%x) DataSz(%u)",
+ p_buf_hdr, p_buf_hdr->nTimeStamp, p_extra->eType, p_extra->nDataSize);
+ if (p_extra->nSize < p_extra->nDataSize)
+ {
+ DEBUG_PRINT_ERROR(" \n Corrupt metadata Buffer size %d payload size %d",
+ p_extra->nSize, p_extra->nDataSize);
+ p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
+ if ((OMX_U8*)p_extra > (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen) ||
+ p_extra->nDataSize == 0)
+ p_extra = NULL;
+ continue;
+ }
+ if (p_extra->eType == VDEC_EXTRADATA_MB_ERROR_MAP)
+ {
+ if (client_extradata & OMX_FRAMEINFO_EXTRADATA)
+ num_conceal_MB = count_MB_in_extradata(p_extra);
+ if (client_extradata & VDEC_EXTRADATA_MB_ERROR_MAP)
+ // Map driver extradata to corresponding OMX type
+ p_extra->eType = (OMX_EXTRADATATYPE)OMX_ExtraDataConcealMB;
+ else
+ p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
+ if (m_debug_concealedmb) {
+ DEBUG_PRINT_HIGH("Concealed MB percentage is %u", num_conceal_MB);
}
- break;
- case EXTRADATA_FRAME_RATE:
- struct msm_vidc_framerate_payload *frame_rate_payload;
- frame_rate_payload = (struct msm_vidc_framerate_payload *)data->data;
- frame_rate = frame_rate_payload->frame_rate;
- break;
- case EXTRADATA_TIMESTAMP:
- struct msm_vidc_ts_payload *time_stamp_payload;
- time_stamp_payload = (struct msm_vidc_ts_payload *)data->data;
- p_buf_hdr->nTimeStamp = time_stamp_payload->timestamp_lo;
- p_buf_hdr->nTimeStamp |= ((unsigned long long)time_stamp_payload->timestamp_hi << 32);
- break;
- case EXTRADATA_NUM_CONCEALED_MB:
- struct msm_vidc_concealmb_payload *conceal_mb_payload;
- conceal_mb_payload = (struct msm_vidc_concealmb_payload *)data->data;
- num_MB_in_frame = ((drv_ctx.video_resolution.frame_width + 15) *
- (drv_ctx.video_resolution.frame_height + 15)) >> 8;
- num_conceal_MB = ((num_MB_in_frame > 0)?(conceal_mb_payload->num_mbs * 100 / num_MB_in_frame) : 0);
- break;
- case EXTRADATA_ASPECT_RATIO:
- struct msm_vidc_aspect_ratio_payload *aspect_ratio_payload;
- aspect_ratio_payload = (struct msm_vidc_aspect_ratio_payload *)data->data;
- ((struct vdec_output_frameinfo *)
- p_buf_hdr->pOutputPortPrivate)->aspect_ratio_info.par_width = aspect_ratio_payload->aspect_width;
- ((struct vdec_output_frameinfo *)
- p_buf_hdr->pOutputPortPrivate)->aspect_ratio_info.par_height = aspect_ratio_payload->aspect_height;
- break;
- case EXTRADATA_RECOVERY_POINT_SEI:
- struct msm_vidc_recoverysei_payload *recovery_sei_payload;
- recovery_sei_payload = (struct msm_vidc_recoverysei_payload *)data->data;
- recovery_sei_flags = recovery_sei_payload->flags;
- if (recovery_sei_flags != FRAME_RECONSTRUCTION_CORRECT) {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_DATACORRUPT;
- DEBUG_PRINT_HIGH("Extradata: OMX_BUFFERFLAG_DATACORRUPT Received\n");
- }
- break;
- case EXTRADATA_PANSCAN_WINDOW:
- panscan_payload = (struct msm_vidc_panscan_window_payload *)data->data;
- break;
- default:
- goto unrecognized_extradata;
}
- consumed_len += data->nSize;
- data = (OMX_OTHER_EXTRADATATYPE *)((char *)data + data->nSize);
- }
- if (!secure_mode && (client_extradata & OMX_FRAMEINFO_EXTRADATA)) {
- p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
- append_frame_info_extradata(p_extra,
- num_conceal_MB, ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->pic_type, frame_rate,
- panscan_payload,&((struct vdec_output_frameinfo *)
- p_buf_hdr->pOutputPortPrivate)->aspect_ratio_info);}
- }
-unrecognized_extradata:
- if(!secure_mode && client_extradata)
- append_terminator_extradata(p_extra);
- return;
+ else if (p_extra->eType == VDEC_EXTRADATA_SEI)
+ {
+ p_sei = p_extra;
+
+ h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
+
+ p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
+ }
+ else if (p_extra->eType == VDEC_EXTRADATA_VUI)
+ {
+ p_vui = p_extra;
+
+ h264_parser->parse_nal((OMX_U8*)p_vui->data, p_vui->nDataSize, NALU_TYPE_VUI, false);
+
+ p_extra->eType = OMX_ExtraDataMax; // Invalid type to avoid expose this extradata to OMX client
+ }
+ print_debug_extradata(p_extra);
+ p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
+ if ((OMX_U8*)p_extra > (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen) ||
+ p_extra->nDataSize == 0)
+ p_extra = NULL;
+ }
+ if (!(client_extradata & VDEC_EXTRADATA_MB_ERROR_MAP))
+ {
+ // Driver extradata is only exposed if MB map is requested by client,
+ // otherwise can be overwritten by omx extradata.
+ p_extra = (OMX_OTHER_EXTRADATATYPE *)
+ ((unsigned)(p_buf_hdr->pBuffer + p_buf_hdr->nOffset +
+ p_buf_hdr->nFilledLen + 3)&(~3));
+ p_buf_hdr->nFlags &= ~OMX_BUFFERFLAG_EXTRADATA;
+ }
+ }
+
+#ifdef PROCESS_EXTRADATA_IN_OUTPUT_PORT
+ if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
+ {
+ if (client_extradata & OMX_TIMEINFO_EXTRADATA)
+ {
+ if (p_vui)
+ h264_parser->parse_nal((OMX_U8*)p_vui->data, p_vui->nDataSize, NALU_TYPE_VUI, false);
+ if (p_sei)
+ h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
+ ts_in_sei = h264_parser->process_ts_with_sei_vui(p_buf_hdr->nTimeStamp);
+ if (!VALID_TS(p_buf_hdr->nTimeStamp))
+ p_buf_hdr->nTimeStamp = ts_in_sei;
+ }
+ else if ((client_extradata & OMX_FRAMEINFO_EXTRADATA) && p_sei)
+ // If timeinfo is present frame info from SEI is already processed
+ h264_parser->parse_nal((OMX_U8*)p_sei->data, p_sei->nDataSize, NALU_TYPE_SEI);
+ }
+#endif
+ if ((client_extradata & OMX_INTERLACE_EXTRADATA) && p_extra &&
+ ((OMX_U8*)p_extra + OMX_INTERLACE_EXTRADATA_SIZE) <
+ (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen))
+ {
+ p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
+ append_interlace_extradata(p_extra,
+ ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->interlaced_format);
+ p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
+ }
+ if (client_extradata & OMX_FRAMEINFO_EXTRADATA && p_extra &&
+ ((OMX_U8*)p_extra + OMX_FRAMEINFO_EXTRADATA_SIZE) <
+ (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen))
+ {
+ p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
+ /* vui extra data (frame_rate) information */
+ if (h264_parser)
+ h264_parser->get_frame_rate(&frame_rate);
+ append_frame_info_extradata(p_extra, num_conceal_MB,
+ ((struct vdec_output_frameinfo *)p_buf_hdr->pOutputPortPrivate)->pic_type,
+ p_buf_hdr->nTimeStamp, frame_rate, NULL);
+ p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
+ }
+ if ((client_extradata & OMX_PORTDEF_EXTRADATA) &&
+ p_extra != NULL &&
+ ((OMX_U8*)p_extra + OMX_PORTDEF_EXTRADATA_SIZE) <
+ (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen))
+ {
+ p_buf_hdr->nFlags |= OMX_BUFFERFLAG_EXTRADATA;
+ append_portdef_extradata(p_extra);
+ p_extra = (OMX_OTHER_EXTRADATATYPE *) (((OMX_U8 *) p_extra) + p_extra->nSize);
+ }
+ if (p_buf_hdr->nFlags & OMX_BUFFERFLAG_EXTRADATA)
+ if (p_extra &&
+ ((OMX_U8*)p_extra + OMX_FRAMEINFO_EXTRADATA_SIZE) <
+ (p_buf_hdr->pBuffer + p_buf_hdr->nAllocLen))
+ append_terminator_extradata(p_extra);
+ else
+ {
+ DEBUG_PRINT_ERROR("ERROR: Terminator extradata cannot be added");
+ p_buf_hdr->nFlags &= ~OMX_BUFFERFLAG_EXTRADATA;
+ }
}
-OMX_ERRORTYPE omx_vdec::enable_extradata(OMX_U32 requested_extradata,
- bool is_internal, bool enable)
+OMX_ERRORTYPE omx_vdec::enable_extradata(OMX_U32 requested_extradata, bool enable)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- struct v4l2_control control;
+ OMX_U32 driver_extradata = 0, extradata_size = 0;
+ struct vdec_ioctl_msg ioctl_msg = {NULL, NULL};
if(m_state != OMX_StateLoaded)
{
DEBUG_PRINT_ERROR("ERROR: enable extradata allowed in Loaded state only");
return OMX_ErrorIncorrectStateOperation;
}
- DEBUG_PRINT_ERROR("NOTE: enable_extradata: actual[%lu] requested[%lu] enable[%d], is_internal: %d\n",
- client_extradata, requested_extradata, enable, is_internal);
+ if (requested_extradata & OMX_FRAMEINFO_EXTRADATA)
+ extradata_size += OMX_FRAMEINFO_EXTRADATA_SIZE;
+ if (requested_extradata & OMX_INTERLACE_EXTRADATA)
+ extradata_size += OMX_INTERLACE_EXTRADATA_SIZE;
+ if (requested_extradata & OMX_PORTDEF_EXTRADATA)
+ {
+ extradata_size += OMX_PORTDEF_EXTRADATA_SIZE;
+ }
+ DEBUG_PRINT_ERROR("enable_extradata: actual[%x] requested[%x] enable[%d]",
+ client_extradata, requested_extradata, enable);
- if (!is_internal) {
- if (enable)
- client_extradata |= requested_extradata;
- else
- client_extradata = client_extradata & ~requested_extradata;
+ if (enable)
+ requested_extradata |= client_extradata;
+ else
+ {
+ requested_extradata = client_extradata & ~requested_extradata;
+ extradata_size *= -1;
}
- if (enable) {
- if (requested_extradata & OMX_INTERLACE_EXTRADATA) {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_INTERLACE_VIDEO;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set interlaced extradata."
- " Quality of interlaced clips might be impacted.\n");
- }
- } else if (requested_extradata & OMX_FRAMEINFO_EXTRADATA)
- {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_FRAME_RATE;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set framerate extradata\n");
- }
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_NUM_CONCEALED_MB;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set concealed MB extradata\n");
- }
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_RECOVERY_POINT_SEI;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set recovery point SEI extradata\n");
- }
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_PANSCAN_WINDOW;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set panscan extradata\n");
- }
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_INDEX_EXTRADATA_ASPECT_RATIO;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set panscan extradata\n");
- }
- } else if (requested_extradata & OMX_TIMEINFO_EXTRADATA)
- {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_TIMESTAMP;
- if(ioctl(drv_ctx.video_driver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_HIGH("Failed to set timeinfo extradata\n");
- }
- }
+ driver_extradata = requested_extradata & DRIVER_EXTRADATA_MASK;
+ if (requested_extradata & OMX_FRAMEINFO_EXTRADATA)
+ driver_extradata |= VDEC_EXTRADATA_MB_ERROR_MAP; // Required for conceal MB frame info
+#ifdef PROCESS_EXTRADATA_IN_OUTPUT_PORT
+ if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
+ {
+ driver_extradata |= ((requested_extradata & OMX_FRAMEINFO_EXTRADATA)?
+ VDEC_EXTRADATA_SEI : 0); // Required for pan scan frame info
+ driver_extradata |= ((requested_extradata & OMX_TIMEINFO_EXTRADATA)?
+ VDEC_EXTRADATA_VUI | VDEC_EXTRADATA_SEI : 0); //Required for time info
+ }
+
+#endif
+ if (driver_extradata != drv_ctx.extradata)
+ {
+ client_extradata = requested_extradata;
+ drv_ctx.extradata = driver_extradata;
+ //ioctl_msg.in = &drv_ctx.extradata;
+ //ioctl_msg.out = NULL;
+ //if (ioctl(drv_ctx.video_driver_fd, VDEC_IOCTL_SET_EXTRADATA,
+ // (void*)&ioctl_msg) < 0)
+ //{
+ // DEBUG_PRINT_ERROR("\nSet extradata failed");
+ // ret = OMX_ErrorUnsupportedSetting;
+ //} // else
+ // ret = get_buffer_req(&drv_ctx.op_buf);
+ }
+ else if ((client_extradata & ~DRIVER_EXTRADATA_MASK) != (requested_extradata & ~DRIVER_EXTRADATA_MASK))
+ {
+ client_extradata = requested_extradata;
+ drv_ctx.op_buf.buffer_size += extradata_size;
+ // align the buffer size
+ drv_ctx.op_buf.buffer_size = (drv_ctx.op_buf.buffer_size + drv_ctx.op_buf.alignment - 1)&(~(drv_ctx.op_buf.alignment - 1));
+ DEBUG_PRINT_LOW("Aligned buffer size with exreadata = %d\n", drv_ctx.op_buf.buffer_size);
+ if (!(client_extradata & ~DRIVER_EXTRADATA_MASK)) // If no omx extradata is required remove space for terminator
+ drv_ctx.op_buf.buffer_size -= sizeof(OMX_OTHER_EXTRADATATYPE);
+ ret = set_buffer_req(&drv_ctx.op_buf);
}
return ret;
}
@@ -8420,41 +8003,41 @@ void omx_vdec::print_debug_extradata(OMX_OTHER_EXTRADATATYPE *extra)
DEBUG_PRINT_HIGH(
"============== Extra Data ==============\n"
- " Size: %lu \n"
- " Version: %lu \n"
- " PortIndex: %lu \n"
+ " Size: %u \n"
+ " Version: %u \n"
+ " PortIndex: %u \n"
" Type: %x \n"
- " DataSize: %lu \n",
+ " DataSize: %u \n",
extra->nSize, extra->nVersion.nVersion,
extra->nPortIndex, extra->eType, extra->nDataSize);
- if (extra->eType == (OMX_EXTRADATATYPE)OMX_ExtraDataInterlaceFormat)
+ if (extra->eType == OMX_ExtraDataInterlaceFormat)
{
OMX_STREAMINTERLACEFORMAT *intfmt = (OMX_STREAMINTERLACEFORMAT *)extra->data;
DEBUG_PRINT_HIGH(
"------ Interlace Format ------\n"
- " Size: %lu \n"
- " Version: %lu \n"
- " PortIndex: %lu \n"
- " Is Interlace Format: %d \n"
- " Interlace Formats: %lu \n"
+ " Size: %u \n"
+ " Version: %u \n"
+ " PortIndex: %u \n"
+ " Is Interlace Format: %u \n"
+ " Interlace Formats: %u \n"
"=========== End of Interlace ===========\n",
intfmt->nSize, intfmt->nVersion.nVersion, intfmt->nPortIndex,
intfmt->bInterlaceFormat, intfmt->nInterlaceFormats);
}
- else if (extra->eType == (OMX_EXTRADATATYPE)OMX_ExtraDataFrameInfo)
+ else if (extra->eType == OMX_ExtraDataFrameInfo)
{
OMX_QCOM_EXTRADATA_FRAMEINFO *fminfo = (OMX_QCOM_EXTRADATA_FRAMEINFO *)extra->data;
DEBUG_PRINT_HIGH(
"-------- Frame Format --------\n"
- " Picture Type: %d \n"
- " Interlace Type: %d \n"
- " Pan Scan Total Frame Num: %lu \n"
- " Concealed Macro Blocks: %lu \n"
- " frame rate: %lu \n"
- " Aspect Ratio X: %lu \n"
- " Aspect Ratio Y: %lu \n",
+ " Picture Type: %u \n"
+ " Interlace Type: %u \n"
+ " Pan Scan Total Frame Num: %u \n"
+ " Concealed Macro Blocks: %u \n"
+ " frame rate: %u \n"
+ " Aspect Ratio X: %u \n"
+ " Aspect Ratio Y: %u \n",
fminfo->ePicType,
fminfo->interlaceType,
fminfo->panScan.numWindows,
@@ -8463,15 +8046,15 @@ void omx_vdec::print_debug_extradata(OMX_OTHER_EXTRADATATYPE *extra)
fminfo->aspectRatio.aspectRatioX,
fminfo->aspectRatio.aspectRatioY);
- for (OMX_U32 i = 0; i < fminfo->panScan.numWindows; i++)
+ for (int i = 0; i < fminfo->panScan.numWindows; i++)
{
DEBUG_PRINT_HIGH(
"------------------------------\n"
- " Pan Scan Frame Num: %lu \n"
- " Rectangle x: %ld \n"
- " Rectangle y: %ld \n"
- " Rectangle dx: %ld \n"
- " Rectangle dy: %ld \n",
+ " Pan Scan Frame Num: %d \n"
+ " Rectangle x: %d \n"
+ " Rectangle y: %d \n"
+ " Rectangle dx: %d \n"
+ " Rectangle dy: %d \n",
i, fminfo->panScan.window[i].x, fminfo->panScan.window[i].y,
fminfo->panScan.window[i].dx, fminfo->panScan.window[i].dy);
}
@@ -8493,9 +8076,6 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
{
OMX_STREAMINTERLACEFORMAT *interlace_format;
OMX_U32 mbaff = 0;
- if (!(client_extradata & OMX_INTERLACE_EXTRADATA)) {
- return;
- }
extra->nSize = OMX_INTERLACE_EXTRADATA_SIZE;
extra->nVersion.nVersion = OMX_SPEC_VERSION;
extra->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
@@ -8506,7 +8086,7 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
interlace_format->nVersion.nVersion = OMX_SPEC_VERSION;
interlace_format->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
mbaff = (h264_parser)? (h264_parser->is_mbaff()): false;
- if ((interlaced_format_type == INTERLACE_FRAME_PROGRESSIVE) && !mbaff)
+ if ((interlaced_format_type == VDEC_InterlaceFrameProgressive) && !mbaff)
{
interlace_format->bInterlaceFormat = OMX_FALSE;
interlace_format->nInterlaceFormats = OMX_InterlaceFrameProgressive;
@@ -8521,27 +8101,12 @@ void omx_vdec::append_interlace_extradata(OMX_OTHER_EXTRADATATYPE *extra,
print_debug_extradata(extra);
}
-void omx_vdec::fill_aspect_ratio_info(
- struct vdec_aspectratioinfo *aspect_ratio_info,
- OMX_QCOM_EXTRADATA_FRAMEINFO *frame_info)
-{
- m_extradata = frame_info;
- m_extradata->aspectRatio.aspectRatioX = aspect_ratio_info->par_width;
- m_extradata->aspectRatio.aspectRatioY = aspect_ratio_info->par_height;
- DEBUG_PRINT_LOW("aspectRatioX %lu aspectRatioX %lu", m_extradata->aspectRatio.aspectRatioX,
- m_extradata->aspectRatio.aspectRatioY);
-}
void omx_vdec::append_frame_info_extradata(OMX_OTHER_EXTRADATATYPE *extra,
- OMX_U32 num_conceal_mb, OMX_U32 picture_type, OMX_U32 frame_rate,
- struct msm_vidc_panscan_window_payload *panscan_payload,
- struct vdec_aspectratioinfo *aspect_ratio_info)
+ OMX_U32 num_conceal_mb, OMX_U32 picture_type, OMX_S64 timestamp, OMX_U32 frame_rate,
+ vdec_aspectratioinfo *aspect_ratio_info)
{
OMX_QCOM_EXTRADATA_FRAMEINFO *frame_info = NULL;
- struct msm_vidc_panscan_window *panscan_window;
- if (!(client_extradata & OMX_FRAMEINFO_EXTRADATA)) {
- return;
- }
extra->nSize = OMX_FRAMEINFO_EXTRADATA_SIZE;
extra->nVersion.nVersion = OMX_SPEC_VERSION;
extra->nPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
@@ -8568,23 +8133,15 @@ void omx_vdec::append_frame_info_extradata(OMX_OTHER_EXTRADATATYPE *extra,
frame_info->interlaceType = OMX_QCOM_InterlaceInterleaveFrameBottomFieldFirst;
else
frame_info->interlaceType = OMX_QCOM_InterlaceFrameProgressive;
+ memset(&frame_info->panScan,0,sizeof(frame_info->panScan));
memset(&frame_info->aspectRatio, 0, sizeof(frame_info->aspectRatio));
+ if (drv_ctx.decoder_format == VDEC_CODECTYPE_H264)
+ {
+ h264_parser->fill_pan_scan_data(&frame_info->panScan, timestamp);
+ h264_parser->fill_aspect_ratio_info(&frame_info->aspectRatio);
+ }
frame_info->nConcealedMacroblocks = num_conceal_mb;
frame_info->nFrameRate = frame_rate;
- frame_info->panScan.numWindows = 0;
- if(panscan_payload) {
- frame_info->panScan.numWindows = panscan_payload->num_panscan_windows;
- panscan_window = &panscan_payload->wnd[0];
- for (OMX_U32 i = 0; i < frame_info->panScan.numWindows; i++)
- {
- frame_info->panScan.window[i].x = panscan_window->panscan_window_width;
- frame_info->panScan.window[i].y = panscan_window->panscan_window_height;
- frame_info->panScan.window[i].dx = panscan_window->panscan_width_offset;
- frame_info->panScan.window[i].dy = panscan_window->panscan_height_offset;
- panscan_window++;
- }
- }
- fill_aspect_ratio_info(aspect_ratio_info, frame_info);
print_debug_extradata(extra);
}
@@ -8598,8 +8155,8 @@ void omx_vdec::append_portdef_extradata(OMX_OTHER_EXTRADATATYPE *extra)
extra->nDataSize = sizeof(OMX_PARAM_PORTDEFINITIONTYPE);
portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *)extra->data;
*portDefn = m_port_def;
- DEBUG_PRINT_LOW("append_portdef_extradata height = %lu width = %lu "
- "stride = %lu sliceheight = %lu \n",portDefn->format.video.nFrameHeight,
+ DEBUG_PRINT_LOW("append_portdef_extradata height = %u width = %u stride = %u"
+ "sliceheight = %u \n",portDefn->format.video.nFrameHeight,
portDefn->format.video.nFrameWidth,
portDefn->format.video.nStride,
portDefn->format.video.nSliceHeight);
@@ -8607,9 +8164,6 @@ void omx_vdec::append_portdef_extradata(OMX_OTHER_EXTRADATATYPE *extra)
void omx_vdec::append_terminator_extradata(OMX_OTHER_EXTRADATATYPE *extra)
{
- if (!client_extradata) {
- return;
- }
extra->nSize = sizeof(OMX_OTHER_EXTRADATATYPE);
extra->nVersion.nVersion = OMX_SPEC_VERSION;
extra->eType = OMX_ExtraDataNone;
@@ -8651,7 +8205,7 @@ OMX_ERRORTYPE omx_vdec::allocate_desc_buffer(OMX_U32 index)
void omx_vdec::insert_demux_addr_offset(OMX_U32 address_offset)
{
- DEBUG_PRINT_LOW("Inserting address offset (%lu) at idx (%lu)", address_offset,m_demux_entries);
+ DEBUG_PRINT_LOW("Inserting address offset (%d) at idx (%d)", address_offset,m_demux_entries);
if (m_demux_entries < 8192)
{
m_demux_offsets[m_demux_entries++] = address_offset;
@@ -8684,7 +8238,7 @@ void omx_vdec::extract_demux_addr_offsets(OMX_BUFFERHEADERTYPE *buf_hdr)
else
index++;
}
- DEBUG_PRINT_LOW("Extracted (%lu) demux entry offsets",m_demux_entries);
+ DEBUG_PRINT_LOW("Extracted (%d) demux entry offsets",m_demux_entries);
return;
}
@@ -8708,7 +8262,7 @@ OMX_ERRORTYPE omx_vdec::handle_demux_data(OMX_BUFFERHEADERTYPE *p_buf_hdr)
buffer_index = p_buf_hdr - ((OMX_BUFFERHEADERTYPE *)m_inp_mem_ptr);
if (buffer_index > drv_ctx.ip_buf.actualcount)
{
- DEBUG_PRINT_ERROR("handle_demux_data:Buffer index is incorrect (%lu)", buffer_index);
+ DEBUG_PRINT_ERROR("handle_demux_data:Buffer index is incorrect (%d)", buffer_index);
return OMX_ErrorBadParameter;
}
@@ -8742,8 +8296,8 @@ OMX_ERRORTYPE omx_vdec::handle_demux_data(OMX_BUFFERHEADERTYPE *p_buf_hdr)
{
nal_size = p_buf_hdr->nFilledLen - m_demux_offsets[demux_index] - 2;
}
- DEBUG_PRINT_LOW("Start_addr(%p), suffix_byte(0x%lx),nal_size(%lu),demux_index(%lu)",
- (void *)start_addr,
+ DEBUG_PRINT_LOW("Start_addr(%p), suffix_byte(0x%x),nal_size(%d),demux_index(%d)",
+ start_addr,
suffix_byte,
nal_size,
demux_index);
@@ -8774,7 +8328,7 @@ OMX_ERRORTYPE omx_vdec::handle_demux_data(OMX_BUFFERHEADERTYPE *p_buf_hdr)
memset(p_demux_data, 0, sizeof(OMX_U32));
m_desc_buffer_ptr[buffer_index].desc_data_size = (m_demux_entries * 16) + sizeof(OMX_U32);
- DEBUG_PRINT_LOW("desc table data size=%lu", m_desc_buffer_ptr[buffer_index].desc_data_size);
+ DEBUG_PRINT_LOW("desc table data size=%d", m_desc_buffer_ptr[buffer_index].desc_data_size);
}
memset(m_demux_offsets, 0, ( sizeof(OMX_U32) * 8192) );
m_demux_entries = 0;
@@ -8782,375 +8336,31 @@ OMX_ERRORTYPE omx_vdec::handle_demux_data(OMX_BUFFERHEADERTYPE *p_buf_hdr)
return OMX_ErrorNone;
}
-OMX_ERRORTYPE omx_vdec::createDivxDrmContext()
+#if 0
+OMX_ERRORTYPE omx_vdec::createDivxDrmContext( OMX_PTR drmHandle )
{
OMX_ERRORTYPE err = OMX_ErrorNone;
- iDivXDrmDecrypt = DivXDrmDecrypt::Create();
+ if( drmHandle == NULL ) {
+ DEBUG_PRINT_HIGH("\n This clip is not DRM encrypted");
+ iDivXDrmDecrypt = NULL;
+ return err;
+ }
+
+ iDivXDrmDecrypt = DivXDrmDecrypt::Create( drmHandle );
if (iDivXDrmDecrypt) {
+ DEBUG_PRINT_LOW("\nCreated DIVX DRM, now calling Init");
OMX_ERRORTYPE err = iDivXDrmDecrypt->Init();
if(err!=OMX_ErrorNone) {
- DEBUG_PRINT_ERROR("\nERROR :iDivXDrmDecrypt->Init %d", err);
+ DEBUG_PRINT_ERROR("\nERROR:iDivXDrmDecrypt->Init %d", err);
delete iDivXDrmDecrypt;
iDivXDrmDecrypt = NULL;
}
}
else {
DEBUG_PRINT_ERROR("\nUnable to Create DIVX DRM");
- err = OMX_ErrorUndefined;
+ return OMX_ErrorUndefined;
}
return err;
}
-
-omx_vdec::allocate_color_convert_buf::allocate_color_convert_buf()
-{
- enabled = false;
- omx = NULL;
- init_members();
- ColorFormat = OMX_COLOR_FormatMax;
-}
-
-void omx_vdec::allocate_color_convert_buf::set_vdec_client(void *client)
-{
- omx = reinterpret_cast<omx_vdec*>(client);
-}
-
-void omx_vdec::allocate_color_convert_buf::init_members() {
- allocated_count = 0;
- buffer_size_req = 0;
- buffer_alignment_req = 0;
- memset(m_platform_list_client,0,sizeof(m_platform_list_client));
- memset(m_platform_entry_client,0,sizeof(m_platform_entry_client));
- memset(m_pmem_info_client,0,sizeof(m_pmem_info_client));
- memset(m_out_mem_ptr_client,0,sizeof(m_out_mem_ptr_client));
-#ifdef USE_ION
- memset(op_buf_ion_info,0,sizeof(m_platform_entry_client));
-#endif
- for (int i = 0; i < MAX_COUNT;i++)
- pmem_fd[i] = -1;
-}
-
-omx_vdec::allocate_color_convert_buf::~allocate_color_convert_buf() {
- c2d.destroy();
-}
-
-bool omx_vdec::allocate_color_convert_buf::update_buffer_req()
-{
- bool status = true;
- unsigned int src_size = 0, destination_size = 0;
- OMX_COLOR_FORMATTYPE drv_color_format;
- if (!omx){
- DEBUG_PRINT_ERROR("\n Invalid client in color convert");
- return false;
- }
- if (!enabled){
- DEBUG_PRINT_ERROR("\n No color conversion required");
- return status;
- }
- pthread_mutex_lock(&omx->c_lock);
- if (omx->drv_ctx.output_format != VDEC_YUV_FORMAT_NV12 &&
- ColorFormat != OMX_COLOR_FormatYUV420Planar) {
- DEBUG_PRINT_ERROR("\nupdate_buffer_req: Unsupported color conversion");
- status = false;
- goto fail_update_buf_req;
- }
- c2d.close();
- status = c2d.open(omx->drv_ctx.video_resolution.frame_height,
- omx->drv_ctx.video_resolution.frame_width,
- NV12_128m,YCbCr420P);
- if (status) {
- status = c2d.get_buffer_size(C2D_INPUT,src_size);
- if (status)
- status = c2d.get_buffer_size(C2D_OUTPUT,destination_size);
- }
- if (status) {
- if (!src_size || src_size > omx->drv_ctx.op_buf.buffer_size ||
- !destination_size) {
- DEBUG_PRINT_ERROR("\nERROR: Size mismatch in C2D src_size %d"
- "driver size %d destination size %d",
- src_size,omx->drv_ctx.op_buf.buffer_size,destination_size);
- status = false;
- c2d.close();
- buffer_size_req = 0;
- } else {
- buffer_size_req = destination_size;
- if (buffer_size_req < omx->drv_ctx.op_buf.buffer_size)
- buffer_size_req = omx->drv_ctx.op_buf.buffer_size;
- if (buffer_alignment_req < omx->drv_ctx.op_buf.alignment)
- buffer_alignment_req = omx->drv_ctx.op_buf.alignment;
- }
- }
-fail_update_buf_req:
- pthread_mutex_unlock(&omx->c_lock);
- return status;
-}
-
-bool omx_vdec::allocate_color_convert_buf::set_color_format(
- OMX_COLOR_FORMATTYPE dest_color_format)
-{
- bool status = true;
- OMX_COLOR_FORMATTYPE drv_color_format;
- if (!omx){
- DEBUG_PRINT_ERROR("\n Invalid client in color convert");
- return false;
- }
- pthread_mutex_lock(&omx->c_lock);
- if (omx->drv_ctx.output_format == VDEC_YUV_FORMAT_NV12)
- drv_color_format = (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
- else {
- DEBUG_PRINT_ERROR("\n Incorrect color format");
- status = false;
- }
- if (status && (drv_color_format != dest_color_format)) {
- DEBUG_PRINT_LOW("Enabling C2D\n");
- if (dest_color_format != OMX_COLOR_FormatYUV420Planar) {
- DEBUG_PRINT_ERROR("\n Unsupported color format for c2d");
- status = false;
- } else {
- ColorFormat = OMX_COLOR_FormatYUV420Planar;
- if (enabled)
- c2d.destroy();
- enabled = false;
- if (!c2d.init()) {
- DEBUG_PRINT_ERROR("\n open failed for c2d");
- status = false;
- } else
- enabled = true;
- }
- } else {
- if (enabled)
- c2d.destroy();
- enabled = false;
- }
- pthread_mutex_unlock(&omx->c_lock);
- return status;
-}
-
-OMX_BUFFERHEADERTYPE* omx_vdec::allocate_color_convert_buf::get_il_buf_hdr()
-{
- if (!omx){
- DEBUG_PRINT_ERROR("\n Invalid param get_buf_hdr");
- return NULL;
- }
- if (!enabled)
- return omx->m_out_mem_ptr;
- return m_out_mem_ptr_client;
-}
-
-OMX_BUFFERHEADERTYPE* omx_vdec::allocate_color_convert_buf::get_il_buf_hdr
- (OMX_BUFFERHEADERTYPE *bufadd)
-{
- if (!omx){
- DEBUG_PRINT_ERROR("\n Invalid param get_buf_hdr");
- return NULL;
- }
- if (!enabled)
- return bufadd;
-
- unsigned index = 0;
- index = bufadd - omx->m_out_mem_ptr;
- if (index < omx->drv_ctx.op_buf.actualcount) {
- m_out_mem_ptr_client[index].nFlags = (bufadd->nFlags & OMX_BUFFERFLAG_EOS);
- m_out_mem_ptr_client[index].nTimeStamp = bufadd->nTimeStamp;
- bool status;
- if (!omx->in_reconfig && !omx->output_flush_progress && bufadd->nFilledLen) {
- pthread_mutex_lock(&omx->c_lock);
- status = c2d.convert(omx->drv_ctx.ptr_outputbuffer[index].pmem_fd,
- bufadd->pBuffer,pmem_fd[index],pmem_baseaddress[index]);
- pthread_mutex_unlock(&omx->c_lock);
- m_out_mem_ptr_client[index].nFilledLen = buffer_size_req;
- if (!status){
- DEBUG_PRINT_ERROR("\n Failed color conversion %d", status);
- m_out_mem_ptr_client[index].nFilledLen = 0;
- return &m_out_mem_ptr_client[index];
- }
- } else
- m_out_mem_ptr_client[index].nFilledLen = 0;
- return &m_out_mem_ptr_client[index];
- }
- DEBUG_PRINT_ERROR("\n Index messed up in the get_il_buf_hdr");
- return NULL;
-}
-
-OMX_BUFFERHEADERTYPE* omx_vdec::allocate_color_convert_buf::get_dr_buf_hdr
- (OMX_BUFFERHEADERTYPE *bufadd)
-{
- if (!omx){
- DEBUG_PRINT_ERROR("\n Invalid param get_buf_hdr");
- return NULL;
- }
- if (!enabled)
- return bufadd;
- unsigned index = 0;
- index = bufadd - m_out_mem_ptr_client;
- if (index < omx->drv_ctx.op_buf.actualcount) {
- return &omx->m_out_mem_ptr[index];
- }
- DEBUG_PRINT_ERROR("\n Index messed up in the get_dr_buf_hdr");
- return NULL;
-}
-bool omx_vdec::allocate_color_convert_buf::get_buffer_req
- (unsigned int &buffer_size)
-{
- bool status = true;
- pthread_mutex_lock(&omx->c_lock);
- if (!enabled)
- buffer_size = omx->drv_ctx.op_buf.buffer_size;
- else {
- if (!c2d.get_buffer_size(C2D_OUTPUT,buffer_size)) {
- DEBUG_PRINT_ERROR("\n Get buffer size failed");
- status = false;
- goto fail_get_buffer_size;
- }
- }
- if (buffer_size < omx->drv_ctx.op_buf.buffer_size)
- buffer_size = omx->drv_ctx.op_buf.buffer_size;
- if (buffer_alignment_req < omx->drv_ctx.op_buf.alignment)
- buffer_alignment_req = omx->drv_ctx.op_buf.alignment;
-fail_get_buffer_size:
- pthread_mutex_unlock(&omx->c_lock);
- return status;
-}
-OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::free_output_buffer(
- OMX_BUFFERHEADERTYPE *bufhdr) {
- unsigned int index = 0;
-
- if (!enabled)
- return omx->free_output_buffer(bufhdr);
- if (enabled && omx->is_component_secure())
- return OMX_ErrorNone;
- if (!allocated_count || !bufhdr) {
- DEBUG_PRINT_ERROR("\n Color convert no buffer to be freed %p",bufhdr);
- return OMX_ErrorBadParameter;
- }
- index = bufhdr - m_out_mem_ptr_client;
- if (index >= omx->drv_ctx.op_buf.actualcount){
- DEBUG_PRINT_ERROR("\n Incorrect index color convert free_output_buffer");
- return OMX_ErrorBadParameter;
- }
- if (pmem_fd[index] > 0) {
- munmap(pmem_baseaddress[index], buffer_size_req);
- close(pmem_fd[index]);
- }
- pmem_fd[index] = -1;
-#ifdef USE_ION
- omx->free_ion_memory(&op_buf_ion_info[index]);
-#endif
- m_heap_ptr[index].video_heap_ptr = NULL;
- if (allocated_count > 0)
- allocated_count--;
- else
- allocated_count = 0;
- if (!allocated_count) {
- pthread_mutex_lock(&omx->c_lock);
- c2d.close();
- init_members();
- pthread_mutex_unlock(&omx->c_lock);
- }
- return omx->free_output_buffer(&omx->m_out_mem_ptr[index]);
-}
-
-OMX_ERRORTYPE omx_vdec::allocate_color_convert_buf::allocate_buffers_color_convert(OMX_HANDLETYPE hComp,
- OMX_BUFFERHEADERTYPE **bufferHdr,OMX_U32 port,OMX_PTR appData,OMX_U32 bytes)
-{
- OMX_ERRORTYPE eRet = OMX_ErrorNone;
- if (!enabled){
- eRet = omx->allocate_output_buffer(hComp,bufferHdr,port,appData,bytes);
- return eRet;
- }
- if (enabled && omx->is_component_secure()) {
- DEBUG_PRINT_ERROR("\nNotin color convert mode secure_mode %d",
- omx->is_component_secure());
- return OMX_ErrorUnsupportedSetting;
- }
- if (!bufferHdr || bytes > buffer_size_req) {
- DEBUG_PRINT_ERROR("\n Invalid params allocate_buffers_color_convert %p", bufferHdr);
- DEBUG_PRINT_ERROR("\n color_convert buffer_size_req %d bytes %lu",
- buffer_size_req,bytes);
- return OMX_ErrorBadParameter;
- }
- if (allocated_count >= omx->drv_ctx.op_buf.actualcount) {
- DEBUG_PRINT_ERROR("\n Actual count err in allocate_buffers_color_convert");
- return OMX_ErrorInsufficientResources;
- }
- OMX_BUFFERHEADERTYPE *temp_bufferHdr = NULL;
- eRet = omx->allocate_output_buffer(hComp,&temp_bufferHdr,
- port,appData,omx->drv_ctx.op_buf.buffer_size);
- if (eRet != OMX_ErrorNone || !temp_bufferHdr){
- DEBUG_PRINT_ERROR("\n Buffer allocation failed color_convert");
- return eRet;
- }
- if ((temp_bufferHdr - omx->m_out_mem_ptr) >=
- omx->drv_ctx.op_buf.actualcount) {
- DEBUG_PRINT_ERROR("\n Invalid header index %d",
- (temp_bufferHdr - omx->m_out_mem_ptr));
- return OMX_ErrorUndefined;
- }
- unsigned int i = allocated_count;
-#ifdef USE_ION
- op_buf_ion_info[i].ion_device_fd = omx->alloc_map_ion_memory(
- buffer_size_req,buffer_alignment_req,
- &op_buf_ion_info[i].ion_alloc_data,&op_buf_ion_info[i].fd_ion_data,
- 0);
- pmem_fd[i] = op_buf_ion_info[i].fd_ion_data.fd;
- if (op_buf_ion_info[i].ion_device_fd < 0) {
- DEBUG_PRINT_ERROR("\n alloc_map_ion failed in color_convert");
- return OMX_ErrorInsufficientResources;
- }
- pmem_baseaddress[i] = (unsigned char *)mmap(NULL,buffer_size_req,
- PROT_READ|PROT_WRITE,MAP_SHARED,pmem_fd[i],0);
-
- if (pmem_baseaddress[i] == MAP_FAILED) {
- DEBUG_PRINT_ERROR("\n MMAP failed for Size %d",buffer_size_req);
- close(pmem_fd[i]);
- omx->free_ion_memory(&op_buf_ion_info[i]);
- return OMX_ErrorInsufficientResources;
- }
- m_heap_ptr[i].video_heap_ptr = new VideoHeap (
- op_buf_ion_info[i].ion_device_fd,buffer_size_req,
- pmem_baseaddress[i],op_buf_ion_info[i].ion_alloc_data.handle,pmem_fd[i]);
#endif
- m_pmem_info_client[i].pmem_fd = (OMX_U32)m_heap_ptr[i].video_heap_ptr.get();
- m_pmem_info_client[i].offset = 0;
- m_platform_entry_client[i].entry = (void *)&m_pmem_info_client[i];
- m_platform_entry_client[i].type = OMX_QCOM_PLATFORM_PRIVATE_PMEM;
- m_platform_list_client[i].nEntries = 1;
- m_platform_list_client[i].entryList = &m_platform_entry_client[i];
- m_out_mem_ptr_client[i].pOutputPortPrivate = NULL;
- m_out_mem_ptr_client[i].nAllocLen = buffer_size_req;
- m_out_mem_ptr_client[i].nFilledLen = 0;
- m_out_mem_ptr_client[i].nFlags = 0;
- m_out_mem_ptr_client[i].nOutputPortIndex = OMX_CORE_OUTPUT_PORT_INDEX;
- m_out_mem_ptr_client[i].nSize = sizeof(OMX_BUFFERHEADERTYPE);
- m_out_mem_ptr_client[i].nVersion.nVersion = OMX_SPEC_VERSION;
- m_out_mem_ptr_client[i].pPlatformPrivate = &m_platform_list_client[i];
- m_out_mem_ptr_client[i].pBuffer = pmem_baseaddress[i];
- m_out_mem_ptr_client[i].pAppPrivate = appData;
- *bufferHdr = &m_out_mem_ptr_client[i];
- DEBUG_PRINT_ERROR("\n IL client buffer header %p", *bufferHdr);
- allocated_count++;
- return eRet;
-}
-bool omx_vdec::is_component_secure()
-{
- return secure_mode;
-}
-
-bool omx_vdec::allocate_color_convert_buf::get_color_format(OMX_COLOR_FORMATTYPE &dest_color_format)
-{
- bool status = true;
- if (!enabled) {
- if (omx->drv_ctx.output_format == VDEC_YUV_FORMAT_NV12)
- dest_color_format = (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
- else
- status = false;
- } else {
- if (ColorFormat != OMX_COLOR_FormatYUV420Planar) {
- status = false;
- } else
- dest_color_format = OMX_COLOR_FormatYUV420Planar;
- }
- return status;
-}
diff --git a/mm-video/vidc/vdec/src/power_module.cpp b/mm-video/vidc/vdec/src/power_module.cpp
deleted file mode 100644
index 3849218..0000000
--- a/mm-video/vidc/vdec/src/power_module.cpp
+++ /dev/null
@@ -1,54 +0,0 @@
-/*-------------------------------------------------------------------------
-Copyright (c) 2012, The Linux Foundation. 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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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 "power_module.h"
-
-PowerModule *PowerModule::mPowerModuleInstance = NULL;
-
-PowerModule *PowerModule::getInstance()
-{
- if (mPowerModuleInstance == NULL) {
- mPowerModuleInstance = new PowerModule;
-
- if (mPowerModuleInstance) {
- mPowerModuleInstance->mPowerModuleHandle = NULL;
-
- hw_get_module(POWER_HARDWARE_MODULE_ID,
- (const hw_module_t **)&(mPowerModuleInstance->mPowerModuleHandle));
- }
- }
-
- return mPowerModuleInstance;
-}
-
-power_module_t *PowerModule::getPowerModuleHandle()
-{
- return mPowerModuleHandle;
-}
diff --git a/mm-video/vidc/vdec/src/queue.c b/mm-video/vidc/vdec/src/queue.c
index 368d7c4..e0aeb9a 100644
--- a/mm-video/vidc/vdec/src/queue.c
+++ b/mm-video/vidc/vdec/src/queue.c
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/vdec/src/ts_parser.cpp b/mm-video/vidc/vdec/src/ts_parser.cpp
index 92b5f52..a950320 100644
--- a/mm-video/vidc/vdec/src/ts_parser.cpp
+++ b/mm-video/vidc/vdec/src/ts_parser.cpp
@@ -1,253 +1,273 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "ts_parser.h"
-
-#define DEBUG ALOGE
-void omx_time_stamp_reorder::set_timestamp_reorder_mode(bool mode)
-{
- reorder_ts = mode;
-}
-
-void omx_time_stamp_reorder::enable_debug_print(bool flag)
-{
- print_debug = flag;
-}
-
-omx_time_stamp_reorder::~omx_time_stamp_reorder()
-{
- delete_list();
-}
-
-omx_time_stamp_reorder::omx_time_stamp_reorder()
-{
- reorder_ts = false;
- phead = pcurrent = NULL;
- error = false;
- print_debug = false;
-}
-
-void omx_time_stamp_reorder::delete_list()
-{
- time_stamp_list *ptemp;
- if (!phead) return;
- while(phead->next != phead) {
- ptemp = phead;
- phead = phead->next;
- phead->prev = ptemp->prev;
- ptemp->prev->next = phead;
- delete ptemp;
- }
- delete phead;
- phead = NULL;
-}
-
-bool omx_time_stamp_reorder::get_current_list()
-{
- if (!phead) {
- if(!add_new_list()) {
- handle_error();
- return false;
- }
- }
- pcurrent = phead->prev;
- return true;
-}
-
-bool omx_time_stamp_reorder::update_head()
-{
- time_stamp_list *ptemp;
- if(!phead) return false;
- if (phead->next != phead) {
- ptemp = phead;
- phead = ptemp->next;
- phead->prev = ptemp->prev;
- ptemp->prev->next = phead;
- delete ptemp;
- }
- return true;
-}
-
-bool omx_time_stamp_reorder::add_new_list()
-{
- bool status = true;
- time_stamp_list *ptemp = NULL;
- if (!phead) {
- ptemp = phead = new time_stamp_list;
- if (!phead) {
- handle_error();
- status = false;
- return status;
- }
- phead->prev = phead->next = phead;
- } else {
- ptemp = new time_stamp_list;
- if (!ptemp) {
- handle_error();
- status = false;
- return status;
- }
- ptemp->prev = phead->prev;
- ptemp->next = phead;
- phead->prev->next = ptemp;
- phead->prev = ptemp;
- }
- ptemp->entries_filled = 0;
- for(int i=0; i < TIME_SZ; i++) {
- ptemp->input_timestamps[i].in_use = false;
- ptemp->input_timestamps[i].timestamps = -1;
- }
- return status;
-}
-
-bool omx_time_stamp_reorder::insert_timestamp(OMX_BUFFERHEADERTYPE *header)
-{
- OMX_TICKS *table_entry = NULL;
- if (!reorder_ts || error || !header) {
- if (error || !header)
- DEBUG("\n Invalid condition in insert_timestamp %p", header);
- return false;
- }
- if(!get_current_list()) {
- handle_error();
- return false;
- }
- if (pcurrent->entries_filled > (TIME_SZ - 1)) {
- DEBUG("\n Table full return error");
- handle_error();
- return false;
- }
- if (header->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
- return true;
- }
- if ((header->nFlags & OMX_BUFFERFLAG_EOS) && !header->nFilledLen)
- {
- DEBUG("\n EOS with zero length recieved");
- if (!add_new_list()) {
- handle_error();
- return false;
- }
- return true;
- }
- for(int i = 0; i < TIME_SZ && !table_entry; i++) {
- if (!pcurrent->input_timestamps[i].in_use) {
- table_entry = &pcurrent->input_timestamps[i].timestamps;
- pcurrent->input_timestamps[i].in_use = true;
- pcurrent->entries_filled++;
- }
- }
- if (!table_entry) {
- DEBUG("\n All entries in use");
- handle_error();
- return false;
- }
- *table_entry = header->nTimeStamp;
- if (print_debug)
- DEBUG("Time stamp inserted %lld", header->nTimeStamp);
- if (header->nFlags & OMX_BUFFERFLAG_EOS) {
- if (!add_new_list()) {
- handle_error();
- return false;
- }
- }
- return true;
-}
-
-bool omx_time_stamp_reorder::remove_time_stamp(OMX_TICKS ts, bool is_interlaced = false)
-{
- unsigned int num_ent_remove = (is_interlaced)?2:1;
- if (!reorder_ts || error) {
- DEBUG("\n not in avi mode");
- return false;
- }
- if (!phead || !phead->entries_filled) return false;
- for(int i=0; i < TIME_SZ && num_ent_remove; i++) {
- if (phead->input_timestamps[i].in_use && phead->input_timestamps[i].timestamps == ts) {
- phead->input_timestamps[i].in_use = false;
- phead->entries_filled--;
- num_ent_remove--;
- if (print_debug)
- DEBUG("Removed TS %lld", ts);
- }
- }
- if (!phead->entries_filled) {
- if (!update_head()) {
- handle_error();
- return false;
- }
- }
- return true;
-}
-
-void omx_time_stamp_reorder::flush_timestamp()
-{
- delete_list();
-}
-
-bool omx_time_stamp_reorder::get_next_timestamp(OMX_BUFFERHEADERTYPE *header, bool is_interlaced)
-{
- timestamp *element = NULL,*duplicate = NULL;
- bool status = false;
- if (!reorder_ts || error || !header) {
- if (error || !header)
- DEBUG("\n Invalid condition in insert_timestamp %p", header);
- return false;
- }
- if(!phead || !phead->entries_filled) return false;
- for(int i=0; i < TIME_SZ; i++) {
- if (phead->input_timestamps[i].in_use) {
- status = true;
- if (!element)
- element = &phead->input_timestamps[i];
- else {
- if (element->timestamps > phead->input_timestamps[i].timestamps){
- element = &phead->input_timestamps[i];
- duplicate = NULL;
- } else if(element->timestamps == phead->input_timestamps[i].timestamps)
- duplicate = &phead->input_timestamps[i];
- }
- }
- }
- if (element) {
- phead->entries_filled--;
- header->nTimeStamp = element->timestamps;
- if (print_debug)
- DEBUG("Getnext Time stamp %lld", header->nTimeStamp);
- element->in_use = false;
- }
- if(is_interlaced && duplicate) {
- phead->entries_filled--;
- duplicate->in_use = false;
- }
- if (!phead->entries_filled) {
- if (!update_head()) {
- handle_error();
- return false;
- }
- }
- return status;
-}
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2012, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "ts_parser.h"
+
+#define DEBUG ALOGE
+void omx_time_stamp_reorder::set_timestamp_reorder_mode(bool mode)
+{
+ reorder_ts = mode;
+}
+
+void omx_time_stamp_reorder::enable_debug_print(bool flag)
+{
+ print_debug = flag;
+}
+
+omx_time_stamp_reorder::~omx_time_stamp_reorder()
+{
+ delete_list();
+}
+
+omx_time_stamp_reorder::omx_time_stamp_reorder()
+{
+ reorder_ts = false;
+ phead = pcurrent = NULL;
+ error = false;
+ print_debug = false;
+}
+
+void omx_time_stamp_reorder::delete_list()
+{
+ time_stamp_list *ptemp;
+ if (!phead) return;
+ while(phead->next != phead) {
+ ptemp = phead;
+ phead = phead->next;
+ phead->prev = ptemp->prev;
+ ptemp->prev->next = phead;
+ delete ptemp;
+ }
+ delete phead;
+ phead = NULL;
+}
+
+bool omx_time_stamp_reorder::get_current_list()
+{
+ if (!phead) {
+ if(!add_new_list()) {
+ handle_error();
+ return false;
+ }
+ }
+ pcurrent = phead->prev;
+ return true;
+}
+
+bool omx_time_stamp_reorder::update_head()
+{
+ time_stamp_list *ptemp;
+ if(!phead) return false;
+ if (phead->next != phead) {
+ ptemp = phead;
+ phead = ptemp->next;
+ phead->prev = ptemp->prev;
+ ptemp->prev->next = phead;
+ delete ptemp;
+ }
+ return true;
+}
+
+bool omx_time_stamp_reorder::add_new_list()
+{
+ bool status = true;
+ time_stamp_list *ptemp = NULL;
+ if (!phead) {
+ ptemp = phead = new time_stamp_list;
+ if (!phead) {
+ handle_error();
+ status = false;
+ return status;
+ }
+ phead->prev = phead->next = phead;
+ } else {
+ ptemp = new time_stamp_list;
+ if (!ptemp) {
+ handle_error();
+ status = false;
+ return status;
+ }
+ ptemp->prev = phead->prev;
+ ptemp->next = phead;
+ phead->prev->next = ptemp;
+ phead->prev = ptemp;
+ }
+ ptemp->entries_filled = 0;
+ for(int i=0; i < TIME_SZ; i++) {
+ ptemp->input_timestamps[i].in_use = false;
+ ptemp->input_timestamps[i].timestamps = -1;
+ }
+ return status;
+}
+
+bool omx_time_stamp_reorder::insert_timestamp(OMX_BUFFERHEADERTYPE *header)
+{
+ OMX_TICKS *table_entry = NULL;
+ if (!reorder_ts || error || !header) {
+ if (error || !header)
+ DEBUG("\n Invalid condition in insert_timestamp %p", header);
+ return false;
+ }
+ if(!get_current_list()) {
+ handle_error();
+ return false;
+ }
+ if (pcurrent->entries_filled > (TIME_SZ - 1)) {
+ DEBUG("\n Table full return error");
+ handle_error();
+ return false;
+ }
+ if (header->nFlags & OMX_BUFFERFLAG_CODECCONFIG) {
+ return true;
+ }
+ if ((header->nFlags & OMX_BUFFERFLAG_EOS) && !header->nFilledLen)
+ {
+ DEBUG("\n EOS with zero length recieved");
+ if (!add_new_list()) {
+ handle_error();
+ return false;
+ }
+ return true;
+ }
+ for(int i = 0; i < TIME_SZ && !table_entry; i++) {
+ if (!pcurrent->input_timestamps[i].in_use) {
+ table_entry = &pcurrent->input_timestamps[i].timestamps;
+ pcurrent->input_timestamps[i].in_use = true;
+ pcurrent->entries_filled++;
+ }
+ }
+ if (!table_entry) {
+ DEBUG("\n All entries in use");
+ handle_error();
+ return false;
+ }
+ *table_entry = header->nTimeStamp;
+ if (print_debug)
+ DEBUG("Time stamp inserted %lld", header->nTimeStamp);
+ if (header->nFlags & OMX_BUFFERFLAG_EOS) {
+ if (!add_new_list()) {
+ handle_error();
+ return false;
+ }
+ }
+ return true;
+}
+
+bool omx_time_stamp_reorder::remove_time_stamp(OMX_TICKS ts, bool is_interlaced = false)
+{
+ unsigned int num_ent_remove = (is_interlaced)?2:1;
+ if (!reorder_ts || error) {
+ DEBUG("\n not in avi mode");
+ return false;
+ }
+ if (!phead || !phead->entries_filled) return false;
+ for(int i=0; i < TIME_SZ && num_ent_remove; i++) {
+ if (phead->input_timestamps[i].in_use && phead->input_timestamps[i].timestamps == ts) {
+ phead->input_timestamps[i].in_use = false;
+ phead->entries_filled--;
+ num_ent_remove--;
+ if (print_debug)
+ DEBUG("Removed TS %lld", ts);
+ }
+ }
+ if (!phead->entries_filled) {
+ if (!update_head()) {
+ handle_error();
+ return false;
+ }
+ }
+ return true;
+}
+
+void omx_time_stamp_reorder::flush_timestamp()
+{
+ delete_list();
+}
+
+bool omx_time_stamp_reorder::get_next_timestamp(OMX_BUFFERHEADERTYPE *header, bool is_interlaced)
+{
+ timestamp *element = NULL,*duplicate = NULL;
+ bool status = false;
+ if (!reorder_ts || error || !header) {
+ if (error || !header)
+ DEBUG("\n Invalid condition in insert_timestamp %p", header);
+ return false;
+ }
+ if(!phead || !phead->entries_filled) return false;
+ for(int i=0; i < TIME_SZ; i++) {
+ if (phead->input_timestamps[i].in_use) {
+ status = true;
+ if (!element)
+ element = &phead->input_timestamps[i];
+ else {
+ if (element->timestamps > phead->input_timestamps[i].timestamps){
+ element = &phead->input_timestamps[i];
+ duplicate = NULL;
+ } else if(element->timestamps == phead->input_timestamps[i].timestamps)
+ duplicate = &phead->input_timestamps[i];
+ }
+ }
+ }
+ if (element) {
+ phead->entries_filled--;
+ header->nTimeStamp = element->timestamps;
+ if (print_debug)
+ DEBUG("Getnext Time stamp %lld", header->nTimeStamp);
+ element->in_use = false;
+ }
+ if(is_interlaced && duplicate) {
+ phead->entries_filled--;
+ duplicate->in_use = false;
+ }
+ else if(is_interlaced && status)
+ {
+ for(int i=0; i < TIME_SZ; i++) {
+ if (phead->input_timestamps[i].in_use) {
+ if (!duplicate)
+ duplicate = &phead->input_timestamps[i];
+ else {
+ if (duplicate->timestamps > phead->input_timestamps[i].timestamps)
+ duplicate = &phead->input_timestamps[i];
+ }
+ }
+ }
+ if (duplicate) {
+ phead->entries_filled--;
+ if (print_debug)
+ DEBUG("Getnext Duplicate Time stamp %lld", header->nTimeStamp);
+ duplicate->in_use = false;
+ }
+ }
+
+ if (!phead->entries_filled) {
+ if (!update_head()) {
+ handle_error();
+ return false;
+ }
+ }
+ return status;
+}
diff --git a/mm-video/vidc/vdec/test/decoder_driver_test.c b/mm-video/vidc/vdec/test/decoder_driver_test.c
index fe870f8..1998acc 100644
--- a/mm-video/vidc/vdec/test/decoder_driver_test.c
+++ b/mm-video/vidc/vdec/test/decoder_driver_test.c
@@ -1,1198 +1,1198 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "decoder_driver_test.h"
-
-#define DEBUG_PRINT printf
-/************************************************************************/
-/* #DEFINES */
-/************************************************************************/
-
-#define VOP_START_CODE 0x000001B6
-#define SHORT_HEADER_START_CODE 0x00008000
-#define H264_START_CODE 0x00000001
-
-/************************************************************************/
-/* STATIC VARIABLES */
-/************************************************************************/
-
-static int Code_type;
-static int total_frames = 0;
-static unsigned int header_code = 0;
-static pthread_mutex_t read_lock;
-
-static unsigned int read_frame ( unsigned char *dataptr,unsigned int length,
- FILE * inputBufferFile
- );
-static int Read_Buffer_From_DAT_File( unsigned char *dataptr, unsigned int length,
- FILE * inputBufferFile
- );
-
-static unsigned clp2(unsigned x)
-{
- x = x - 1;
- x = x | (x >> 1);
- x = x | (x >> 2);
- x = x | (x >> 4);
- x = x | (x >> 8);
- x = x | (x >>16);
- return x + 1;
-}
-
-static void* video_thread (void *);
-static void* async_thread (void *);
-
-int main (int argc, char **argv)
-{
- struct video_decoder_context *decoder_context = NULL;
- char *file_name = NULL;
- FILE *file_ptr = NULL;
- int temp1 =0,temp2 =0;
- int error = 1;
- unsigned int i = 0;
-
- file_name = argv [1];
- file_ptr = fopen (file_name,"rb");
-
- if (file_ptr == NULL)
- {
- DEBUG_PRINT("\n File is not located ");
- return -1;
- }
-
-
- decoder_context = (struct video_decoder_context *) \
- calloc (sizeof (struct video_decoder_context),1);
- if (decoder_context == NULL)
- {
- return -1;
- }
- decoder_context->outputBufferFile = NULL;
- decoder_context->inputBufferFile = NULL;
- decoder_context->video_driver_fd = -1;
- decoder_context->inputBufferFile = file_ptr;
-
- file_ptr = fopen ("/data/output.yuv","wb");
- if (file_ptr == NULL)
- {
- DEBUG_PRINT("\n File can't be created");
- free (decoder_context);
- return -1;
- }
- decoder_context->outputBufferFile = file_ptr;
-
- switch (atoi(argv[2]))
- {
- case 0:
- DEBUG_PRINT("\n MPEG4 codec selected");
- decoder_context->decoder_format = VDEC_CODECTYPE_MPEG4;
- Code_type = 0;
- break;
- case 1:
- DEBUG_PRINT("\n H.263");
- decoder_context->decoder_format = VDEC_CODECTYPE_H263;
- Code_type = 0;
- break;
- case 2:
- DEBUG_PRINT("\n H.264");
- decoder_context->decoder_format = VDEC_CODECTYPE_H264;
- Code_type = 1;
- break;
- default:
- DEBUG_PRINT("\n Wrong codec type");
- error = -1;
- break;
- }
-
- if (error != -1)
- {
- temp1 = atoi(argv[3]);
- temp2 = atoi(argv[4]);
-
- if (((temp1%16) != 0) || ((temp2%16) != 0))
- {
- error = -1;
- }
- else
- {
- decoder_context->video_resoultion.frame_height = temp1;
- decoder_context->video_resoultion.frame_width = temp2;
- }
- }
-
- switch (atoi(argv[5]))
- {
- case 0:
- DEBUG_PRINT("\n No Sink");
- decoder_context->outputBufferFile = NULL;
- break;
- }
-
- if ( error != -1 && (init_decoder (decoder_context) == -1 ))
- {
- DEBUG_PRINT("\n Init decoder fails ");
- error = -1;
- }
- DEBUG_PRINT("\n Decoder open successfull");
-
-
- /*Allocate input and output buffers*/
- if (error != -1 && (allocate_buffer (VDEC_BUFFER_TYPE_INPUT,
- decoder_context)== -1))
- {
- DEBUG_PRINT("\n Error in input Buffer allocation");
- error = -1;
- }
-
- if (error != -1 && (allocate_buffer (VDEC_BUFFER_TYPE_OUTPUT,
- decoder_context)== -1))
- {
- DEBUG_PRINT("\n Error in output Buffer allocation");
- error = -1;
- }
-
-
- if (error != -1 && (start_decoding (decoder_context) == -1))
- {
- DEBUG_PRINT("\n Error in start decoding call");
- error = -1;
- }
-
- if (error != -1 && (stop_decoding (decoder_context) == -1))
- {
- DEBUG_PRINT("\n Error in stop decoding call");
- error = -1;
- }
-
- DEBUG_PRINT("\n De-init the decoder");
- if ((deinit_decoder (decoder_context) == -1))
- {
- error = -1;
- }
-
-
- (void)free_buffer (VDEC_BUFFER_TYPE_INPUT,decoder_context);
- (void)free_buffer (VDEC_BUFFER_TYPE_OUTPUT,decoder_context);
-
- if (decoder_context->inputBufferFile != NULL)
- {
- fclose (decoder_context->inputBufferFile);
- }
- if (decoder_context->outputBufferFile != NULL)
- {
- fclose (decoder_context->outputBufferFile);
- }
- DEBUG_PRINT ("\n Total Number of frames decoded %d",total_frames);
- DEBUG_PRINT("\n closing the driver");
- free (decoder_context);
-
- return error;
-}
-
-int init_decoder ( struct video_decoder_context *init_decode )
-{
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- struct video_queue_context *queue_ptr = NULL;
-#ifdef MAX_RES_720P
- enum vdec_output_fromat output_format = VDEC_YUV_FORMAT_NV12;
-#endif
-#ifdef MAX_RES_1080P
- enum vdec_output_fromat output_format = VDEC_YUV_FORMAT_TILE_4x2;
-#endif
-
- pthread_mutexattr_t init_values;
-
- DEBUG_PRINT("\n Before calling the open");
-
- init_decode->video_driver_fd = open ("/dev/msm_vidc_dec", \
- O_RDWR | O_NONBLOCK);
-
-
-
- if (init_decode->video_driver_fd < 0)
- {
- DEBUG_PRINT("\n Open failed");
- return -1;
- }
-
-
- /*Initialize Decoder with codec type and resolution*/
- ioctl_msg.in = &init_decode->decoder_format;
- ioctl_msg.out = NULL;
-
- if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_CODEC,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set codec type failed");
- return -1;
- }
-
- /*Set the output format*/
- ioctl_msg.in = &output_format;
- ioctl_msg.out = NULL;
-
- if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_OUTPUT_FORMAT,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set output format failed");
- return -1;
- }
-
- ioctl_msg.in = &init_decode->video_resoultion;
- ioctl_msg.out = NULL;
-
- if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_PICRES,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set Resolution failed");
- return -1;
- }
- DEBUG_PRINT("\n After Set Resolution");
-
- DEBUG_PRINT("\n Query Input bufffer requirements");
- /*Get the Buffer requirements for input and output ports*/
-
- init_decode->input_buffer.buffer_type = VDEC_BUFFER_TYPE_INPUT;
- ioctl_msg.in = NULL;
- ioctl_msg.out = &init_decode->input_buffer;
-
- if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_GET_BUFFER_REQ,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Requesting for input buffer requirements failed");
- return -1;
- }
-
- DEBUG_PRINT("\n input Size=%d min count =%d actual count = %d", \
- init_decode->input_buffer.buffer_size,\
- init_decode->input_buffer.mincount,\
- init_decode->input_buffer.actualcount);
-
-
- init_decode->input_buffer.buffer_type = VDEC_BUFFER_TYPE_INPUT;
- ioctl_msg.in = &init_decode->input_buffer;
- ioctl_msg.out = NULL;
- init_decode->input_buffer.actualcount = init_decode->input_buffer.mincount + 2;
-
- if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_BUFFER_REQ,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set Buffer Requirements Failed");
- return -1;
- }
-
-
- DEBUG_PRINT("\n Query output bufffer requirements");
- init_decode->output_buffer.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
- ioctl_msg.in = NULL;
- ioctl_msg.out = &init_decode->output_buffer;
-
- if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_GET_BUFFER_REQ,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Requesting for output buffer requirements failed");
- return -1;
- }
-
- DEBUG_PRINT("\n output Size=%d min count =%d actual count = %d", \
- init_decode->output_buffer.buffer_size,\
- init_decode->output_buffer.mincount,\
- init_decode->output_buffer.actualcount);
-
- /*Create Queue related data structures*/
- queue_ptr = &init_decode->queue_context;
- queue_ptr->commandq_size = 50;
- queue_ptr->dataq_size = 50;
-
- sem_init(&queue_ptr->sem_message,0, 0);
- sem_init(&init_decode->sem_synchronize,0, 0);
-
- pthread_mutexattr_init (&init_values);
- pthread_mutex_init (&queue_ptr->mutex,&init_values);
- pthread_mutex_init (&read_lock,&init_values);
- DEBUG_PRINT("\n create Queues");
- queue_ptr->ptr_cmdq = (struct video_msgq*) \
- calloc (sizeof (struct video_msgq),
- queue_ptr->commandq_size);
- queue_ptr->ptr_dataq = (struct video_msgq*) \
- calloc (sizeof (struct video_msgq),
- queue_ptr->dataq_size
- );
-
- if ( queue_ptr->ptr_cmdq == NULL ||
- queue_ptr->ptr_dataq == NULL
- )
- {
- return -1;
- }
- DEBUG_PRINT("\n create Threads");
- /*Create two threads*/
- if ( (pthread_create (&init_decode->videothread_id,NULL,video_thread,
- init_decode) < 0) ||
- (pthread_create (&init_decode->asyncthread_id,NULL,async_thread,
- init_decode) < 0)
- )
- {
- return -1;
- }
-
- return 1;
-}
-
-
-
-int free_buffer ( enum vdec_buffer buffer_dir,
- struct video_decoder_context *decode_context
- )
-{
- unsigned int buffercount = 0,i=0;
- struct vdec_bufferpayload **ptemp = NULL;
-
- if (decode_context == NULL)
- {
- return -1;
- }
-
- if (buffer_dir == VDEC_BUFFER_TYPE_INPUT && decode_context->ptr_inputbuffer)
- {
- buffercount = decode_context->input_buffer.actualcount;
- ptemp = decode_context->ptr_inputbuffer;
-
- for (i=0;i<buffercount;i++)
- {
- if (ptemp [i])
- {
- if (ptemp [i]->pmem_fd != -1)
- {
- munmap ( ptemp [i]->bufferaddr,ptemp [i]->mmaped_size);
- ptemp [i]->bufferaddr = NULL;
- close (ptemp [i]->pmem_fd);
- }
- free (ptemp [i]);
- ptemp [i] = NULL;
- }
- }
- free (decode_context->ptr_inputbuffer);
- decode_context->ptr_inputbuffer = NULL;
- }
- else if ( buffer_dir == VDEC_BUFFER_TYPE_OUTPUT )
- {
- buffercount = decode_context->output_buffer.actualcount;
- ptemp = decode_context->ptr_outputbuffer;
-
- if (decode_context->ptr_respbuffer)
- {
- for (i=0;i<buffercount;i++)
- {
- if (decode_context->ptr_respbuffer [i])
- {
- free (decode_context->ptr_respbuffer[i]);
- decode_context->ptr_respbuffer [i] = NULL;
- }
- }
- free (decode_context->ptr_respbuffer);
- decode_context->ptr_respbuffer = NULL;
- }
-
- if (ptemp)
- {
- for (i=0;i<buffercount;i++)
- {
- if (ptemp [i])
- {
- if (ptemp [i]->pmem_fd != -1)
- {
- munmap ( ptemp [i]->bufferaddr,ptemp [i]->mmaped_size);
- ptemp [i]->bufferaddr = NULL;
- close (ptemp [i]->pmem_fd);
- }
- free (ptemp [i]);
- ptemp [i] = NULL;
- }
- }
- free (ptemp);
- decode_context->ptr_outputbuffer = NULL;
- }
- }
-
- return 1;
-}
-
-int allocate_buffer ( enum vdec_buffer buffer_dir,
- struct video_decoder_context *decode_context
- )
-{
- struct vdec_setbuffer_cmd setbuffers;
- struct vdec_bufferpayload **ptemp = NULL;
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- unsigned int buffercount = 0,i=0,alignedsize=0;
- unsigned int buffersize = 0;
-
- if ( decode_context == NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: context is NULL");
- return -1;
- }
-
- if ( buffer_dir == VDEC_BUFFER_TYPE_INPUT )
- {
- /*Check if buffers are allocated*/
- if (decode_context->ptr_inputbuffer != NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: decode_context->ptr_inputbuffer is set");
- return -1;
- }
-
- buffercount = decode_context->input_buffer.actualcount;
- alignedsize = decode_context->input_buffer.alignment;
- buffersize = decode_context->input_buffer.buffer_size;
- buffersize = (buffersize + alignedsize) & (~alignedsize);
- }
- else if (buffer_dir == VDEC_BUFFER_TYPE_OUTPUT)
- {
- /*Check if buffers are allocated*/
- if (decode_context->ptr_outputbuffer != NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: Double allcoate output");
- return -1;
- }
-
- buffercount = decode_context->output_buffer.actualcount;
- alignedsize = decode_context->output_buffer.alignment;
- buffersize = decode_context->output_buffer.buffer_size;
- buffersize = (buffersize + alignedsize) & (~alignedsize);
-
- decode_context->ptr_respbuffer = (struct vdec_output_frameinfo **)\
- calloc (sizeof (struct vdec_output_frameinfo *),buffercount);
-
- if (decode_context->ptr_respbuffer == NULL)
- {
- DEBUG_PRINT ("\n Allocate failure ptr_respbuffer");
- return -1;
- }
-
- for (i=0; i< buffercount; i++)
- {
- decode_context->ptr_respbuffer [i] = (struct vdec_output_frameinfo *)\
- calloc (sizeof (struct vdec_output_frameinfo),buffercount);
- if (decode_context->ptr_respbuffer [i] == NULL)
- {
- DEBUG_PRINT ("\nfailed to allocate vdec_output_frameinfo");
- return -1;
- }
- }
- }
- else
- {
- DEBUG_PRINT ("\nallocate_buffer: Wrong buffer directions");
- return -1;
- }
-
- ptemp = (struct vdec_bufferpayload **)\
- calloc (sizeof (struct vdec_bufferpayload *),buffercount);
-
- if (ptemp == NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: vdec_bufferpayload failure");
- return -1;
- }
-
-
- if (buffer_dir == VDEC_BUFFER_TYPE_OUTPUT)
- {
- DEBUG_PRINT ("\nallocate_buffer: OUT");
- decode_context->ptr_outputbuffer = ptemp;
- }
- else
- {
- DEBUG_PRINT ("\nallocate_buffer: IN");
- decode_context->ptr_inputbuffer = ptemp;
- }
-
- /*Allocate buffer headers*/
- for (i=0; i< buffercount; i++)
- {
- ptemp [i] = (struct vdec_bufferpayload*)\
- calloc (sizeof (struct vdec_bufferpayload),1);
-
- if (ptemp [i] == NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: ptemp [i] calloc failure");
- return -1;
- }
-
- if (buffer_dir == VDEC_BUFFER_TYPE_OUTPUT)
- {
- decode_context->ptr_respbuffer [i]->client_data = \
- (void *) ptemp [i];
- }
- ptemp [i]->pmem_fd = -1;
-
- }
-
- for (i=0; i< buffercount; i++)
- {
- ptemp [i]->pmem_fd = open ("/dev/pmem_adsp",O_RDWR);
-
- if (ptemp [i]->pmem_fd < 0)
- {
- DEBUG_PRINT ("\nallocate_buffer: open pmem_adsp failed");
- return -1;
- }
-
- ptemp [i]->bufferaddr = mmap(NULL,clp2(buffersize),PROT_READ|PROT_WRITE,
- MAP_SHARED,ptemp [i]->pmem_fd,0);
- DEBUG_PRINT ("\n pmem fd = %d virt addr = %p",ptemp [i]->pmem_fd,\
- ptemp [i]->bufferaddr);
- if (ptemp [i]->bufferaddr == MAP_FAILED)
- {
- ptemp [i]->bufferaddr = NULL;
- DEBUG_PRINT ("\nallocate_buffer: MMAP failed");
- return -1;
- }
- ptemp [i]->buffer_len = buffersize;
- ptemp [i]->mmaped_size = clp2 (buffersize);
-
- setbuffers.buffer_type = buffer_dir;
- memcpy (&setbuffers.buffer,ptemp [i],sizeof (struct vdec_bufferpayload));
-
- ioctl_msg.in = &setbuffers;
- ioctl_msg.out = NULL;
-
- if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_SET_BUFFER,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT ("\nallocate_buffer: Set Buffer IOCTL failed");
- return -1;
- }
-
- }
- DEBUG_PRINT ("\nallocate_buffer: Success");
- return 1;
-}
-
-
-
-int start_decoding (struct video_decoder_context *decode_context)
-{
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- struct vdec_input_frameinfo frameinfo;
- struct vdec_fillbuffer_cmd fillbuffer;
- unsigned int i = 0;
- unsigned int data_len =0;
-
- memset ((unsigned char*)&frameinfo,0,sizeof (struct vdec_input_frameinfo));
- memset ((unsigned char*)&fillbuffer,0,sizeof (struct vdec_fillbuffer_cmd));
-
- if (decode_context == NULL)
- {
- return -1;
- }
-
- if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_CMD_START,
- NULL) < 0)
- {
- DEBUG_PRINT("\n Start failed");
- return -1;
- }
-
- DEBUG_PRINT("\n Start Issued successfully waiting for Start Done");
- /*Wait for Start command response*/
- sem_wait (&decode_context->sem_synchronize);
-
- /*Push output Buffers*/
- i = 0;
- while (i < decode_context->output_buffer.mincount)
- {
- fillbuffer.buffer.buffer_len =
- decode_context->ptr_outputbuffer [i]->buffer_len;
- fillbuffer.buffer.bufferaddr =
- decode_context->ptr_outputbuffer [i]->bufferaddr;
- fillbuffer.buffer.offset =
- decode_context->ptr_outputbuffer [i]->offset;
- fillbuffer.buffer.pmem_fd =
- decode_context->ptr_outputbuffer [i]->pmem_fd;
- fillbuffer.client_data = (void *)decode_context->ptr_respbuffer [i];
- DEBUG_PRINT ("\n Client Data on output = %p",fillbuffer.client_data);
- ioctl_msg.in = &fillbuffer;
- ioctl_msg.out = NULL;
-
- if (ioctl (decode_context->video_driver_fd,
- VDEC_IOCTL_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Decoder frame failed");
- return -1;
- }
- i++;
- }
-
-
- /*push input buffers*/
- i = 0;
- while (i < decode_context->input_buffer.mincount)
- {
- DEBUG_PRINT("\n Read Frame from File");
- data_len = read_frame ( decode_context->ptr_inputbuffer [i]->bufferaddr,
- decode_context->ptr_inputbuffer [i]->buffer_len,
- decode_context->inputBufferFile);
- if (data_len == 0)
- {
- DEBUG_PRINT("\n Length is zero error");
- return -1;
- }
- DEBUG_PRINT("\n Read Frame from File szie = %u",data_len);
- frameinfo.bufferaddr =
- decode_context->ptr_inputbuffer [i]->bufferaddr;
- frameinfo.offset = 0;
- frameinfo.pmem_fd = decode_context->ptr_inputbuffer [i]->pmem_fd;
- frameinfo.pmem_offset = decode_context->ptr_inputbuffer [i]->offset;
- frameinfo.datalen = data_len;
- frameinfo.client_data = (struct vdec_bufferpayload *)\
- decode_context->ptr_inputbuffer [i];
- /*TODO: Time stamp needs to be updated*/
- ioctl_msg.in = &frameinfo;
- ioctl_msg.out = NULL;
-
- if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_DECODE_FRAME,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Decoder frame failed");
- return -1;
- }
- total_frames++;
- i++;
- }
- DEBUG_PRINT ("\n Wait for EOS");
- /*Wait for EOS or Error condition*/
- sem_wait (&decode_context->sem_synchronize);
- DEBUG_PRINT ("\n Reached EOS");
-
- return 1;
-}
-
-int stop_decoding (struct video_decoder_context *decode_context)
-{
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- enum vdec_bufferflush flush_dir = VDEC_FLUSH_TYPE_INPUT;
-
- if (decode_context == NULL)
- {
- return -1;
- }
-
- ioctl_msg.in = &flush_dir;
- ioctl_msg.out = NULL;
-
- if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_CMD_FLUSH,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Flush input failed");
- }
- else
- {
- sem_wait (&decode_context->sem_synchronize);
- }
-
- flush_dir = VDEC_FLUSH_TYPE_OUTPUT;
- ioctl_msg.in = &flush_dir;
- ioctl_msg.out = NULL;
-
- if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_CMD_FLUSH,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Flush output failed");
- }
- else
- {
- sem_wait (&decode_context->sem_synchronize);
- }
-
- DEBUG_PRINT("\n Stop VDEC_IOCTL_CMD_STOP");
- if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_CMD_STOP,
- NULL) < 0)
- {
- DEBUG_PRINT("\n Stop failed");
- }
- else
- {
- sem_wait (&decode_context->sem_synchronize);
- }
- return 1;
-}
-
-int deinit_decoder (struct video_decoder_context *init_decode)
-{
- if (init_decode == NULL)
- {
- return -1;
- }
-
- /*Close the driver*/
- if (init_decode->video_driver_fd != -1)
- {
- close (init_decode->video_driver_fd);
- }
-
- if (init_decode->queue_context.ptr_cmdq)
- {
- free (init_decode->queue_context.ptr_cmdq);
- init_decode->queue_context.ptr_cmdq = NULL;
- }
-
- if (init_decode->queue_context.ptr_dataq)
- {
- free (init_decode->queue_context.ptr_dataq);
- init_decode->queue_context.ptr_dataq = NULL;
- }
-
- sem_destroy (&init_decode->queue_context.sem_message);
- sem_destroy (&init_decode->sem_synchronize);
-
- pthread_mutex_destroy(&init_decode->queue_context.mutex);
- pthread_mutex_destroy (&read_lock);
-
- return 1;
-}
-
-static void* video_thread (void *context)
-{
- struct video_decoder_context *decode_context = NULL;
- struct video_msgq *queueitem = NULL;
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- struct vdec_input_frameinfo frameinfo;
- struct vdec_fillbuffer_cmd fillbuffer;
- struct vdec_output_frameinfo *outputbuffer = NULL;
- struct vdec_bufferpayload *tempbuffer = NULL;
- unsigned int data_len =0;
-
-
- if (context == NULL)
- {
- DEBUG_PRINT("\n video thread recieved NULL context");
- return NULL;
- }
- decode_context = (struct video_decoder_context *) context;
-
- /* Thread function which will accept commands from async thread
- * or main thread
- */
- while (1)
- {
- queueitem = queue_get_cmd (&decode_context ->queue_context);
- if (queueitem != NULL)
- {
- switch (queueitem->cmd)
- {
- case VDEC_MSG_EVT_HW_ERROR:
- DEBUG_PRINT("\n FATAL ERROR ");
- break;
- case VDEC_MSG_RESP_INPUT_FLUSHED:
- DEBUG_PRINT("\n Input Buffer Flushed");
- break;
- case VDEC_MSG_RESP_OUTPUT_FLUSHED:
- DEBUG_PRINT("\n Output buffer Flushed");
- break;
- case VDEC_MSG_RESP_START_DONE:
- DEBUG_PRINT("\n recived start done command");
- sem_post (&decode_context->sem_synchronize);
- break;
-
- case VDEC_MSG_RESP_STOP_DONE:
- DEBUG_PRINT("\n recieved stop done");
- sem_post (&decode_context->sem_synchronize);
- break;
-
- case VDEC_MSG_RESP_INPUT_BUFFER_DONE:
-
- tempbuffer = (struct vdec_bufferpayload *)queueitem->clientdata;
- if (tempbuffer == NULL)
- {
- DEBUG_PRINT("\n FATAL ERROR input buffer address is bad");
- sem_post (&decode_context->sem_synchronize);
- break;
- }
- data_len = read_frame ( tempbuffer->bufferaddr,
- tempbuffer->buffer_len,
- decode_context->inputBufferFile
- );
-
- if (data_len == 0)
- {
- DEBUG_PRINT ("\n End of stream reached");
- sem_post (&decode_context->sem_synchronize);
- break;
- }
-
- frameinfo.bufferaddr = tempbuffer->bufferaddr;
- frameinfo.offset = 0;
- frameinfo.pmem_fd = tempbuffer->pmem_fd;
- frameinfo.pmem_offset = tempbuffer->offset;
- frameinfo.datalen = data_len;
- frameinfo.client_data = (struct vdec_bufferpayload *)\
- tempbuffer;
- /*TODO: Time stamp needs to be updated*/
- ioctl_msg.in = &frameinfo;
- ioctl_msg.out = NULL;
- total_frames++;
- if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_DECODE_FRAME,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Decoder frame failed");
- sem_post (&decode_context->sem_synchronize);
- }
- DEBUG_PRINT("\n Input buffer done send next buffer current value = %d",\
- total_frames);
- break;
-
- case VDEC_MSG_RESP_OUTPUT_BUFFER_DONE:
-
- outputbuffer = (struct vdec_output_frameinfo *)\
- queueitem->clientdata;
- DEBUG_PRINT("\n Value of client Data in VT %p",queueitem->clientdata);
- if (outputbuffer == NULL || outputbuffer->bufferaddr == NULL ||
- outputbuffer->client_data == NULL
- )
- {
- DEBUG_PRINT("\n FATAL ERROR output buffer is bad");
- DEBUG_PRINT("\nValues outputbuffer = %p",outputbuffer);
- if (outputbuffer != NULL)
- {
- DEBUG_PRINT("\nValues outputbuffer->bufferaddr = %p",\
- outputbuffer->bufferaddr);
- DEBUG_PRINT("\nValues outputbuffer->client_data = %p",\
- outputbuffer->client_data);
- }
- sem_post (&decode_context->sem_synchronize);
- break;
- }
-
-
- if (outputbuffer->len == 0)
- {
- DEBUG_PRINT("\n Filled Length is zero Close decoding");
- sem_post (&decode_context->sem_synchronize);
- break;
- }
-
- if (decode_context->outputBufferFile != NULL)
- {
- fwrite (outputbuffer->bufferaddr,1,outputbuffer->len,
- decode_context->outputBufferFile);
- }
-
- tempbuffer = (struct vdec_bufferpayload *)\
- outputbuffer->client_data;
-
- DEBUG_PRINT("\n recieved output buffer consume outbuffer");
- DEBUG_PRINT("\nValues outputbuffer->bufferaddr = %p",\
- outputbuffer->bufferaddr);
- DEBUG_PRINT ("\n Vir address of allocated buffer %p",\
- tempbuffer->bufferaddr);
- fillbuffer.buffer.buffer_len = tempbuffer->buffer_len;
- fillbuffer.buffer.bufferaddr = tempbuffer->bufferaddr;
- fillbuffer.buffer.offset = tempbuffer->offset;
- fillbuffer.buffer.pmem_fd = tempbuffer->pmem_fd;
- fillbuffer.client_data = (void *)outputbuffer;
-
- ioctl_msg.in = &fillbuffer;
- ioctl_msg.out = NULL;
-
- if (ioctl (decode_context->video_driver_fd,
- VDEC_IOCTL_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Decoder frame failed");
- return NULL;
- }
-
- break;
-
- case VDEC_MSG_RESP_FLUSH_INPUT_DONE:
- DEBUG_PRINT("\n Flush input complete");
- sem_post (&decode_context->sem_synchronize);
- break;
-
- case VDEC_MSG_RESP_FLUSH_OUTPUT_DONE:
- DEBUG_PRINT("\n Flush output complete");
- sem_post (&decode_context->sem_synchronize);
- break;
- }
-
- if (queueitem->cmd == VDEC_MSG_RESP_STOP_DONE)
- {
- DEBUG_PRINT("\n Playback has ended thread will exit");
- return NULL;
- }
- }
- else
- {
- DEBUG_PRINT("\n Error condition recieved NULL from Queue");
- }
-
- }
-}
-
-static void* async_thread (void *context)
-{
- struct video_decoder_context *decode_context = NULL;
- struct vdec_output_frameinfo *outputframe = NULL;
- struct video_msgq queueitem ;
- struct vdec_msginfo vdec_msg;
- struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
- int result = -1;
-
- if (context == NULL)
- {
- DEBUG_PRINT("\n aynsc thread recieved NULL context");
- return NULL;
- }
- decode_context = (struct video_decoder_context *) context;
- DEBUG_PRINT("\n Entering the async thread");
-
- while (1)
- {
- ioctl_msg.in = NULL;
-
- ioctl_msg.out = (void*)&vdec_msg;
- DEBUG_PRINT ("\n Sizeof vdec_msginfo = %d ",sizeof (vdec_msg));
- DEBUG_PRINT("\n Address of Vdec msg in async thread %p",\
- ioctl_msg.out);
- if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_GET_NEXT_MSG,\
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Error in ioctl read next msg");
- }
- else
- {
- switch (vdec_msg.msgcode)
- {
- case VDEC_MSG_RESP_FLUSH_INPUT_DONE:
- case VDEC_MSG_RESP_FLUSH_OUTPUT_DONE:
- case VDEC_MSG_RESP_START_DONE:
- case VDEC_MSG_RESP_STOP_DONE:
- case VDEC_MSG_EVT_HW_ERROR:
- DEBUG_PRINT("\nioctl read next msg");
- queueitem.cmd = vdec_msg.msgcode;
- queueitem.status = vdec_msg.status_code;
- queueitem.clientdata = NULL;
- break;
-
- case VDEC_MSG_RESP_INPUT_FLUSHED:
- case VDEC_MSG_RESP_INPUT_BUFFER_DONE:
-
- queueitem.cmd = vdec_msg.msgcode;
- queueitem.status = vdec_msg.status_code;
- queueitem.clientdata = (void *)\
- vdec_msg.msgdata.input_frame_clientdata;
- break;
-
- case VDEC_MSG_RESP_OUTPUT_FLUSHED:
- case VDEC_MSG_RESP_OUTPUT_BUFFER_DONE:
- queueitem.cmd = vdec_msg.msgcode;
- queueitem.status = vdec_msg.status_code;
- outputframe = (struct vdec_output_frameinfo *)\
- vdec_msg.msgdata.output_frame.client_data;
- DEBUG_PRINT ("\n Client Data value in %p", \
- vdec_msg.msgdata.output_frame.client_data);
- outputframe->bufferaddr = vdec_msg.msgdata.output_frame.bufferaddr;
- outputframe->framesize.bottom = \
- vdec_msg.msgdata.output_frame.framesize.bottom;
- outputframe->framesize.left = \
- vdec_msg.msgdata.output_frame.framesize.left;
- outputframe->framesize.right = \
- vdec_msg.msgdata.output_frame.framesize.right;
- outputframe->framesize.top = \
- vdec_msg.msgdata.output_frame.framesize.top;
- outputframe->framesize = vdec_msg.msgdata.output_frame.framesize;
- outputframe->len = vdec_msg.msgdata.output_frame.len;
- outputframe->time_stamp = vdec_msg.msgdata.output_frame.time_stamp;
- queueitem.clientdata = (void *)outputframe;
- DEBUG_PRINT ("\n Client Data value Copy %p",queueitem.clientdata);
- break;
-
- default:
- DEBUG_PRINT("\nIn Default of get next message %d",vdec_msg.msgcode);
- queueitem.cmd = vdec_msg.msgcode;
- queueitem.status = vdec_msg.status_code;
- queueitem.clientdata = NULL;
- break;
- }
- result = queue_post_cmdq (&decode_context->queue_context,&queueitem);
- while (result == 0)
- {
- result = queue_post_cmdq (&decode_context->queue_context,
- &queueitem);
- }
-
- if (result == -1)
- {
- DEBUG_PRINT("\n FATAL ERROR WITH Queue");
- }
- }
- if (vdec_msg.msgcode == VDEC_MSG_RESP_STOP_DONE)
- {
- /*Thread can exit at this point*/
- return NULL;
- }
- }
-}
-
-
-static unsigned int read_frame (unsigned char *dataptr, unsigned int length,
- FILE * inputBufferFile)
-{
-
- unsigned int readOffset = 0;
- int bytes_read = 0;
- unsigned int code = 0;
- int found = 0;
-
- DEBUG_PRINT ("\n Inside the readframe");
-
- if (dataptr == NULL || length == 0)
- {
- DEBUG_PRINT ("\n dataptr = %p length = %u",dataptr,length);
- return 0;
- }
-
- if (!Code_type)
- {
- /* Start of Critical Section*/
- pthread_mutex_lock(&read_lock);
- do
- {
- //Start codes are always byte aligned.
- bytes_read = fread(&dataptr[readOffset],1, 1,inputBufferFile);
- if( !bytes_read)
- {
- DEBUG_PRINT("\n Bytes read Zero \n");
- break;
- }
- code <<= 8;
- code |= (0x000000FF & dataptr[readOffset]);
- //VOP start code comparision
- if (readOffset>3)
- {
- if(!header_code )
- {
- if( VOP_START_CODE == code)
- {
- DEBUG_PRINT ("\n Found VOP Code");
- header_code = VOP_START_CODE;
- }
- else if ( (0xFFFFFC00 & code) == SHORT_HEADER_START_CODE )
- {
- header_code = SHORT_HEADER_START_CODE;
- }
- }
- if ((header_code == VOP_START_CODE) && (code == VOP_START_CODE))
- {
- //Seek backwards by 4
- fseek(inputBufferFile, -4, SEEK_CUR);
- readOffset-=4;
- found = 1;
- break;
-
- }
- else if (( header_code == SHORT_HEADER_START_CODE ) &&
- ( SHORT_HEADER_START_CODE == (code & 0xFFFFFC00)))
- {
- //Seek backwards by 4
- fseek(inputBufferFile, -4, SEEK_CUR);
- readOffset-=4;
- found = 1;
- break;
- }
- }
- readOffset++;
- }while (readOffset < length);
- pthread_mutex_unlock(&read_lock);
- /* End of Critical Section*/
- if (found == 1)
- {
- //DEBUG_PRINT ("Found a Frame");
- return (readOffset+1);
- }
- else
- {
- //DEBUG_PRINT ("No Frames detected");
- return 0;
- }
- }
- else
- {
-
- readOffset = Read_Buffer_From_DAT_File(dataptr,length,inputBufferFile);
- if (total_frames == 0)
- {
- bytes_read = Read_Buffer_From_DAT_File(&dataptr[readOffset],
- (length-readOffset),
- inputBufferFile);
- readOffset += bytes_read;
- }
- return (readOffset);
- }
-
-}
-
-static int Read_Buffer_From_DAT_File(unsigned char *dataptr, unsigned int length,
- FILE * inputBufferFile)
-{
-
-
- long frameSize=0;
- char temp_buffer[10];
- char temp_byte;
- int bytes_read=0;
- int i=0;
- unsigned char *read_buffer=NULL;
- char c = '1'; //initialize to anything except '\0'(0)
- char inputFrameSize[12];
- int count =0; char cnt =0;
- memset(temp_buffer, 0, sizeof(temp_buffer));
-
- while (cnt < 10)
- /* Check the input file format, may result in infinite loop */
- {
- count = fread(&inputFrameSize[cnt],1,1,inputBufferFile);
- if(inputFrameSize[cnt] == '\0' )
- break;
- cnt++;
- }
- inputFrameSize[cnt]='\0';
- frameSize = atoi(inputFrameSize);
- //length = 0;
- DEBUG_PRINT ("\n Frame Size is %d",frameSize);
-
- /* get the frame length */
- fseek(inputBufferFile, -1, SEEK_CUR);
- bytes_read = fread(dataptr, 1, frameSize, inputBufferFile);
-
- if(bytes_read == 0 || bytes_read < frameSize ) {
- return 0;
- }
- return bytes_read;
-}
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "decoder_driver_test.h"
+
+#define DEBUG_PRINT printf
+/************************************************************************/
+/* #DEFINES */
+/************************************************************************/
+
+#define VOP_START_CODE 0x000001B6
+#define SHORT_HEADER_START_CODE 0x00008000
+#define H264_START_CODE 0x00000001
+
+/************************************************************************/
+/* STATIC VARIABLES */
+/************************************************************************/
+
+static int Code_type;
+static int total_frames = 0;
+static unsigned int header_code = 0;
+static pthread_mutex_t read_lock;
+
+static unsigned int read_frame ( unsigned char *dataptr,unsigned int length,
+ FILE * inputBufferFile
+ );
+static int Read_Buffer_From_DAT_File( unsigned char *dataptr, unsigned int length,
+ FILE * inputBufferFile
+ );
+
+static unsigned clp2(unsigned x)
+{
+ x = x - 1;
+ x = x | (x >> 1);
+ x = x | (x >> 2);
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ return x + 1;
+}
+
+static void* video_thread (void *);
+static void* async_thread (void *);
+
+int main (int argc, char **argv)
+{
+ struct video_decoder_context *decoder_context = NULL;
+ char *file_name = NULL;
+ FILE *file_ptr = NULL;
+ int temp1 =0,temp2 =0;
+ int error = 1;
+ unsigned int i = 0;
+
+ file_name = argv [1];
+ file_ptr = fopen (file_name,"rb");
+
+ if (file_ptr == NULL)
+ {
+ DEBUG_PRINT("\n File is not located ");
+ return -1;
+ }
+
+
+ decoder_context = (struct video_decoder_context *) \
+ calloc (sizeof (struct video_decoder_context),1);
+ if (decoder_context == NULL)
+ {
+ return -1;
+ }
+ decoder_context->outputBufferFile = NULL;
+ decoder_context->inputBufferFile = NULL;
+ decoder_context->video_driver_fd = -1;
+ decoder_context->inputBufferFile = file_ptr;
+
+ file_ptr = fopen ("/data/output.yuv","wb");
+ if (file_ptr == NULL)
+ {
+ DEBUG_PRINT("\n File can't be created");
+ free (decoder_context);
+ return -1;
+ }
+ decoder_context->outputBufferFile = file_ptr;
+
+ switch (atoi(argv[2]))
+ {
+ case 0:
+ DEBUG_PRINT("\n MPEG4 codec selected");
+ decoder_context->decoder_format = VDEC_CODECTYPE_MPEG4;
+ Code_type = 0;
+ break;
+ case 1:
+ DEBUG_PRINT("\n H.263");
+ decoder_context->decoder_format = VDEC_CODECTYPE_H263;
+ Code_type = 0;
+ break;
+ case 2:
+ DEBUG_PRINT("\n H.264");
+ decoder_context->decoder_format = VDEC_CODECTYPE_H264;
+ Code_type = 1;
+ break;
+ default:
+ DEBUG_PRINT("\n Wrong codec type");
+ error = -1;
+ break;
+ }
+
+ if (error != -1)
+ {
+ temp1 = atoi(argv[3]);
+ temp2 = atoi(argv[4]);
+
+ if (((temp1%16) != 0) || ((temp2%16) != 0))
+ {
+ error = -1;
+ }
+ else
+ {
+ decoder_context->video_resoultion.frame_height = temp1;
+ decoder_context->video_resoultion.frame_width = temp2;
+ }
+ }
+
+ switch (atoi(argv[5]))
+ {
+ case 0:
+ DEBUG_PRINT("\n No Sink");
+ decoder_context->outputBufferFile = NULL;
+ break;
+ }
+
+ if ( error != -1 && (init_decoder (decoder_context) == -1 ))
+ {
+ DEBUG_PRINT("\n Init decoder fails ");
+ error = -1;
+ }
+ DEBUG_PRINT("\n Decoder open successfull");
+
+
+ /*Allocate input and output buffers*/
+ if (error != -1 && (allocate_buffer (VDEC_BUFFER_TYPE_INPUT,
+ decoder_context)== -1))
+ {
+ DEBUG_PRINT("\n Error in input Buffer allocation");
+ error = -1;
+ }
+
+ if (error != -1 && (allocate_buffer (VDEC_BUFFER_TYPE_OUTPUT,
+ decoder_context)== -1))
+ {
+ DEBUG_PRINT("\n Error in output Buffer allocation");
+ error = -1;
+ }
+
+
+ if (error != -1 && (start_decoding (decoder_context) == -1))
+ {
+ DEBUG_PRINT("\n Error in start decoding call");
+ error = -1;
+ }
+
+ if (error != -1 && (stop_decoding (decoder_context) == -1))
+ {
+ DEBUG_PRINT("\n Error in stop decoding call");
+ error = -1;
+ }
+
+ DEBUG_PRINT("\n De-init the decoder");
+ if ((deinit_decoder (decoder_context) == -1))
+ {
+ error = -1;
+ }
+
+
+ (void)free_buffer (VDEC_BUFFER_TYPE_INPUT,decoder_context);
+ (void)free_buffer (VDEC_BUFFER_TYPE_OUTPUT,decoder_context);
+
+ if (decoder_context->inputBufferFile != NULL)
+ {
+ fclose (decoder_context->inputBufferFile);
+ }
+ if (decoder_context->outputBufferFile != NULL)
+ {
+ fclose (decoder_context->outputBufferFile);
+ }
+ DEBUG_PRINT ("\n Total Number of frames decoded %d",total_frames);
+ DEBUG_PRINT("\n closing the driver");
+ free (decoder_context);
+
+ return error;
+}
+
+int init_decoder ( struct video_decoder_context *init_decode )
+{
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct video_queue_context *queue_ptr = NULL;
+#ifdef MAX_RES_720P
+ enum vdec_output_fromat output_format = VDEC_YUV_FORMAT_NV12;
+#endif
+#ifdef MAX_RES_1080P
+ enum vdec_output_fromat output_format = VDEC_YUV_FORMAT_TILE_4x2;
+#endif
+
+ pthread_mutexattr_t init_values;
+
+ DEBUG_PRINT("\n Before calling the open");
+
+ init_decode->video_driver_fd = open ("/dev/msm_vidc_dec", \
+ O_RDWR | O_NONBLOCK);
+
+
+
+ if (init_decode->video_driver_fd < 0)
+ {
+ DEBUG_PRINT("\n Open failed");
+ return -1;
+ }
+
+
+ /*Initialize Decoder with codec type and resolution*/
+ ioctl_msg.in = &init_decode->decoder_format;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_CODEC,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set codec type failed");
+ return -1;
+ }
+
+ /*Set the output format*/
+ ioctl_msg.in = &output_format;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_OUTPUT_FORMAT,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set output format failed");
+ return -1;
+ }
+
+ ioctl_msg.in = &init_decode->video_resoultion;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_PICRES,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set Resolution failed");
+ return -1;
+ }
+ DEBUG_PRINT("\n After Set Resolution");
+
+ DEBUG_PRINT("\n Query Input bufffer requirements");
+ /*Get the Buffer requirements for input and output ports*/
+
+ init_decode->input_buffer.buffer_type = VDEC_BUFFER_TYPE_INPUT;
+ ioctl_msg.in = NULL;
+ ioctl_msg.out = &init_decode->input_buffer;
+
+ if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_GET_BUFFER_REQ,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Requesting for input buffer requirements failed");
+ return -1;
+ }
+
+ DEBUG_PRINT("\n input Size=%d min count =%d actual count = %d", \
+ init_decode->input_buffer.buffer_size,\
+ init_decode->input_buffer.mincount,\
+ init_decode->input_buffer.actualcount);
+
+
+ init_decode->input_buffer.buffer_type = VDEC_BUFFER_TYPE_INPUT;
+ ioctl_msg.in = &init_decode->input_buffer;
+ ioctl_msg.out = NULL;
+ init_decode->input_buffer.actualcount = init_decode->input_buffer.mincount + 2;
+
+ if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_SET_BUFFER_REQ,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set Buffer Requirements Failed");
+ return -1;
+ }
+
+
+ DEBUG_PRINT("\n Query output bufffer requirements");
+ init_decode->output_buffer.buffer_type = VDEC_BUFFER_TYPE_OUTPUT;
+ ioctl_msg.in = NULL;
+ ioctl_msg.out = &init_decode->output_buffer;
+
+ if (ioctl (init_decode->video_driver_fd,VDEC_IOCTL_GET_BUFFER_REQ,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Requesting for output buffer requirements failed");
+ return -1;
+ }
+
+ DEBUG_PRINT("\n output Size=%d min count =%d actual count = %d", \
+ init_decode->output_buffer.buffer_size,\
+ init_decode->output_buffer.mincount,\
+ init_decode->output_buffer.actualcount);
+
+ /*Create Queue related data structures*/
+ queue_ptr = &init_decode->queue_context;
+ queue_ptr->commandq_size = 50;
+ queue_ptr->dataq_size = 50;
+
+ sem_init(&queue_ptr->sem_message,0, 0);
+ sem_init(&init_decode->sem_synchronize,0, 0);
+
+ pthread_mutexattr_init (&init_values);
+ pthread_mutex_init (&queue_ptr->mutex,&init_values);
+ pthread_mutex_init (&read_lock,&init_values);
+ DEBUG_PRINT("\n create Queues");
+ queue_ptr->ptr_cmdq = (struct video_msgq*) \
+ calloc (sizeof (struct video_msgq),
+ queue_ptr->commandq_size);
+ queue_ptr->ptr_dataq = (struct video_msgq*) \
+ calloc (sizeof (struct video_msgq),
+ queue_ptr->dataq_size
+ );
+
+ if ( queue_ptr->ptr_cmdq == NULL ||
+ queue_ptr->ptr_dataq == NULL
+ )
+ {
+ return -1;
+ }
+ DEBUG_PRINT("\n create Threads");
+ /*Create two threads*/
+ if ( (pthread_create (&init_decode->videothread_id,NULL,video_thread,
+ init_decode) < 0) ||
+ (pthread_create (&init_decode->asyncthread_id,NULL,async_thread,
+ init_decode) < 0)
+ )
+ {
+ return -1;
+ }
+
+ return 1;
+}
+
+
+
+int free_buffer ( enum vdec_buffer buffer_dir,
+ struct video_decoder_context *decode_context
+ )
+{
+ unsigned int buffercount = 0,i=0;
+ struct vdec_bufferpayload **ptemp = NULL;
+
+ if (decode_context == NULL)
+ {
+ return -1;
+ }
+
+ if (buffer_dir == VDEC_BUFFER_TYPE_INPUT && decode_context->ptr_inputbuffer)
+ {
+ buffercount = decode_context->input_buffer.actualcount;
+ ptemp = decode_context->ptr_inputbuffer;
+
+ for (i=0;i<buffercount;i++)
+ {
+ if (ptemp [i])
+ {
+ if (ptemp [i]->pmem_fd != -1)
+ {
+ munmap ( ptemp [i]->bufferaddr,ptemp [i]->mmaped_size);
+ ptemp [i]->bufferaddr = NULL;
+ close (ptemp [i]->pmem_fd);
+ }
+ free (ptemp [i]);
+ ptemp [i] = NULL;
+ }
+ }
+ free (decode_context->ptr_inputbuffer);
+ decode_context->ptr_inputbuffer = NULL;
+ }
+ else if ( buffer_dir == VDEC_BUFFER_TYPE_OUTPUT )
+ {
+ buffercount = decode_context->output_buffer.actualcount;
+ ptemp = decode_context->ptr_outputbuffer;
+
+ if (decode_context->ptr_respbuffer)
+ {
+ for (i=0;i<buffercount;i++)
+ {
+ if (decode_context->ptr_respbuffer [i])
+ {
+ free (decode_context->ptr_respbuffer[i]);
+ decode_context->ptr_respbuffer [i] = NULL;
+ }
+ }
+ free (decode_context->ptr_respbuffer);
+ decode_context->ptr_respbuffer = NULL;
+ }
+
+ if (ptemp)
+ {
+ for (i=0;i<buffercount;i++)
+ {
+ if (ptemp [i])
+ {
+ if (ptemp [i]->pmem_fd != -1)
+ {
+ munmap ( ptemp [i]->bufferaddr,ptemp [i]->mmaped_size);
+ ptemp [i]->bufferaddr = NULL;
+ close (ptemp [i]->pmem_fd);
+ }
+ free (ptemp [i]);
+ ptemp [i] = NULL;
+ }
+ }
+ free (ptemp);
+ decode_context->ptr_outputbuffer = NULL;
+ }
+ }
+
+ return 1;
+}
+
+int allocate_buffer ( enum vdec_buffer buffer_dir,
+ struct video_decoder_context *decode_context
+ )
+{
+ struct vdec_setbuffer_cmd setbuffers;
+ struct vdec_bufferpayload **ptemp = NULL;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ unsigned int buffercount = 0,i=0,alignedsize=0;
+ unsigned int buffersize = 0;
+
+ if ( decode_context == NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: context is NULL");
+ return -1;
+ }
+
+ if ( buffer_dir == VDEC_BUFFER_TYPE_INPUT )
+ {
+ /*Check if buffers are allocated*/
+ if (decode_context->ptr_inputbuffer != NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: decode_context->ptr_inputbuffer is set");
+ return -1;
+ }
+
+ buffercount = decode_context->input_buffer.actualcount;
+ alignedsize = decode_context->input_buffer.alignment;
+ buffersize = decode_context->input_buffer.buffer_size;
+ buffersize = (buffersize + alignedsize) & (~alignedsize);
+ }
+ else if (buffer_dir == VDEC_BUFFER_TYPE_OUTPUT)
+ {
+ /*Check if buffers are allocated*/
+ if (decode_context->ptr_outputbuffer != NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Double allcoate output");
+ return -1;
+ }
+
+ buffercount = decode_context->output_buffer.actualcount;
+ alignedsize = decode_context->output_buffer.alignment;
+ buffersize = decode_context->output_buffer.buffer_size;
+ buffersize = (buffersize + alignedsize) & (~alignedsize);
+
+ decode_context->ptr_respbuffer = (struct vdec_output_frameinfo **)\
+ calloc (sizeof (struct vdec_output_frameinfo *),buffercount);
+
+ if (decode_context->ptr_respbuffer == NULL)
+ {
+ DEBUG_PRINT ("\n Allocate failure ptr_respbuffer");
+ return -1;
+ }
+
+ for (i=0; i< buffercount; i++)
+ {
+ decode_context->ptr_respbuffer [i] = (struct vdec_output_frameinfo *)\
+ calloc (sizeof (struct vdec_output_frameinfo),buffercount);
+ if (decode_context->ptr_respbuffer [i] == NULL)
+ {
+ DEBUG_PRINT ("\nfailed to allocate vdec_output_frameinfo");
+ return -1;
+ }
+ }
+ }
+ else
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Wrong buffer directions");
+ return -1;
+ }
+
+ ptemp = (struct vdec_bufferpayload **)\
+ calloc (sizeof (struct vdec_bufferpayload *),buffercount);
+
+ if (ptemp == NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: vdec_bufferpayload failure");
+ return -1;
+ }
+
+
+ if (buffer_dir == VDEC_BUFFER_TYPE_OUTPUT)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: OUT");
+ decode_context->ptr_outputbuffer = ptemp;
+ }
+ else
+ {
+ DEBUG_PRINT ("\nallocate_buffer: IN");
+ decode_context->ptr_inputbuffer = ptemp;
+ }
+
+ /*Allocate buffer headers*/
+ for (i=0; i< buffercount; i++)
+ {
+ ptemp [i] = (struct vdec_bufferpayload*)\
+ calloc (sizeof (struct vdec_bufferpayload),1);
+
+ if (ptemp [i] == NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: ptemp [i] calloc failure");
+ return -1;
+ }
+
+ if (buffer_dir == VDEC_BUFFER_TYPE_OUTPUT)
+ {
+ decode_context->ptr_respbuffer [i]->client_data = \
+ (void *) ptemp [i];
+ }
+ ptemp [i]->pmem_fd = -1;
+
+ }
+
+ for (i=0; i< buffercount; i++)
+ {
+ ptemp [i]->pmem_fd = open ("/dev/pmem_adsp",O_RDWR);
+
+ if (ptemp [i]->pmem_fd < 0)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: open pmem_adsp failed");
+ return -1;
+ }
+
+ ptemp [i]->bufferaddr = mmap(NULL,clp2(buffersize),PROT_READ|PROT_WRITE,
+ MAP_SHARED,ptemp [i]->pmem_fd,0);
+ DEBUG_PRINT ("\n pmem fd = %d virt addr = %p",ptemp [i]->pmem_fd,\
+ ptemp [i]->bufferaddr);
+ if (ptemp [i]->bufferaddr == MAP_FAILED)
+ {
+ ptemp [i]->bufferaddr = NULL;
+ DEBUG_PRINT ("\nallocate_buffer: MMAP failed");
+ return -1;
+ }
+ ptemp [i]->buffer_len = buffersize;
+ ptemp [i]->mmaped_size = clp2 (buffersize);
+
+ setbuffers.buffer_type = buffer_dir;
+ memcpy (&setbuffers.buffer,ptemp [i],sizeof (struct vdec_bufferpayload));
+
+ ioctl_msg.in = &setbuffers;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_SET_BUFFER,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Set Buffer IOCTL failed");
+ return -1;
+ }
+
+ }
+ DEBUG_PRINT ("\nallocate_buffer: Success");
+ return 1;
+}
+
+
+
+int start_decoding (struct video_decoder_context *decode_context)
+{
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct vdec_input_frameinfo frameinfo;
+ struct vdec_fillbuffer_cmd fillbuffer;
+ unsigned int i = 0;
+ unsigned int data_len =0;
+
+ memset ((unsigned char*)&frameinfo,0,sizeof (struct vdec_input_frameinfo));
+ memset ((unsigned char*)&fillbuffer,0,sizeof (struct vdec_fillbuffer_cmd));
+
+ if (decode_context == NULL)
+ {
+ return -1;
+ }
+
+ if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_CMD_START,
+ NULL) < 0)
+ {
+ DEBUG_PRINT("\n Start failed");
+ return -1;
+ }
+
+ DEBUG_PRINT("\n Start Issued successfully waiting for Start Done");
+ /*Wait for Start command response*/
+ sem_wait (&decode_context->sem_synchronize);
+
+ /*Push output Buffers*/
+ i = 0;
+ while (i < decode_context->output_buffer.mincount)
+ {
+ fillbuffer.buffer.buffer_len =
+ decode_context->ptr_outputbuffer [i]->buffer_len;
+ fillbuffer.buffer.bufferaddr =
+ decode_context->ptr_outputbuffer [i]->bufferaddr;
+ fillbuffer.buffer.offset =
+ decode_context->ptr_outputbuffer [i]->offset;
+ fillbuffer.buffer.pmem_fd =
+ decode_context->ptr_outputbuffer [i]->pmem_fd;
+ fillbuffer.client_data = (void *)decode_context->ptr_respbuffer [i];
+ DEBUG_PRINT ("\n Client Data on output = %p",fillbuffer.client_data);
+ ioctl_msg.in = &fillbuffer;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (decode_context->video_driver_fd,
+ VDEC_IOCTL_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Decoder frame failed");
+ return -1;
+ }
+ i++;
+ }
+
+
+ /*push input buffers*/
+ i = 0;
+ while (i < decode_context->input_buffer.mincount)
+ {
+ DEBUG_PRINT("\n Read Frame from File");
+ data_len = read_frame ( decode_context->ptr_inputbuffer [i]->bufferaddr,
+ decode_context->ptr_inputbuffer [i]->buffer_len,
+ decode_context->inputBufferFile);
+ if (data_len == 0)
+ {
+ DEBUG_PRINT("\n Length is zero error");
+ return -1;
+ }
+ DEBUG_PRINT("\n Read Frame from File szie = %u",data_len);
+ frameinfo.bufferaddr =
+ decode_context->ptr_inputbuffer [i]->bufferaddr;
+ frameinfo.offset = 0;
+ frameinfo.pmem_fd = decode_context->ptr_inputbuffer [i]->pmem_fd;
+ frameinfo.pmem_offset = decode_context->ptr_inputbuffer [i]->offset;
+ frameinfo.datalen = data_len;
+ frameinfo.client_data = (struct vdec_bufferpayload *)\
+ decode_context->ptr_inputbuffer [i];
+ /*TODO: Time stamp needs to be updated*/
+ ioctl_msg.in = &frameinfo;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_DECODE_FRAME,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Decoder frame failed");
+ return -1;
+ }
+ total_frames++;
+ i++;
+ }
+ DEBUG_PRINT ("\n Wait for EOS");
+ /*Wait for EOS or Error condition*/
+ sem_wait (&decode_context->sem_synchronize);
+ DEBUG_PRINT ("\n Reached EOS");
+
+ return 1;
+}
+
+int stop_decoding (struct video_decoder_context *decode_context)
+{
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ enum vdec_bufferflush flush_dir = VDEC_FLUSH_TYPE_INPUT;
+
+ if (decode_context == NULL)
+ {
+ return -1;
+ }
+
+ ioctl_msg.in = &flush_dir;
+ ioctl_msg.out = NULL;
+
+ if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_CMD_FLUSH,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Flush input failed");
+ }
+ else
+ {
+ sem_wait (&decode_context->sem_synchronize);
+ }
+
+ flush_dir = VDEC_FLUSH_TYPE_OUTPUT;
+ ioctl_msg.in = &flush_dir;
+ ioctl_msg.out = NULL;
+
+ if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_CMD_FLUSH,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Flush output failed");
+ }
+ else
+ {
+ sem_wait (&decode_context->sem_synchronize);
+ }
+
+ DEBUG_PRINT("\n Stop VDEC_IOCTL_CMD_STOP");
+ if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_CMD_STOP,
+ NULL) < 0)
+ {
+ DEBUG_PRINT("\n Stop failed");
+ }
+ else
+ {
+ sem_wait (&decode_context->sem_synchronize);
+ }
+ return 1;
+}
+
+int deinit_decoder (struct video_decoder_context *init_decode)
+{
+ if (init_decode == NULL)
+ {
+ return -1;
+ }
+
+ /*Close the driver*/
+ if (init_decode->video_driver_fd != -1)
+ {
+ close (init_decode->video_driver_fd);
+ }
+
+ if (init_decode->queue_context.ptr_cmdq)
+ {
+ free (init_decode->queue_context.ptr_cmdq);
+ init_decode->queue_context.ptr_cmdq = NULL;
+ }
+
+ if (init_decode->queue_context.ptr_dataq)
+ {
+ free (init_decode->queue_context.ptr_dataq);
+ init_decode->queue_context.ptr_dataq = NULL;
+ }
+
+ sem_destroy (&init_decode->queue_context.sem_message);
+ sem_destroy (&init_decode->sem_synchronize);
+
+ pthread_mutex_destroy(&init_decode->queue_context.mutex);
+ pthread_mutex_destroy (&read_lock);
+
+ return 1;
+}
+
+static void* video_thread (void *context)
+{
+ struct video_decoder_context *decode_context = NULL;
+ struct video_msgq *queueitem = NULL;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct vdec_input_frameinfo frameinfo;
+ struct vdec_fillbuffer_cmd fillbuffer;
+ struct vdec_output_frameinfo *outputbuffer = NULL;
+ struct vdec_bufferpayload *tempbuffer = NULL;
+ unsigned int data_len =0;
+
+
+ if (context == NULL)
+ {
+ DEBUG_PRINT("\n video thread recieved NULL context");
+ return NULL;
+ }
+ decode_context = (struct video_decoder_context *) context;
+
+ /* Thread function which will accept commands from async thread
+ * or main thread
+ */
+ while (1)
+ {
+ queueitem = queue_get_cmd (&decode_context ->queue_context);
+ if (queueitem != NULL)
+ {
+ switch (queueitem->cmd)
+ {
+ case VDEC_MSG_EVT_HW_ERROR:
+ DEBUG_PRINT("\n FATAL ERROR ");
+ break;
+ case VDEC_MSG_RESP_INPUT_FLUSHED:
+ DEBUG_PRINT("\n Input Buffer Flushed");
+ break;
+ case VDEC_MSG_RESP_OUTPUT_FLUSHED:
+ DEBUG_PRINT("\n Output buffer Flushed");
+ break;
+ case VDEC_MSG_RESP_START_DONE:
+ DEBUG_PRINT("\n recived start done command");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+
+ case VDEC_MSG_RESP_STOP_DONE:
+ DEBUG_PRINT("\n recieved stop done");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+
+ case VDEC_MSG_RESP_INPUT_BUFFER_DONE:
+
+ tempbuffer = (struct vdec_bufferpayload *)queueitem->clientdata;
+ if (tempbuffer == NULL)
+ {
+ DEBUG_PRINT("\n FATAL ERROR input buffer address is bad");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+ }
+ data_len = read_frame ( tempbuffer->bufferaddr,
+ tempbuffer->buffer_len,
+ decode_context->inputBufferFile
+ );
+
+ if (data_len == 0)
+ {
+ DEBUG_PRINT ("\n End of stream reached");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+ }
+
+ frameinfo.bufferaddr = tempbuffer->bufferaddr;
+ frameinfo.offset = 0;
+ frameinfo.pmem_fd = tempbuffer->pmem_fd;
+ frameinfo.pmem_offset = tempbuffer->offset;
+ frameinfo.datalen = data_len;
+ frameinfo.client_data = (struct vdec_bufferpayload *)\
+ tempbuffer;
+ /*TODO: Time stamp needs to be updated*/
+ ioctl_msg.in = &frameinfo;
+ ioctl_msg.out = NULL;
+ total_frames++;
+ if (ioctl(decode_context->video_driver_fd,VDEC_IOCTL_DECODE_FRAME,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Decoder frame failed");
+ sem_post (&decode_context->sem_synchronize);
+ }
+ DEBUG_PRINT("\n Input buffer done send next buffer current value = %d",\
+ total_frames);
+ break;
+
+ case VDEC_MSG_RESP_OUTPUT_BUFFER_DONE:
+
+ outputbuffer = (struct vdec_output_frameinfo *)\
+ queueitem->clientdata;
+ DEBUG_PRINT("\n Value of client Data in VT %p",queueitem->clientdata);
+ if (outputbuffer == NULL || outputbuffer->bufferaddr == NULL ||
+ outputbuffer->client_data == NULL
+ )
+ {
+ DEBUG_PRINT("\n FATAL ERROR output buffer is bad");
+ DEBUG_PRINT("\nValues outputbuffer = %p",outputbuffer);
+ if (outputbuffer != NULL)
+ {
+ DEBUG_PRINT("\nValues outputbuffer->bufferaddr = %p",\
+ outputbuffer->bufferaddr);
+ DEBUG_PRINT("\nValues outputbuffer->client_data = %p",\
+ outputbuffer->client_data);
+ }
+ sem_post (&decode_context->sem_synchronize);
+ break;
+ }
+
+
+ if (outputbuffer->len == 0)
+ {
+ DEBUG_PRINT("\n Filled Length is zero Close decoding");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+ }
+
+ if (decode_context->outputBufferFile != NULL)
+ {
+ fwrite (outputbuffer->bufferaddr,1,outputbuffer->len,
+ decode_context->outputBufferFile);
+ }
+
+ tempbuffer = (struct vdec_bufferpayload *)\
+ outputbuffer->client_data;
+
+ DEBUG_PRINT("\n recieved output buffer consume outbuffer");
+ DEBUG_PRINT("\nValues outputbuffer->bufferaddr = %p",\
+ outputbuffer->bufferaddr);
+ DEBUG_PRINT ("\n Vir address of allocated buffer %p",\
+ tempbuffer->bufferaddr);
+ fillbuffer.buffer.buffer_len = tempbuffer->buffer_len;
+ fillbuffer.buffer.bufferaddr = tempbuffer->bufferaddr;
+ fillbuffer.buffer.offset = tempbuffer->offset;
+ fillbuffer.buffer.pmem_fd = tempbuffer->pmem_fd;
+ fillbuffer.client_data = (void *)outputbuffer;
+
+ ioctl_msg.in = &fillbuffer;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (decode_context->video_driver_fd,
+ VDEC_IOCTL_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Decoder frame failed");
+ return NULL;
+ }
+
+ break;
+
+ case VDEC_MSG_RESP_FLUSH_INPUT_DONE:
+ DEBUG_PRINT("\n Flush input complete");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+
+ case VDEC_MSG_RESP_FLUSH_OUTPUT_DONE:
+ DEBUG_PRINT("\n Flush output complete");
+ sem_post (&decode_context->sem_synchronize);
+ break;
+ }
+
+ if (queueitem->cmd == VDEC_MSG_RESP_STOP_DONE)
+ {
+ DEBUG_PRINT("\n Playback has ended thread will exit");
+ return NULL;
+ }
+ }
+ else
+ {
+ DEBUG_PRINT("\n Error condition recieved NULL from Queue");
+ }
+
+ }
+}
+
+static void* async_thread (void *context)
+{
+ struct video_decoder_context *decode_context = NULL;
+ struct vdec_output_frameinfo *outputframe = NULL;
+ struct video_msgq queueitem ;
+ struct vdec_msginfo vdec_msg;
+ struct vdec_ioctl_msg ioctl_msg = {NULL,NULL};
+ int result = -1;
+
+ if (context == NULL)
+ {
+ DEBUG_PRINT("\n aynsc thread recieved NULL context");
+ return NULL;
+ }
+ decode_context = (struct video_decoder_context *) context;
+ DEBUG_PRINT("\n Entering the async thread");
+
+ while (1)
+ {
+ ioctl_msg.in = NULL;
+
+ ioctl_msg.out = (void*)&vdec_msg;
+ DEBUG_PRINT ("\n Sizeof vdec_msginfo = %d ",sizeof (vdec_msg));
+ DEBUG_PRINT("\n Address of Vdec msg in async thread %p",\
+ ioctl_msg.out);
+ if (ioctl (decode_context->video_driver_fd,VDEC_IOCTL_GET_NEXT_MSG,\
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Error in ioctl read next msg");
+ }
+ else
+ {
+ switch (vdec_msg.msgcode)
+ {
+ case VDEC_MSG_RESP_FLUSH_INPUT_DONE:
+ case VDEC_MSG_RESP_FLUSH_OUTPUT_DONE:
+ case VDEC_MSG_RESP_START_DONE:
+ case VDEC_MSG_RESP_STOP_DONE:
+ case VDEC_MSG_EVT_HW_ERROR:
+ DEBUG_PRINT("\nioctl read next msg");
+ queueitem.cmd = vdec_msg.msgcode;
+ queueitem.status = vdec_msg.status_code;
+ queueitem.clientdata = NULL;
+ break;
+
+ case VDEC_MSG_RESP_INPUT_FLUSHED:
+ case VDEC_MSG_RESP_INPUT_BUFFER_DONE:
+
+ queueitem.cmd = vdec_msg.msgcode;
+ queueitem.status = vdec_msg.status_code;
+ queueitem.clientdata = (void *)\
+ vdec_msg.msgdata.input_frame_clientdata;
+ break;
+
+ case VDEC_MSG_RESP_OUTPUT_FLUSHED:
+ case VDEC_MSG_RESP_OUTPUT_BUFFER_DONE:
+ queueitem.cmd = vdec_msg.msgcode;
+ queueitem.status = vdec_msg.status_code;
+ outputframe = (struct vdec_output_frameinfo *)\
+ vdec_msg.msgdata.output_frame.client_data;
+ DEBUG_PRINT ("\n Client Data value in %p", \
+ vdec_msg.msgdata.output_frame.client_data);
+ outputframe->bufferaddr = vdec_msg.msgdata.output_frame.bufferaddr;
+ outputframe->framesize.bottom = \
+ vdec_msg.msgdata.output_frame.framesize.bottom;
+ outputframe->framesize.left = \
+ vdec_msg.msgdata.output_frame.framesize.left;
+ outputframe->framesize.right = \
+ vdec_msg.msgdata.output_frame.framesize.right;
+ outputframe->framesize.top = \
+ vdec_msg.msgdata.output_frame.framesize.top;
+ outputframe->framesize = vdec_msg.msgdata.output_frame.framesize;
+ outputframe->len = vdec_msg.msgdata.output_frame.len;
+ outputframe->time_stamp = vdec_msg.msgdata.output_frame.time_stamp;
+ queueitem.clientdata = (void *)outputframe;
+ DEBUG_PRINT ("\n Client Data value Copy %p",queueitem.clientdata);
+ break;
+
+ default:
+ DEBUG_PRINT("\nIn Default of get next message %d",vdec_msg.msgcode);
+ queueitem.cmd = vdec_msg.msgcode;
+ queueitem.status = vdec_msg.status_code;
+ queueitem.clientdata = NULL;
+ break;
+ }
+ result = queue_post_cmdq (&decode_context->queue_context,&queueitem);
+ while (result == 0)
+ {
+ result = queue_post_cmdq (&decode_context->queue_context,
+ &queueitem);
+ }
+
+ if (result == -1)
+ {
+ DEBUG_PRINT("\n FATAL ERROR WITH Queue");
+ }
+ }
+ if (vdec_msg.msgcode == VDEC_MSG_RESP_STOP_DONE)
+ {
+ /*Thread can exit at this point*/
+ return NULL;
+ }
+ }
+}
+
+
+static unsigned int read_frame (unsigned char *dataptr, unsigned int length,
+ FILE * inputBufferFile)
+{
+
+ unsigned int readOffset = 0;
+ int bytes_read = 0;
+ unsigned int code = 0;
+ int found = 0;
+
+ DEBUG_PRINT ("\n Inside the readframe");
+
+ if (dataptr == NULL || length == 0)
+ {
+ DEBUG_PRINT ("\n dataptr = %p length = %u",dataptr,length);
+ return 0;
+ }
+
+ if (!Code_type)
+ {
+ /* Start of Critical Section*/
+ pthread_mutex_lock(&read_lock);
+ do
+ {
+ //Start codes are always byte aligned.
+ bytes_read = fread(&dataptr[readOffset],1, 1,inputBufferFile);
+ if( !bytes_read)
+ {
+ DEBUG_PRINT("\n Bytes read Zero \n");
+ break;
+ }
+ code <<= 8;
+ code |= (0x000000FF & dataptr[readOffset]);
+ //VOP start code comparision
+ if (readOffset>3)
+ {
+ if(!header_code )
+ {
+ if( VOP_START_CODE == code)
+ {
+ DEBUG_PRINT ("\n Found VOP Code");
+ header_code = VOP_START_CODE;
+ }
+ else if ( (0xFFFFFC00 & code) == SHORT_HEADER_START_CODE )
+ {
+ header_code = SHORT_HEADER_START_CODE;
+ }
+ }
+ if ((header_code == VOP_START_CODE) && (code == VOP_START_CODE))
+ {
+ //Seek backwards by 4
+ fseek(inputBufferFile, -4, SEEK_CUR);
+ readOffset-=4;
+ found = 1;
+ break;
+
+ }
+ else if (( header_code == SHORT_HEADER_START_CODE ) &&
+ ( SHORT_HEADER_START_CODE == (code & 0xFFFFFC00)))
+ {
+ //Seek backwards by 4
+ fseek(inputBufferFile, -4, SEEK_CUR);
+ readOffset-=4;
+ found = 1;
+ break;
+ }
+ }
+ readOffset++;
+ }while (readOffset < length);
+ pthread_mutex_unlock(&read_lock);
+ /* End of Critical Section*/
+ if (found == 1)
+ {
+ //DEBUG_PRINT ("Found a Frame");
+ return (readOffset+1);
+ }
+ else
+ {
+ //DEBUG_PRINT ("No Frames detected");
+ return 0;
+ }
+ }
+ else
+ {
+
+ readOffset = Read_Buffer_From_DAT_File(dataptr,length,inputBufferFile);
+ if (total_frames == 0)
+ {
+ bytes_read = Read_Buffer_From_DAT_File(&dataptr[readOffset],
+ (length-readOffset),
+ inputBufferFile);
+ readOffset += bytes_read;
+ }
+ return (readOffset);
+ }
+
+}
+
+static int Read_Buffer_From_DAT_File(unsigned char *dataptr, unsigned int length,
+ FILE * inputBufferFile)
+{
+
+
+ long frameSize=0;
+ char temp_buffer[10];
+ char temp_byte;
+ int bytes_read=0;
+ int i=0;
+ unsigned char *read_buffer=NULL;
+ char c = '1'; //initialize to anything except '\0'(0)
+ char inputFrameSize[12];
+ int count =0; char cnt =0;
+ memset(temp_buffer, 0, sizeof(temp_buffer));
+
+ while (cnt < 10)
+ /* Check the input file format, may result in infinite loop */
+ {
+ count = fread(&inputFrameSize[cnt],1,1,inputBufferFile);
+ if(inputFrameSize[cnt] == '\0' )
+ break;
+ cnt++;
+ }
+ inputFrameSize[cnt]='\0';
+ frameSize = atoi(inputFrameSize);
+ //length = 0;
+ DEBUG_PRINT ("\n Frame Size is %d",frameSize);
+
+ /* get the frame length */
+ fseek(inputBufferFile, -1, SEEK_CUR);
+ bytes_read = fread(dataptr, 1, frameSize, inputBufferFile);
+
+ if(bytes_read == 0 || bytes_read < frameSize ) {
+ return 0;
+ }
+ return bytes_read;
+}
diff --git a/mm-video/vidc/vdec/test/omx_vdec_test.cpp b/mm-video/vidc/vdec/test/omx_vdec_test.cpp
index 84a0743..06fee26 100644
--- a/mm-video/vidc/vdec/test/omx_vdec_test.cpp
+++ b/mm-video/vidc/vdec/test/omx_vdec_test.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010 - 2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -29,8 +29,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
An Open max test application ....
*/
-#define LOG_TAG "OMX-VDEC-TEST"
-
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -45,7 +43,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <semaphore.h>
#include "OMX_QCOMExtns.h"
#include <sys/time.h>
-#include <cutils/properties.h>
#ifndef USE_ION
#include <linux/android_pmem.h>
@@ -57,6 +54,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
extern "C"{
#include<utils/Log.h>
}
+#define LOG_TAG "OMX-VDEC-TEST"
#define DEBUG_PRINT
#define DEBUG_PRINT_ERROR ALOGE
@@ -93,7 +91,6 @@ extern "C" {
#define DELAY 66
#define false 0
#define true 1
-#define H264_START_CODE 0x00000001
#define VOP_START_CODE 0x000001B6
#define SHORT_HEADER_START_CODE 0x00008000
#define MPEG2_FRAME_START_CODE 0x00000100
@@ -137,77 +134,6 @@ static int previous_vc1_au = 0;
using namespace android;
#endif
-#ifdef _MSM8974_
-typedef unsigned short int uint16;
-const uint16 CRC_INIT = 0xFFFF ;
-
-const uint16 crc_16_l_table[ 256 ] = {
- 0x0000, 0x1189, 0x2312, 0x329b, 0x4624, 0x57ad, 0x6536, 0x74bf,
- 0x8c48, 0x9dc1, 0xaf5a, 0xbed3, 0xca6c, 0xdbe5, 0xe97e, 0xf8f7,
- 0x1081, 0x0108, 0x3393, 0x221a, 0x56a5, 0x472c, 0x75b7, 0x643e,
- 0x9cc9, 0x8d40, 0xbfdb, 0xae52, 0xdaed, 0xcb64, 0xf9ff, 0xe876,
- 0x2102, 0x308b, 0x0210, 0x1399, 0x6726, 0x76af, 0x4434, 0x55bd,
- 0xad4a, 0xbcc3, 0x8e58, 0x9fd1, 0xeb6e, 0xfae7, 0xc87c, 0xd9f5,
- 0x3183, 0x200a, 0x1291, 0x0318, 0x77a7, 0x662e, 0x54b5, 0x453c,
- 0xbdcb, 0xac42, 0x9ed9, 0x8f50, 0xfbef, 0xea66, 0xd8fd, 0xc974,
- 0x4204, 0x538d, 0x6116, 0x709f, 0x0420, 0x15a9, 0x2732, 0x36bb,
- 0xce4c, 0xdfc5, 0xed5e, 0xfcd7, 0x8868, 0x99e1, 0xab7a, 0xbaf3,
- 0x5285, 0x430c, 0x7197, 0x601e, 0x14a1, 0x0528, 0x37b3, 0x263a,
- 0xdecd, 0xcf44, 0xfddf, 0xec56, 0x98e9, 0x8960, 0xbbfb, 0xaa72,
- 0x6306, 0x728f, 0x4014, 0x519d, 0x2522, 0x34ab, 0x0630, 0x17b9,
- 0xef4e, 0xfec7, 0xcc5c, 0xddd5, 0xa96a, 0xb8e3, 0x8a78, 0x9bf1,
- 0x7387, 0x620e, 0x5095, 0x411c, 0x35a3, 0x242a, 0x16b1, 0x0738,
- 0xffcf, 0xee46, 0xdcdd, 0xcd54, 0xb9eb, 0xa862, 0x9af9, 0x8b70,
- 0x8408, 0x9581, 0xa71a, 0xb693, 0xc22c, 0xd3a5, 0xe13e, 0xf0b7,
- 0x0840, 0x19c9, 0x2b52, 0x3adb, 0x4e64, 0x5fed, 0x6d76, 0x7cff,
- 0x9489, 0x8500, 0xb79b, 0xa612, 0xd2ad, 0xc324, 0xf1bf, 0xe036,
- 0x18c1, 0x0948, 0x3bd3, 0x2a5a, 0x5ee5, 0x4f6c, 0x7df7, 0x6c7e,
- 0xa50a, 0xb483, 0x8618, 0x9791, 0xe32e, 0xf2a7, 0xc03c, 0xd1b5,
- 0x2942, 0x38cb, 0x0a50, 0x1bd9, 0x6f66, 0x7eef, 0x4c74, 0x5dfd,
- 0xb58b, 0xa402, 0x9699, 0x8710, 0xf3af, 0xe226, 0xd0bd, 0xc134,
- 0x39c3, 0x284a, 0x1ad1, 0x0b58, 0x7fe7, 0x6e6e, 0x5cf5, 0x4d7c,
- 0xc60c, 0xd785, 0xe51e, 0xf497, 0x8028, 0x91a1, 0xa33a, 0xb2b3,
- 0x4a44, 0x5bcd, 0x6956, 0x78df, 0x0c60, 0x1de9, 0x2f72, 0x3efb,
- 0xd68d, 0xc704, 0xf59f, 0xe416, 0x90a9, 0x8120, 0xb3bb, 0xa232,
- 0x5ac5, 0x4b4c, 0x79d7, 0x685e, 0x1ce1, 0x0d68, 0x3ff3, 0x2e7a,
- 0xe70e, 0xf687, 0xc41c, 0xd595, 0xa12a, 0xb0a3, 0x8238, 0x93b1,
- 0x6b46, 0x7acf, 0x4854, 0x59dd, 0x2d62, 0x3ceb, 0x0e70, 0x1ff9,
- 0xf78f, 0xe606, 0xd49d, 0xc514, 0xb1ab, 0xa022, 0x92b9, 0x8330,
- 0x7bc7, 0x6a4e, 0x58d5, 0x495c, 0x3de3, 0x2c6a, 0x1ef1, 0x0f78
-};
-
-uint16 crc_16_l_step_nv12 (uint16 seed, const void *buf_ptr,
- unsigned int byte_len, unsigned int height, unsigned int width)
-{
- uint16 crc_16 = ~seed;
- char *buf = (char *)buf_ptr;
- char *byte_ptr = buf;
- int i, j;
- const unsigned int width_align = 32;
- const unsigned int height_align = 32;
- unsigned int stride = (width + width_align -1) & (~(width_align-1));
- unsigned int scan_lines = (height + height_align -1) & (~(height_align-1));
- for (i = 0; i < height; i++) {
- for (j = 0; j < stride; j++) {
- if (j < width) {
- crc_16 = crc_16_l_table[ (crc_16 ^ *byte_ptr) & 0x00ff ] ^ (crc_16 >> 8);
- }
- byte_ptr++;
- }
- }
- byte_ptr = buf + (scan_lines * stride);
- for (i = scan_lines; i < scan_lines + height/2;i++) {
- for (j = 0; j < stride; j++) {
- if (j < width) {
- crc_16 = crc_16_l_table[ (crc_16 ^ *byte_ptr) & 0x00ff ] ^ (crc_16 >> 8);
- }
- byte_ptr++;
- }
- }
- return( ~crc_16 );
-}
-#endif
-
typedef enum {
CODEC_FORMAT_H264 = 1,
CODEC_FORMAT_MP4,
@@ -215,10 +141,7 @@ typedef enum {
CODEC_FORMAT_VC1,
CODEC_FORMAT_DIVX,
CODEC_FORMAT_MPEG2,
-#ifdef _MSM8974_
- CODEC_FORMAT_VP8,
-#endif
- CODEC_FORMAT_MAX
+ CODEC_FORMAT_MAX = CODEC_FORMAT_MPEG2
} codec_format;
typedef enum {
@@ -228,7 +151,6 @@ typedef enum {
FILE_TYPE_START_OF_H264_SPECIFIC = 10,
FILE_TYPE_264_NAL_SIZE_LENGTH = FILE_TYPE_START_OF_H264_SPECIFIC,
- FILE_TYPE_264_START_CODE_BASED,
FILE_TYPE_START_OF_MP4_SPECIFIC = 20,
FILE_TYPE_PICTURE_START_CODE = FILE_TYPE_START_OF_MP4_SPECIFIC,
@@ -242,13 +164,7 @@ typedef enum {
FILE_TYPE_DIVX_311,
FILE_TYPE_START_OF_MPEG2_SPECIFIC = 50,
- FILE_TYPE_MPEG2_START_CODE = FILE_TYPE_START_OF_MPEG2_SPECIFIC,
-
-#ifdef _MSM8974_
- FILE_TYPE_START_OF_VP8_SPECIFIC = 60,
- FILE_TYPE_VP8_START_CODE = FILE_TYPE_START_OF_VP8_SPECIFIC,
- FILE_TYPE_VP8
-#endif
+ FILE_TYPE_MPEG2_START_CODE = FILE_TYPE_START_OF_MPEG2_SPECIFIC
} file_type;
@@ -275,9 +191,6 @@ static int (*Read_Buffer)(OMX_BUFFERHEADERTYPE *pBufHdr );
int inputBufferFileFd;
FILE * outputBufferFile;
-#ifdef _MSM8974_
-FILE * crcFile;
-#endif
FILE * seqFile;
int takeYuvLog = 0;
int displayYuv = 0;
@@ -352,9 +265,6 @@ int ebd_cnt= 0, fbd_cnt = 0;
int bInputEosReached = 0;
int bOutputEosReached = 0;
char in_filename[512];
-#ifdef _MSM8974_
-char crclogname[512];
-#endif
char seq_file_name[512];
unsigned char seq_enabled = 0;
bool anti_flickering = true;
@@ -411,16 +321,12 @@ int run_tests();
static int video_playback_count = 1;
static int open_video_file ();
static int Read_Buffer_From_DAT_File(OMX_BUFFERHEADERTYPE *pBufHdr );
-static int Read_Buffer_From_H264_Start_Code_File(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_ArbitraryBytes(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_Vop_Start_Code_File(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_Mpeg2_Start_Code(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_Size_Nal(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_RCV_File_Seq_Layer(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_RCV_File(OMX_BUFFERHEADERTYPE *pBufHdr);
-#ifdef _MSM8974_
-static int Read_Buffer_From_VP8_File(OMX_BUFFERHEADERTYPE *pBufHdr);
-#endif
static int Read_Buffer_From_VC1_File(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_DivX_4_5_6_File(OMX_BUFFERHEADERTYPE *pBufHdr);
static int Read_Buffer_From_DivX_311_File(OMX_BUFFERHEADERTYPE *pBufHdr);
@@ -467,8 +373,6 @@ static bool align_pmem_buffers(int pmem_fd, OMX_U32 buffer_size,
OMX_U32 alignment);
#endif
void getFreePmem();
-static int overlay_vsync_ctrl(int enable);
-
static int clip2(int x)
{
x = x -1;
@@ -686,6 +590,7 @@ void* ebd_thread(void* pArg)
DEBUG_PRINT_ERROR("Error - No etb pBuffer to dequeue\n");
continue;
}
+
pBuffer->nOffset = 0;
if((readBytes = Read_Buffer(pBuffer)) > 0) {
pBuffer->nFilledLen = readBytes;
@@ -716,15 +621,9 @@ void* fbd_thread(void* pArg)
int canDisplay = 1, contigous_drop_frame = 0, bytes_written = 0, ret = 0;
OMX_S64 base_timestamp = 0, lastTimestamp = 0;
OMX_BUFFERHEADERTYPE *pBuffer = NULL, *pPrevBuff = NULL;
- char value[PROPERTY_VALUE_MAX] = {0};
- OMX_U32 aspectratio_prop = 0;
pthread_mutex_lock(&eos_lock);
-#ifdef _MSM8974_
- int stride,scanlines,stride_c,i;
-#endif
+
DEBUG_PRINT("First Inside %s\n", __FUNCTION__);
- property_get("vidc.vdec.debug.aspectratio", value, "0");
- aspectratio_prop = atoi(value);
while(currentStatus != ERROR_STATE && !bOutputEosReached)
{
pthread_mutex_unlock(&eos_lock);
@@ -741,10 +640,6 @@ void* fbd_thread(void* pArg)
{
pthread_mutex_unlock(&enable_lock);
pthread_mutex_lock(&fbd_lock);
- if (pPrevBuff != NULL ) {
- push(fbd_queue, (void *)pBuffer);
- pPrevBuff = NULL;
- }
if (free_op_buf_cnt == portFmt.nBufferCountActual)
free_output_buffers();
pthread_mutex_unlock(&fbd_lock);
@@ -833,27 +728,8 @@ void* fbd_thread(void* pArg)
if (takeYuvLog)
{
- if (color_fmt == (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m)
- {
- unsigned int stride = ((width + 127) & (~127));
- unsigned int scanlines = ((height+31) & (~31));
- char *temp = (char *) pBuffer->pBuffer;
- int i = 0;
- for (i = 0; i < height; i++) {
- bytes_written = fwrite(temp, width, 1, outputBufferFile);
- temp += stride;
- }
- temp = (char *)pBuffer->pBuffer + stride * scanlines;
- for(i = 0; i < height/2; i++) {
- bytes_written += fwrite(temp, width, 1, outputBufferFile);
- temp += stride;
- }
- }
- else
- {
- bytes_written = fwrite((const char *)pBuffer->pBuffer,
- pBuffer->nFilledLen,1,outputBufferFile);
- }
+ bytes_written = fwrite((const char *)pBuffer->pBuffer,
+ pBuffer->nFilledLen,1,outputBufferFile);
if (bytes_written < 0) {
DEBUG_PRINT("\nFillBufferDone: Failed to write to the file\n");
}
@@ -862,17 +738,6 @@ void* fbd_thread(void* pArg)
bytes_written);
}
}
-#ifdef _MSM8974_
- if (crcFile) {
- uint16 crc_val;
- crc_val = crc_16_l_step_nv12(CRC_INIT, pBuffer->pBuffer,
- pBuffer->nFilledLen, height, width);
- int num_bytes = fwrite(&crc_val, 1, sizeof(crc_val), crcFile);
- if (num_bytes < sizeof(crc_val)) {
- printf("Failed to write CRC value into file\n");
- }
- }
-#endif
if (pBuffer->nFlags & OMX_BUFFERFLAG_EXTRADATA)
{
OMX_OTHER_EXTRADATATYPE *pExtra;
@@ -902,16 +767,9 @@ void* fbd_thread(void* pArg)
DEBUG_PRINT("OMX_ExtraDataFrameInfo: Buf(%p) TSmp(%lld) PicType(%u) IntT(%u) ConMB(%u)",
pBuffer->pBuffer, pBuffer->nTimeStamp, frame_info->ePicType,
frame_info->interlaceType, frame_info->nConcealedMacroblocks);
- if (aspectratio_prop)
- DEBUG_PRINT_ERROR(" FrmRate(%u), AspRatioX(%u), AspRatioY(%u) DispWidth(%u) DispHeight(%u)",
- frame_info->nFrameRate, frame_info->aspectRatio.aspectRatioX,
- frame_info->aspectRatio.aspectRatioY, frame_info->displayAspectRatio.displayHorizontalSize,
- frame_info->displayAspectRatio.displayVerticalSize);
- else
- DEBUG_PRINT(" FrmRate(%u), AspRatioX(%u), AspRatioY(%u) DispWidth(%u) DispHeight(%u)",
+ DEBUG_PRINT(" FrmRate(%u), AspRatioX(%u), AspRatioY(%u) ",
frame_info->nFrameRate, frame_info->aspectRatio.aspectRatioX,
- frame_info->aspectRatio.aspectRatioY, frame_info->displayAspectRatio.displayHorizontalSize,
- frame_info->displayAspectRatio.displayVerticalSize);
+ frame_info->aspectRatio.aspectRatioY);
DEBUG_PRINT("PANSCAN numWindows(%d)", frame_info->panScan.numWindows);
for (int i = 0; i < frame_info->panScan.numWindows; i++)
{
@@ -943,32 +801,6 @@ void* fbd_thread(void* pArg)
pBuffer->pBuffer, pBuffer->nTimeStamp, concealMBnum);
}
break;
- case OMX_ExtraDataMP2ExtnData:
- {
- DEBUG_PRINT("\nOMX_ExtraDataMP2ExtnData");
- OMX_U8 data = 0, *data_ptr = (OMX_U8 *)pExtra->data;
- OMX_U32 bytes_cnt = 0;
- while (bytes_cnt < pExtra->nDataSize)
- {
- DEBUG_PRINT("\n MPEG-2 Extension Data Values[%d] = 0x%x", bytes_cnt, *data_ptr);
- data_ptr++;
- bytes_cnt++;
- }
- }
- break;
- case OMX_ExtraDataMP2UserData:
- {
- DEBUG_PRINT("\nOMX_ExtraDataMP2UserData");
- OMX_U8 data = 0, *data_ptr = (OMX_U8 *)pExtra->data;
- OMX_U32 bytes_cnt = 0;
- while (bytes_cnt < pExtra->nDataSize)
- {
- DEBUG_PRINT("\n MPEG-2 User Data Values[%d] = 0x%x", bytes_cnt, *data_ptr);
- data_ptr++;
- bytes_cnt++;
- }
- }
- break;
default:
DEBUG_PRINT_ERROR("Unknown Extrata!");
}
@@ -1153,10 +985,6 @@ OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
break;
case OMX_EventPortSettingsChanged:
DEBUG_PRINT("OMX_EventPortSettingsChanged port[%d]\n", nData1);
-#ifdef _MSM8974_
- if (nData2 != OMX_IndexParamPortDefinition)
- break;
-#endif
currentStatus = PORT_SETTING_CHANGE_STATE;
if (waitForPortSettingsChanged)
{
@@ -1173,9 +1001,6 @@ OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
case OMX_EventBufferFlag:
DEBUG_PRINT("OMX_EventBufferFlag port[%d] flags[%x]\n", nData1, nData2);
-#if 0
- // we should not set the bOutputEosReached here. in stead we wait until fbd_thread to
- // check the flag so that all frames can be dumped for bit exactness check.
if (nData1 == 1 && (nData2 & OMX_BUFFERFLAG_EOS)) {
pthread_mutex_lock(&eos_lock);
bOutputEosReached = true;
@@ -1191,7 +1016,6 @@ OMX_ERRORTYPE EventHandler(OMX_IN OMX_HANDLETYPE hComponent,
{
DEBUG_PRINT_ERROR("OMX_EventBufferFlag Event not handled\n");
}
-#endif
break;
case OMX_EventIndexsettingChanged:
DEBUG_PRINT("OMX_EventIndexSettingChanged Interlace mode[%x]\n", nData1);
@@ -1283,10 +1107,6 @@ int main(int argc, char **argv)
}
strlcpy(in_filename, argv[1], strlen(argv[1])+1);
-#ifdef _MSM8974_
- strlcpy(crclogname, argv[1], strlen(argv[1])+1);
- strcat(crclogname, ".crc");
-#endif
if(argc > 2)
{
codec_format_option = (codec_format)atoi(argv[2]);
@@ -1348,9 +1168,6 @@ int main(int argc, char **argv)
printf(" 4--> VC1\n");
printf(" 5--> DivX\n");
printf(" 6--> MPEG2\n");
-#ifdef _MSM8974_
- printf(" 7--> VP8\n");
-#endif
fflush(stdin);
fgets(tempbuf,sizeof(tempbuf),stdin);
sscanf(tempbuf,"%d",&codec_format_option);
@@ -1368,7 +1185,6 @@ int main(int argc, char **argv)
if (codec_format_option == CODEC_FORMAT_H264)
{
printf(" 3--> NAL LENGTH SIZE CLIP (.264c)\n");
- printf(" 4--> START CODE BASED CLIP (.264/.h264)\n");
}
else if ( (codec_format_option == CODEC_FORMAT_MP4) || (codec_format_option == CODEC_FORMAT_H263) )
{
@@ -1390,21 +1206,10 @@ int main(int argc, char **argv)
{
printf(" 3--> MPEG2 START CODE CLIP (.m2v)\n");
}
-#ifdef _MSM8974_
- else if (codec_format_option == CODEC_FORMAT_VP8)
- {
- printf(" 61--> VP8 START CODE CLIP (.ivf)\n");
- }
-#endif
+
fflush(stdin);
fgets(tempbuf,sizeof(tempbuf),stdin);
sscanf(tempbuf,"%d",&file_type_option);
-#ifdef _MSM8974_
- if (codec_format_option == CODEC_FORMAT_VP8)
- {
- file_type_option = FILE_TYPE_VP8;
- }
-#endif
fflush(stdin);
if (codec_format_option == CODEC_FORMAT_H264 && file_type_option == 3)
{
@@ -1529,10 +1334,6 @@ int main(int argc, char **argv)
case CODEC_FORMAT_MPEG2:
file_type_option = (file_type)(FILE_TYPE_START_OF_MPEG2_SPECIFIC + file_type_option - FILE_TYPE_COMMON_CODEC_MAX);
break;
-#ifdef _MSM8974_
- case CODEC_FORMAT_VP8:
- break;
-#endif
default:
printf("Error: Unknown code %d\n", codec_format_option);
}
@@ -1695,14 +1496,7 @@ int run_tests()
Read_Buffer = Read_Buffer_ArbitraryBytes;
}
else if(codec_format_option == CODEC_FORMAT_H264) {
- if (file_type_option == FILE_TYPE_264_NAL_SIZE_LENGTH) {
- Read_Buffer = Read_Buffer_From_Size_Nal;
- } else if (file_type_option == FILE_TYPE_264_START_CODE_BASED) {
- Read_Buffer = Read_Buffer_From_H264_Start_Code_File;
- } else {
- DEBUG_PRINT_ERROR("Invalid file_type_option(%d) for H264", file_type_option);
- return -1;
- }
+ Read_Buffer = Read_Buffer_From_Size_Nal;
}
else if((codec_format_option == CODEC_FORMAT_H263) ||
(codec_format_option == CODEC_FORMAT_MP4)) {
@@ -1722,11 +1516,6 @@ int run_tests()
else if(file_type_option == FILE_TYPE_RCV) {
Read_Buffer = Read_Buffer_From_RCV_File;
}
-#ifdef _MSM8974_
- else if(file_type_option == FILE_TYPE_VP8) {
- Read_Buffer = Read_Buffer_From_VP8_File;
- }
-#endif
else if(file_type_option == FILE_TYPE_VC1) {
Read_Buffer = Read_Buffer_From_VC1_File;
}
@@ -1737,15 +1526,11 @@ int run_tests()
{
case FILE_TYPE_DAT_PER_AU:
case FILE_TYPE_ARBITRARY_BYTES:
- case FILE_TYPE_264_START_CODE_BASED:
case FILE_TYPE_264_NAL_SIZE_LENGTH:
case FILE_TYPE_PICTURE_START_CODE:
case FILE_TYPE_MPEG2_START_CODE:
case FILE_TYPE_RCV:
case FILE_TYPE_VC1:
-#ifdef _MSM8974_
- case FILE_TYPE_VP8:
-#endif
case FILE_TYPE_DIVX_4_5_6:
#ifdef MAX_RES_1080P
case FILE_TYPE_DIVX_311:
@@ -1903,12 +1688,6 @@ int Init_Decoder()
{
strlcpy(vdecCompNames, "OMX.qcom.video.decoder.divx", 28);
}
-#ifdef _MSM8974_
- else if (codec_format_option == CODEC_FORMAT_VP8)
- {
- strlcpy(vdecCompNames, "OMX.qcom.video.decoder.vp8", 27);
- }
-#endif
#ifdef MAX_RES_1080P
else if (file_type_option == FILE_TYPE_DIVX_311)
{
@@ -2013,7 +1792,6 @@ int Play_Decoder()
case FILE_TYPE_DAT_PER_AU:
case FILE_TYPE_PICTURE_START_CODE:
case FILE_TYPE_MPEG2_START_CODE:
- case FILE_TYPE_264_START_CODE_BASED:
case FILE_TYPE_RCV:
case FILE_TYPE_VC1:
#ifdef MAX_RES_1080P
@@ -2031,13 +1809,7 @@ int Play_Decoder()
inputPortFmt.nFramePackingFormat = OMX_QCOM_FramePacking_Arbitrary;
break;
}
-#ifdef _MSM8974_
- case FILE_TYPE_VP8:
- {
- inputPortFmt.nFramePackingFormat = OMX_QCOM_FramePacking_OnlyOneCompleteFrame;
- break;
- }
-#endif
+
default:
inputPortFmt.nFramePackingFormat = OMX_QCOM_FramePacking_Unspecified;
}
@@ -2085,11 +1857,6 @@ int Play_Decoder()
OMX_SetParameter(dec_handle,(OMX_INDEXTYPE)OMX_QcomIndexParamConcealMBMapExtraData,
(OMX_PTR)&extra_data);
#endif
-#if 0
- extra_data.bEnable = OMX_TRUE;
- OMX_SetParameter(dec_handle,(OMX_INDEXTYPE)OMX_QcomIndexEnableExtnUserData,
- (OMX_PTR)&extra_data);
-#endif
/* Query the decoder outport's min buf requirements */
CONFIG_VERSION_SIZE(portFmt);
@@ -2146,9 +1913,8 @@ int Play_Decoder()
color_fmt = (OMX_COLOR_FORMATTYPE)
QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
}
-#elif _MSM8974_
- color_fmt = (OMX_COLOR_FORMATTYPE)
- QOMX_COLOR_FORMATYUV420PackedSemiPlanar32m;
+#elif _COPPER_
+ color_fmt = OMX_COLOR_FormatYUV420SemiPlanar;
#else
color_fmt = (OMX_COLOR_FORMATTYPE)
QOMX_COLOR_FormatYUV420PackedSemiPlanar64x32Tile2m8ka;
@@ -2798,12 +2564,6 @@ static void do_freeHandle_and_clean_up(bool isDueToError)
fclose(outputBufferFile);
outputBufferFile = NULL;
}
-#ifdef _MSM8974_
- if (crcFile) {
- fclose(crcFile);
- crcFile = NULL;
- }
-#endif
DEBUG_PRINT("[OMX Vdec Test] - after free outputfile\n");
if(etb_queue)
@@ -2872,92 +2632,6 @@ static int Read_Buffer_From_DAT_File(OMX_BUFFERHEADERTYPE *pBufHdr)
return bytes_read;
}
-static int Read_Buffer_From_H264_Start_Code_File(OMX_BUFFERHEADERTYPE *pBufHdr)
-{
- int bytes_read = 0;
- int cnt = 0;
- unsigned int code = 0;
- int naluType = 0;
- int newFrame = 0;
- char *dataptr = (char *)pBufHdr->pBuffer;
- DEBUG_PRINT("Inside %s", __FUNCTION__);
- do
- {
- newFrame = 0;
- bytes_read = read(inputBufferFileFd, &dataptr[cnt], 1);
- if (!bytes_read)
- {
- DEBUG_PRINT("\n%s: Bytes read Zero", __FUNCTION__);
- break;
- }
- code <<= 8;
- code |= (0x000000FF & dataptr[cnt]);
- cnt++;
- if ((cnt == 4) && (code != H264_START_CODE))
- {
- DEBUG_PRINT_ERROR("\n%s: ERROR: Invalid start code found 0x%x", __FUNCTION__, code);
- cnt = 0;
- break;
- }
- if ((cnt > 4) && (code == H264_START_CODE))
- {
- DEBUG_PRINT("%s: Found H264_START_CODE", __FUNCTION__);
- bytes_read = read(inputBufferFileFd, &dataptr[cnt], 1);
- if (!bytes_read)
- {
- DEBUG_PRINT("\n%s: Bytes read Zero", __FUNCTION__);
- break;
- }
- DEBUG_PRINT("%s: READ Byte[%d] = 0x%x", __FUNCTION__, cnt, dataptr[cnt]);
- naluType = dataptr[cnt] & 0x1F;
- cnt++;
- if ((naluType == 1) || (naluType == 5))
- {
- DEBUG_PRINT("%s: Found AU", __FUNCTION__);
- bytes_read = read(inputBufferFileFd, &dataptr[cnt], 1);
- if (!bytes_read)
- {
- DEBUG_PRINT("\n%s: Bytes read Zero", __FUNCTION__);
- break;
- }
- DEBUG_PRINT("%s: READ Byte[%d] = 0x%x", __FUNCTION__, cnt, dataptr[cnt]);
- newFrame = (dataptr[cnt] & 0x80);
- cnt++;
- if (newFrame)
- {
- lseek64(inputBufferFileFd, -6, SEEK_CUR);
- cnt -= 6;
- DEBUG_PRINT("%s: Found a NAL unit (type 0x%x) of size = %d", __FUNCTION__, (dataptr[4] & 0x1F), cnt);
- break;
- }
- else
- {
- DEBUG_PRINT("%s: Not a New Frame", __FUNCTION__);
- }
- }
- else
- {
- lseek64(inputBufferFileFd, -5, SEEK_CUR);
- cnt -= 5;
- DEBUG_PRINT("%s: Found NAL unit (type 0x%x) of size = %d", __FUNCTION__, (dataptr[4] & 0x1F), cnt);
- break;
- }
- }
- } while (1);
-
-#ifdef TEST_TS_FROM_SEI
- if (timeStampLfile == 0)
- pBufHdr->nTimeStamp = 0;
- else
- pBufHdr->nTimeStamp = LLONG_MAX;
-#else
- pBufHdr->nTimeStamp = timeStampLfile;
-#endif
- timeStampLfile += timestampInterval;
-
- return cnt;
-}
-
static int Read_Buffer_ArbitraryBytes(OMX_BUFFERHEADERTYPE *pBufHdr)
{
int bytes_read=0;
@@ -3586,56 +3260,7 @@ static int Read_Buffer_From_DivX_311_File(OMX_BUFFERHEADERTYPE *pBufHdr)
return n_offset;
}
-#ifdef _MSM8974_
-static int Read_Buffer_From_VP8_File(OMX_BUFFERHEADERTYPE *pBufHdr)
-{
- static OMX_S64 timeStampLfile = 0;
- char *p_buffer = NULL;
- bool pkt_ready = false;
- unsigned int frame_type = 0;
- unsigned int bytes_read = 0;
- unsigned int frame_size = 0;
- unsigned int num_bytes_size = 4;
- unsigned int num_bytes_frame_type = 1;
- unsigned long long time_stamp;
- unsigned int n_offset = pBufHdr->nOffset;
- static int ivf_header_read;
- if (pBufHdr != NULL)
- {
- p_buffer = (char *)pBufHdr->pBuffer + pBufHdr->nOffset;
- }
- else
- {
- DEBUG_PRINT("\n ERROR:Read_Buffer_From_DivX_311_File: pBufHdr is NULL\n");
- return 0;
- }
-
- if (p_buffer == NULL)
- {
- DEBUG_PRINT("\n ERROR:Read_Buffer_From_DivX_311_File: p_bufhdr is NULL\n");
- return 0;
- }
-
- if(ivf_header_read == 0) {
- bytes_read = read(inputBufferFileFd, p_buffer, 32);
- ivf_header_read = 1;
- if(p_buffer[0] == 'D' && p_buffer[1] == 'K' && p_buffer[2] == 'I' && p_buffer[3] == 'F')
- {
- printf(" \n IVF header found \n ");
- } else
- {
- printf(" \n No IVF header found \n ");
- lseek(inputBufferFileFd, -32, SEEK_CUR);
- }
- }
- bytes_read = read(inputBufferFileFd, &frame_size, 4);
- bytes_read = read(inputBufferFileFd, &time_stamp, 8);
- n_offset += read(inputBufferFileFd, p_buffer, frame_size);
- pBufHdr->nTimeStamp = time_stamp;
- return n_offset;
-}
-#endif
static int open_video_file ()
{
int error_code = 0;
@@ -3664,15 +3289,6 @@ static int open_video_file ()
DEBUG_PRINT("O/p file %s is opened \n", outputfilename);
}
}
-#ifdef _MSM8974_
- /*if (!crcFile) {
- crcFile = fopen(crclogname, "ab");
- if (!crcFile) {
- printf("Failed to open CRC file\n");
- error_code = -1;
- }
- }*/
-#endif
return error_code;
}
@@ -3728,19 +3344,6 @@ int drawBG(void)
return 0;
}
-static int overlay_vsync_ctrl(int enable)
-{
- int ret;
- int vsync_en = enable;
- ret = ioctl(fb_fd, MSMFB_OVERLAY_VSYNC_CTRL, &vsync_en);
- if (ret)
- printf("\n MSMFB_OVERLAY_VSYNC_CTRL failed! (Line %d)\n",
- __LINE__);
- return ret;
-}
-
-
-
void overlay_set()
{
overlayp = &overlay;
@@ -3756,9 +3359,6 @@ void overlay_set()
#ifdef MAX_RES_1080P
overlayp->src.format = MDP_Y_CBCR_H2V2_TILE;
#endif
-#ifdef _MSM8974_
- overlayp->src.format = MDP_Y_CBCR_H2V2_VENUS;
-#endif
overlayp->src_rect.x = 0;
overlayp->src_rect.y = 0;
overlayp->src_rect.w = width;
@@ -3794,14 +3394,12 @@ void overlay_set()
printf("overlayp->dst_rect.w = %u \n", overlayp->dst_rect.w);
printf("overlayp->dst_rect.h = %u \n", overlayp->dst_rect.h);
- overlayp->alpha = 0xff;
+ overlayp->alpha = 0x0;
overlayp->transp_mask = 0xFFFFFFFF;
overlayp->flags = 0;
overlayp->is_fg = 0;
overlayp->id = MSMFB_NEW_REQUEST;
-
- overlay_vsync_ctrl(OMX_TRUE);
vid_buf_front_id = ioctl(fb_fd, MSMFB_OVERLAY_SET, overlayp);
if (vid_buf_front_id < 0)
{
@@ -3842,8 +3440,7 @@ int overlay_fb(struct OMX_BUFFERHEADERTYPE *pBufHdr)
vheap = (MemoryHeapBase*)pPMEMInfo->pmem_fd;
#endif
-
-#if defined(_ANDROID_) && !defined(USE_EGL_IMAGE_TEST_APP) && !defined(USE_EXTERN_PMEM_BUF) && !defined(_MSM8974_)
+#if defined(_ANDROID_) && !defined(USE_EGL_IMAGE_TEST_APP) && !defined(USE_EXTERN_PMEM_BUF)
ov_front.data.memory_id = vheap->getHeapID();
#else
ov_front.data.memory_id = pPMEMInfo->pmem_fd;
@@ -3859,12 +3456,6 @@ int overlay_fb(struct OMX_BUFFERHEADERTYPE *pBufHdr)
__LINE__);
return -1;
}
- if (ioctl(fb_fd, FBIOPAN_DISPLAY, &vinfo) < 0)
- {
- printf("ERROR: FBIOPAN_DISPLAY failed! line=%d\n", __LINE__);
- return -1;
- }
-
DEBUG_PRINT("\nMSMFB_OVERLAY_PLAY successfull");
return 0;
}
@@ -4299,7 +3890,6 @@ int open_display()
void close_display()
{
overlay_unset();
- overlay_vsync_ctrl(OMX_FALSE);
close(fb_fd);
fb_fd = -1;
}
diff --git a/mm-video/vidc/venc/Android.mk b/mm-video/vidc/venc/Android.mk
index 5448683..f287690 100755
--- a/mm-video/vidc/venc/Android.mk
+++ b/mm-video/vidc/venc/Android.mk
@@ -9,7 +9,6 @@ LOCAL_PATH:= $(ROOT_DIR)
# Common definitons
# ---------------------------------------------------------------------------------
-libmm-venc-def := -g -O3 -Dlrintf=_ffix_r
libmm-venc-def += -D__align=__alignx
libmm-venc-def += -D__alignx\(x\)=__attribute__\(\(__aligned__\(x\)\)\)
libmm-venc-def += -DT_ARM
@@ -23,38 +22,19 @@ libmm-venc-def += -UOUTPUT_BUFFER_LOG
libmm-venc-def += -USINGLE_ENCODER_INSTANCE
ifeq ($(TARGET_BOARD_PLATFORM),msm8660)
libmm-venc-def += -DMAX_RES_1080P
-libmm-venc-def += -UENABLE_GET_SYNTAX_HDR
endif
ifeq ($(TARGET_BOARD_PLATFORM),msm8960)
libmm-venc-def += -DMAX_RES_1080P
libmm-venc-def += -DMAX_RES_1080P_EBI
-libmm-venc-def += -UENABLE_GET_SYNTAX_HDR
endif
ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
libmm-venc-def += -DMAX_RES_1080P
libmm-venc-def += -DMAX_RES_1080P_EBI
-libOmxVdec-def += -DPROCESS_EXTRADATA_IN_OUTPUT_PORT
-libmm-venc-def += -D_MSM8974_
+libmm-venc-def += -DBADGER
endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm7627a)
-libmm-venc-def += -DMAX_RES_720P
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm7630_surf)
-libmm-venc-def += -DMAX_RES_720P
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm8610)
-libmm-venc-def += -DMAX_RES_720P
-libmm-venc-def += -D_MSM8974_
-endif
-ifeq ($(TARGET_BOARD_PLATFORM),msm8226)
-libmm-venc-def += -DMAX_RES_1080P
-libmm-venc-def += -D_MSM8974_
-endif
-
ifeq ($(TARGET_USES_ION),true)
libmm-venc-def += -DUSE_ION
endif
-
libmm-venc-def += -D_ANDROID_ICS_
# ---------------------------------------------------------------------------------
# Make the Shared library (libOmxVenc)
@@ -64,13 +44,17 @@ include $(CLEAR_VARS)
libmm-venc-inc := bionic/libc/include
libmm-venc-inc += bionic/libstdc++/include
-libmm-venc-inc += $(LOCAL_PATH)/inc
+libmm-venc-inc := $(LOCAL_PATH)/inc
libmm-venc-inc += $(OMX_VIDEO_PATH)/vidc/common/inc
libmm-venc-inc += hardware/qcom/media/mm-core/inc
libmm-venc-inc += hardware/qcom/media/libstagefrighthw
libmm-venc-inc += hardware/qcom/display/libgralloc
libmm-venc-inc += frameworks/native/include/media/hardware
libmm-venc-inc += frameworks/native/include/media/openmax
+libmm-venc-inc += hardware/qcom/media/libc2dcolorconvert
+libmm-venc-inc += hardware/qcom/display/libcopybit
+libmm-venc-inc += frameworks/av/include/media/stagefright
+
LOCAL_MODULE := libOmxVenc
@@ -79,16 +63,18 @@ LOCAL_CFLAGS := $(libmm-venc-def)
LOCAL_C_INCLUDES := $(libmm-venc-inc)
LOCAL_PRELINK_MODULE := false
-LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils
+LOCAL_SHARED_LIBRARIES := liblog libutils libbinder libcutils \
+ libc2dcolorconvert libdl
LOCAL_SRC_FILES := src/omx_video_base.cpp
LOCAL_SRC_FILES += src/omx_video_encoder.cpp
-ifneq ($(filter msm8974 msm8610 msm8226,$(TARGET_BOARD_PLATFORM)),)
-LOCAL_SRC_FILES += src/video_encoder_device_v4l2.cpp
+ifeq ($(TARGET_BOARD_PLATFORM),msm8974)
+LOCAL_SRC_FILES += src/video_encoder_device_copper.cpp
else
LOCAL_SRC_FILES += src/video_encoder_device.cpp
endif
+
LOCAL_SRC_FILES += ../common/src/extra_data_handler.cpp
include $(BUILD_SHARED_LIBRARY)
@@ -109,8 +95,9 @@ LOCAL_MODULE := mm-venc-omx-test720p
LOCAL_MODULE_TAGS := optional
LOCAL_CFLAGS := $(libmm-venc-def)
LOCAL_C_INCLUDES := $(mm-venc-test720p-inc)
+#LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
LOCAL_PRELINK_MODULE := false
-LOCAL_SHARED_LIBRARIES := libmm-omxcore libOmxVenc libbinder liblog
+LOCAL_SHARED_LIBRARIES := libmm-omxcore libOmxVenc libbinder
LOCAL_SRC_FILES := test/venc_test.cpp
LOCAL_SRC_FILES += test/camera_test.cpp
@@ -126,13 +113,13 @@ include $(BUILD_EXECUTABLE)
include $(CLEAR_VARS)
venc-test-inc += $(LOCAL_PATH)/inc
-venc-test-inc += hardware/qcom/display/libgralloc
LOCAL_MODULE := mm-video-encdrv-test
LOCAL_MODULE_TAGS := optional
LOCAL_C_INCLUDES := $(venc-test-inc)
LOCAL_C_INCLUDES += hardware/qcom/media/mm-core/inc
+#LOCAL_ADDITIONAL_DEPENDENCIES := $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
LOCAL_PRELINK_MODULE := false
LOCAL_SRC_FILES := test/video_encoder_test.c
diff --git a/mm-video/vidc/venc/inc/camera_test.h b/mm-video/vidc/venc/inc/camera_test.h
index 53bc2da..b277ce4 100644
--- a/mm-video/vidc/venc/inc/camera_test.h
+++ b/mm-video/vidc/venc/inc/camera_test.h
@@ -1,58 +1,58 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 _CAMERA_TEST_H
-#define _CAMERA_TEST_H
-
-#define EXTERN_C_START extern "C" {
-#define EXTERN_C_END }
-
-#ifdef __cplusplus
-EXTERN_C_START
-#endif
-
-typedef void (*CameraPreviewCallback)(int nFD,
- int nOffset,
- void* pPhys,
- void* pVirt,
- long long nTimeStamp);
-
-
-int CameraTest_Initialize(int nFrameRate,
- int nFrameWidth,
- int nFrameHeight,
- CameraPreviewCallback pfnPreviewCallback);
-int CameraTest_Run();
-int CameraTest_ReleaseFrame(void* pPhys, void* pVirt);
-int CameraTest_Exit();
-
-
-#ifdef __cplusplus
-EXTERN_C_END
-#endif
-
-#endif
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 _CAMERA_TEST_H
+#define _CAMERA_TEST_H
+
+#define EXTERN_C_START extern "C" {
+#define EXTERN_C_END }
+
+#ifdef __cplusplus
+EXTERN_C_START
+#endif
+
+typedef void (*CameraPreviewCallback)(int nFD,
+ int nOffset,
+ void* pPhys,
+ void* pVirt,
+ long long nTimeStamp);
+
+
+int CameraTest_Initialize(int nFrameRate,
+ int nFrameWidth,
+ int nFrameHeight,
+ CameraPreviewCallback pfnPreviewCallback);
+int CameraTest_Run();
+int CameraTest_ReleaseFrame(void* pPhys, void* pVirt);
+int CameraTest_Exit();
+
+
+#ifdef __cplusplus
+EXTERN_C_END
+#endif
+
+#endif
diff --git a/mm-video/vidc/venc/inc/fb_test.h b/mm-video/vidc/venc/inc/fb_test.h
index 52a007f..0408214 100644
--- a/mm-video/vidc/venc/inc/fb_test.h
+++ b/mm-video/vidc/venc/inc/fb_test.h
@@ -1,48 +1,48 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 _FB_TEST_H
-#define _FB_TEST_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-int FBTest_Initialize(int nFrameWidth,
- int nFrameHeight);
-int FBTest_DisplayImage(int nPmemFd, int nOffset);
-int FBTest_Exit();
-
-int FBTest_RunTest();
-
-#ifdef __cplusplus
-}
-#endif
-
-
-#endif // _FB_TEST_H
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 _FB_TEST_H
+#define _FB_TEST_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+int FBTest_Initialize(int nFrameWidth,
+ int nFrameHeight);
+int FBTest_DisplayImage(int nPmemFd, int nOffset);
+int FBTest_Exit();
+
+int FBTest_RunTest();
+
+#ifdef __cplusplus
+}
+#endif
+
+
+#endif // _FB_TEST_H
diff --git a/mm-video/vidc/venc/inc/omx_video_base.h b/mm-video/vidc/venc/inc/omx_video_base.h
index d86a6c3..9a2c4e9 100644
--- a/mm-video/vidc/venc/inc/omx_video_base.h
+++ b/mm-video/vidc/venc/inc/omx_video_base.h
@@ -1,30 +1,29 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+ * 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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_VIDEO_BASE_H__
@@ -42,8 +41,7 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Include Files
//////////////////////////////////////////////////////////////////////////////
-#define LOG_TAG "OMX-VENC-720p"
-#include <stdlib.h>
+#include<stdlib.h>
#include <stdio.h>
#include <sys/mman.h>
#ifdef _ANDROID_
@@ -61,6 +59,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "omx_video_common.h"
#include "extra_data_handler.h"
#include <linux/videodev2.h>
+#include <dlfcn.h>
+#include "C2DColorConverter.h"
#ifdef _ANDROID_
using namespace android;
@@ -73,6 +73,22 @@ public:
};
#include <utils/Log.h>
+#define LOG_TAG "OMX-VENC-720p"
+#ifdef ENABLE_DEBUG_LOW
+#define DEBUG_PRINT_LOW ALOGV
+#else
+#define DEBUG_PRINT_LOW
+#endif
+#ifdef ENABLE_DEBUG_HIGH
+#define DEBUG_PRINT_HIGH ALOGV
+#else
+#define DEBUG_PRINT_HIGH
+#endif
+#ifdef ENABLE_DEBUG_ERROR
+#define DEBUG_PRINT_ERROR ALOGE
+#else
+#define DEBUG_PRINT_ERROR
+#endif
#else //_ANDROID_
#define DEBUG_PRINT_LOW
@@ -82,15 +98,7 @@ public:
#ifdef USE_ION
static const char* MEM_DEVICE = "/dev/ion";
- #ifdef MAX_RES_720P
- #define MEM_HEAP_ID ION_CAMERA_HEAP_ID
- #else
- #ifdef _MSM8974_
- #define MEM_HEAP_ID ION_IOMMU_HEAP_ID
- #else
- #define MEM_HEAP_ID ION_CP_MM_HEAP_ID
- #endif
- #endif
+ #define MEM_HEAP_ID ION_CP_MM_HEAP_ID
#elif MAX_RES_720P
static const char* MEM_DEVICE = "/dev/pmem_adsp";
#elif MAX_RES_1080P_EBI
@@ -138,22 +146,41 @@ static const char* MEM_DEVICE = "/dev/pmem_smipool";
#define MAX_NUM_INPUT_BUFFERS 32
#endif
void* message_thread(void *);
-#ifdef USE_ION
-int alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_data,
- struct ion_fd_data *fd_data,int flag);
-void free_ion_memory(struct venc_ion *buf_ion_info);
-#endif
-
// OMX video class
class omx_video: public qc_omx_component
{
protected:
#ifdef _ANDROID_ICS_
bool meta_mode_enable;
+ bool c2d_opened;
encoder_media_buffer_type meta_buffers[MAX_NUM_INPUT_BUFFERS];
- OMX_BUFFERHEADERTYPE meta_buffer_hdr[MAX_NUM_INPUT_BUFFERS];
+ OMX_BUFFERHEADERTYPE *opaque_buffer_hdr[MAX_NUM_INPUT_BUFFERS];
bool mUseProxyColorFormat;
- bool get_syntaxhdr_enable;
+ OMX_BUFFERHEADERTYPE *psource_frame;
+ OMX_BUFFERHEADERTYPE *pdest_frame;
+ bool secure_session;
+ int secure_color_format;
+ class omx_c2d_conv {
+ public:
+ omx_c2d_conv();
+ ~omx_c2d_conv();
+ bool init();
+ bool open(unsigned int height,unsigned int width,
+ ColorConvertFormat src,
+ ColorConvertFormat dest);
+ bool convert(int src_fd, void *src_viraddr,
+ int dest_fd,void *dest_viraddr);
+ bool get_buffer_size(int port,unsigned int &buf_size);
+ int get_src_format();
+ void close();
+ private:
+ C2DColorConverterBase *c2dcc;
+ void *mLibHandle;
+ ColorConvertFormat src_format;
+ createC2DColorConverter_t *mConvertOpen;
+ destroyC2DColorConverter_t *mConvertClose;
+ };
+ omx_c2d_conv c2d_conv;
#endif
public:
omx_video(); // constructor
@@ -181,7 +208,7 @@ public:
virtual OMX_U32 dev_flush(unsigned) = 0;
virtual OMX_U32 dev_resume(void) = 0;
virtual OMX_U32 dev_start_done(void) = 0;
- virtual OMX_U32 dev_set_message_thread_id(pthread_t) = 0;
+ virtual OMX_U32 dev_stop_done(void) = 0;
virtual bool dev_use_buf(void *,unsigned,unsigned) = 0;
virtual bool dev_free_buf(void *,unsigned) = 0;
virtual bool dev_empty_buf(void *, void *,unsigned,unsigned) = 0;
@@ -192,10 +219,7 @@ public:
virtual bool dev_loaded_stop(void) = 0;
virtual bool dev_loaded_start_done(void) = 0;
virtual bool dev_loaded_stop_done(void) = 0;
-#ifdef _MSM8974_
- virtual int dev_handle_extradata(void*, int) = 0;
-#endif
- virtual bool dev_get_capability_ltrcount(OMX_U32 *, OMX_U32 *, OMX_U32 *) = 0;
+ virtual bool is_secure_session(void) = 0;
#ifdef _ANDROID_ICS_
void omx_release_meta_buffer(OMX_BUFFERHEADERTYPE *buffer);
#endif
@@ -374,7 +398,7 @@ public:
OMX_COMPONENT_GENERATE_RESUME_DONE = 0xF,
OMX_COMPONENT_GENERATE_STOP_DONE = 0x10,
OMX_COMPONENT_GENERATE_HARDWARE_ERROR = 0x11,
- OMX_COMPONENT_GENERATE_LTRUSE_FAILED = 0x12,
+ OMX_COMPONENT_GENERATE_ETB_OPQ = 0x12
};
struct omx_event
@@ -413,7 +437,8 @@ public:
OMX_PTR appData,
OMX_U32 bytes);
#ifdef _ANDROID_ICS_
- OMX_ERRORTYPE allocate_input_meta_buffer(OMX_BUFFERHEADERTYPE **bufferHdr,
+ OMX_ERRORTYPE allocate_input_meta_buffer(OMX_HANDLETYPE hComp,
+ OMX_BUFFERHEADERTYPE **bufferHdr,
OMX_PTR appData,
OMX_U32 bytes);
#endif
@@ -439,17 +464,20 @@ public:
bool execute_omx_flush(OMX_U32);
bool execute_output_flush(void);
bool execute_input_flush(void);
-#ifdef _MSM8974_
- bool execute_flush_all(void);
-#endif
OMX_ERRORTYPE empty_buffer_done(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE * buffer);
OMX_ERRORTYPE fill_buffer_done(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE * buffer);
- OMX_ERRORTYPE empty_this_buffer_proxy(OMX_HANDLETYPE hComp,
+ OMX_ERRORTYPE empty_this_buffer_proxy(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE *buffer);
-
+ OMX_ERRORTYPE empty_this_buffer_opaque(OMX_HANDLETYPE hComp,
+ OMX_BUFFERHEADERTYPE *buffer);
+ OMX_ERRORTYPE push_input_buffer(OMX_HANDLETYPE hComp);
+ OMX_ERRORTYPE convert_queue_buffer(OMX_HANDLETYPE hComp,
+ struct pmem &Input_pmem_info,unsigned &index);
+ OMX_ERRORTYPE queue_meta_buffer(OMX_HANDLETYPE hComp,
+ struct pmem &Input_pmem_info);
OMX_ERRORTYPE fill_this_buffer_proxy(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE *buffer);
bool release_done();
@@ -519,24 +547,23 @@ public:
OMX_CONFIG_ROTATIONTYPE m_sConfigFrameRotation;
OMX_CONFIG_INTRAREFRESHVOPTYPE m_sConfigIntraRefreshVOP;
OMX_VIDEO_PARAM_QUANTIZATIONTYPE m_sSessionQuantization;
- OMX_QCOM_VIDEO_PARAM_QPRANGETYPE m_sSessionQPRange;
OMX_VIDEO_PARAM_AVCSLICEFMO m_sAVCSliceFMO;
QOMX_VIDEO_INTRAPERIODTYPE m_sIntraperiod;
OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE m_sErrorCorrection;
OMX_VIDEO_PARAM_INTRAREFRESHTYPE m_sIntraRefresh;
- QOMX_VIDEO_PARAM_LTRMODE_TYPE m_sParamLTRMode;
- QOMX_VIDEO_PARAM_LTRCOUNT_TYPE m_sParamLTRCount;
- QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE m_sConfigLTRPeriod;
- QOMX_VIDEO_CONFIG_LTRUSE_TYPE m_sConfigLTRUse;
OMX_U32 m_sExtraData;
-
+ OMX_U32 m_sDebugSliceinfo;
+ OMX_U32 m_input_msg_id;
// fill this buffer queue
omx_cmd_queue m_ftb_q;
// Command Q for rest of the events
omx_cmd_queue m_cmd_q;
omx_cmd_queue m_etb_q;
+ omx_cmd_queue m_opq_meta_q;
+ omx_cmd_queue m_opq_pmem_q;
// Input memory pointer
OMX_BUFFERHEADERTYPE *m_inp_mem_ptr;
+ OMX_BUFFERHEADERTYPE meta_buffer_hdr[MAX_NUM_INPUT_BUFFERS];
// Output memory pointer
OMX_BUFFERHEADERTYPE *m_out_mem_ptr;
@@ -561,6 +588,12 @@ public:
OMX_U8 m_cRole[OMX_MAX_STRINGNAME_SIZE];
extra_data_handler extra_data_handle;
+private:
+#ifdef USE_ION
+ int alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_data,
+ struct ion_fd_data *fd_data,int flag);
+ void free_ion_memory(struct venc_ion *buf_ion_info);
+#endif
};
#endif // __OMX_VIDEO_BASE_H__
diff --git a/mm-video/vidc/venc/inc/omx_video_common.h b/mm-video/vidc/venc/inc/omx_video_common.h
index dc4be1d..eb10201 100644
--- a/mm-video/vidc/venc/inc/omx_video_common.h
+++ b/mm-video/vidc/venc/inc/omx_video_common.h
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
diff --git a/mm-video/vidc/venc/inc/omx_video_encoder.h b/mm-video/vidc/venc/inc/omx_video_encoder.h
index 17178ca..74e5841 100644
--- a/mm-video/vidc/venc/inc/omx_video_encoder.h
+++ b/mm-video/vidc/venc/inc/omx_video_encoder.h
@@ -1,38 +1,37 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+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 The Linux Foundation nor the names of its
- contributors may be used to endorse or promote products derived
- from this software without specific prior written permission.
+ * 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 Code Aurora 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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_VENC__H
#define __OMX_VENC__H
#include <unistd.h>
#include "omx_video_base.h"
-#ifdef _MSM8974_
-#include "video_encoder_device_v4l2.h"
+#ifdef _COPPER_
+#include "video_encoder_device_copper.h"
#else
#include "video_encoder_device.h"
#endif
@@ -55,12 +54,11 @@ public:
OMX_INDEXTYPE configIndex,
OMX_PTR configData);
OMX_ERRORTYPE component_deinit(OMX_HANDLETYPE hComp);
+ bool is_secure_session();
//OMX strucutres
OMX_U32 m_nVenc_format;
class venc_dev *handle;
-#ifdef _MSM8974_
- int dev_handle_extradata(void *, int);
-#endif
+
private:
OMX_U32 dev_stop(void);
OMX_U32 dev_pause(void);
@@ -68,7 +66,7 @@ private:
OMX_U32 dev_flush(unsigned);
OMX_U32 dev_resume(void);
OMX_U32 dev_start_done(void);
- OMX_U32 dev_set_message_thread_id(pthread_t);
+ OMX_U32 dev_stop_done(void);
bool dev_use_buf( void *,unsigned,unsigned);
bool dev_free_buf( void *,unsigned);
bool dev_empty_buf(void *, void *,unsigned,unsigned);
@@ -81,7 +79,6 @@ private:
bool dev_loaded_stop(void);
bool dev_loaded_start_done(void);
bool dev_loaded_stop_done(void);
- bool dev_get_capability_ltrcount(OMX_U32 *, OMX_U32 *, OMX_U32 *);
};
#endif //__OMX_VENC__H
diff --git a/mm-video/vidc/venc/inc/queue.h b/mm-video/vidc/venc/inc/queue.h
index 530b087..991b7cc 100644
--- a/mm-video/vidc/venc/inc/queue.h
+++ b/mm-video/vidc/venc/inc/queue.h
@@ -1,80 +1,80 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 QUEUE_H
-#define QUEUE_H
-
-#include<pthread.h>
-#include <semaphore.h>
-#include <stdio.h>
-#include <string.h>
-
-/* Message Queue structure */
-struct video_msgq
-{
- /* Command to be executed */
- unsigned int cmd;
-
- unsigned int status;
-
- /* Client-specific data */
- void *clientdata;
-};
-
-
-/* Thread & Message Queue information */
-struct video_queue_context
-{
- /* Message Queue related members */
- pthread_mutex_t mutex;
- sem_t sem_message;
- int commandq_size;
- int dataq_size;
- struct video_msgq *ptr_dataq;
- struct video_msgq *ptr_cmdq;
- int write_dataq ;
- int read_dataq;
- int write_comq ;
- int read_comq ;
-
-};
-
-int check_if_queue_empty ( unsigned int queuetocheck,void* queuecontext );
-
-struct video_msgq * queue_get_cmd ( void* queuecontext );
-
-
-
-int queue_post_cmdq ( void *queuecontext,
- struct video_msgq *post_msg
- );
-
-int queue_post_dataq ( void *queuecontext,
- struct video_msgq *post_msg
- );
-
-#endif /* QUEUE_H */
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 QUEUE_H
+#define QUEUE_H
+
+#include<pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+#include <string.h>
+
+/* Message Queue structure */
+struct video_msgq
+{
+ /* Command to be executed */
+ unsigned int cmd;
+
+ unsigned int status;
+
+ /* Client-specific data */
+ void *clientdata;
+};
+
+
+/* Thread & Message Queue information */
+struct video_queue_context
+{
+ /* Message Queue related members */
+ pthread_mutex_t mutex;
+ sem_t sem_message;
+ int commandq_size;
+ int dataq_size;
+ struct video_msgq *ptr_dataq;
+ struct video_msgq *ptr_cmdq;
+ int write_dataq ;
+ int read_dataq;
+ int write_comq ;
+ int read_comq ;
+
+};
+
+int check_if_queue_empty ( unsigned int queuetocheck,void* queuecontext );
+
+struct video_msgq * queue_get_cmd ( void* queuecontext );
+
+
+
+int queue_post_cmdq ( void *queuecontext,
+ struct video_msgq *post_msg
+ );
+
+int queue_post_dataq ( void *queuecontext,
+ struct video_msgq *post_msg
+ );
+
+#endif /* QUEUE_H */
diff --git a/mm-video/vidc/venc/inc/venc_util.h b/mm-video/vidc/venc/inc/venc_util.h
index cfa590c..b256496 100644
--- a/mm-video/vidc/venc/inc/venc_util.h
+++ b/mm-video/vidc/venc/inc/venc_util.h
@@ -1,53 +1,53 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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.
---------------------------------------------------------------------------*/
-/*============================================================================
- V E N C _ U T I L. H
-
-DESCRIPTION
-
-
-REFERENCES
-
-
-============================================================================*/
-
-#ifndef _VENC_UTIL_H
-#define _VENC_UTIL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-long long GetTimeStamp();
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ V E N C _ U T I L. H
+
+DESCRIPTION
+
+
+REFERENCES
+
+
+============================================================================*/
+
+#ifndef _VENC_UTIL_H
+#define _VENC_UTIL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+long long GetTimeStamp();
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/mm-video/vidc/venc/inc/video_encoder_device.h b/mm-video/vidc/venc/inc/video_encoder_device.h
index fb24c76..fcca3ea 100644
--- a/mm-video/vidc/venc/inc/video_encoder_device.h
+++ b/mm-video/vidc/venc/inc/video_encoder_device.h
@@ -1,172 +1,164 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2012, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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_VENC_DEV__
-#define __OMX_VENC_DEV__
-
-#include "OMX_Types.h"
-#include "OMX_Core.h"
-#include "OMX_QCOMExtns.h"
-#include "qc_omx_component.h"
-#include "omx_video_common.h"
-#include <linux/msm_vidc_enc.h>
-#include <pthread.h>
-#include <linux/videodev2.h>
-#include <poll.h>
-#define TIMEOUT 5000
-#define MAX_RECON_BUFFERS 4
-
-void* async_venc_message_thread (void *);
-
-class venc_dev
-{
-public:
- venc_dev(class omx_venc *venc_class); //constructor
- ~venc_dev(); //des
-
- bool venc_open(OMX_U32);
- void venc_close();
- unsigned venc_stop(void);
- unsigned venc_pause(void);
- unsigned venc_start(void);
- unsigned venc_flush(unsigned);
-#ifdef _ANDROID_ICS_
- bool venc_set_meta_mode(bool);
-#endif
- unsigned venc_resume(void);
- unsigned venc_start_done(void);
- unsigned venc_set_message_thread_id(pthread_t);
- bool venc_use_buf(void*, unsigned,unsigned);
- bool venc_free_buf(void*, unsigned);
- bool venc_empty_buf(void *, void *,unsigned,unsigned);
- bool venc_fill_buf(void *, void *,unsigned,unsigned);
-
- bool venc_get_buf_req(unsigned long *,unsigned long *,
- unsigned long *,unsigned long);
- bool venc_set_buf_req(unsigned long *,unsigned long *,
- unsigned long *,unsigned long);
- bool venc_set_param(void *,OMX_INDEXTYPE);
- bool venc_set_config(void *configData, OMX_INDEXTYPE index);
- bool venc_get_profile_level(OMX_U32 *eProfile,OMX_U32 *eLevel);
- bool venc_max_allowed_bitrate_check(OMX_U32 nTargetBitrate);
- bool venc_get_seq_hdr(void *, unsigned, unsigned *);
- bool venc_loaded_start(void);
- bool venc_loaded_stop(void);
- bool venc_loaded_start_done(void);
- bool venc_loaded_stop_done(void);
- bool venc_get_capability_ltrcount(OMX_U32 *, OMX_U32 *, OMX_U32 *);
- OMX_U32 m_nDriver_fd;
- bool m_profile_set;
- bool m_level_set;
- pthread_mutex_t loaded_start_stop_mlock;
- pthread_cond_t loaded_start_stop_cond;
-
- struct recon_buffer {
- unsigned char* virtual_address;
- int pmem_fd;
- int size;
- int alignment;
- int offset;
-#ifdef USE_ION
- int ion_device_fd;
- struct ion_allocation_data alloc_data;
- struct ion_fd_data ion_alloc_fd;
-#endif
- };
-
- recon_buffer recon_buff[MAX_RECON_BUFFERS];
- int recon_buffers_count;
- bool m_max_allowed_bitrate_check;
- int m_eProfile;
- int m_eLevel;
- int etb_count;
-private:
- struct venc_basecfg m_sVenc_cfg;
- struct venc_ratectrlcfg rate_ctrl;
- struct venc_targetbitrate bitrate;
- struct venc_intraperiod intra_period;
- struct venc_profile codec_profile;
- struct ven_profilelevel profile_level;
- struct venc_switch set_param;
- struct venc_voptimingcfg time_inc;
- struct venc_allocatorproperty m_sInput_buff_property;
- struct venc_allocatorproperty m_sOutput_buff_property;
- struct venc_sessionqp session_qp;
- struct venc_qprange qp_range;
- struct venc_multiclicecfg multislice;
- struct venc_entropycfg entropy;
- struct venc_dbcfg dbkfilter;
- struct venc_intrarefresh intra_refresh;
- struct venc_headerextension hec;
- struct venc_voptimingcfg voptimecfg;
- struct venc_seqheader seqhdr;
- struct venc_ltrmode ltrmode;
- struct venc_ltrcount ltrcount;
- struct venc_ltrperiod ltrperiod;
-
- bool venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel);
- bool venc_set_intra_period(OMX_U32 nPFrames, OMX_U32 nBFrames);
- bool venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config);
- bool venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate);
- bool venc_set_qp_range(OMX_U32 min_qp, OMX_U32 max_qp);
- bool venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp);
- bool venc_set_extradata(OMX_U32 extra_data);
- bool venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 config);
- bool venc_set_intra_vop_refresh(OMX_BOOL intra_vop_refresh);
- bool venc_set_color_format(OMX_COLOR_FORMATTYPE color_format);
- bool venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel);
- bool venc_set_multislice_cfg(OMX_INDEXTYPE codec, OMX_U32 slicesize);
- bool venc_set_entropy_config(OMX_BOOL enable, OMX_U32 i_cabac_level);
- bool venc_set_inloop_filter(OMX_VIDEO_AVCLOOPFILTERTYPE loop_filter);
- bool venc_set_intra_refresh (OMX_VIDEO_INTRAREFRESHTYPE intrarefresh, OMX_U32 nMBs);
- bool venc_set_error_resilience(OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE* error_resilience);
- bool venc_set_voptiming_cfg(OMX_U32 nTimeIncRes);
- void venc_config_print();
- bool venc_set_slice_delivery_mode(OMX_BOOL enable);
- bool venc_set_plusptype(OMX_BOOL enable);
- bool venc_set_ltrmode(QOMX_VIDEO_LTRMODETYPE mode);
- bool venc_set_ltrcount(OMX_U32 count);
- bool venc_set_ltrperiod(OMX_U32 period);
- bool venc_set_ltruse(OMX_U32 id, OMX_U32 frames);
-#ifdef MAX_RES_1080P
- OMX_U32 pmem_free();
- OMX_U32 pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count);
- OMX_U32 venc_allocate_recon_buffers();
- inline int clip2(int x)
- {
- x = x -1;
- x = x | x >> 1;
- x = x | x >> 2;
- x = x | x >> 4;
- x = x | x >> 16;
- x = x + 1;
- return x;
- }
-#endif
-};
-
-#endif
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2012, The Linux Foundation. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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_VENC_DEV__
+#define __OMX_VENC_DEV__
+
+#include "OMX_Types.h"
+#include "OMX_Core.h"
+#include "OMX_QCOMExtns.h"
+#include "qc_omx_component.h"
+#include "omx_video_common.h"
+#include <linux/msm_vidc_enc.h>
+#include <pthread.h>
+#include <linux/videodev2.h>
+#include <poll.h>
+#define TIMEOUT 5000
+#define MAX_RECON_BUFFERS 4
+
+void* async_venc_message_thread (void *);
+
+class venc_dev
+{
+public:
+ venc_dev(class omx_venc *venc_class); //constructor
+ ~venc_dev(); //des
+
+ bool venc_open(OMX_U32);
+ void venc_close();
+ unsigned venc_stop(void);
+ unsigned venc_pause(void);
+ unsigned venc_start(void);
+ unsigned venc_flush(unsigned);
+#ifdef _ANDROID_ICS_
+ bool venc_set_meta_mode(bool);
+#endif
+ unsigned venc_resume(void);
+ unsigned venc_start_done(void);
+ unsigned venc_stop_done(void);
+ bool venc_use_buf(void*, unsigned,unsigned);
+ bool venc_free_buf(void*, unsigned);
+ bool venc_empty_buf(void *, void *,unsigned,unsigned);
+ bool venc_fill_buf(void *, void *,unsigned,unsigned);
+
+ bool venc_get_buf_req(unsigned long *,unsigned long *,
+ unsigned long *,unsigned long);
+ bool venc_set_buf_req(unsigned long *,unsigned long *,
+ unsigned long *,unsigned long);
+ bool venc_set_param(void *,OMX_INDEXTYPE);
+ bool venc_set_config(void *configData, OMX_INDEXTYPE index);
+ bool venc_get_profile_level(OMX_U32 *eProfile,OMX_U32 *eLevel);
+ bool venc_max_allowed_bitrate_check(OMX_U32 nTargetBitrate);
+ bool venc_get_seq_hdr(void *, unsigned, unsigned *);
+ bool venc_loaded_start(void);
+ bool venc_loaded_stop(void);
+ bool venc_loaded_start_done(void);
+ bool venc_loaded_stop_done(void);
+ OMX_U32 m_nDriver_fd;
+ bool m_profile_set;
+ bool m_level_set;
+ pthread_mutex_t loaded_start_stop_mlock;
+ pthread_cond_t loaded_start_stop_cond;
+
+ struct recon_buffer {
+ unsigned char* virtual_address;
+ int pmem_fd;
+ int size;
+ int alignment;
+ int offset;
+#ifdef USE_ION
+ int ion_device_fd;
+ struct ion_allocation_data alloc_data;
+ struct ion_fd_data ion_alloc_fd;
+#endif
+ };
+
+ recon_buffer recon_buff[MAX_RECON_BUFFERS];
+ int recon_buffers_count;
+ bool m_max_allowed_bitrate_check;
+ int m_eProfile;
+ int m_eLevel;
+ int etb_count;
+private:
+ class omx_venc *venc_encoder;
+ struct venc_basecfg m_sVenc_cfg;
+ struct venc_ratectrlcfg rate_ctrl;
+ struct venc_targetbitrate bitrate;
+ struct venc_intraperiod intra_period;
+ struct venc_profile codec_profile;
+ struct ven_profilelevel profile_level;
+ struct venc_switch set_param;
+ struct venc_voptimingcfg time_inc;
+ struct venc_allocatorproperty m_sInput_buff_property;
+ struct venc_allocatorproperty m_sOutput_buff_property;
+ struct venc_sessionqp session_qp;
+ struct venc_multiclicecfg multislice;
+ struct venc_entropycfg entropy;
+ struct venc_dbcfg dbkfilter;
+ struct venc_intrarefresh intra_refresh;
+ struct venc_headerextension hec;
+ struct venc_voptimingcfg voptimecfg;
+ struct venc_seqheader seqhdr;
+
+ bool venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel);
+ bool venc_set_intra_period(OMX_U32 nPFrames, OMX_U32 nBFrames);
+ bool venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config);
+ bool venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate);
+ bool venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp);
+ bool venc_set_extradata(OMX_U32 extra_data);
+ bool venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 config);
+ bool venc_set_intra_vop_refresh(OMX_BOOL intra_vop_refresh);
+ bool venc_set_color_format(OMX_COLOR_FORMATTYPE color_format);
+ bool venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel);
+ bool venc_set_multislice_cfg(OMX_INDEXTYPE codec, OMX_U32 slicesize);
+ bool venc_set_entropy_config(OMX_BOOL enable, OMX_U32 i_cabac_level);
+ bool venc_set_inloop_filter(OMX_VIDEO_AVCLOOPFILTERTYPE loop_filter);
+ bool venc_set_intra_refresh (OMX_VIDEO_INTRAREFRESHTYPE intrarefresh, OMX_U32 nMBs);
+ bool venc_set_error_resilience(OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE* error_resilience);
+ bool venc_set_voptiming_cfg(OMX_U32 nTimeIncRes);
+ void venc_config_print();
+ bool venc_set_slice_delivery_mode(OMX_BOOL enable);
+ bool venc_set_inband_video_header(OMX_BOOL enable);
+ bool venc_set_bitstream_restrict_in_vui(OMX_BOOL enable);
+#ifdef MAX_RES_1080P
+ OMX_U32 pmem_free();
+ OMX_U32 pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count);
+ OMX_U32 venc_allocate_recon_buffers();
+ inline int clip2(int x)
+ {
+ x = x -1;
+ x = x | x >> 1;
+ x = x | x >> 2;
+ x = x | x >> 4;
+ x = x | x >> 16;
+ x = x + 1;
+ return x;
+ }
+#endif
+};
+
+#endif
diff --git a/mm-video/vidc/venc/inc/video_encoder_device_v4l2.h b/mm-video/vidc/venc/inc/video_encoder_device_copper.h
index aba6029..95f0a1b 100644
--- a/mm-video/vidc/venc/inc/video_encoder_device_v4l2.h
+++ b/mm-video/vidc/venc/inc/video_encoder_device_copper.h
@@ -1,30 +1,29 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2012-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
+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 The Linux Foundation 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 "AS IS" AND ANY EXPRESS OR IMPLIED
-WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT
-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.
+ * 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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_VENC_DEV__
#define __OMX_VENC_DEV__
@@ -38,8 +37,8 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "omx_video_encoder.h"
#include <linux/videodev2.h>
#include <poll.h>
-
-#define TIMEOUT 5*60*1000
+#define TIMEOUT 5000
+#define MAX_RECON_BUFFERS 4
void* async_venc_message_thread (void *);
@@ -49,6 +48,7 @@ struct msm_venc_switch{
struct msm_venc_allocatorproperty{
unsigned long mincount;
+ unsigned long maxcount;
unsigned long actualcount;
unsigned long datasize;
unsigned long suffixsize;
@@ -159,23 +159,6 @@ struct msm_venc_headerextension{
unsigned long header_extension;
};
-enum v4l2_ports {
- CAPTURE_PORT,
- OUTPUT_PORT,
- MAX_PORT
-};
-
-struct extradata_buffer_info {
- int buffer_size;
- char* uaddr;
- int count;
- int size;
- int allocated;
-#ifdef USE_ION
- struct venc_ion ion;
-#endif
-};
-
class venc_dev
{
public:
@@ -194,7 +177,6 @@ public:
unsigned venc_resume(void);
unsigned venc_start_done(void);
unsigned venc_stop_done(void);
- unsigned venc_set_message_thread_id(pthread_t);
bool venc_use_buf(void*, unsigned,unsigned);
bool venc_free_buf(void*, unsigned);
bool venc_empty_buf(void *, void *,unsigned,unsigned);
@@ -215,7 +197,6 @@ public:
OMX_U32 m_nDriver_fd;
bool m_profile_set;
bool m_level_set;
- int num_planes;
struct recon_buffer {
unsigned char* virtual_address;
int pmem_fd;
@@ -229,14 +210,11 @@ public:
#endif
};
- int stopped;
+ recon_buffer recon_buff[MAX_RECON_BUFFERS];
+ int recon_buffers_count;
bool m_max_allowed_bitrate_check;
int etb_count;
- pthread_t m_tid;
class omx_venc *venc_handle;
- OMX_ERRORTYPE allocate_extradata();
- void free_extradata();
- bool handle_extradata(void *, int);
private:
struct msm_venc_basecfg m_sVenc_cfg;
struct msm_venc_ratectrlcfg rate_ctrl;
@@ -272,8 +250,6 @@ private:
bool venc_set_error_resilience(OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE* error_resilience);
bool venc_set_voptiming_cfg(OMX_U32 nTimeIncRes);
void venc_config_print();
- bool venc_set_slice_delivery_mode(OMX_U32 enable);
- bool venc_set_extradata(OMX_U32 extra_data);
#ifdef MAX_RES_1080P
OMX_U32 pmem_free();
OMX_U32 pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count);
@@ -289,10 +265,6 @@ private:
return x;
}
#endif
- int metadatamode;
- bool streaming[MAX_PORT];
- bool extradata;
- struct extradata_buffer_info extradata_info;
};
enum instance_state {
@@ -314,4 +286,3 @@ enum instance_state {
MSM_VIDC_CORE_UNINIT,
};
#endif
-
diff --git a/mm-video/vidc/venc/inc/video_encoder_test.h b/mm-video/vidc/venc/inc/video_encoder_test.h
index bf1082a..b48e76e 100644
--- a/mm-video/vidc/venc/inc/video_encoder_test.h
+++ b/mm-video/vidc/venc/inc/video_encoder_test.h
@@ -1,76 +1,76 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 <stdio.h>
-#include <stdlib.h>
-#include "queue.h"
-#include<fcntl.h>
-#include<sys/ioctl.h>
-#include <sys/mman.h>
-#include <linux/msm_vidc_enc.h>
-#include<pthread.h>
-#include <semaphore.h>
-#include <stdio.h>
-
-#define INPUT_BUFFER 0
-#define OUTPUT_BUFFER 1
-
-struct video_encoder_context
-{
- unsigned long input_width;
- unsigned long input_height;
- unsigned long codectype;
- unsigned long fps_num;
- unsigned long fps_den;
- unsigned long targetbitrate;
- unsigned long inputformat;
-
- struct venc_allocatorproperty input_buffer;
- struct venc_allocatorproperty output_buffer;
- struct venc_bufferpayload **ptr_inputbuffer;
- struct venc_bufferpayload **ptr_outputbuffer;
- struct video_queue_context queue_context;
- int video_driver_fd;
-
- FILE * inputBufferFile;
- FILE * outputBufferFile;
-
- pthread_t videothread_id;
- pthread_t asyncthread_id;
- sem_t sem_synchronize;
-};
-
-int init_encoder ( struct video_encoder_context *init_decode );
-int allocate_buffer ( unsigned int buffer_dir,
- struct video_encoder_context *decode_context
- );
-int free_buffer ( unsigned int buffer_dir,
- struct video_encoder_context *decode_context
- );
-int start_encoding (struct video_encoder_context *decode_context);
-int stop_encoding (struct video_encoder_context *decode_context);
-int deinit_encoder (struct video_encoder_context *init_decode);
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 <stdio.h>
+#include <stdlib.h>
+#include "queue.h"
+#include<fcntl.h>
+#include<sys/ioctl.h>
+#include <sys/mman.h>
+#include <linux/msm_vidc_enc.h>
+#include<pthread.h>
+#include <semaphore.h>
+#include <stdio.h>
+
+#define INPUT_BUFFER 0
+#define OUTPUT_BUFFER 1
+
+struct video_encoder_context
+{
+ unsigned long input_width;
+ unsigned long input_height;
+ unsigned long codectype;
+ unsigned long fps_num;
+ unsigned long fps_den;
+ unsigned long targetbitrate;
+ unsigned long inputformat;
+
+ struct venc_allocatorproperty input_buffer;
+ struct venc_allocatorproperty output_buffer;
+ struct venc_bufferpayload **ptr_inputbuffer;
+ struct venc_bufferpayload **ptr_outputbuffer;
+ struct video_queue_context queue_context;
+ int video_driver_fd;
+
+ FILE * inputBufferFile;
+ FILE * outputBufferFile;
+
+ pthread_t videothread_id;
+ pthread_t asyncthread_id;
+ sem_t sem_synchronize;
+};
+
+int init_encoder ( struct video_encoder_context *init_decode );
+int allocate_buffer ( unsigned int buffer_dir,
+ struct video_encoder_context *decode_context
+ );
+int free_buffer ( unsigned int buffer_dir,
+ struct video_encoder_context *decode_context
+ );
+int start_encoding (struct video_encoder_context *decode_context);
+int stop_encoding (struct video_encoder_context *decode_context);
+int deinit_encoder (struct video_encoder_context *init_decode);
diff --git a/mm-video/vidc/venc/src/omx_video_base.cpp b/mm-video/vidc/venc/src/omx_video_base.cpp
index 6cc84d6..9629268 100644
--- a/mm-video/vidc/venc/src/omx_video_base.cpp
+++ b/mm-video/vidc/venc/src/omx_video_base.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -90,7 +90,6 @@ typedef struct OMXComponentCapabilityFlagsType
} OMXComponentCapabilityFlagsType;
#define OMX_COMPONENT_CAPABILITY_TYPE_INDEX 0xFF7A347
-
#ifdef OUTPUT_BUFFER_LOG
extern FILE *outputBufferFile1;
#endif
@@ -220,38 +219,41 @@ PARAMETERS
RETURN VALUE
None.
========================================================================== */
-omx_video::omx_video():
- m_pInput_pmem(NULL),
- m_pOutput_pmem(NULL),
+omx_video::omx_video(): m_state(OMX_StateInvalid),
+ m_app_data(NULL),
+ m_inp_mem_ptr(NULL),
+ m_out_mem_ptr(NULL),
+ m_pInput_pmem(NULL),
+ m_pOutput_pmem(NULL),
#ifdef USE_ION
- m_pInput_ion(NULL),
- m_pOutput_ion(NULL),
+ m_pInput_ion(NULL),
+ m_pOutput_ion(NULL),
#endif
- m_error_propogated(false),
- m_state(OMX_StateInvalid),
- m_app_data(NULL),
- m_use_input_pmem(OMX_FALSE),
- m_use_output_pmem(OMX_FALSE),
- m_inp_mem_ptr(NULL),
- m_out_mem_ptr(NULL),
- input_flush_progress (false),
- output_flush_progress (false),
- input_use_buffer (false),
- output_use_buffer (false),
- pending_input_buffers(0),
- pending_output_buffers(0),
- m_out_bm_count(0),
- m_inp_bm_count(0),
- m_flags(0),
- m_etb_count(0),
- m_fbd_count(0),
- m_event_port_settings_sent(false)
+ pending_input_buffers(0),
+ pending_output_buffers(0),
+ m_out_bm_count(0),
+ m_inp_bm_count(0),
+ m_flags(0),
+ m_event_port_settings_sent(false),
+ output_flush_progress (false),
+ input_flush_progress (false),
+ input_use_buffer (false),
+ output_use_buffer (false),
+ m_use_input_pmem(OMX_FALSE),
+ m_use_output_pmem(OMX_FALSE),
+ m_etb_count(0),
+ m_fbd_count(0),
+ m_error_propogated(false),
+ m_input_msg_id(OMX_COMPONENT_GENERATE_ETB),
+ psource_frame(NULL),
+ pdest_frame(NULL),
+ c2d_opened(false),
+ secure_session(false)
{
DEBUG_PRINT_HIGH("\n omx_video(): Inside Constructor()");
memset(&m_cmp,0,sizeof(m_cmp));
memset(&m_pCallbacks,0,sizeof(m_pCallbacks));
-
-
+ secure_color_format = (int) OMX_COLOR_FormatYUV420SemiPlanar;
pthread_mutex_init(&m_lock, NULL);
sem_init(&m_cmd_lock,0,0);
}
@@ -411,8 +413,17 @@ void omx_video::process_event_cb(void *ctxt, unsigned char id)
DEBUG_PRINT_ERROR("ERROR: ProcessMsgCb NULL callbacks\n");
}
break;
-
+ case OMX_COMPONENT_GENERATE_ETB_OPQ:
+ DEBUG_PRINT_LOW("OMX_COMPONENT_GENERATE_ETB_OPQ\n");
+ if(pThis->empty_this_buffer_opaque((OMX_HANDLETYPE)p1,\
+ (OMX_BUFFERHEADERTYPE *)p2) != OMX_ErrorNone)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: ETBProxy() failed!\n");
+ pThis->omx_report_error ();
+ }
+ break;
case OMX_COMPONENT_GENERATE_ETB:
+ DEBUG_PRINT_LOW("OMX_COMPONENT_GENERATE_ETB\n");
if(pThis->empty_this_buffer_proxy((OMX_HANDLETYPE)p1,\
(OMX_BUFFERHEADERTYPE *)p2) != OMX_ErrorNone)
{
@@ -560,7 +571,7 @@ void omx_video::process_event_cb(void *ctxt, unsigned char id)
}
else
{
- DEBUG_PRINT_LOW("\nERROR: unknown flags=%x\n",pThis->m_flags);
+ DEBUG_PRINT_ERROR("\nERROR: unknown flags=%x\n",pThis->m_flags);
}
}
else
@@ -635,7 +646,7 @@ void omx_video::process_event_cb(void *ctxt, unsigned char id)
}
else
{
- DEBUG_PRINT_LOW("\nERROR: unknown flags=%x\n",pThis->m_flags);
+ DEBUG_PRINT_ERROR("\nERROR: unknown flags=%x\n",pThis->m_flags);
}
}
@@ -645,18 +656,7 @@ void omx_video::process_event_cb(void *ctxt, unsigned char id)
DEBUG_PRINT_ERROR("\nERROR: OMX_COMPONENT_GENERATE_HARDWARE_ERROR!\n");
pThis->omx_report_error ();
break;
-#ifndef _MSM8974_
- case OMX_COMPONENT_GENERATE_LTRUSE_FAILED:
- DEBUG_PRINT_ERROR("ERROR: OMX_COMPONENT_GENERATE_LTRUSE_FAILED!");
- if(pThis->m_pCallbacks.EventHandler)
- {
- DEBUG_PRINT_ERROR("Sending QOMX_ErrorLTRUseFailed, p2 = 0x%x", p2);
- pThis->m_pCallbacks.EventHandler(
- &pThis->m_cmp, pThis->m_app_data,
- OMX_EventError, QOMX_ErrorLTRUseFailed, NULL, NULL);
- }
- break;
-#endif
+
default:
DEBUG_PRINT_LOW("\n process_event_cb unknown msg id 0x%02x", id);
break;
@@ -968,6 +968,7 @@ OMX_ERRORTYPE omx_video::send_command_proxy(OMX_IN OMX_HANDLETYPE hComp,
BITMASK_SET(&m_flags,OMX_COMPONENT_IDLE_PENDING);
execute_omx_flush(OMX_ALL);
bFlag = 0;
+ dev_stop_done();
}
/* Requesting transition from Executing to Paused */
else if(eState == OMX_StatePause)
@@ -1297,19 +1298,6 @@ bool omx_video::execute_omx_flush(OMX_U32 flushType)
{
bool bRet = false;
DEBUG_PRINT_LOW("\n execute_omx_flush - %d\n", flushType);
-#ifdef _MSM8974_
- if(flushType == OMX_ALL)
- {
- input_flush_progress = true;
- output_flush_progress = true;
- bRet = execute_flush_all();
- }
- else
- {
- DEBUG_PRINT_ERROR("Invalid index (%lu) for flush\n", flushType);
- return bRet;
- }
-#else
if(flushType == 0 || flushType == OMX_ALL)
{
input_flush_progress = true;
@@ -1322,7 +1310,6 @@ bool omx_video::execute_omx_flush(OMX_U32 flushType)
output_flush_progress = true;
bRet = execute_output_flush();
}
-#endif
return bRet;
}
/*=========================================================================
@@ -1407,87 +1394,38 @@ bool omx_video::execute_input_flush(void)
{
empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p1);
}
- }
-
- pthread_mutex_unlock(&m_lock);
- /*Check if there are buffers with the Driver*/
- if(dev_flush(PORT_INDEX_IN))
- {
- DEBUG_PRINT_ERROR("\nERROR: i/p dev_flush() Failed");
- return false;
- }
-
- return bRet;
-}
-
-
-/*=========================================================================
-FUNCTION : execute_flush
-
-DESCRIPTION
- Executes the OMX flush at INPUT & OUTPUT PORT.
-
-PARAMETERS
- None.
-
-RETURN VALUE
- true/false
-==========================================================================*/
-#ifdef _MSM8974_
-bool omx_video::execute_flush_all(void)
-{
- unsigned p1 = 0; // Parameter - 1
- unsigned p2 = 0; // Parameter - 2
- unsigned ident = 0;
- bool bRet = true;
-
- DEBUG_PRINT_LOW("\n execute_flush_all\n");
-
- /*Generate EBD for all Buffers in the ETBq*/
- pthread_mutex_lock(&m_lock);
- while(m_etb_q.m_size)
- {
- m_etb_q.pop_entry(&p1,&p2,&ident);
- if(ident == OMX_COMPONENT_GENERATE_ETB)
- {
- pending_input_buffers++;
- empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p2);
- }
- else if(ident == OMX_COMPONENT_GENERATE_EBD)
+ else if(ident == OMX_COMPONENT_GENERATE_ETB_OPQ)
{
- empty_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p1);
+ m_pCallbacks.EmptyBufferDone(&m_cmp,m_app_data,(OMX_BUFFERHEADERTYPE *)p2);
}
}
-
- /*Generate FBD for all Buffers in the FTBq*/
- DEBUG_PRINT_LOW("\n execute_output_flush\n");
- while(m_ftb_q.m_size)
- {
- m_ftb_q.pop_entry(&p1,&p2,&ident);
-
- if(ident == OMX_COMPONENT_GENERATE_FTB )
- {
- pending_output_buffers++;
- fill_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p2);
+ if(mUseProxyColorFormat) {
+ if(psource_frame) {
+ m_pCallbacks.EmptyBufferDone(&m_cmp,m_app_data,psource_frame);
+ psource_frame = NULL;
}
- else if(ident == OMX_COMPONENT_GENERATE_FBD)
- {
- fill_buffer_done(&m_cmp,(OMX_BUFFERHEADERTYPE *)p1);
+ while(m_opq_meta_q.m_size) {
+ unsigned p1,p2,id;
+ m_opq_meta_q.pop_entry(&p1,&p2,&id);
+ m_pCallbacks.EmptyBufferDone(&m_cmp,m_app_data,
+ (OMX_BUFFERHEADERTYPE *)p1);
+ }
+ if(pdest_frame){
+ m_opq_pmem_q.insert_entry((unsigned int)pdest_frame,0,0);
+ pdest_frame = NULL;
}
}
-
pthread_mutex_unlock(&m_lock);
-
/*Check if there are buffers with the Driver*/
- if(dev_flush(PORT_INDEX_BOTH))
+ if(dev_flush(PORT_INDEX_IN))
{
- DEBUG_PRINT_ERROR("\nERROR: dev_flush() Failed");
+ DEBUG_PRINT_ERROR("\nERROR: i/p dev_flush() Failed");
return false;
}
+
return bRet;
}
-#endif
/* ======================================================================
FUNCTION
@@ -1513,15 +1451,13 @@ bool omx_video::post_event(unsigned int p1,
pthread_mutex_lock(&m_lock);
- if ((id == OMX_COMPONENT_GENERATE_FTB) ||
- (id == OMX_COMPONENT_GENERATE_FBD) ||
- (id == OMX_COMPONENT_GENERATE_EVENT_OUTPUT_FLUSH))
+ if( id == OMX_COMPONENT_GENERATE_FTB || \
+ (id == OMX_COMPONENT_GENERATE_FRAME_DONE))
{
m_ftb_q.insert_entry(p1,p2,id);
}
- else if ((id == OMX_COMPONENT_GENERATE_ETB) ||
- (id == OMX_COMPONENT_GENERATE_EBD) ||
- (id == OMX_COMPONENT_GENERATE_EVENT_INPUT_FLUSH))
+ else if((id == m_input_msg_id) \
+ || (id == OMX_COMPONENT_GENERATE_EBD))
{
m_etb_q.insert_entry(p1,p2,id);
}
@@ -1589,9 +1525,13 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
portDefn->nBufferSize = sizeof(encoder_media_buffer_type);
}
-
- if (mUseProxyColorFormat) {
- portDefn->format.video.eColorFormat = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatAndroidOpaque;
+ if(secure_session) {
+ portDefn->format.video.eColorFormat =
+ (OMX_COLOR_FORMATTYPE)secure_color_format;
+ }
+ else if (mUseProxyColorFormat) {
+ portDefn->format.video.eColorFormat =
+ (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatAndroidOpaque;
}
#endif
}
@@ -1631,21 +1571,23 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
if(portFmt->nPortIndex == (OMX_U32) PORT_INDEX_IN)
{
int index = portFmt->nIndex;
- if(index > 1)
- eRet = OMX_ErrorNoMore;
- else {
- memcpy(portFmt, &m_sInPortFormat, sizeof(m_sInPortFormat));
+
+ if (index > 1) {
+ eRet = OMX_ErrorNoMore;
+ } else {
+ memcpy(portFmt, &m_sInPortFormat, sizeof(m_sInPortFormat));
#ifdef _ANDROID_ICS_
- if (index == 1) {
- //we support two formats
- //index 0 - YUV420SP
- //index 1 - opaque which internally maps to YUV420SP.
- //this can be extended in the future
- portFmt->nIndex = index; //restore index set from client
- portFmt->eColorFormat = (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatAndroidOpaque;
- }
-#endif
+ if (index == 1) {
+ //we support two formats
+ //index 0 - YUV420SP
+ //index 1 - opaque which internally maps to YUV420SP.
+ //this can be extended in the future
+ portFmt->nIndex = index; //restore index set from client
+ portFmt->eColorFormat =
+ (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatAndroidOpaque;
+ }
}
+#endif
}
else if(portFmt->nPortIndex == (OMX_U32) PORT_INDEX_OUT)
{
@@ -1702,7 +1644,7 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported\n");
eRet = get_supported_profile_level(pParam);
if(eRet)
- DEBUG_PRINT_ERROR("Invalid entry returned from get_supported_profile_level %lu, %lu",
+ DEBUG_PRINT_ERROR("Invalid entry returned from get_supported_profile_level %d, %d",
pParam->eProfile, pParam->eLevel);
break;
}
@@ -1794,14 +1736,6 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
break;
}
- case OMX_QcomIndexParamVideoQPRange:
- {
- OMX_QCOM_VIDEO_PARAM_QPRANGETYPE *qp_range = (OMX_QCOM_VIDEO_PARAM_QPRANGETYPE*) paramData;
- DEBUG_PRINT_LOW("get_parameter: OMX_QcomIndexParamVideoQPRange\n");
- memcpy(qp_range, &m_sSessionQPRange, sizeof(m_sSessionQPRange));
- break;
- }
-
case OMX_IndexParamVideoErrorCorrection:
{
OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE* errorresilience = (OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE*)paramData;
@@ -1859,75 +1793,20 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
eRet =OMX_ErrorUnsupportedIndex;
}
}
-#ifndef _MSM8974_
- else if (pParam->nIndex == (OMX_INDEXTYPE)OMX_ExtraDataVideoLTRInfo)
- {
- if (pParam->nPortIndex == PORT_INDEX_OUT)
- {
- pParam->bEnabled =
- (OMX_BOOL)((m_sExtraData & VEN_EXTRADATA_LTRINFO) ? 1 : 0);
- DEBUG_PRINT_HIGH("LTR Info extradata %d", pParam->bEnabled);
- }
- else
- {
- DEBUG_PRINT_ERROR("get_parameter: LTR information is "
- "valid for output port only");
- eRet = OMX_ErrorUnsupportedIndex;
- }
- }
-#endif
else
{
- DEBUG_PRINT_ERROR("get_parameter: unsupported extradata index (0x%x)",
- pParam->nIndex);
- eRet = OMX_ErrorUnsupportedIndex;
+ DEBUG_PRINT_ERROR("get_parameter: unsupported index (%x), "
+ "only slice information extradata is supported", pParam->nIndex);
+ eRet =OMX_ErrorUnsupportedIndex;
}
break;
}
- case QOMX_IndexParamVideoLTRCountRangeSupported:
- {
- DEBUG_PRINT_HIGH("get_parameter: QOMX_IndexParamVideoLTRCountRangeSupported");
- QOMX_EXTNINDEX_RANGETYPE *pParam = (QOMX_EXTNINDEX_RANGETYPE *)paramData;
- if (pParam->nPortIndex == PORT_INDEX_OUT)
- {
- OMX_U32 min = 0, max = 0, step_size = 0;
- if (dev_get_capability_ltrcount(&min, &max, &step_size))
- {
- pParam->nMin = min;
- pParam->nMax = max;
- pParam->nStepSize = step_size;
- }
- else
- {
- DEBUG_PRINT_ERROR("get_parameter: get_capability_ltrcount failed");
- eRet = OMX_ErrorUndefined;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("LTR count range is valid for output port only");
- eRet = OMX_ErrorUnsupportedIndex;
- }
- }
- break;
#endif
case QOMX_IndexParamVideoSyntaxHdr:
{
DEBUG_PRINT_HIGH("QOMX_IndexParamVideoSyntaxHdr");
QOMX_EXTNINDEX_PARAMTYPE* pParam =
reinterpret_cast<QOMX_EXTNINDEX_PARAMTYPE*>(paramData);
- if (pParam->pData == NULL)
- {
- DEBUG_PRINT_ERROR("Error: Data buffer is NULL");
- eRet = OMX_ErrorBadParameter;
- break;
- }
- if (get_syntaxhdr_enable == false)
- {
- DEBUG_PRINT_ERROR("ERROR: get_parameter: Get syntax header disabled");
- eRet = OMX_ErrorUnsupportedIndex;
- break;
- }
BITMASK_SET(&m_flags, OMX_COMPONENT_LOADED_START_PENDING);
if(dev_loaded_start())
{
@@ -1943,7 +1822,7 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
(unsigned)(pParam->nSize - sizeof(QOMX_EXTNINDEX_PARAMTYPE)),
(unsigned *)&pParam->nDataSize))
{
- DEBUG_PRINT_HIGH("get syntax header successful (hdrlen = %lu)",
+ DEBUG_PRINT_HIGH("get syntax header successful (hdrlen = %d)",
pParam->nDataSize);
for (unsigned i = 0; i < pParam->nDataSize; i++) {
DEBUG_PRINT_LOW("Header[%d] = %x", i, *((char *)pParam->pData + i));
@@ -1970,7 +1849,7 @@ OMX_ERRORTYPE omx_video::get_parameter(OMX_IN OMX_HANDLETYPE hComp,
case OMX_IndexParamVideoSliceFMO:
default:
{
- DEBUG_PRINT_LOW("ERROR: get_parameter: unknown param %08x\n", paramIndex);
+ DEBUG_PRINT_ERROR("ERROR: get_parameter: unknown param %08x\n", paramIndex);
eRet =OMX_ErrorUnsupportedIndex;
break;
}
@@ -2072,22 +1951,34 @@ OMX_ERRORTYPE omx_video::get_extension_index(OMX_IN OMX_HANDLETYPE hComp,
OMX_IN OMX_STRING paramName,
OMX_OUT OMX_INDEXTYPE* indexType)
{
+ char *extns[] = {
+ "OMX.QCOM.index.param.SliceDeliveryMode",
+ "OMX.google.android.index.storeMetaDataInBuffers",
+ "OMX.google.android.index.prependSPSPPSToIDRFrames",
+ "OMX.google.android.index.setVUIStreamRestrictFlag"
+ };
+
if(m_state == OMX_StateInvalid)
{
DEBUG_PRINT_ERROR("ERROR: Get Extension Index in Invalid State\n");
return OMX_ErrorInvalidState;
}
#ifdef MAX_RES_1080P
- if (!strncmp(paramName, "OMX.QCOM.index.param.SliceDeliveryMode",
- sizeof("OMX.QCOM.index.param.SliceDeliveryMode") - 1)) {
+ if (!strncmp(paramName, extns[0], strlen(extns[0]))) {
*indexType = (OMX_INDEXTYPE)OMX_QcomIndexEnableSliceDeliveryMode;
return OMX_ErrorNone;
}
#endif
#ifdef _ANDROID_ICS_
- if (!strncmp(paramName, "OMX.google.android.index.storeMetaDataInBuffers",sizeof("OMX.google.android.index.storeMetaDataInBuffers") - 1)) {
+ if (!strncmp(paramName, extns[1], strlen(extns[1]))) {
*indexType = (OMX_INDEXTYPE)OMX_QcomIndexParamVideoEncodeMetaBufferMode;
return OMX_ErrorNone;
+ } else if (!strncmp(paramName, extns[2], strlen(extns[2]))) {
+ *indexType = (OMX_INDEXTYPE)OMX_QcomIndexParamSequenceHeaderWithIDR;
+ return OMX_ErrorNone;
+ } else if (!strncmp(paramName, extns[3], strlen(extns[3]))) {
+ *indexType = (OMX_INDEXTYPE)OMX_QcomIndexParamEnableVUIStreamRestrictFlag;
+ return OMX_ErrorNone;
}
#endif
return OMX_ErrorNotImplemented;
@@ -2165,11 +2056,11 @@ OMX_ERRORTYPE omx_video::use_input_buffer(
unsigned i = 0;
unsigned char *buf_addr = NULL;
- DEBUG_PRINT_HIGH("use_input_buffer: port = %lu appData = %p bytes = %lu buffer = %p",port,appData,bytes,buffer);
- if(bytes != m_sInPortDef.nBufferSize)
+ DEBUG_PRINT_HIGH("use_input_buffer: port = %d appData = %p bytes = %d buffer = %p",port,appData,bytes,buffer);
+ if(bytes != m_sInPortDef.nBufferSize || secure_session)
{
DEBUG_PRINT_ERROR("\nERROR: use_input_buffer: Size Mismatch!! "
- "bytes[%lu] != Port.nBufferSize[%lu]", bytes, m_sInPortDef.nBufferSize);
+ "bytes[%d] != Port.nBufferSize[%d]", bytes, m_sInPortDef.nBufferSize);
return OMX_ErrorBadParameter;
}
@@ -2236,15 +2127,9 @@ OMX_ERRORTYPE omx_video::use_input_buffer(
if(!m_use_input_pmem)
{
#ifdef USE_ION
-#ifdef _MSM8974_
- m_pInput_ion[i].ion_device_fd = alloc_map_ion_memory(m_sInPortDef.nBufferSize,
- &m_pInput_ion[i].ion_alloc_data,
- &m_pInput_ion[i].fd_ion_data,0);
-#else
m_pInput_ion[i].ion_device_fd = alloc_map_ion_memory(m_sInPortDef.nBufferSize,
&m_pInput_ion[i].ion_alloc_data,
&m_pInput_ion[i].fd_ion_data,ION_FLAG_CACHED);
-#endif
if(m_pInput_ion[i].ion_device_fd < 0) {
DEBUG_PRINT_ERROR("\nERROR:ION device open() Failed");
return OMX_ErrorInsufficientResources;
@@ -2345,15 +2230,12 @@ OMX_ERRORTYPE omx_video::use_output_buffer(
OMX_BUFFERHEADERTYPE *bufHdr= NULL; // buffer header
unsigned i= 0; // Temporary counter
unsigned char *buf_addr = NULL;
-#ifdef _MSM8974_
- int align_size;
-#endif
DEBUG_PRINT_HIGH("\n Inside use_output_buffer()");
- if(bytes != m_sOutPortDef.nBufferSize)
+ if(bytes != m_sOutPortDef.nBufferSize || secure_session)
{
DEBUG_PRINT_ERROR("\nERROR: use_output_buffer: Size Mismatch!! "
- "bytes[%lu] != Port.nBufferSize[%lu]", bytes, m_sOutPortDef.nBufferSize);
+ "bytes[%d] != Port.nBufferSize[%d]", bytes, m_sOutPortDef.nBufferSize);
return OMX_ErrorBadParameter;
}
@@ -2418,7 +2300,7 @@ OMX_ERRORTYPE omx_video::use_output_buffer(
}
else
{
- DEBUG_PRINT_ERROR("ERROR: Output buf mem alloc failed[0x%p]\n",m_out_mem_ptr);
+ DEBUG_PRINT_ERROR("ERROR: Output buf mem alloc failed[0x%x]\n",m_out_mem_ptr);
eRet = OMX_ErrorInsufficientResources;
}
}
@@ -2443,17 +2325,10 @@ OMX_ERRORTYPE omx_video::use_output_buffer(
if(!m_use_output_pmem)
{
#ifdef USE_ION
-#ifdef _MSM8974_
- align_size = ((m_sOutPortDef.nBufferSize + 4095)/4096) * 4096;
- m_pOutput_ion[i].ion_device_fd = alloc_map_ion_memory(align_size,
- &m_pOutput_ion[i].ion_alloc_data,
- &m_pOutput_ion[i].fd_ion_data,0);
-#else
- m_pOutput_ion[i].ion_device_fd = alloc_map_ion_memory(
+ m_pOutput_ion[i].ion_device_fd = alloc_map_ion_memory(
m_sOutPortDef.nBufferSize,
&m_pOutput_ion[i].ion_alloc_data,
&m_pOutput_ion[i].fd_ion_data,ION_FLAG_CACHED);
-#endif
if(m_pOutput_ion[i].ion_device_fd < 0) {
DEBUG_PRINT_ERROR("\nERROR:ION device open() Failed");
return OMX_ErrorInsufficientResources;
@@ -2475,13 +2350,8 @@ OMX_ERRORTYPE omx_video::use_output_buffer(
#endif
m_pOutput_pmem[i].size = m_sOutPortDef.nBufferSize;
m_pOutput_pmem[i].offset = 0;
-#ifdef _MSM8974_
- m_pOutput_pmem[i].buffer = (unsigned char *)mmap(NULL,align_size,PROT_READ|PROT_WRITE,
- MAP_SHARED,m_pOutput_pmem[i].fd,0);
-#else
- m_pOutput_pmem[i].buffer = (unsigned char *)mmap(NULL,m_pOutput_pmem[i].size,PROT_READ|PROT_WRITE,
- MAP_SHARED,m_pOutput_pmem[i].fd,0);
-#endif
+ m_pOutput_pmem[i].buffer = (unsigned char *)mmap(NULL,m_pOutput_pmem[i].size,PROT_READ|PROT_WRITE,
+ MAP_SHARED,m_pOutput_pmem[i].fd,0);
if(m_pOutput_pmem[i].buffer == MAP_FAILED)
{
DEBUG_PRINT_ERROR("\nERROR: mmap() Failed");
@@ -2624,7 +2494,7 @@ OMX_ERRORTYPE omx_video::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
return OMX_ErrorBadParameter;
}
- index = bufferHdr - m_inp_mem_ptr;
+ index = bufferHdr - ((!mUseProxyColorFormat)?m_inp_mem_ptr:meta_buffer_hdr);
#ifdef _ANDROID_ICS_
if(meta_mode_enable)
{
@@ -2633,13 +2503,16 @@ OMX_ERRORTYPE omx_video::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
memset(&meta_buffer_hdr[index], 0, sizeof(meta_buffer_hdr[index]));
memset(&meta_buffers[index], 0, sizeof(meta_buffers[index]));
}
- return OMX_ErrorNone;
+ if(!mUseProxyColorFormat)
+ return OMX_ErrorNone;
+ else
+ c2d_conv.close();
}
#endif
- if(index < m_sInPortDef.nBufferCountActual &&
+ if(index < m_sInPortDef.nBufferCountActual && !mUseProxyColorFormat &&
dev_free_buf(&m_pInput_pmem[index],PORT_INDEX_IN) != true)
{
- DEBUG_PRINT_ERROR("\nERROR: dev_free_buf() Failed for i/p buf");
+ DEBUG_PRINT_LOW("\nERROR: dev_free_buf() Failed for i/p buf");
}
if(index < m_sInPortDef.nBufferCountActual && m_pInput_pmem)
@@ -2671,7 +2544,7 @@ OMX_ERRORTYPE omx_video::free_input_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
}
else
{
- DEBUG_PRINT_LOW("\n FreeBuffer:: fd is invalid or i/p PMEM UseBuffer case");
+ DEBUG_PRINT_ERROR("\n FreeBuffer:: fd is invalid or i/p PMEM UseBuffer case");
}
}
return OMX_ErrorNone;
@@ -2701,7 +2574,8 @@ OMX_ERRORTYPE omx_video::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
if(m_pOutput_pmem[index].fd > 0 && output_use_buffer == false )
{
DEBUG_PRINT_LOW("\n FreeBuffer:: o/p AllocateBuffer case");
- munmap (m_pOutput_pmem[index].buffer,m_pOutput_pmem[index].size);
+ if(!secure_session)
+ munmap (m_pOutput_pmem[index].buffer,m_pOutput_pmem[index].size);
close (m_pOutput_pmem[index].fd);
#ifdef USE_ION
free_ion_memory(&m_pOutput_ion[index]);
@@ -2732,6 +2606,7 @@ OMX_ERRORTYPE omx_video::free_output_buffer(OMX_BUFFERHEADERTYPE *bufferHdr)
}
#ifdef _ANDROID_ICS_
OMX_ERRORTYPE omx_video::allocate_input_meta_buffer(
+ OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE **bufferHdr,
OMX_PTR appData,
OMX_U32 bytes)
@@ -2739,11 +2614,11 @@ OMX_ERRORTYPE omx_video::allocate_input_meta_buffer(
unsigned index = 0;
if(!bufferHdr || bytes != sizeof(encoder_media_buffer_type))
{
- DEBUG_PRINT_ERROR("wrong params allocate_input_meta_buffer Hdr %p len %lu",
+ DEBUG_PRINT_ERROR("wrong params allocate_input_meta_buffer Hdr %p len %d",
bufferHdr,bytes);
return OMX_ErrorBadParameter;
}
- if(!m_inp_mem_ptr)
+ if(!m_inp_mem_ptr && !mUseProxyColorFormat)
m_inp_mem_ptr = meta_buffer_hdr;
for(index = 0;((index < m_sInPortDef.nBufferCountActual) &&
meta_buffer_hdr[index].pBuffer); index++);
@@ -2752,6 +2627,17 @@ OMX_ERRORTYPE omx_video::allocate_input_meta_buffer(
DEBUG_PRINT_ERROR("All buffers are allocated input_meta_buffer");
return OMX_ErrorBadParameter;
}
+ if(mUseProxyColorFormat){
+ if(opaque_buffer_hdr[index]){
+ DEBUG_PRINT_ERROR("All buffers are allocated opaque_buffer_hdr");
+ return OMX_ErrorBadParameter;
+ }
+ if(allocate_input_buffer(hComp,&opaque_buffer_hdr[index],
+ PORT_INDEX_IN,appData,m_sInPortDef.nBufferSize) != OMX_ErrorNone) {
+ DEBUG_PRINT_ERROR("All buffers are allocated opaque_buffer_hdr");
+ return OMX_ErrorBadParameter;
+ }
+ }
BITMASK_SET(&m_inp_bm_count,index);
*bufferHdr = &meta_buffer_hdr[index];
memset(&meta_buffer_hdr[index], 0, sizeof(meta_buffer_hdr[index]));
@@ -2761,6 +2647,10 @@ OMX_ERRORTYPE omx_video::allocate_input_meta_buffer(
meta_buffer_hdr[index].nInputPortIndex = PORT_INDEX_IN;
meta_buffer_hdr[index].pBuffer = (OMX_U8*)&meta_buffers[index];
meta_buffer_hdr[index].pAppPrivate = appData;
+ if(mUseProxyColorFormat) {
+ m_opq_pmem_q.insert_entry((unsigned int)opaque_buffer_hdr[index],0,0);
+ DEBUG_PRINT_HIGH("\n opaque_buffer_hdr insert %p", opaque_buffer_hdr[index]);
+ }
return OMX_ErrorNone;
}
#endif
@@ -2790,16 +2680,16 @@ OMX_ERRORTYPE omx_video::allocate_input_buffer(
unsigned i = 0;
DEBUG_PRINT_HIGH("\n allocate_input_buffer()::");
- if(bytes != m_sInPortDef.nBufferSize)
+ if(bytes != m_sInPortDef.nBufferSize || secure_session)
{
- DEBUG_PRINT_ERROR("\nERROR: Buffer size mismatch error: bytes[%lu] != nBufferSize[%lu]\n",
+ DEBUG_PRINT_ERROR("\nERROR: Buffer size mismatch error: bytes[%u] != nBufferSize[%u]\n",
bytes, m_sInPortDef.nBufferSize);
return OMX_ErrorBadParameter;
}
if(!m_inp_mem_ptr)
{
- DEBUG_PRINT_HIGH("%s: size = %lu, actual cnt %lu", __FUNCTION__,
+ DEBUG_PRINT_HIGH("%s: size = %d, actual cnt %d", __FUNCTION__,
m_sInPortDef.nBufferSize, m_sInPortDef.nBufferCountActual);
m_inp_mem_ptr = (OMX_BUFFERHEADERTYPE*) \
calloc( (sizeof(OMX_BUFFERHEADERTYPE)), m_sInPortDef.nBufferCountActual);
@@ -2853,15 +2743,9 @@ OMX_ERRORTYPE omx_video::allocate_input_buffer(
(*bufferHdr)->nInputPortIndex = PORT_INDEX_IN;
#ifdef USE_ION
-#ifdef _MSM8974_
- m_pInput_ion[i].ion_device_fd = alloc_map_ion_memory(m_sInPortDef.nBufferSize,
- &m_pInput_ion[i].ion_alloc_data,
- &m_pInput_ion[i].fd_ion_data,0);
-#else
m_pInput_ion[i].ion_device_fd = alloc_map_ion_memory(m_sInPortDef.nBufferSize,
&m_pInput_ion[i].ion_alloc_data,
&m_pInput_ion[i].fd_ion_data,ION_FLAG_CACHED);
-#endif
if(m_pInput_ion[i].ion_device_fd < 0) {
DEBUG_PRINT_ERROR("\nERROR:ION device open() Failed");
return OMX_ErrorInsufficientResources;
@@ -2898,10 +2782,10 @@ OMX_ERRORTYPE omx_video::allocate_input_buffer(
}
(*bufferHdr)->pBuffer = (OMX_U8 *)m_pInput_pmem[i].buffer;
-
+ DEBUG_PRINT_LOW("\n Virtual address in allocate buffer is %p", m_pInput_pmem[i].buffer);
BITMASK_SET(&m_inp_bm_count,i);
//here change the I/P param here from buf_adr to pmem
- if( dev_use_buf(&m_pInput_pmem[i],PORT_INDEX_IN,i) != true)
+ if(!mUseProxyColorFormat && (dev_use_buf(&m_pInput_pmem[i],PORT_INDEX_IN,i) != true))
{
DEBUG_PRINT_ERROR("\nERROR: dev_use_buf FAILED for i/p buf\n");
return OMX_ErrorInsufficientResources;
@@ -2942,14 +2826,12 @@ OMX_ERRORTYPE omx_video::allocate_output_buffer(
OMX_ERRORTYPE eRet = OMX_ErrorNone;
OMX_BUFFERHEADERTYPE *bufHdr= NULL; // buffer header
unsigned i= 0; // Temporary counter
-#ifdef _MSM8974_
- int align_size;
-#endif
- DEBUG_PRINT_HIGH("\n allocate_output_buffer()for %lu bytes", bytes);
+
+ DEBUG_PRINT_HIGH("\n allocate_output_buffer()::");
if(!m_out_mem_ptr)
{
int nBufHdrSize = 0;
- DEBUG_PRINT_HIGH("%s: size = %lu, actual cnt %lu", __FUNCTION__,
+ DEBUG_PRINT_HIGH("%s: size = %d, actual cnt %d", __FUNCTION__,
m_sOutPortDef.nBufferSize, m_sOutPortDef.nBufferCountActual);
nBufHdrSize = m_sOutPortDef.nBufferCountActual * sizeof(OMX_BUFFERHEADERTYPE);
@@ -3006,7 +2888,7 @@ OMX_ERRORTYPE omx_video::allocate_output_buffer(
}
}
- DEBUG_PRINT_HIGH("\n actual cnt = %lu", m_sOutPortDef.nBufferCountActual);
+ DEBUG_PRINT_HIGH("\n actual cnt = %u", m_sOutPortDef.nBufferCountActual);
for(i=0; i< m_sOutPortDef.nBufferCountActual; i++)
{
if(BITMASK_ABSENT(&m_out_bm_count,i))
@@ -3020,21 +2902,13 @@ OMX_ERRORTYPE omx_video::allocate_output_buffer(
if(i < m_sOutPortDef.nBufferCountActual)
{
#ifdef USE_ION
-#ifdef _MSM8974_
- align_size = ((m_sOutPortDef.nBufferSize + 4095)/4096) * 4096;
- m_pOutput_ion[i].ion_device_fd = alloc_map_ion_memory(align_size,
- &m_pOutput_ion[i].ion_alloc_data,
- &m_pOutput_ion[i].fd_ion_data,0);
-#else
m_pOutput_ion[i].ion_device_fd = alloc_map_ion_memory(m_sOutPortDef.nBufferSize,
&m_pOutput_ion[i].ion_alloc_data,
&m_pOutput_ion[i].fd_ion_data,ION_FLAG_CACHED);
-#endif
if(m_pOutput_ion[i].ion_device_fd < 0) {
DEBUG_PRINT_ERROR("\nERROR:ION device open() Failed");
return OMX_ErrorInsufficientResources;
}
-
m_pOutput_pmem[i].fd = m_pOutput_ion[i].fd_ion_data.fd;
#else
m_pOutput_pmem[i].fd = open (MEM_DEVICE,O_RDWR);
@@ -3051,25 +2925,27 @@ OMX_ERRORTYPE omx_video::allocate_output_buffer(
#endif
m_pOutput_pmem[i].size = m_sOutPortDef.nBufferSize;
m_pOutput_pmem[i].offset = 0;
-#ifdef _MSM8974_
- m_pOutput_pmem[i].buffer = (unsigned char *)mmap(NULL,align_size,PROT_READ|PROT_WRITE,
- MAP_SHARED,m_pOutput_pmem[i].fd,0);
-#else
- m_pOutput_pmem[i].buffer = (unsigned char *)mmap(NULL,m_pOutput_pmem[i].size,PROT_READ|PROT_WRITE,
- MAP_SHARED,m_pOutput_pmem[i].fd,0);
-#endif
- if(m_pOutput_pmem[i].buffer == MAP_FAILED)
- {
- DEBUG_PRINT_ERROR("\nERROR: MMAP_FAILED in o/p alloc buffer");
- close (m_pOutput_pmem[i].fd);
+ if(!secure_session) {
+ m_pOutput_pmem[i].buffer = (unsigned char *)mmap(NULL,m_pOutput_pmem[i].size,PROT_READ|PROT_WRITE,
+ MAP_SHARED,m_pOutput_pmem[i].fd,0);
+ if(m_pOutput_pmem[i].buffer == MAP_FAILED)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: MMAP_FAILED in o/p alloc buffer");
+ close (m_pOutput_pmem[i].fd);
#ifdef USE_ION
- free_ion_memory(&m_pOutput_ion[i]);
+ free_ion_memory(&m_pOutput_ion[i]);
#endif
- return OMX_ErrorInsufficientResources;
+ return OMX_ErrorInsufficientResources;
+ }
}
*bufferHdr = (m_out_mem_ptr + i );
- (*bufferHdr)->pBuffer = (OMX_U8 *)m_pOutput_pmem[i].buffer;
+ if(!secure_session)
+ (*bufferHdr)->pBuffer = (OMX_U8 *)m_pOutput_pmem[i].buffer;
+ else {
+ m_pOutput_pmem[i].buffer = (OMX_U8 *)(i + 12345);
+ (*bufferHdr)->pBuffer = (OMX_U8 *)(i + 12345);
+ }
(*bufferHdr)->pAppPrivate = appData;
BITMASK_SET(&m_out_bm_count,i);
@@ -3083,7 +2959,7 @@ OMX_ERRORTYPE omx_video::allocate_output_buffer(
else
{
DEBUG_PRINT_ERROR("\nERROR: All o/p buffers are allocated, invalid allocate buf call"
- "for index [%d] actual: %lu\n", i, m_sOutPortDef.nBufferCountActual);
+ "for index [%d]\n", i);
}
}
@@ -3127,7 +3003,7 @@ OMX_ERRORTYPE omx_video::allocate_buffer(OMX_IN OMX_HANDLETYPE h
{
#ifdef _ANDROID_ICS_
if(meta_mode_enable)
- eRet = allocate_input_meta_buffer(bufferHdr,appData,bytes);
+ eRet = allocate_input_meta_buffer(hComp,bufferHdr,appData,bytes);
else
#endif
eRet = allocate_input_buffer(hComp,bufferHdr,port,appData,bytes);
@@ -3202,7 +3078,7 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
OMX_ERRORTYPE eRet = OMX_ErrorNone;
unsigned int nPortIndex;
- DEBUG_PRINT_LOW("In for encoder free_buffer \n");
+ DEBUG_PRINT_LOW("In for decoder free_buffer \n");
if(m_state == OMX_StateIdle &&
(BITMASK_PRESENT(&m_flags ,OMX_COMPONENT_LOADING_PENDING)))
@@ -3220,6 +3096,7 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
post_event(OMX_EventError,
OMX_ErrorPortUnpopulated,
OMX_COMPONENT_GENERATE_EVENT);
+
return eRet;
}
else
@@ -3233,7 +3110,7 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
if(port == PORT_INDEX_IN)
{
// check if the buffer is valid
- nPortIndex = buffer - m_inp_mem_ptr;
+ nPortIndex = buffer - ((!mUseProxyColorFormat)?m_inp_mem_ptr:meta_buffer_hdr);
DEBUG_PRINT_LOW("free_buffer on i/p port - Port idx %d, actual cnt %d \n",
nPortIndex, m_sInPortDef.nBufferCountActual);
@@ -3365,9 +3242,6 @@ OMX_ERRORTYPE omx_video::free_buffer(OMX_IN OMX_HANDLETYPE hComp,
BITMASK_CLEAR((&m_flags),OMX_COMPONENT_LOADING_PENDING);
post_event(OMX_CommandStateSet, OMX_StateLoaded,
OMX_COMPONENT_GENERATE_EVENT);
- } else {
- DEBUG_PRINT_ERROR("in free buffer, release not done, need to free more buffers input 0x%x output 0x%x",
- m_out_bm_count, m_inp_bm_count);
}
}
@@ -3426,7 +3300,7 @@ OMX_ERRORTYPE omx_video::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorIncorrectStateOperation;
}
- nBufferIndex = buffer - m_inp_mem_ptr;
+ nBufferIndex = buffer - ((!mUseProxyColorFormat)?m_inp_mem_ptr:meta_buffer_hdr);
if(nBufferIndex > m_sInPortDef.nBufferCountActual )
{
@@ -3436,11 +3310,9 @@ OMX_ERRORTYPE omx_video::empty_this_buffer(OMX_IN OMX_HANDLETYPE hComp,
m_etb_count++;
DEBUG_PRINT_LOW("\n DBG: i/p nTimestamp = %u", (unsigned)buffer->nTimeStamp);
- post_event ((unsigned)hComp,(unsigned)buffer,OMX_COMPONENT_GENERATE_ETB);
+ post_event ((unsigned)hComp,(unsigned)buffer,m_input_msg_id);
return OMX_ErrorNone;
}
-
-
/* ======================================================================
FUNCTION
omx_video::empty_this_buffer_proxy
@@ -3461,20 +3333,21 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE
{
OMX_U8 *pmem_data_buf = NULL;
int push_cnt = 0;
- unsigned nBufIndex = 0;
+ unsigned nBufIndex = 0,nBufIndex_meta = 0;
OMX_ERRORTYPE ret = OMX_ErrorNone;
-#ifdef _MSM8974_
- int fd = 0;
-#endif
- DEBUG_PRINT_LOW("\n ETBProxy: buffer->pBuffer[%p]\n", buffer->pBuffer);
+
+ DEBUG_PRINT_LOW("\n ETBProxy: buffer[%p]\n", buffer);
+
if(buffer == NULL)
{
DEBUG_PRINT_ERROR("\nERROR: ETBProxy: Invalid buffer[%p]\n", buffer);
return OMX_ErrorBadParameter;
}
- nBufIndex = buffer - ((OMX_BUFFERHEADERTYPE *)m_inp_mem_ptr);
- if(nBufIndex >= m_sInPortDef.nBufferCountActual)
+ nBufIndex = buffer - ((OMX_BUFFERHEADERTYPE *)m_inp_mem_ptr);
+ nBufIndex_meta = buffer - meta_buffer_hdr;
+ if(nBufIndex >= m_sInPortDef.nBufferCountActual &&
+ nBufIndex_meta >= m_sInPortDef.nBufferCountActual)
{
DEBUG_PRINT_ERROR("\nERROR: ETBProxy: Invalid bufindex = %u\n", nBufIndex);
return OMX_ErrorBadParameter;
@@ -3488,12 +3361,8 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE
DEBUG_PRINT_ERROR("\nERROR: ETBProxy: Input flush in progress");
return OMX_ErrorNone;
}
-#ifdef _MSM8974_
- if(!meta_mode_enable)
- fd = m_pInput_pmem[nBufIndex].fd;
-#endif
#ifdef _ANDROID_ICS_
- if(meta_mode_enable)
+ if(meta_mode_enable && !mUseProxyColorFormat)
{
encoder_media_buffer_type *media_buffer;
bool met_error = false;
@@ -3525,21 +3394,25 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE
post_event ((unsigned int)buffer,0,OMX_COMPONENT_GENERATE_EBD);
return OMX_ErrorBadParameter;
}
+
struct pmem Input_pmem_info;
if(media_buffer->buffer_type == kMetadataBufferTypeCameraSource)
{
Input_pmem_info.buffer = media_buffer;
Input_pmem_info.fd = media_buffer->meta_handle->data[0];
-#ifdef _MSM8974_
- fd = Input_pmem_info.fd;
-#endif
Input_pmem_info.offset = media_buffer->meta_handle->data[1];
Input_pmem_info.size = media_buffer->meta_handle->data[2];
DEBUG_PRINT_LOW("ETB fd = %d, offset = %d, size = %d",Input_pmem_info.fd,
Input_pmem_info.offset,
Input_pmem_info.size);
+
} else {
private_handle_t *handle = (private_handle_t *)media_buffer->meta_handle;
+ if(handle->format != HAL_PIXEL_FORMAT_NV12_ENCODEABLE) {
+ DEBUG_PRINT_ERROR("\n Incorrect pixel format");
+ post_event ((unsigned int)buffer,0,OMX_COMPONENT_GENERATE_EBD);
+ return OMX_ErrorBadParameter;
+ }
Input_pmem_info.buffer = media_buffer;
Input_pmem_info.fd = handle->fd;
Input_pmem_info.offset = 0;
@@ -3558,12 +3431,13 @@ OMX_ERRORTYPE omx_video::empty_this_buffer_proxy(OMX_IN OMX_HANDLETYPE
{
DEBUG_PRINT_LOW("\n Heap UseBuffer case, so memcpy the data");
pmem_data_buf = (OMX_U8 *)m_pInput_pmem[nBufIndex].buffer;
+
memcpy (pmem_data_buf, (buffer->pBuffer + buffer->nOffset),
buffer->nFilledLen);
DEBUG_PRINT_LOW("memcpy() done in ETBProxy for i/p Heap UseBuf");
}
-#ifdef _MSM8974_
- if(dev_empty_buf(buffer, pmem_data_buf,nBufIndex,fd) != true)
+#ifdef _COPPER_
+ if(dev_empty_buf(buffer, pmem_data_buf,nBufIndex,m_pInput_pmem[nBufIndex].fd) != true)
#else
if(dev_empty_buf(buffer, pmem_data_buf,0,0) != true)
#endif
@@ -3849,21 +3723,6 @@ OMX_ERRORTYPE omx_video::component_role_enum(OMX_IN OMX_HANDLETYPE hComp,
eRet = OMX_ErrorNoMore;
}
}
-#ifdef _MSM8974_
- else if(!strncmp((char*)m_nkind, "OMX.qcom.video.encoder.vp8",OMX_MAX_STRINGNAME_SIZE))
- {
- if((0 == index) && role)
- {
- strlcpy((char *)role, "video_encoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- DEBUG_PRINT_LOW("component_role_enum: role %s\n",role);
- }
- else
- {
- DEBUG_PRINT_ERROR("\nERROR: No more roles \n");
- eRet = OMX_ErrorNoMore;
- }
- }
-#endif
else
{
DEBUG_PRINT_ERROR("\nERROR: Querying Role on Unknown Component\n");
@@ -4109,25 +3968,25 @@ bool omx_video::release_input_done(void)
OMX_ERRORTYPE omx_video::fill_buffer_done(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE * buffer)
{
-#ifdef _MSM8974_
- int index = buffer - m_out_mem_ptr;
-#endif
- DEBUG_PRINT_LOW("fill_buffer_done: buffer->pBuffer[%p], flags=0x%x",
- buffer->pBuffer, buffer->nFlags);
+ DEBUG_PRINT_LOW("fill_buffer_done: buffer->pBuffer[%p], flags=0x%x size = %d",
+ buffer->pBuffer, buffer->nFlags,buffer->nFilledLen);
if(buffer == NULL || ((buffer - m_out_mem_ptr) > m_sOutPortDef.nBufferCountActual))
{
return OMX_ErrorBadParameter;
}
pending_output_buffers--;
+ if(!secure_session)
+ {
+ extra_data_handle.create_extra_data(buffer);
+ }
- extra_data_handle.create_extra_data(buffer);
-#ifndef _MSM8974_
- if(buffer->nFlags & OMX_BUFFERFLAG_EXTRADATA) {
- DEBUG_PRINT_LOW("parsing extradata");
- extra_data_handle.parse_extra_data(buffer);
+ if (!secure_session && m_sDebugSliceinfo) {
+ if(buffer->nFlags & OMX_BUFFERFLAG_EXTRADATA) {
+ DEBUG_PRINT_HIGH("parsing extradata");
+ extra_data_handle.parse_extra_data(buffer);
+ }
}
-#endif
/* For use buffer we need to copy the data */
if(m_pCallbacks.FillBufferDone)
{
@@ -4142,12 +4001,6 @@ OMX_ERRORTYPE omx_video::fill_buffer_done(OMX_HANDLETYPE hComp,
}
#endif
}
-#ifdef _MSM8974_
- if(buffer->nFlags & OMX_BUFFERFLAG_EXTRADATA) {
- if(!dev_handle_extradata((void *)buffer, index))
- DEBUG_PRINT_ERROR("Failed to parse extradata\n");
- }
-#endif
m_pCallbacks.FillBufferDone (hComp,m_app_data,buffer);
}
else
@@ -4160,16 +4013,36 @@ OMX_ERRORTYPE omx_video::fill_buffer_done(OMX_HANDLETYPE hComp,
OMX_ERRORTYPE omx_video::empty_buffer_done(OMX_HANDLETYPE hComp,
OMX_BUFFERHEADERTYPE* buffer)
{
- DEBUG_PRINT_LOW("empty_buffer_done: buffer->pBuffer[%p]", buffer->pBuffer);
- if(buffer == NULL || ((buffer - m_inp_mem_ptr) > m_sInPortDef.nBufferCountActual))
+ int buffer_index = -1;
+ int buffer_index_meta = -1;
+
+ buffer_index = (buffer - m_inp_mem_ptr);
+ buffer_index_meta = (buffer - meta_buffer_hdr);
+ DEBUG_PRINT_LOW("\n empty_buffer_done: buffer[%p]", buffer);
+ if(buffer == NULL ||
+ ((buffer_index > m_sInPortDef.nBufferCountActual) &&
+ (buffer_index_meta > m_sInPortDef.nBufferCountActual)))
{
+ DEBUG_PRINT_ERROR("\n ERROR in empty_buffer_done due to index buffer");
return OMX_ErrorBadParameter;
}
pending_input_buffers--;
- if(m_pCallbacks.EmptyBufferDone)
- {
+ if(mUseProxyColorFormat && (buffer_index < m_sInPortDef.nBufferCountActual)) {
+ if(!pdest_frame) {
+ pdest_frame = buffer;
+ DEBUG_PRINT_LOW("\n empty_buffer_done pdest_frame address is %p",pdest_frame);
+ return push_input_buffer(hComp);
+
+ } else {
+ DEBUG_PRINT_LOW("\n empty_buffer_done insert address is %p",buffer);
+ if (!m_opq_pmem_q.insert_entry((unsigned int)buffer, 0, 0)) {
+ DEBUG_PRINT_ERROR("\n empty_buffer_done: pmem queue is full");
+ return OMX_ErrorBadParameter;
+ }
+ }
+ } else if(m_pCallbacks.EmptyBufferDone) {
m_pCallbacks.EmptyBufferDone(hComp ,m_app_data, buffer);
}
return OMX_ErrorNone;
@@ -4227,7 +4100,7 @@ void omx_video::complete_pending_buffer_done_cbs()
pending_bd_q.pop_entry(&p1,&p2,&ident);
switch(ident)
{
- case OMX_COMPONENT_GENERATE_EBD:
+ case OMX_COMPONENT_GENERATE_EBD:
if(empty_buffer_done(&m_cmp, (OMX_BUFFERHEADERTYPE *)p1) != OMX_ErrorNone)
{
DEBUG_PRINT_ERROR("\nERROR: empty_buffer_done() failed!\n");
@@ -4331,33 +4204,9 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
if(profileLevelType->nPortIndex == 1) {
if (m_sOutPortDef.format.video.eCompressionFormat == OMX_VIDEO_CodingAVC)
{
-#ifdef _MSM8974_
if (profileLevelType->nProfileIndex == 0)
{
profileLevelType->eProfile = OMX_VIDEO_AVCProfileBaseline;
- profileLevelType->eLevel = OMX_VIDEO_AVCLevel51;
-
- }
- else if (profileLevelType->nProfileIndex == 1)
- {
- profileLevelType->eProfile = OMX_VIDEO_AVCProfileMain;
- profileLevelType->eLevel = OMX_VIDEO_AVCLevel51;
- }
- else if(profileLevelType->nProfileIndex == 2)
- {
- profileLevelType->eProfile = OMX_VIDEO_AVCProfileHigh;
- profileLevelType->eLevel = OMX_VIDEO_AVCLevel51;
- }
- else
- {
- DEBUG_PRINT_LOW("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n",
- profileLevelType->nProfileIndex);
- eRet = OMX_ErrorNoMore;
- }
-#else
- if (profileLevelType->nProfileIndex == 0)
- {
- profileLevelType->eProfile = OMX_VIDEO_AVCProfileBaseline;
profileLevelType->eLevel = OMX_VIDEO_AVCLevel4;
}
@@ -4377,7 +4226,6 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
-#endif
}
else if (m_sOutPortDef.format.video.eCompressionFormat == OMX_VIDEO_CodingH263)
{
@@ -4388,7 +4236,7 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %lu\n", profileLevelType->nProfileIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n", profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
}
@@ -4406,39 +4254,32 @@ OMX_ERRORTYPE omx_video::get_supported_profile_level(OMX_VIDEO_PARAM_PROFILELEVE
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %lu\n", profileLevelType->nProfileIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported nProfileIndex ret NoMore %d\n", profileLevelType->nProfileIndex);
eRet = OMX_ErrorNoMore;
}
}
- else
- {
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported ret NoMore\n");
- eRet = OMX_ErrorNoMore;
- }
}
else
{
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported should be queries on Input port only %lu\n", profileLevelType->nPortIndex);
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported should be queries on Input port only %d\n", profileLevelType->nPortIndex);
eRet = OMX_ErrorBadPortIndex;
}
- DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported for Input port returned Profile:%lu, Level:%lu\n",
+ DEBUG_PRINT_ERROR("get_parameter: OMX_IndexParamVideoProfileLevelQuerySupported for Input port returned Profile:%d, Level:%d\n",
profileLevelType->eProfile,profileLevelType->eLevel);
return eRet;
}
-#endif
#ifdef USE_ION
-int alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_data,
+int omx_video::alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_data,
struct ion_fd_data *fd_data,int flag)
{
- struct venc_ion buf_ion_info;
- int ion_device_fd =-1,rc=0,ion_dev_flags = 0;
- if (size <=0 || !alloc_data || !fd_data) {
- DEBUG_PRINT_ERROR("\nInvalid input to alloc_map_ion_memory");
- return -EINVAL;
+ struct venc_ion buf_ion_info;
+ int ion_device_fd =-1,rc=0,ion_dev_flags = 0;
+ if (size <=0 || !alloc_data || !fd_data) {
+ DEBUG_PRINT_ERROR("\nInvalid input to alloc_map_ion_memory");
+ return -EINVAL;
}
-
- ion_dev_flags = O_RDONLY;
+ ion_dev_flags = O_RDONLY;
ion_device_fd = open (MEM_DEVICE,ion_dev_flags);
if(ion_device_fd < 0)
{
@@ -4447,14 +4288,18 @@ int alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_data,
}
alloc_data->len = size;
alloc_data->align = 4096;
- alloc_data->flags = flag;
-#ifdef MAX_RES_720P
- alloc_data->len = (size + (alloc_data->align - 1)) & ~(alloc_data->align - 1);
- alloc_data->heap_mask = ION_HEAP(MEM_HEAP_ID);
-#else
- alloc_data->heap_mask = (ION_HEAP(MEM_HEAP_ID) |
- ION_HEAP(ION_IOMMU_HEAP_ID));
-#endif
+ alloc_data->flags = 0;
+ if(!secure_session && (flag & ION_FLAG_CACHED))
+ {
+ alloc_data->flags = ION_FLAG_CACHED;
+ }
+
+ if (secure_session)
+ alloc_data->heap_mask = (ION_HEAP(MEM_HEAP_ID) | ION_SECURE);
+ else
+ alloc_data->heap_mask = (ION_HEAP(MEM_HEAP_ID) |
+ ION_HEAP(ION_IOMMU_HEAP_ID));
+
rc = ioctl(ion_device_fd,ION_IOC_ALLOC,alloc_data);
if(rc || !alloc_data->handle) {
DEBUG_PRINT_ERROR("\n ION ALLOC memory failed ");
@@ -4477,11 +4322,11 @@ int alloc_map_ion_memory(int size,struct ion_allocation_data *alloc_data,
return ion_device_fd;
}
-void free_ion_memory(struct venc_ion *buf_ion_info)
+void omx_video::free_ion_memory(struct venc_ion *buf_ion_info)
{
if (!buf_ion_info) {
DEBUG_PRINT_ERROR("\n Invalid input to free_ion_memory");
- return;
+ return;
}
if (ioctl(buf_ion_info->ion_device_fd,ION_IOC_FREE,
&buf_ion_info->ion_alloc_data.handle)) {
@@ -4494,7 +4339,7 @@ void free_ion_memory(struct venc_ion *buf_ion_info)
buf_ion_info->fd_ion_data.fd = -1;
}
#endif
-
+#endif
#ifdef _ANDROID_ICS_
void omx_video::omx_release_meta_buffer(OMX_BUFFERHEADERTYPE *buffer)
{
@@ -4502,38 +4347,384 @@ void omx_video::omx_release_meta_buffer(OMX_BUFFERHEADERTYPE *buffer)
{
encoder_media_buffer_type *media_ptr;
struct pmem Input_pmem;
+ unsigned int index_pmem = 0;
bool meta_error = false;
- media_ptr = (encoder_media_buffer_type *) buffer->pBuffer;
- if(media_ptr && media_ptr->meta_handle)
- {
- if(media_ptr->buffer_type == kMetadataBufferTypeCameraSource &&
- media_ptr->meta_handle->numFds == 1 &&
- media_ptr->meta_handle->numInts == 2) {
- Input_pmem.fd = media_ptr->meta_handle->data[0];
- Input_pmem.buffer = media_ptr;
- Input_pmem.size = media_ptr->meta_handle->data[2];
- Input_pmem.offset = media_ptr->meta_handle->data[1];
- DEBUG_PRINT_LOW("EBD fd = %d, offset = %d, size = %d",Input_pmem.fd,
- Input_pmem.offset,
- Input_pmem.size);
- } else if(media_ptr->buffer_type == kMetadataBufferTypeGrallocSource) {
- private_handle_t *handle = (private_handle_t *)media_ptr->meta_handle;
- Input_pmem.buffer = media_ptr;
- Input_pmem.fd = handle->fd;
- Input_pmem.offset = 0;
- Input_pmem.size = handle->size;
- } else {
- meta_error = true;
- DEBUG_PRINT_ERROR(" Meta Error set in EBD");
- }
- if(!meta_error)
- meta_error = !dev_free_buf(&Input_pmem,PORT_INDEX_IN);
- if(meta_error)
- {
- DEBUG_PRINT_ERROR(" Warning dev_free_buf failed flush value is %d",
- input_flush_progress);
+
+ index_pmem = (buffer - m_inp_mem_ptr);
+ if(mUseProxyColorFormat &&
+ (index_pmem < m_sInPortDef.nBufferCountActual)) {
+ if(!dev_free_buf((&m_pInput_pmem[index_pmem]),PORT_INDEX_IN)){
+ DEBUG_PRINT_ERROR("\n omx_release_meta_buffer dev free failed");
+ }
+ } else {
+ media_ptr = (encoder_media_buffer_type *) buffer->pBuffer;
+ if(media_ptr && media_ptr->meta_handle)
+ {
+ if(media_ptr->buffer_type == kMetadataBufferTypeCameraSource &&
+ media_ptr->meta_handle->numFds == 1 &&
+ media_ptr->meta_handle->numInts == 2) {
+ Input_pmem.fd = media_ptr->meta_handle->data[0];
+ Input_pmem.buffer = media_ptr;
+ Input_pmem.size = media_ptr->meta_handle->data[2];
+ Input_pmem.offset = media_ptr->meta_handle->data[1];
+ DEBUG_PRINT_LOW("EBD fd = %d, offset = %d, size = %d",Input_pmem.fd,
+ Input_pmem.offset,
+ Input_pmem.size);
+ } else if(media_ptr->buffer_type == kMetadataBufferTypeGrallocSource) {
+ private_handle_t *handle = (private_handle_t *)media_ptr->meta_handle;
+ Input_pmem.buffer = media_ptr;
+ Input_pmem.fd = handle->fd;
+ Input_pmem.offset = 0;
+ Input_pmem.size = handle->size;
+ } else {
+ meta_error = true;
+ DEBUG_PRINT_ERROR(" Meta Error set in EBD");
+ }
+ if(!meta_error)
+ meta_error = !dev_free_buf(&Input_pmem,PORT_INDEX_IN);
+ if(meta_error)
+ {
+ DEBUG_PRINT_ERROR(" Warning dev_free_buf failed flush value is %d",
+ input_flush_progress);
+ }
}
+ }
+ }
+}
+#endif
+omx_video::omx_c2d_conv::omx_c2d_conv()
+{
+ c2dcc = NULL;
+ mLibHandle = NULL;
+ mConvertOpen = NULL;
+ mConvertClose = NULL;
+ src_format = NV12_2K;
+}
+
+bool omx_video::omx_c2d_conv::init() {
+ bool status = true;
+ if(mLibHandle || mConvertOpen || mConvertClose) {
+ DEBUG_PRINT_ERROR("\n omx_c2d_conv::init called twice");
+ status = false;
+ }
+ if(status) {
+ mLibHandle = dlopen("libc2dcolorconvert.so", RTLD_LAZY);
+ if(mLibHandle){
+ mConvertOpen = (createC2DColorConverter_t *)
+ dlsym(mLibHandle,"createC2DColorConverter");
+ mConvertClose = (destroyC2DColorConverter_t *)
+ dlsym(mLibHandle,"destroyC2DColorConverter");
+ if(!mConvertOpen || !mConvertClose)
+ status = false;
+ } else
+ status = false;
+ }
+ if(!status && mLibHandle){
+ dlclose(mLibHandle);
+ mLibHandle = NULL;
+ mConvertOpen = NULL;
+ mConvertClose = NULL;
+ }
+ return status;
+}
+
+bool omx_video::omx_c2d_conv::convert(int src_fd, void *src_viraddr,
+ int dest_fd,void *dest_viraddr)
+{
+ int result;
+ if(!src_viraddr || !dest_viraddr || !c2dcc){
+ DEBUG_PRINT_ERROR("\n Invalid arguments omx_c2d_conv::convert");
+ return false;
+ }
+ result = c2dcc->convertC2D(src_fd,src_viraddr,
+ dest_fd,dest_viraddr);
+ DEBUG_PRINT_LOW("\n Color convert status %d",result);
+ return ((result < 0)?false:true);
+}
+
+bool omx_video::omx_c2d_conv::open(unsigned int height,unsigned int width,
+ ColorConvertFormat src, ColorConvertFormat dest)
+{
+ bool status = false;
+ if(!c2dcc) {
+ c2dcc = mConvertOpen(width, height, width, height,
+ src,dest,0);
+ if(c2dcc) {
+ src_format = src;
+ status = true;
+ } else
+ DEBUG_PRINT_ERROR("\n mConvertOpen failed");
+ }
+ return status;
+}
+void omx_video::omx_c2d_conv::close()
+{
+ if(mLibHandle) {
+ if(mConvertClose && c2dcc)
+ mConvertClose(c2dcc);
+ c2dcc = NULL;
+ }
+}
+omx_video::omx_c2d_conv::~omx_c2d_conv()
+{
+ DEBUG_PRINT_ERROR("\n Destroy C2D instance");
+ if(mLibHandle) {
+ if(mConvertClose && c2dcc)
+ mConvertClose(c2dcc);
+ dlclose(mLibHandle);
+ }
+ c2dcc = NULL;
+ mLibHandle = NULL;
+ mConvertOpen = NULL;
+ mConvertClose = NULL;
+}
+int omx_video::omx_c2d_conv::get_src_format()
+{
+ int format = -1;
+ if(src_format == NV12_2K) {
+ format = HAL_PIXEL_FORMAT_NV12_ENCODEABLE;
+ } else if(src_format == RGBA8888) {
+ format = HAL_PIXEL_FORMAT_RGBA_8888;
+ }
+ return format;
+}
+bool omx_video::omx_c2d_conv::get_buffer_size(int port,unsigned int &buf_size)
+{
+ int cret = 0;
+ bool ret = false;
+ C2DBuffReq bufferreq;
+ if(c2dcc){
+ bufferreq.size = 0;
+ cret = c2dcc->getBuffReq(port,&bufferreq);
+ DEBUG_PRINT_LOW("\n Status of getbuffer is %d", cret);
+ ret = (cret)?false:true;
+ buf_size = bufferreq.size;
+ }
+ return ret;
+}
+OMX_ERRORTYPE omx_video::empty_this_buffer_opaque(OMX_IN OMX_HANDLETYPE hComp,
+ OMX_IN OMX_BUFFERHEADERTYPE* buffer)
+{
+ unsigned nBufIndex = 0;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ encoder_media_buffer_type *media_buffer;
+ DEBUG_PRINT_LOW("\n ETBProxyOpaque: buffer[%p]\n", buffer);
+
+ if(buffer == NULL) {
+ DEBUG_PRINT_ERROR("\nERROR: ETBProxyA: Invalid buffer[%p]\n",buffer);
+ return OMX_ErrorBadParameter;
+ }
+ nBufIndex = buffer - meta_buffer_hdr;
+ if(nBufIndex >= m_sInPortDef.nBufferCountActual) {
+ DEBUG_PRINT_ERROR("\nERROR: ETBProxyA: Invalid bufindex = %u\n",
+ nBufIndex);
+ return OMX_ErrorBadParameter;
+ }
+ media_buffer = (encoder_media_buffer_type *)buffer->pBuffer;
+ private_handle_t *handle = (private_handle_t *)media_buffer->meta_handle;
+ /*Enable following code once private handle color format is
+ updated correctly*/
+
+ if(c2d_opened && handle->format != c2d_conv.get_src_format()) {
+ c2d_conv.close();
+ c2d_opened = false;
+ }
+ if (!c2d_opened) {
+ if (handle->format == HAL_PIXEL_FORMAT_RGBA_8888) {
+ DEBUG_PRINT_ERROR("\n open Color conv for RGBA888");
+ if(!c2d_conv.open(m_sInPortDef.format.video.nFrameHeight,
+ m_sInPortDef.format.video.nFrameWidth,RGBA8888,NV12_2K)){
+ m_pCallbacks.EmptyBufferDone(hComp,m_app_data,buffer);
+ DEBUG_PRINT_ERROR("\n Color conv open failed");
+ return OMX_ErrorBadParameter;
+ }
+ c2d_opened = true;
+ } else if(handle->format != HAL_PIXEL_FORMAT_NV12_ENCODEABLE) {
+ DEBUG_PRINT_ERROR("\n Incorrect color format");
+ m_pCallbacks.EmptyBufferDone(hComp,m_app_data,buffer);
+ return OMX_ErrorBadParameter;
}
+ }
+
+ if(input_flush_progress == true)
+ {
+ m_pCallbacks.EmptyBufferDone(hComp,m_app_data,buffer);
+ DEBUG_PRINT_ERROR("\nERROR: ETBProxyA: Input flush in progress");
+ return OMX_ErrorNone;
+ }
+
+ if(!psource_frame) {
+ psource_frame = buffer;
+ ret = push_input_buffer(hComp);
+ } else {
+ if (!m_opq_meta_q.insert_entry((unsigned)buffer,0,0)) {
+ DEBUG_PRINT_ERROR("\nERROR: ETBProxy: Queue is full");
+ ret = OMX_ErrorBadParameter;
}
+ }
+ if(ret != OMX_ErrorNone) {
+ m_pCallbacks.EmptyBufferDone(hComp,m_app_data,buffer);
+ DEBUG_PRINT_LOW("\nERROR: ETBOpaque failed:");
+ }
+ return ret;
+}
+OMX_ERRORTYPE omx_video::queue_meta_buffer(OMX_HANDLETYPE hComp,
+ struct pmem &Input_pmem_info) {
+
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ unsigned address = 0,p2,id;
+
+ DEBUG_PRINT_LOW("\n In queue Meta Buffer");
+ if(!psource_frame || !pdest_frame) {
+ DEBUG_PRINT_ERROR("\n convert_queue_buffer invalid params");
+ return OMX_ErrorBadParameter;
+ }
+
+ if(dev_use_buf(&Input_pmem_info,PORT_INDEX_IN,0) != true) {
+ DEBUG_PRINT_ERROR("\nERROR: in dev_use_buf");
+ post_event ((unsigned int)psource_frame,0,OMX_COMPONENT_GENERATE_EBD);
+ ret = OMX_ErrorBadParameter;
+ }
+
+ if(ret == OMX_ErrorNone)
+ ret = empty_this_buffer_proxy(hComp,psource_frame);
+
+ if(ret == OMX_ErrorNone) {
+ psource_frame = NULL;
+ if(!psource_frame && m_opq_meta_q.m_size) {
+ m_opq_meta_q.pop_entry(&address,&p2,&id);
+ psource_frame = (OMX_BUFFERHEADERTYPE* ) address;
+ }
+ }
+ return ret;
+}
+
+OMX_ERRORTYPE omx_video::convert_queue_buffer(OMX_HANDLETYPE hComp,
+ struct pmem &Input_pmem_info,unsigned &index){
+
+ unsigned char *uva;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ unsigned address = 0,p2,id;
+
+ DEBUG_PRINT_LOW("\n In Convert and queue Meta Buffer");
+ if(!psource_frame || !pdest_frame) {
+ DEBUG_PRINT_ERROR("\n convert_queue_buffer invalid params");
+ return OMX_ErrorBadParameter;
+ }
+
+ if(!psource_frame->nFilledLen){
+ pdest_frame->nOffset = 0;
+ pdest_frame->nFilledLen = 0;
+ pdest_frame->nTimeStamp = psource_frame->nTimeStamp;
+ pdest_frame->nFlags = psource_frame->nFlags;
+ DEBUG_PRINT_LOW("\n Buffer header %p Filled len size %d",
+ pdest_frame,pdest_frame->nFilledLen);
+ } else {
+ uva = (unsigned char *)mmap(NULL, Input_pmem_info.size,
+ PROT_READ|PROT_WRITE,
+ MAP_SHARED,Input_pmem_info.fd,0);
+ if(uva == MAP_FAILED) {
+ ret = OMX_ErrorBadParameter;
+ } else {
+ if(!c2d_conv.convert(Input_pmem_info.fd,uva,
+ m_pInput_pmem[index].fd,pdest_frame->pBuffer)) {
+ DEBUG_PRINT_ERROR("\n Color Conversion failed");
+ ret = OMX_ErrorBadParameter;
+ } else {
+ unsigned int buf_size = 0;
+ if (!c2d_conv.get_buffer_size(C2D_OUTPUT,buf_size))
+ ret = OMX_ErrorBadParameter;
+ else {
+ pdest_frame->nOffset = 0;
+ if(!buf_size || buf_size > pdest_frame->nAllocLen) {
+ DEBUG_PRINT_ERROR("\n convert_queue_buffer buffer"
+ "size mismatch buf size %d alloc size %d",
+ buf_size, pdest_frame->nAllocLen);
+ ret = OMX_ErrorBadParameter;
+ buf_size = 0;
+ }
+ pdest_frame->nFilledLen = buf_size;
+ pdest_frame->nTimeStamp = psource_frame->nTimeStamp;
+ pdest_frame->nFlags = psource_frame->nFlags;
+ DEBUG_PRINT_LOW("\n Buffer header %p Filled len size %d",
+ pdest_frame,pdest_frame->nFilledLen);
+ }
+ }
+ munmap(uva,Input_pmem_info.size);
+ }
+ }
+ if((ret == OMX_ErrorNone) &&
+ dev_use_buf(&m_pInput_pmem[index],PORT_INDEX_IN,0) != true) {
+ DEBUG_PRINT_ERROR("\nERROR: in dev_use_buf");
+ post_event ((unsigned int)pdest_frame,0,OMX_COMPONENT_GENERATE_EBD);
+ ret = OMX_ErrorBadParameter;
+ }
+ if(ret == OMX_ErrorNone)
+ ret = empty_this_buffer_proxy(hComp,pdest_frame);
+ if(ret == OMX_ErrorNone) {
+ m_pCallbacks.EmptyBufferDone(hComp ,m_app_data, psource_frame);
+ psource_frame = NULL;
+ pdest_frame = NULL;
+ if(!psource_frame && m_opq_meta_q.m_size) {
+ m_opq_meta_q.pop_entry(&address,&p2,&id);
+ psource_frame = (OMX_BUFFERHEADERTYPE* ) address;
+ }
+ if(!pdest_frame && m_opq_pmem_q.m_size) {
+ m_opq_pmem_q.pop_entry(&address,&p2,&id);
+ pdest_frame = (OMX_BUFFERHEADERTYPE* ) address;
+ DEBUG_PRINT_LOW("\n pdest_frame pop address is %p",pdest_frame);
+ }
+ }
+ return ret;
+}
+
+OMX_ERRORTYPE omx_video::push_input_buffer(OMX_HANDLETYPE hComp)
+{
+ unsigned address = 0,p2,id, index = 0;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+
+ if(!psource_frame && m_opq_meta_q.m_size) {
+ m_opq_meta_q.pop_entry(&address,&p2,&id);
+ psource_frame = (OMX_BUFFERHEADERTYPE* ) address;
+ }
+ if(!pdest_frame && m_opq_pmem_q.m_size) {
+ m_opq_pmem_q.pop_entry(&address,&p2,&id);
+ pdest_frame = (OMX_BUFFERHEADERTYPE* ) address;
+ }
+ while(psource_frame != NULL && pdest_frame != NULL &&
+ ret == OMX_ErrorNone) {
+ struct pmem Input_pmem_info;
+ encoder_media_buffer_type *media_buffer;
+ index = pdest_frame - m_inp_mem_ptr;
+ if(index >= m_sInPortDef.nBufferCountActual){
+ DEBUG_PRINT_ERROR("\n Output buffer index is wrong %d act count %d",
+ index,m_sInPortDef.nBufferCountActual);
+ return OMX_ErrorBadParameter;
+ }
+ media_buffer = (encoder_media_buffer_type *)psource_frame->pBuffer;
+ /*Will enable to verify camcorder in current TIPS can be removed*/
+ if(media_buffer->buffer_type == kMetadataBufferTypeCameraSource) {
+ Input_pmem_info.buffer = media_buffer;
+ Input_pmem_info.fd = media_buffer->meta_handle->data[0];
+ Input_pmem_info.offset = media_buffer->meta_handle->data[1];
+ Input_pmem_info.size = media_buffer->meta_handle->data[2];
+ DEBUG_PRINT_LOW("ETB fd = %d, offset = %d, size = %d",Input_pmem_info.fd,
+ Input_pmem_info.offset,
+ Input_pmem_info.size);
+ ret = queue_meta_buffer(hComp,Input_pmem_info);
+ } else {
+ private_handle_t *handle = (private_handle_t *)media_buffer->meta_handle;
+ Input_pmem_info.buffer = media_buffer;
+ Input_pmem_info.fd = handle->fd;
+ Input_pmem_info.offset = 0;
+ Input_pmem_info.size = handle->size;
+ if(handle->format == HAL_PIXEL_FORMAT_RGBA_8888)
+ ret = convert_queue_buffer(hComp,Input_pmem_info,index);
+ else if(handle->format == HAL_PIXEL_FORMAT_NV12_ENCODEABLE)
+ ret = queue_meta_buffer(hComp,Input_pmem_info);
+ else
+ ret = OMX_ErrorBadParameter;
+ }
+ }
+ return ret;
}
-#endif
diff --git a/mm-video/vidc/venc/src/omx_video_encoder.cpp b/mm-video/vidc/venc/src/omx_video_encoder.cpp
index 9bba0fc..0ceea35 100644
--- a/mm-video/vidc/venc/src/omx_video_encoder.cpp
+++ b/mm-video/vidc/venc/src/omx_video_encoder.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2012, The Linux Foundation. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -65,14 +65,13 @@ omx_venc::omx_venc()
meta_mode_enable = false;
memset(meta_buffer_hdr,0,sizeof(meta_buffer_hdr));
memset(meta_buffers,0,sizeof(meta_buffers));
+ memset(opaque_buffer_hdr,0,sizeof(opaque_buffer_hdr));
mUseProxyColorFormat = false;
- get_syntaxhdr_enable = false;
#endif
}
omx_venc::~omx_venc()
{
- get_syntaxhdr_enable = false;
//nothing to do
}
@@ -127,14 +126,13 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
strlcpy((char *)m_cRole, "video_encoder.avc",OMX_MAX_STRINGNAME_SIZE);
codec_type = OMX_VIDEO_CodingAVC;
}
-#ifdef _MSM8974_
- else if(!strncmp((char *)m_nkind, "OMX.qcom.video.encoder.vp8", \
+ else if(!strncmp((char *)m_nkind, "OMX.qcom.video.encoder.avc.secure",\
OMX_MAX_STRINGNAME_SIZE))
{
- strlcpy((char *)m_cRole, "video_encoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- codec_type = OMX_VIDEO_CodingVPX;
+ strlcpy((char *)m_cRole, "video_encoder.avc",OMX_MAX_STRINGNAME_SIZE);
+ codec_type = OMX_VIDEO_CodingAVC;
+ secure_session = true;
}
-#endif
else
{
DEBUG_PRINT_ERROR("\nERROR: Unknown Component\n");
@@ -146,10 +144,6 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
{
return eRet;
}
-#ifdef ENABLE_GET_SYNTAX_HDR
- get_syntaxhdr_enable = true;
- DEBUG_PRINT_HIGH("Get syntax header enabled");
-#endif
handle = new venc_dev(this);
@@ -207,14 +201,6 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
m_sSessionQuantization.nQpP = 6;
m_sSessionQuantization.nQpB = 2;
- OMX_INIT_STRUCT(&m_sSessionQPRange, OMX_QCOM_VIDEO_PARAM_QPRANGETYPE);
- m_sSessionQPRange.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
- m_sSessionQPRange.minQP = 2;
- if(codec_type == OMX_VIDEO_CodingAVC)
- m_sSessionQPRange.maxQP = 51;
- else
- m_sSessionQPRange.maxQP = 31;
-
OMX_INIT_STRUCT(&m_sAVCSliceFMO, OMX_VIDEO_PARAM_AVCSLICEFMO);
m_sAVCSliceFMO.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
m_sAVCSliceFMO.eSliceMode = OMX_VIDEO_SLICEMODE_AVCDefault;
@@ -374,7 +360,7 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
m_sParamH263.bPLUSPTYPEAllowed = OMX_FALSE;
m_sParamH263.nAllowedPictureTypes = 2;
m_sParamH263.bForceRoundingTypeToZero = OMX_TRUE;
- m_sParamH263.nPictureHeaderRepetition = 0;
+ m_sParamH263.nPictureHeaderRepetition = 0;
m_sParamH263.nGOBHeaderInterval = 1;
// h264 specific init
@@ -385,7 +371,7 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
m_sParamAVC.nBFrames = 0;
m_sParamAVC.bUseHadamard = OMX_FALSE;
m_sParamAVC.nRefFrames = 1;
- m_sParamAVC.nRefIdx10ActiveMinus1 = 1;
+ m_sParamAVC.nRefIdx10ActiveMinus1 = 1;
m_sParamAVC.nRefIdx11ActiveMinus1 = 0;
m_sParamAVC.bEnableUEP = OMX_FALSE;
m_sParamAVC.bEnableFMO = OMX_FALSE;
@@ -405,12 +391,29 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
m_sParamAVC.nCabacInitIdc = 0;
m_sParamAVC.eLoopFilterMode = OMX_VIDEO_AVCLoopFilterEnable;
- OMX_INIT_STRUCT(&m_sParamLTRMode, QOMX_VIDEO_PARAM_LTRMODE_TYPE);
- m_sParamLTRMode.nPortIndex = (OMX_U32) PORT_INDEX_OUT;
- m_sParamLTRMode.eLTRMode = QOMX_VIDEO_LTRMode_Disable;
-
m_state = OMX_StateLoaded;
m_sExtraData = 0;
+ m_sDebugSliceinfo = 0;
+
+ // For H264 enable some parameters in VUI by default
+ if (codec_type == OMX_VIDEO_CodingAVC)
+ {
+ QOMX_VUI_BITSTREAM_RESTRICT parm;
+ OMX_INIT_STRUCT(&parm, QOMX_VUI_BITSTREAM_RESTRICT);
+ parm.bEnable = OMX_TRUE;
+ if (set_parameter(NULL, (OMX_INDEXTYPE)OMX_QcomIndexParamEnableVUIStreamRestrictFlag,
+ (OMX_PTR)&parm)) {
+ // Don't treat this as a fatal error
+ DEBUG_PRINT_ERROR("Unable to set EnableVUIStreamRestrictFlag as default");
+ }
+ }
+
+#ifdef _ANDROID_
+ char value[PROPERTY_VALUE_MAX] = {0};
+ property_get("vidc.venc.debug.sliceinfo", value, "0");
+ m_sDebugSliceinfo = (OMX_U32)atoi(value);
+ DEBUG_PRINT_HIGH("vidc.venc.debug.sliceinfo value is %d", m_sDebugSliceinfo);
+#endif
if(eRet == OMX_ErrorNone)
{
@@ -444,7 +447,6 @@ OMX_ERRORTYPE omx_venc::component_init(OMX_STRING role)
else
{
r = pthread_create(&async_thread_id,0,async_venc_message_thread,this);
- dev_set_message_thread_id(async_thread_id);
if(r < 0)
{
eRet = OMX_ErrorInsufficientResources;
@@ -532,8 +534,21 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
if (portDefn->format.video.eColorFormat == (OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatAndroidOpaque) {
m_sInPortDef.format.video.eColorFormat =
OMX_COLOR_FormatYUV420SemiPlanar;
- mUseProxyColorFormat = true;
- } //else case not needed as color format is already updated in the memcpy above
+ if(secure_session) {
+ secure_color_format = (int) QOMX_COLOR_FormatAndroidOpaque;
+ mUseProxyColorFormat = false;
+ m_input_msg_id = OMX_COMPONENT_GENERATE_ETB;
+ } else if(!mUseProxyColorFormat){
+ if (!c2d_conv.init()) {
+ DEBUG_PRINT_ERROR("\n C2D init failed");
+ return OMX_ErrorUnsupportedSetting;
+ }
+ DEBUG_PRINT_ERROR("\nC2D init is successful");
+ mUseProxyColorFormat = true;
+ m_input_msg_id = OMX_COMPONENT_GENERATE_ETB_OPQ;
+ }
+ } else
+ mUseProxyColorFormat = false;
#endif
/*Query Input Buffer Requirements*/
dev_get_buf_req (&m_sInPortDef.nBufferCountMin,
@@ -558,13 +573,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_ERROR("\nERROR: venc_set_param output failed");
return OMX_ErrorUnsupportedSetting;
}
-#ifdef _MSM8974_
- /*Query ouput Buffer Requirements*/
- dev_get_buf_req(&m_sOutPortDef.nBufferCountMin,
- &m_sOutPortDef.nBufferCountActual,
- &m_sOutPortDef.nBufferSize,
- m_sOutPortDef.nPortIndex);
-#endif
memcpy(&m_sOutPortDef,portDefn,sizeof(struct OMX_PARAM_PORTDEFINITIONTYPE));
update_profile_level(); //framerate , bitrate
@@ -606,12 +614,26 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
if (portFmt->eColorFormat ==
(OMX_COLOR_FORMATTYPE)QOMX_COLOR_FormatAndroidOpaque) {
m_sInPortFormat.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar;
- mUseProxyColorFormat = true;
+ if(secure_session) {
+ secure_color_format = (int) QOMX_COLOR_FormatAndroidOpaque;
+ mUseProxyColorFormat = false;
+ m_input_msg_id = OMX_COMPONENT_GENERATE_ETB;
+ } else if(!mUseProxyColorFormat){
+ if (!c2d_conv.init()) {
+ DEBUG_PRINT_ERROR("\n C2D init failed");
+ return OMX_ErrorUnsupportedSetting;
+ }
+ DEBUG_PRINT_ERROR("\nC2D init is successful");
+ mUseProxyColorFormat = true;
+ m_input_msg_id = OMX_COMPONENT_GENERATE_ETB_OPQ;
+ }
}
else
#endif
{
m_sInPortFormat.eColorFormat = portFmt->eColorFormat;
+ m_input_msg_id = OMX_COMPONENT_GENERATE_ETB;
+ mUseProxyColorFormat = false;
}
m_sInPortFormat.xFramerate = portFmt->xFramerate;
}
@@ -677,8 +699,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorUnsupportedSetting;
}
memcpy(&m_sParamMPEG4,pParam, sizeof(struct OMX_VIDEO_PARAM_MPEG4TYPE));
- m_sIntraperiod.nPFrames = m_sParamMPEG4.nPFrames;
- m_sIntraperiod.nBFrames = m_sParamMPEG4.nBFrames;
break;
}
case OMX_IndexParamVideoH263:
@@ -690,8 +710,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorUnsupportedSetting;
}
memcpy(&m_sParamH263,pParam, sizeof(struct OMX_VIDEO_PARAM_H263TYPE));
- m_sIntraperiod.nPFrames = m_sParamH263.nPFrames;
- m_sIntraperiod.nBFrames = m_sParamH263.nBFrames;
break;
}
case OMX_IndexParamVideoAvc:
@@ -712,7 +730,7 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
if(pParam->nRefFrames != 2)
{
- DEBUG_PRINT_ERROR("Warning: 2 RefFrames are needed, changing RefFrames from %lu to 2", pParam->nRefFrames);
+ DEBUG_PRINT_ERROR("Warning: 2 RefFrames are needed, changing RefFrames from %d to 2", pParam->nRefFrames);
avc_param.nRefFrames = 2;
}
#else
@@ -723,7 +741,7 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
if(pParam->nRefFrames != 1)
{
- DEBUG_PRINT_ERROR("Warning: Only 1 RefFrame is supported, changing RefFrame from %lu to 1)", pParam->nRefFrames);
+ DEBUG_PRINT_ERROR("Warning: Only 1 RefFrame is supported, changing RefFrame from %d to 1)", pParam->nRefFrames);
avc_param.nRefFrames = 1;
}
#endif
@@ -732,7 +750,7 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
if(pParam->nRefFrames != 1)
{
- DEBUG_PRINT_ERROR("Warning: Only 1 RefFrame is supported, changing RefFrame from %lu to 1)", pParam->nRefFrames);
+ DEBUG_PRINT_ERROR("Warning: Only 1 RefFrame is supported, changing RefFrame from %d to 1)", pParam->nRefFrames);
avc_param.nRefFrames = 1;
}
if(pParam->nBFrames)
@@ -745,9 +763,8 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
return OMX_ErrorUnsupportedSetting;
}
+
memcpy(&m_sParamAVC,pParam, sizeof(struct OMX_VIDEO_PARAM_AVCTYPE));
- m_sIntraperiod.nPFrames = m_sParamAVC.nPFrames;
- m_sIntraperiod.nBFrames = m_sParamAVC.nBFrames;
break;
}
case OMX_IndexParamVideoProfileLevelCurrent:
@@ -756,8 +773,8 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
DEBUG_PRINT_LOW("set_parameter: OMX_IndexParamVideoProfileLevelCurrent");
if(handle->venc_set_param(pParam,OMX_IndexParamVideoProfileLevelCurrent) != true)
{
- DEBUG_PRINT_ERROR("set_parameter: OMX_IndexParamVideoProfileLevelCurrent failed for Profile: %lu "
- "Level :%lu", pParam->eProfile, pParam->eLevel);
+ DEBUG_PRINT_ERROR("set_parameter: OMX_IndexParamVideoProfileLevelCurrent failed for Profile: %d "
+ "Level :%d", pParam->eProfile, pParam->eLevel);
return OMX_ErrorUnsupportedSetting;
}
m_sParamProfileLevel.eProfile = pParam->eProfile;
@@ -843,20 +860,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
eRet =OMX_ErrorUnsupportedSetting;
}
}
-#ifdef _MSM8974_
- else if(!strncmp((char*)m_nkind, "OMX.qcom.video.encoder.vp8",OMX_MAX_STRINGNAME_SIZE))
- {
- if(!strncmp((const char*)comp_role->cRole,"video_encoder.vp8",OMX_MAX_STRINGNAME_SIZE))
- {
- strlcpy((char*)m_cRole,"video_encoder.vp8",OMX_MAX_STRINGNAME_SIZE);
- }
- else
- {
- DEBUG_PRINT_ERROR("ERROR: Setparameter: unknown Index %s\n", comp_role->cRole);
- eRet =OMX_ErrorUnsupportedSetting;
- }
- }
-#endif
else
{
DEBUG_PRINT_ERROR("ERROR: Setparameter: unknown param %s\n", m_nkind);
@@ -923,28 +926,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
break;
}
- case OMX_QcomIndexParamVideoQPRange:
- {
- DEBUG_PRINT_LOW("set_parameter: OMX_QcomIndexParamVideoQPRange\n");
- OMX_QCOM_VIDEO_PARAM_QPRANGETYPE *qp_range = (OMX_QCOM_VIDEO_PARAM_QPRANGETYPE*) paramData;
- if(qp_range->nPortIndex == PORT_INDEX_OUT)
- {
- if(handle->venc_set_param(paramData,
- (OMX_INDEXTYPE)OMX_QcomIndexParamVideoQPRange) != true)
- {
- return OMX_ErrorUnsupportedSetting;
- }
- m_sSessionQPRange.minQP= qp_range->minQP;
- m_sSessionQPRange.maxQP= qp_range->maxQP;
- }
- else
- {
- DEBUG_PRINT_ERROR("\nERROR: Unsupported port Index for QP range setting\n");
- eRet = OMX_ErrorBadPortIndex;
- }
- break;
- }
-
case OMX_QcomIndexPortDefn:
{
OMX_QCOM_PARAM_PORTDEFINITIONTYPE* pParam =
@@ -1013,8 +994,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
{
StoreMetaDataInBuffersParams *pParam =
(StoreMetaDataInBuffersParams*)paramData;
- DEBUG_PRINT_HIGH("set_parameter:OMX_QcomIndexParamVideoEncodeMetaBufferMode: "
- "port_index = %lu, meta_mode = %d", pParam->nPortIndex, pParam->bStoreMetaData);
if(pParam->nPortIndex == PORT_INDEX_IN)
{
if(pParam->bStoreMetaData != meta_mode_enable)
@@ -1042,19 +1021,13 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
}
}
- else
- {
- DEBUG_PRINT_ERROR("set_parameter: metamode is "
- "valid for input port only");
- eRet = OMX_ErrorUnsupportedIndex;
- }
+ break;
}
- break;
#endif
#ifndef MAX_RES_720P
case OMX_QcomIndexParamIndexExtraDataType:
{
- DEBUG_PRINT_HIGH("set_parameter: OMX_QcomIndexParamIndexExtraDataType");
+ DEBUG_PRINT_LOW("set_parameter: OMX_QcomIndexParamIndexExtraDataType");
QOMX_INDEXEXTRADATATYPE *pParam = (QOMX_INDEXEXTRADATATYPE *)paramData;
if (pParam->nIndex == (OMX_INDEXTYPE)OMX_ExtraDataVideoEncoderSliceInfo)
{
@@ -1064,13 +1037,12 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
m_sExtraData |= VEN_EXTRADATA_SLICEINFO;
else
m_sExtraData &= ~VEN_EXTRADATA_SLICEINFO;
- DEBUG_PRINT_HIGH("SliceInfo extradata %s",
- ((pParam->bEnabled == OMX_TRUE) ? "enabled" : "disabled"));
+ DEBUG_PRINT_HIGH("set_param: m_sExtraData=%x", m_sExtraData);
if(handle->venc_set_param(&m_sExtraData,
(OMX_INDEXTYPE)OMX_ExtraDataVideoEncoderSliceInfo) != true)
{
DEBUG_PRINT_ERROR("ERROR: Setting "
- "OMX_ExtraDataVideoEncoderSliceInfo failed");
+ "OMX_QcomIndexParamIndexExtraDataType failed");
return OMX_ErrorUnsupportedSetting;
}
else
@@ -1080,39 +1052,6 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
&m_sOutPortDef.nBufferCountActual,
&m_sOutPortDef.nBufferSize,
m_sOutPortDef.nPortIndex);
- DEBUG_PRINT_HIGH("updated out_buf_req: buffer cnt=%lu, "
- "count min=%lu, buffer size=%lu",
- m_sOutPortDef.nBufferCountActual,
- m_sOutPortDef.nBufferCountMin,
- m_sOutPortDef.nBufferSize);
- }
- }
- }
-#ifndef _MSM8974_
- else if (pParam->nIndex == (OMX_INDEXTYPE)OMX_ExtraDataVideoLTRInfo)
- {
- if (pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if (pParam->bEnabled == OMX_TRUE)
- m_sExtraData |= VEN_EXTRADATA_LTRINFO;
- else
- m_sExtraData &= ~VEN_EXTRADATA_LTRINFO;
- DEBUG_PRINT_HIGH("LTRInfo extradata %s",
- ((pParam->bEnabled == OMX_TRUE) ? "enabled" : "disabled"));
- if(handle->venc_set_param(&m_sExtraData,
- (OMX_INDEXTYPE)OMX_ExtraDataVideoLTRInfo) != true)
- {
- DEBUG_PRINT_ERROR("ERROR: Setting "
- "OMX_ExtraDataVideoLTRInfo failed");
- return OMX_ErrorUnsupportedSetting;
- }
- else
- {
- m_sOutPortDef.nPortIndex = PORT_INDEX_OUT;
- dev_get_buf_req(&m_sOutPortDef.nBufferCountMin,
- &m_sOutPortDef.nBufferCountActual,
- &m_sOutPortDef.nBufferSize,
- m_sOutPortDef.nPortIndex);
DEBUG_PRINT_HIGH("updated out_buf_req: buffer cnt=%d, "
"count min=%d, buffer size=%d",
m_sOutPortDef.nBufferCountActual,
@@ -1122,44 +1061,19 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_ERROR("set_parameter: LTR information is "
+ DEBUG_PRINT_ERROR("set_parameter: slice information is "
"valid for output port only");
eRet = OMX_ErrorUnsupportedIndex;
}
}
-#endif
else
{
- DEBUG_PRINT_ERROR("set_parameter: unsupported extrdata index (%x)",
- pParam->nIndex);
+ DEBUG_PRINT_ERROR("set_parameter: unsupported index (%x), "
+ "only slice information extradata is supported", pParam->nIndex);
eRet = OMX_ErrorUnsupportedIndex;
}
break;
}
- case QOMX_IndexParamVideoLTRMode:
- {
- QOMX_VIDEO_PARAM_LTRMODE_TYPE* pParam =
- (QOMX_VIDEO_PARAM_LTRMODE_TYPE*)paramData;
- if(!handle->venc_set_param(paramData, (OMX_INDEXTYPE)QOMX_IndexParamVideoLTRMode))
- {
- DEBUG_PRINT_ERROR("\nERROR: Setting LTR mode failed");
- return OMX_ErrorUnsupportedSetting;
- }
- memcpy(&m_sParamLTRMode, pParam, sizeof(m_sParamLTRMode));
- break;
- }
- case QOMX_IndexParamVideoLTRCount:
- {
- QOMX_VIDEO_PARAM_LTRCOUNT_TYPE* pParam =
- (QOMX_VIDEO_PARAM_LTRCOUNT_TYPE*)paramData;
- if(!handle->venc_set_param(paramData, (OMX_INDEXTYPE)QOMX_IndexParamVideoLTRCount))
- {
- DEBUG_PRINT_ERROR("\nERROR: Setting LTR count failed");
- return OMX_ErrorUnsupportedSetting;
- }
- memcpy(&m_sParamLTRCount, pParam, sizeof(m_sParamLTRCount));
- break;
- }
#endif
case OMX_QcomIndexParamVideoMaxAllowedBitrateCheck:
{
@@ -1175,7 +1089,7 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
else
{
DEBUG_PRINT_ERROR("ERROR: OMX_QcomIndexParamVideoMaxAllowedBitrateCheck "
- " called on wrong port(%lu)", pParam->nPortIndex);
+ " called on wrong port(%d)", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
break;
@@ -1197,31 +1111,30 @@ OMX_ERRORTYPE omx_venc::set_parameter(OMX_IN OMX_HANDLETYPE hComp,
else
{
DEBUG_PRINT_ERROR("ERROR: OMX_QcomIndexEnableSliceDeliveryMode "
- "called on wrong port(%lu)", pParam->nPortIndex);
+ "called on wrong port(%d)", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
break;
}
#endif
- case OMX_QcomIndexEnableH263PlusPType:
+ case OMX_QcomIndexParamSequenceHeaderWithIDR:
{
- QOMX_EXTNINDEX_PARAMTYPE* pParam =
- (QOMX_EXTNINDEX_PARAMTYPE*)paramData;
- DEBUG_PRINT_LOW("OMX_QcomIndexEnableH263PlusPType");
- if(pParam->nPortIndex == PORT_INDEX_OUT)
+ if(!handle->venc_set_param(paramData,
+ (OMX_INDEXTYPE)OMX_QcomIndexParamSequenceHeaderWithIDR))
{
- if(!handle->venc_set_param(paramData,
- (OMX_INDEXTYPE)OMX_QcomIndexEnableH263PlusPType))
- {
- DEBUG_PRINT_ERROR("ERROR: Request for setting PlusPType failed");
- return OMX_ErrorUnsupportedSetting;
- }
+ DEBUG_PRINT_ERROR("ERROR: Request for setting inband sps/pps failed");
+ return OMX_ErrorUnsupportedSetting;
}
- else
+ break;
+ }
+ case OMX_QcomIndexParamEnableVUIStreamRestrictFlag:
+ {
+ if(!handle->venc_set_param(paramData,
+ (OMX_INDEXTYPE)OMX_QcomIndexParamEnableVUIStreamRestrictFlag))
{
- DEBUG_PRINT_ERROR("ERROR: OMX_QcomIndexEnableH263PlusPType "
- "called on wrong port(%lu)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
+ DEBUG_PRINT_ERROR("ERROR: Request for enabling bitstream_restrict "
+ "flag in VUI failed");
+ return OMX_ErrorUnsupportedSetting;
}
break;
}
@@ -1311,7 +1224,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_VIDEO_CONFIG_BITRATETYPE* pParam =
reinterpret_cast<OMX_VIDEO_CONFIG_BITRATETYPE*>(configData);
- DEBUG_PRINT_HIGH("set_config(): OMX_IndexConfigVideoBitrate (%lu)", pParam->nEncodeBitrate);
+ DEBUG_PRINT_LOW("\n omx_venc:: set_config(): OMX_IndexConfigVideoBitrate");
if(pParam->nPortIndex == PORT_INDEX_OUT)
{
@@ -1327,7 +1240,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %lu", pParam->nPortIndex);
+ DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %u", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
break;
@@ -1336,7 +1249,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
{
OMX_CONFIG_FRAMERATETYPE* pParam =
reinterpret_cast<OMX_CONFIG_FRAMERATETYPE*>(configData);
- DEBUG_PRINT_HIGH("set_config(): OMX_IndexConfigVideoFramerate (0x%lx)", pParam->xEncodeFramerate);
+ DEBUG_PRINT_LOW("\n omx_venc:: set_config(): OMX_IndexConfigVideoFramerate");
if(pParam->nPortIndex == PORT_INDEX_OUT)
{
@@ -1352,7 +1265,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %lu", pParam->nPortIndex);
+ DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %u", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
@@ -1363,7 +1276,6 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
QOMX_VIDEO_INTRAPERIODTYPE* pParam =
reinterpret_cast<QOMX_VIDEO_INTRAPERIODTYPE*>(configData);
- DEBUG_PRINT_HIGH("set_config(): QOMX_IndexConfigVideoIntraperiod");
if(pParam->nPortIndex == PORT_INDEX_OUT)
{
#ifdef MAX_RES_720P
@@ -1373,14 +1285,6 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
return OMX_ErrorUnsupportedSetting;
}
#endif
- DEBUG_PRINT_HIGH("Old: P/B frames = %lu/%lu, New: P/B frames = %lu/%lu",
- m_sIntraperiod.nPFrames, m_sIntraperiod.nBFrames,
- pParam->nPFrames, pParam->nBFrames);
- if (m_sIntraperiod.nBFrames != pParam->nBFrames)
- {
- DEBUG_PRINT_HIGH("Dynamically changing B-frames not supported");
- return OMX_ErrorUnsupportedSetting;
- }
if(handle->venc_set_config(configData, (OMX_INDEXTYPE) QOMX_IndexConfigVideoIntraperiod) != true)
{
DEBUG_PRINT_ERROR("ERROR: Setting QOMX_IndexConfigVideoIntraperiod failed");
@@ -1413,7 +1317,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_ERROR("ERROR: (QOMX_IndexConfigVideoIntraperiod) Unsupported port index: %lu", pParam->nPortIndex);
+ DEBUG_PRINT_ERROR("ERROR: (QOMX_IndexConfigVideoIntraperiod) Unsupported port index: %u", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
@@ -1425,7 +1329,6 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
OMX_CONFIG_INTRAREFRESHVOPTYPE* pParam =
reinterpret_cast<OMX_CONFIG_INTRAREFRESHVOPTYPE*>(configData);
- DEBUG_PRINT_HIGH("set_config(): OMX_IndexConfigVideoIntraVOPRefresh");
if(pParam->nPortIndex == PORT_INDEX_OUT)
{
if(handle->venc_set_config(configData,
@@ -1439,7 +1342,7 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
else
{
- DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %lu", pParam->nPortIndex);
+ DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %u", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
@@ -1452,16 +1355,16 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
OMX_S32 nRotation;
if(pParam->nPortIndex != PORT_INDEX_IN){
- DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %lu", pParam->nPortIndex);
+ DEBUG_PRINT_ERROR("ERROR: Unsupported port index: %u", pParam->nPortIndex);
return OMX_ErrorBadPortIndex;
}
if( pParam->nRotation == 0 ||
pParam->nRotation == 90 ||
pParam->nRotation == 180 ||
pParam->nRotation == 270 ) {
- DEBUG_PRINT_HIGH("\nset_config: Rotation Angle %lu", pParam->nRotation);
+ DEBUG_PRINT_HIGH("\nset_config: Rotation Angle %u", pParam->nRotation);
} else {
- DEBUG_PRINT_ERROR("ERROR: un supported Rotation %lu", pParam->nRotation);
+ DEBUG_PRINT_ERROR("ERROR: un supported Rotation %u", pParam->nRotation);
return OMX_ErrorUnsupportedSetting;
}
nRotation = pParam->nRotation - m_sConfigFrameRotation.nRotation;
@@ -1496,7 +1399,6 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
case OMX_QcomIndexConfigVideoFramePackingArrangement:
{
- DEBUG_PRINT_HIGH("set_config(): OMX_QcomIndexConfigVideoFramePackingArrangement");
if(m_sOutPortFormat.eCompressionFormat == OMX_VIDEO_CodingAVC)
{
OMX_QCOM_FRAME_PACK_ARRANGEMENT *configFmt =
@@ -1509,35 +1411,6 @@ OMX_ERRORTYPE omx_venc::set_config(OMX_IN OMX_HANDLETYPE hComp,
}
break;
}
- case QOMX_IndexConfigVideoLTRPeriod:
- {
- QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE* pParam = (QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE*)configData;
- if(!handle->venc_set_config(configData, (OMX_INDEXTYPE)QOMX_IndexConfigVideoLTRPeriod))
- {
- DEBUG_PRINT_ERROR("\nERROR: Setting LTR period failed");
- return OMX_ErrorUnsupportedSetting;
- }
- memcpy(&m_sConfigLTRPeriod, pParam, sizeof(m_sConfigLTRPeriod));
- break;
- }
- case QOMX_IndexConfigVideoLTRUse:
- {
- QOMX_VIDEO_CONFIG_LTRUSE_TYPE* pParam = (QOMX_VIDEO_CONFIG_LTRUSE_TYPE*)configData;
- if(!handle->venc_set_config(configData, (OMX_INDEXTYPE)QOMX_IndexConfigVideoLTRUse))
- {
- DEBUG_PRINT_ERROR("\nERROR: Setting LTR use failed");
- return OMX_ErrorUnsupportedSetting;
- }
- memcpy(&m_sConfigLTRUse, pParam, sizeof(m_sConfigLTRUse));
- break;
- }
- case QOMX_IndexConfigVideoLTRMark:
- {
- QOMX_VIDEO_CONFIG_LTRMARK_TYPE* pParam = (QOMX_VIDEO_CONFIG_LTRMARK_TYPE*)configData;
- DEBUG_PRINT_ERROR("Setting ltr mark is not supported");
- return OMX_ErrorUnsupportedSetting;
- break;
- }
default:
DEBUG_PRINT_ERROR("ERROR: unsupported index %d", (int) configIndex);
break;
@@ -1650,9 +1523,9 @@ OMX_U32 omx_venc::dev_start_done(void)
return handle->venc_start_done();
}
-OMX_U32 omx_venc::dev_set_message_thread_id(pthread_t tid)
+OMX_U32 omx_venc::dev_stop_done(void)
{
- return handle->venc_set_message_thread_id(tid);
+ return handle->venc_stop_done();
}
bool omx_venc::dev_use_buf(void *buf_addr,unsigned port,unsigned index)
@@ -1680,16 +1553,6 @@ bool omx_venc::dev_get_seq_hdr(void *buffer, unsigned size, unsigned *hdrlen)
return handle->venc_get_seq_hdr(buffer, size, hdrlen);
}
-bool omx_venc::dev_get_capability_ltrcount(OMX_U32 *min, OMX_U32 *max, OMX_U32 *step_size)
-{
-#ifdef _MSM8974_
- DEBUG_PRINT_ERROR("Get Capability LTR Count is not supported");
- return false;
-#else
- return handle->venc_get_capability_ltrcount(min, max, step_size);
-#endif
-}
-
bool omx_venc::dev_loaded_start()
{
return handle->venc_loaded_start();
@@ -1734,13 +1597,6 @@ bool omx_venc::dev_set_buf_req(OMX_U32 *min_buff_count,
}
-#ifdef _MSM8974_
-int omx_venc::dev_handle_extradata(void *buffer, int index)
-{
- return handle->handle_extradata(buffer, index);
-}
-#endif
-
int omx_venc::async_message_process (void *context, void* message)
{
omx_video* omx = NULL;
@@ -1759,7 +1615,7 @@ int omx_venc::async_message_process (void *context, void* message)
if(m_sVenc_msg->statuscode != VEN_S_SUCCESS)
{
- DEBUG_PRINT_ERROR("\nERROR: async_msg_process() - Error statuscode = %lu\n",
+ DEBUG_PRINT_ERROR("\nERROR: async_msg_process() - Error statuscode = %d\n",
m_sVenc_msg->statuscode);
omx->omx_report_error();
}
@@ -1768,22 +1624,28 @@ int omx_venc::async_message_process (void *context, void* message)
m_sVenc_msg->msgcode);
switch(m_sVenc_msg->msgcode)
{
+
case VEN_MSG_START:
omx->post_event (NULL,m_sVenc_msg->statuscode,\
OMX_COMPONENT_GENERATE_START_DONE);
break;
+
case VEN_MSG_STOP:
omx->post_event (NULL,m_sVenc_msg->statuscode,\
OMX_COMPONENT_GENERATE_STOP_DONE);
break;
+
case VEN_MSG_RESUME:
omx->post_event (NULL,m_sVenc_msg->statuscode,\
OMX_COMPONENT_GENERATE_RESUME_DONE);
break;
+
case VEN_MSG_PAUSE:
omx->post_event (NULL,m_sVenc_msg->statuscode,\
OMX_COMPONENT_GENERATE_PAUSE_DONE);
+
break;
+
case VEN_MSG_FLUSH_INPUT_DONE:
omx->post_event (NULL,m_sVenc_msg->statuscode,\
@@ -1798,18 +1660,21 @@ int omx_venc::async_message_process (void *context, void* message)
m_sVenc_msg->buf.clientdata;
if(omxhdr == NULL ||
- ((OMX_U32)(omxhdr - omx->m_inp_mem_ptr) > omx->m_sInPortDef.nBufferCountActual) )
+ (((OMX_U32)(omxhdr - omx->m_inp_mem_ptr) > omx->m_sInPortDef.nBufferCountActual) &&
+ ((OMX_U32)(omxhdr - omx->meta_buffer_hdr) > omx->m_sInPortDef.nBufferCountActual)))
{
omxhdr = NULL;
m_sVenc_msg->statuscode = VEN_S_EFAIL;
}
+
#ifdef _ANDROID_ICS_
- omx->omx_release_meta_buffer(omxhdr);
+ omx->omx_release_meta_buffer(omxhdr);
#endif
omx->post_event ((unsigned int)omxhdr,m_sVenc_msg->statuscode,
OMX_COMPONENT_GENERATE_EBD);
break;
case VEN_MSG_OUTPUT_BUFFER_DONE:
+
omxhdr = (OMX_BUFFERHEADERTYPE*)m_sVenc_msg->buf.clientdata;
if( (omxhdr != NULL) &&
@@ -1843,21 +1708,19 @@ int omx_venc::async_message_process (void *context, void* message)
omxhdr = NULL;
m_sVenc_msg->statuscode = VEN_S_EFAIL;
}
+
omx->post_event ((unsigned int)omxhdr,m_sVenc_msg->statuscode,
OMX_COMPONENT_GENERATE_FBD);
break;
case VEN_MSG_NEED_OUTPUT_BUFFER:
//TBD what action needs to be done here??
break;
-#ifndef _MSM8974_
- case VEN_MSG_LTRUSE_FAILED:
- DEBUG_PRINT_ERROR("LTRUSE Failed!");
- omx->post_event (NULL,m_sVenc_msg->statuscode,
- OMX_COMPONENT_GENERATE_LTRUSE_FAILED);
- break;
-#endif
default:
break;
}
return 0;
}
+bool omx_venc::is_secure_session()
+{
+ return secure_session;
+}
diff --git a/mm-video/vidc/venc/src/video_encoder_device.cpp b/mm-video/vidc/venc/src/video_encoder_device.cpp
index 906d0f3..9d8bf74 100644
--- a/mm-video/vidc/venc/src/video_encoder_device.cpp
+++ b/mm-video/vidc/venc/src/video_encoder_device.cpp
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -32,6 +32,7 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <fcntl.h>
#include "video_encoder_device.h"
#include "omx_video_encoder.h"
+#include <media/hardware/HardwareAPI.h>
#ifdef USE_ION
#include <linux/msm_ion.h>
#else
@@ -150,6 +151,7 @@ venc_dev::venc_dev(class omx_venc *venc_class)
m_eProfile = 0;
pthread_mutex_init(&loaded_start_stop_mlock, NULL);
pthread_cond_init (&loaded_start_stop_cond, NULL);
+ venc_encoder = reinterpret_cast<omx_venc*>(venc_class);
DEBUG_PRINT_LOW("venc_dev constructor");
}
@@ -183,7 +185,7 @@ void* async_venc_message_thread (void *input)
}
else if (error_code <0)
{
- DEBUG_PRINT_LOW("\nioctl VEN_IOCTL_CMD_READ_NEXT_MSG failed");
+ DEBUG_PRINT_ERROR("\nioctl VEN_IOCTL_CMD_READ_NEXT_MSG failed");
break;
}
else if(omx->async_message_process(input,&venc_msg) < 0)
@@ -201,12 +203,16 @@ bool venc_dev::venc_open(OMX_U32 codec)
struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
int r;
unsigned int alignment = 0,buffer_size = 0, temp =0;
-
- m_nDriver_fd = open ("/dev/msm_vidc_enc",O_RDWR|O_NONBLOCK);
+ OMX_STRING device_name = "/dev/msm_vidc_enc";
+ DEBUG_PRINT_ERROR("\n Is component secure %d",
+ venc_encoder->is_secure_session());
+ if(venc_encoder->is_secure_session())
+ device_name = "/dev/msm_vidc_enc_sec";
+ m_nDriver_fd = open (device_name,O_RDWR|O_NONBLOCK);
if(m_nDriver_fd == 0)
{
DEBUG_PRINT_ERROR("ERROR: Got fd as 0 for msm_vidc_enc, Opening again\n");
- m_nDriver_fd = open ("/dev/msm_vidc_enc",O_RDWR|O_NONBLOCK);
+ m_nDriver_fd = open (device_name,O_RDWR|O_NONBLOCK);
}
if((int)m_nDriver_fd < 0)
@@ -244,13 +250,6 @@ bool venc_dev::venc_open(OMX_U32 codec)
#else
m_sVenc_cfg.inputformat= VEN_INPUTFMT_NV12;
#endif
-// initializing QP range parameters
- qp_range.minqp = 2;
- if(codec == OMX_VIDEO_CodingAVC)
- qp_range.maxqp = 51;
- else
- qp_range.maxqp = 31;
-
if(codec == OMX_VIDEO_CodingMPEG4)
{
m_sVenc_cfg.codectype = VEN_CODEC_MPEG4;
@@ -315,10 +314,6 @@ bool venc_dev::venc_open(OMX_U32 codec)
__func__);
}
recon_buffers_count = MAX_RECON_BUFFERS;
- ltrmode.ltr_mode = 0;
- ltrcount.ltr_count = 0;
- ltrperiod.ltr_period = 0;
-
return true;
}
@@ -508,30 +503,6 @@ bool venc_dev::venc_get_seq_hdr(void *buffer,
return true;
}
-bool venc_dev::venc_get_capability_ltrcount(unsigned long *min,
- unsigned long *max, unsigned long *step_size)
-{
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- venc_range cap_ltr_count;
- ioctl_msg.in = NULL;
- ioctl_msg.out = (void*)&cap_ltr_count;
- if(ioctl (m_nDriver_fd, VEN_IOCTL_GET_CAPABILITY_LTRCOUNT,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT_ERROR("ERROR: Get LTR Capability failed");
- return false;
- }
- else
- {
- *min = cap_ltr_count.min;
- *max = cap_ltr_count.max;
- *step_size = cap_ltr_count.step_size;
- DEBUG_PRINT_HIGH("LTR Capability: min=%x, max=%d, step_size=%d",
- *min, *max, *step_size);
- }
- return true;
-}
-
bool venc_dev::venc_get_buf_req(unsigned long *min_buff_count,
unsigned long *actual_buff_count,
unsigned long *buff_size,
@@ -587,7 +558,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
{
OMX_PARAM_PORTDEFINITIONTYPE *portDefn;
portDefn = (OMX_PARAM_PORTDEFINITIONTYPE *) paramData;
- DEBUG_PRINT_HIGH("venc_set_param: OMX_IndexParamPortDefinition");
+ DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamPortDefinition\n");
if(portDefn->nPortIndex == PORT_INDEX_IN)
{
@@ -601,7 +572,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
return false;
}
- DEBUG_PRINT_LOW("Basic parameter has changed");
+ DEBUG_PRINT_LOW("\n Basic parameter has changed");
m_sVenc_cfg.input_height = portDefn->format.video.nFrameHeight;
m_sVenc_cfg.input_width = portDefn->format.video.nFrameWidth;
@@ -611,19 +582,15 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
DEBUG_PRINT_ERROR("\nERROR: Request for setting base config failed");
return false;
}
- DEBUG_PRINT_HIGH("WxH (%dx%d), codec (%d), fps(nr/dr) (%d/%d), bitrate (%d), "
- "color_format (%d)", m_sVenc_cfg.input_width, m_sVenc_cfg.input_height,
- m_sVenc_cfg.codectype, m_sVenc_cfg.fps_num, m_sVenc_cfg.fps_den,
- m_sVenc_cfg.targetbitrate, m_sVenc_cfg.inputformat);
- DEBUG_PRINT_LOW("Updating the buffer count/size for the new resolution");
+ DEBUG_PRINT_LOW("\n Updating the buffer count/size for the new resolution");
ioctl_msg.in = NULL;
ioctl_msg.out = (void*)&m_sInput_buff_property;
if(ioctl (m_nDriver_fd, VEN_IOCTL_GET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < 0) {
DEBUG_PRINT_ERROR("\nERROR: Request for getting i/p bufreq failed");
return false;
}
- DEBUG_PRINT_HIGH("Got updated m_sInput_buff_property values: "
+ DEBUG_PRINT_LOW("\n Got updated m_sInput_buff_property values: "
"datasize = %u, maxcount = %u, actualcnt = %u, "
"mincount = %u", m_sInput_buff_property.datasize,
m_sInput_buff_property.maxcount, m_sInput_buff_property.actualcount,
@@ -636,7 +603,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
return false;
}
- DEBUG_PRINT_HIGH("Got updated m_sOutput_buff_property values: "
+ DEBUG_PRINT_LOW("\n Got updated m_sOutput_buff_property values: "
"datasize = %u, maxcount = %u, actualcnt = %u, "
"mincount = %u", m_sOutput_buff_property.datasize,
m_sOutput_buff_property.maxcount, m_sOutput_buff_property.actualcount,
@@ -666,7 +633,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
}
m_level_set = false;
if(venc_set_profile_level(0, 0)) {
- DEBUG_PRINT_LOW("%s(): Profile/Level setting success", __func__);
+ DEBUG_PRINT_HIGH("\n %s(): Profile/Level setting success", __func__);
}
}
else if(portDefn->nPortIndex == PORT_INDEX_OUT)
@@ -990,28 +957,6 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
}
break;
}
-
- case OMX_QcomIndexParamVideoQPRange:
- {
- DEBUG_PRINT_LOW("venc_set_param:OMX_QcomIndexParamVideoQPRange\n");
- OMX_QCOM_VIDEO_PARAM_QPRANGETYPE *qp_range =
- (OMX_QCOM_VIDEO_PARAM_QPRANGETYPE *)paramData;
- if(qp_range->nPortIndex == (OMX_U32) PORT_INDEX_OUT)
- {
- if(venc_set_qp_range (qp_range->minQP,
- qp_range->maxQP) == false)
- {
- DEBUG_PRINT_ERROR("\nERROR: Setting QP Range failed");
- return false;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("\nERROR: Invalid Port Index for OMX_QcomIndexParamVideoQPRange");
- }
- break;
- }
-
case OMX_ExtraDataVideoEncoderSliceInfo:
{
DEBUG_PRINT_LOW("venc_set_param: OMX_ExtraDataVideoEncoderSliceInfo");
@@ -1019,19 +964,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
if(venc_set_extradata(extra_data) == false)
{
DEBUG_PRINT_ERROR("ERROR: Setting "
- "OMX_ExtraDataVideoEncoderSliceInfo failed");
- return false;
- }
- break;
- }
- case OMX_ExtraDataVideoLTRInfo:
- {
- DEBUG_PRINT_LOW("venc_set_param: OMX_ExtraDataVideoLTRInfo");
- OMX_U32 extra_data = *(OMX_U32 *)paramData;
- if(venc_set_extradata(extra_data) == false)
- {
- DEBUG_PRINT_ERROR("ERROR: Setting "
- "OMX_ExtraDataVideoLTRInfo failed");
+ "OMX_QcomIndexParamIndexExtraDataType failed");
return false;
}
break;
@@ -1056,71 +989,36 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
}
break;
}
- case OMX_QcomIndexEnableH263PlusPType:
+ case OMX_QcomIndexParamSequenceHeaderWithIDR:
{
- QOMX_EXTNINDEX_PARAMTYPE* pParam =
- (QOMX_EXTNINDEX_PARAMTYPE*)paramData;
- DEBUG_PRINT_LOW("OMX_QcomIndexEnableH263PlusPType");
- if(pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if(venc_set_plusptype(pParam->bEnable) == false)
- {
- DEBUG_PRINT_ERROR("Setting PlusPType failed for H263");
- return OMX_ErrorUnsupportedSetting;
- }
- }
- else
+ PrependSPSPPSToIDRFramesParams * pParam =
+ (PrependSPSPPSToIDRFramesParams *)paramData;
+
+ if(venc_set_inband_video_header(pParam->bEnable) == false)
{
- DEBUG_PRINT_ERROR("OMX_QcomIndexEnableH263PlusPType "
- "called on wrong port(%d)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
+ DEBUG_PRINT_ERROR("Setting inband sps/pps failed");
+ return false;
}
break;
}
- case QOMX_IndexParamVideoLTRMode:
- {
- QOMX_VIDEO_PARAM_LTRMODE_TYPE* pParam =
- (QOMX_VIDEO_PARAM_LTRMODE_TYPE*)paramData;
- if(pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if(!venc_set_ltrmode(pParam->eLTRMode))
- {
- DEBUG_PRINT_ERROR("Setting ltr mode failed");
- return OMX_ErrorUnsupportedSetting;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("QOMX_IndexParamVideoLTRMode "
- "called on wrong port(%d)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
- }
- break;
- }
- case QOMX_IndexParamVideoLTRCount:
+ case OMX_QcomIndexParamEnableVUIStreamRestrictFlag:
{
- QOMX_VIDEO_PARAM_LTRCOUNT_TYPE* pParam =
- (QOMX_VIDEO_PARAM_LTRCOUNT_TYPE*)paramData;
- if(pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if(!venc_set_ltrcount(pParam->nCount))
- {
- DEBUG_PRINT_ERROR("Setting ltr count failed");
- return OMX_ErrorUnsupportedSetting;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("QOMX_IndexParamVideoLTRCount "
- "called on wrong port(%d)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
- }
- break;
+ QOMX_VUI_BITSTREAM_RESTRICT *pParam =
+ (QOMX_VUI_BITSTREAM_RESTRICT *)paramData;
+
+ if(venc_set_bitstream_restrict_in_vui(pParam->bEnable) == false)
+ {
+ DEBUG_PRINT_ERROR("Setting bitstream_restrict flag in VUI failed");
+ return false;
+ }
+ break;
}
case OMX_IndexParamVideoSliceFMO:
default:
- DEBUG_PRINT_ERROR("venc_set_param: Unsupported index 0x%x", index);
+ DEBUG_PRINT_ERROR("\nERROR: Unsupported parameter in venc_set_param: %u",
+ index);
break;
+ //case
}
return true;
@@ -1230,48 +1128,8 @@ bool venc_dev::venc_set_config(void *configData, OMX_INDEXTYPE index)
}
break;
}
- case QOMX_IndexConfigVideoLTRPeriod:
- {
- QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE* pParam =
- (QOMX_VIDEO_CONFIG_LTRPERIOD_TYPE*)configData;
- if(pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if(!venc_set_ltrperiod(pParam->nFrames))
- {
- DEBUG_PRINT_ERROR("Setting ltr period failed");
- return OMX_ErrorUnsupportedSetting;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("QOMX_IndexConfigVideoLTRPeriod "
- "called on wrong port(%d)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
- }
- break;
- }
- case QOMX_IndexConfigVideoLTRUse:
- {
- QOMX_VIDEO_CONFIG_LTRUSE_TYPE* pParam =
- (QOMX_VIDEO_CONFIG_LTRUSE_TYPE*)configData;
- if(pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if(!venc_set_ltruse(pParam->nID, pParam->nFrames))
- {
- DEBUG_PRINT_ERROR("Setting ltr use failed");
- return OMX_ErrorUnsupportedSetting;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("QOMX_IndexConfigVideoLTRUse "
- "called on wrong port(%d)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
- }
- break;
- }
default:
- DEBUG_PRINT_ERROR("venc_set_config: Unsupported index = 0x%x", index);
+ DEBUG_PRINT_ERROR("\n Unsupported config index = %u", index);
break;
}
@@ -1301,7 +1159,7 @@ unsigned venc_dev::venc_start_done(void)
return 0;
}
-unsigned venc_dev::venc_set_message_thread_id(pthread_t)
+unsigned venc_dev::venc_stop_done(void)
{
return 0;
}
@@ -1338,13 +1196,6 @@ unsigned venc_dev::venc_start(void)
else
recon_buffers_count = MAX_RECON_BUFFERS;
- if (ltrmode.ltr_mode == (unsigned long)QOMX_VIDEO_LTRMode_Auto)
- {
- recon_buffers_count = MAX_RECON_BUFFERS;
- DEBUG_PRINT_HIGH("ltr mode enabled, so set recon buffers "
- "count to %d", recon_buffers_count);
- }
-
if (!venc_allocate_recon_buffers())
return ioctl(m_nDriver_fd, VEN_IOCTL_CMD_START, NULL);
else
@@ -1405,21 +1256,18 @@ OMX_U32 venc_dev::pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count)
int rc = 0;
#ifdef USE_ION
- recon_buff[count].ion_device_fd = open (MEM_DEVICE,O_RDONLY);
+ recon_buff[count].ion_device_fd = open (MEM_DEVICE,O_RDONLY | O_DSYNC);
if(recon_buff[count].ion_device_fd < 0)
{
DEBUG_PRINT_ERROR("\nERROR: ION Device open() Failed");
return -1;
}
+ recon_buff[count].alloc_data.flags = 0;
recon_buff[count].alloc_data.len = size;
-#ifdef MAX_RES_720P
- recon_buff[count].alloc_data.heap_mask = ION_HEAP(MEM_HEAP_ID);
-#else
recon_buff[count].alloc_data.heap_mask = (ION_HEAP(MEM_HEAP_ID) |
- ION_HEAP(ION_IOMMU_HEAP_ID));
-#endif
- recon_buff[count].alloc_data.flags = ION_FLAG_CACHED;
+ (venc_encoder->is_secure_session() ? ION_SECURE
+ : ION_HEAP(ION_IOMMU_HEAP_ID)));
recon_buff[count].alloc_data.align = clip2(alignment);
if (recon_buff[count].alloc_data.align != 8192)
recon_buff[count].alloc_data.align = 8192;
@@ -1463,26 +1311,28 @@ OMX_U32 venc_dev::pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count)
return -1;
}
#endif
- buf_addr = mmap(NULL, size,
- PROT_READ | PROT_WRITE,
- MAP_SHARED, pmem_fd, 0);
-
- if (buf_addr == (void*) MAP_FAILED)
- {
- close(pmem_fd);
- pmem_fd = -1;
- DEBUG_PRINT_ERROR("Error returned in allocating recon buffers buf_addr: %p\n",buf_addr);
-#ifdef USE_ION
- if(ioctl(recon_buff[count].ion_device_fd,ION_IOC_FREE,
- &recon_buff[count].alloc_data.handle)) {
- DEBUG_PRINT_LOW("ion recon buffer free failed");
- }
- recon_buff[count].alloc_data.handle = NULL;
- recon_buff[count].ion_alloc_fd.fd =-1;
- close(recon_buff[count].ion_device_fd);
- recon_buff[count].ion_device_fd =-1;
-#endif
- return -1;
+ if(!venc_encoder->is_secure_session()) {
+ buf_addr = mmap(NULL, size,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, pmem_fd, 0);
+
+ if (buf_addr == (void*) MAP_FAILED)
+ {
+ close(pmem_fd);
+ pmem_fd = -1;
+ DEBUG_PRINT_ERROR("Error returned in allocating recon buffers buf_addr: %p\n",buf_addr);
+ #ifdef USE_ION
+ if(ioctl(recon_buff[count].ion_device_fd,ION_IOC_FREE,
+ &recon_buff[count].alloc_data.handle)) {
+ DEBUG_PRINT_ERROR("ion recon buffer free failed");
+ }
+ recon_buff[count].alloc_data.handle = NULL;
+ recon_buff[count].ion_alloc_fd.fd =-1;
+ close(recon_buff[count].ion_device_fd);
+ recon_buff[count].ion_device_fd =-1;
+ #endif
+ return -1;
+ }
}
DEBUG_PRINT_HIGH("\n Allocated virt:%p, FD: %d of size %d \n", buf_addr, pmem_fd, size);
@@ -1490,7 +1340,10 @@ OMX_U32 venc_dev::pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count)
recon_addr.buffer_size = size;
recon_addr.pmem_fd = pmem_fd;
recon_addr.offset = 0;
- recon_addr.pbuffer = (unsigned char *)buf_addr;
+ if(!venc_encoder->is_secure_session())
+ recon_addr.pbuffer = (unsigned char *)buf_addr;
+ else
+ recon_addr.pbuffer = (unsigned char *)(pmem_fd + 1);
ioctl_msg.in = (void*)&recon_addr;
ioctl_msg.out = NULL;
@@ -1528,12 +1381,13 @@ OMX_U32 venc_dev::pmem_free()
ioctl_msg.out = NULL;
if(ioctl(m_nDriver_fd, VEN_IOCTL_FREE_RECON_BUFFER ,&ioctl_msg) < 0)
DEBUG_PRINT_ERROR("VEN_IOCTL_FREE_RECON_BUFFER failed");
- munmap(recon_buff[cnt].virtual_address, recon_buff[cnt].size);
+ if(!venc_encoder->is_secure_session())
+ munmap(recon_buff[cnt].virtual_address, recon_buff[cnt].size);
close(recon_buff[cnt].pmem_fd);
#ifdef USE_ION
if(ioctl(recon_buff[cnt].ion_device_fd,ION_IOC_FREE,
&recon_buff[cnt].alloc_data.handle)) {
- DEBUG_PRINT_LOW("ion recon buffer free failed");
+ DEBUG_PRINT_ERROR("ion recon buffer free failed");
}
recon_buff[cnt].alloc_data.handle = NULL;
recon_buff[cnt].ion_alloc_fd.fd =-1;
@@ -1568,9 +1422,6 @@ void venc_dev::venc_config_print()
DEBUG_PRINT_HIGH("\nENC_CONFIG: qpI: %d, qpP: %d, qpb: 0",
session_qp.iframeqp, session_qp.pframqp);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: minQP: %d, maxQP: %d",
- qp_range.minqp, qp_range.maxqp);
-
DEBUG_PRINT_HIGH("\nENC_CONFIG: VOP_Resolution: %d, Slice-Mode: %d, Slize_Size: %d",
voptimecfg.voptime_resolution, multislice.mslice_mode,
multislice.mslice_size);
@@ -1927,85 +1778,25 @@ bool venc_dev::venc_set_slice_delivery_mode(OMX_BOOL enable)
return true;
}
-bool venc_dev::venc_set_plusptype(OMX_BOOL enable)
-{
- venc_ioctl_msg ioctl_msg = {NULL,NULL};
- struct venc_plusptype plusptype = {0};
- DEBUG_PRINT_LOW("Set plusptype: %d", enable);
- plusptype.plusptype_enable = enable;
- ioctl_msg.in = (void*)&plusptype;
- ioctl_msg.out = NULL;
- if(ioctl(m_nDriver_fd, VEN_IOCTL_SET_H263_PLUSPTYPE,(void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT_ERROR("Request for setting plusptype for h263 failed");
- return false;
- }
- return true;
-}
-
-bool venc_dev::venc_set_ltrmode(QOMX_VIDEO_LTRMODETYPE mode)
-{
- venc_ioctl_msg ioctl_msg = {NULL,NULL};
- venc_ltrmode ltr_mode;
- ltr_mode.ltr_mode = (unsigned long)mode;
- DEBUG_PRINT_HIGH("Set ltr mode: %d", mode);
- ioctl_msg.in = (void*)&ltr_mode;
- ioctl_msg.out = NULL;
- if(ioctl (m_nDriver_fd, VEN_IOCTL_SET_LTRMODE, (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT_ERROR("ERROR: Setting ltrmode failed");
- return false;
- }
- ltrmode.ltr_mode = (unsigned long)mode;
- return true;
-}
-
-bool venc_dev::venc_set_ltrcount(OMX_U32 count)
-{
- venc_ioctl_msg ioctl_msg = {NULL,NULL};
- venc_ltrcount ltr_count;
- ltr_count.ltr_count = (unsigned long)count;
- DEBUG_PRINT_HIGH("Set ltr count: %d", count);
- ioctl_msg.in = (void*)&ltr_count;
- ioctl_msg.out = NULL;
- if(ioctl (m_nDriver_fd, VEN_IOCTL_SET_LTRCOUNT, (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT_ERROR("ERROR: Setting ltrcount failed");
- return false;
- }
- ltrcount.ltr_count = (unsigned long)count;
- return true;
-}
-
-bool venc_dev::venc_set_ltrperiod(OMX_U32 period)
+bool venc_dev::venc_set_inband_video_header(OMX_BOOL enable)
{
- venc_ioctl_msg ioctl_msg = {NULL,NULL};
- venc_ltrperiod ltr_period;
- ltr_period.ltr_period = (unsigned long)period;
- DEBUG_PRINT_HIGH("Set ltr period: %d", period);
- ioctl_msg.in = (void*)&ltr_period;
- ioctl_msg.out = NULL;
- if(ioctl (m_nDriver_fd, VEN_IOCTL_SET_LTRPERIOD, (void*)&ioctl_msg) < 0)
+ venc_ioctl_msg ioctl_msg = {(void *)&enable, NULL};
+ DEBUG_PRINT_HIGH("Set inband sps/pps: %d", enable);
+ if(ioctl(m_nDriver_fd, VEN_IOCTL_SET_SPS_PPS_FOR_IDR, (void *)&ioctl_msg) < 0)
{
- DEBUG_PRINT_ERROR("ERROR: Setting ltrperiod failed");
+ DEBUG_PRINT_ERROR("Request for inband sps/pps failed");
return false;
}
- ltrperiod.ltr_period = (unsigned long)period;
return true;
}
-bool venc_dev::venc_set_ltruse(OMX_U32 id, OMX_U32 frames)
+bool venc_dev::venc_set_bitstream_restrict_in_vui(OMX_BOOL enable)
{
- venc_ioctl_msg ioctl_msg = {NULL,NULL};
- venc_ltruse ltr_use;
- ltr_use.ltr_id = (unsigned long)id;
- ltr_use.ltr_frames = (unsigned long)frames;
- DEBUG_PRINT_HIGH("Set ltr use: id = %d, ltr_frames = %d", id, frames);
- ioctl_msg.in = (void*)&ltr_use;
- ioctl_msg.out = NULL;
- if(ioctl (m_nDriver_fd, VEN_IOCTL_SET_LTRUSE, (void*)&ioctl_msg) < 0)
+ venc_ioctl_msg ioctl_msg = {NULL, NULL};
+ DEBUG_PRINT_HIGH("Set bistream_restrict in vui: %d", enable);
+ if(ioctl(m_nDriver_fd, VEN_IOCTL_SET_VUI_BITSTREAM_RESTRICT_FLAG, (void *)&ioctl_msg) < 0)
{
- DEBUG_PRINT_ERROR("ERROR: Setting ltruse failed");
+ DEBUG_PRINT_ERROR("Request for setting bitstream_restrict flag in VUI failed");
return false;
}
return true;
@@ -2030,7 +1821,7 @@ bool venc_dev::venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp)
{
venc_ioctl_msg ioctl_msg = {NULL,NULL};
struct venc_sessionqp qp = {0, 0};
- DEBUG_PRINT_HIGH("venc_set_session_qp:: i_frame_qp = %d, p_frame_qp = %d", i_frame_qp,
+ DEBUG_PRINT_LOW("venc_set_session_qp:: i_frame_qp = %d, p_frame_qp = %d", i_frame_qp,
p_frame_qp);
qp.iframeqp = i_frame_qp;
@@ -2050,30 +1841,6 @@ bool venc_dev::venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp)
return true;
}
-bool venc_dev::venc_set_qp_range(OMX_U32 min_qp, OMX_U32 max_qp)
-{
- venc_ioctl_msg ioctl_msg = {NULL,NULL};
- struct venc_qprange qp = {0, 0};
- DEBUG_PRINT_LOW("venc_set_qp_range:: min_qp = %d, max_qp = %d", min_qp,
- max_qp);
-
- qp.minqp = min_qp;
- qp.maxqp = max_qp;
-
- ioctl_msg.in = (void*)&qp;
- ioctl_msg.out = NULL;
- if(ioctl (m_nDriver_fd,VEN_IOCTL_SET_QP_RANGE,(void*)&ioctl_msg)< 0)
- {
- DEBUG_PRINT_ERROR("\nERROR: Request for setting qp range failed");
- return false;
- }
-
- qp_range.minqp= min_qp;
- qp_range.maxqp= max_qp;
-
- return true;
-}
-
bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
{
venc_ioctl_msg ioctl_msg = {NULL,NULL};
@@ -2081,13 +1848,13 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
struct ven_profilelevel requested_level;
unsigned const int *profile_tbl = NULL;
unsigned long mb_per_frame = 0, mb_per_sec = 0;
- DEBUG_PRINT_HIGH("venc_set_profile_level:: eProfile = %d, Level = %d",
+ DEBUG_PRINT_LOW("venc_set_profile_level:: eProfile = %d, Level = %d",
eProfile, eLevel);
mb_per_frame = ((m_sVenc_cfg.input_height + 15) >> 4)*
((m_sVenc_cfg.input_width + 15) >> 4);
if((eProfile == 0) && (eLevel == 0) && m_profile_set && m_level_set)
{
- DEBUG_PRINT_HIGH("Set profile/level was done already");
+ DEBUG_PRINT_LOW("\n Profile/Level setting complete before venc_start");
return true;
}
@@ -2096,11 +1863,10 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
/* non-zero values will be set by user, saving the same*/
m_eProfile = eProfile;
m_eLevel = eLevel;
- DEBUG_PRINT_HIGH("Save profile/level (%d/%d) for max allowed bitrate check",
- m_eProfile, m_eLevel);
+ DEBUG_PRINT_HIGH("Profile/Level set equal to %d/%d",m_eProfile, m_eLevel);
}
- DEBUG_PRINT_LOW("Validating Profile/Level from table");
+ DEBUG_PRINT_LOW("\n Validating Profile/Level from table");
if(!venc_validate_profile_level(&eProfile, &eLevel))
{
DEBUG_PRINT_LOW("\nERROR: Profile/Level validation failed");
@@ -2306,7 +2072,6 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
}
codec_profile.profile = requested_profile.profile;
m_profile_set = true;
- DEBUG_PRINT_HIGH("Set codec profile = 0x%x", codec_profile.profile);
}
if(!m_level_set)
@@ -2320,7 +2085,6 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
}
profile_level.level = requested_level.level;
m_level_set = true;
- DEBUG_PRINT_HIGH("Set codec level = 0x%x", profile_level.level);
}
return true;
@@ -2331,7 +2095,7 @@ bool venc_dev::venc_set_voptiming_cfg( OMX_U32 TimeIncRes)
venc_ioctl_msg ioctl_msg = {NULL,NULL};
struct venc_voptimingcfg vop_timing_cfg;
- DEBUG_PRINT_HIGH("venc_set_voptiming_cfg: TimeRes = %u",
+ DEBUG_PRINT_LOW("\n venc_set_voptiming_cfg: TimeRes = %u",
TimeIncRes);
vop_timing_cfg.voptime_resolution = TimeIncRes;
@@ -2353,7 +2117,7 @@ bool venc_dev::venc_set_intra_period(OMX_U32 nPFrames, OMX_U32 nBFrames)
venc_ioctl_msg ioctl_msg = {NULL,NULL};
struct venc_intraperiod intraperiod_cfg;
- DEBUG_PRINT_LOW("venc_set_intra_period: nPFrames = %u",
+ DEBUG_PRINT_LOW("\n venc_set_intra_period: nPFrames = %u",
nPFrames);
intraperiod_cfg.num_pframes = nPFrames;
if((codec_profile.profile == VEN_PROFILE_MPEG4_ASP) ||
@@ -2384,7 +2148,7 @@ bool venc_dev::venc_set_intra_period(OMX_U32 nPFrames, OMX_U32 nBFrames)
else
intraperiod_cfg.num_bframes = 0;
- DEBUG_PRINT_HIGH("venc_set_intra_period: nPFrames = %u nBFrames = %u",
+ DEBUG_PRINT_ERROR("\n venc_set_intra_period: nPFrames = %u nBFrames = %u",
intraperiod_cfg.num_pframes, intraperiod_cfg.num_bframes);
ioctl_msg.in = (void*)&intraperiod_cfg;
ioctl_msg.out = NULL;
@@ -2623,7 +2387,7 @@ bool venc_dev::venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config)
venc_ioctl_msg ioctl_msg = {NULL, NULL};
struct venc_targetbitrate bitrate_cfg;
- DEBUG_PRINT_HIGH("venc_set_target_bitrate: bitrate = %u",
+ DEBUG_PRINT_LOW("\n venc_set_target_bitrate: bitrate = %u",
nTargetBitrate);
bitrate_cfg.target_bitrate = nTargetBitrate ;
ioctl_msg.in = (void*)&bitrate_cfg;
@@ -2653,7 +2417,7 @@ bool venc_dev::venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 confi
Q16ToFraction(encode_framerate,frame_rate_cfg.fps_numerator,frame_rate_cfg.fps_denominator);
- DEBUG_PRINT_HIGH("venc_set_encode_framerate: framerate(Q16) = %u, NR: %d, DR: %d",
+ DEBUG_PRINT_LOW("\n venc_set_encode_framerate: framerate(Q16) = %u,NR: %d, DR: %d",
encode_framerate,frame_rate_cfg.fps_numerator,frame_rate_cfg.fps_denominator);
ioctl_msg.in = (void*)&frame_rate_cfg;
@@ -2672,7 +2436,7 @@ bool venc_dev::venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 confi
m_level_set = false;
if(venc_set_profile_level(0, 0))
{
- DEBUG_PRINT_LOW("Calling set level (Framerate) with %d",profile_level.level);
+ DEBUG_PRINT_LOW("Calling set level (Framerate) with %d\n",profile_level.level);
}
}
return true;
@@ -2681,6 +2445,8 @@ bool venc_dev::venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 confi
bool venc_dev::venc_set_color_format(OMX_COLOR_FORMATTYPE color_format)
{
venc_ioctl_msg ioctl_msg = {NULL, NULL};
+ DEBUG_PRINT_LOW("\n venc_set_color_format: color_format = %u ", color_format);
+
if(color_format == OMX_COLOR_FormatYUV420SemiPlanar)
{
#ifdef MAX_RES_1080P
diff --git a/mm-video/vidc/venc/src/video_encoder_device_v4l2.cpp b/mm-video/vidc/venc/src/video_encoder_device_copper.cpp
index f86a925..fa71cb8 100644
--- a/mm-video/vidc/venc/src/video_encoder_device_v4l2.cpp
+++ b/mm-video/vidc/venc/src/video_encoder_device_copper.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2012, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -25,22 +25,18 @@ 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<string.h>
#include <sys/ioctl.h>
#include <sys/prctl.h>
-#include <unistd.h>
+#include<unistd.h>
#include <fcntl.h>
-#include "video_encoder_device_v4l2.h"
+#include "video_encoder_device_copper.h"
#include "omx_video_encoder.h"
#ifdef USE_ION
#include <linux/msm_ion.h>
#else
#include <linux/android_pmem.h>
#endif
-#include <media/msm_media_info.h>
-
-#define EXTRADATA_IDX(__num_planes) (__num_planes - 1)
#define MPEG4_SP_START 0
#define MPEG4_ASP_START (MPEG4_SP_START + 8)
@@ -49,7 +45,6 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#define H264_BP_START 0
#define H264_HP_START (H264_BP_START + 13)
#define H264_MP_START (H264_BP_START + 26)
-#define POLL_TIMEOUT 0x7fffffff
/* MPEG4 profile and level table*/
static const unsigned int mpeg4_profile_level_table[][5]=
@@ -62,8 +57,6 @@ static const unsigned int mpeg4_profile_level_table[][5]=
{1200,36000,4000000,OMX_VIDEO_MPEG4Level4a,OMX_VIDEO_MPEG4ProfileSimple},
{1620,40500,8000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
{3600,108000,12000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
- {32400,972000,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
- {34560,1036800,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
{0,0,0,0,0},
{99,1485,128000,OMX_VIDEO_MPEG4Level0,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
@@ -72,8 +65,6 @@ static const unsigned int mpeg4_profile_level_table[][5]=
{396,11880,768000,OMX_VIDEO_MPEG4Level3,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
{792,23760,3000000,OMX_VIDEO_MPEG4Level4,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
{1620,48600,8000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
- {32400,972000,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
- {34560,1036800,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
{0,0,0,0,0},
};
@@ -93,10 +84,6 @@ static const unsigned int h264_profile_level_table[][5]=
{3600,108000,14000000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileBaseline},
{5120,216000,20000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileBaseline},
{8192,245760,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileBaseline},
- {8192,245760,50000000,OMX_VIDEO_AVCLevel41,OMX_VIDEO_AVCProfileBaseline},
- {8704,522240,50000000,OMX_VIDEO_AVCLevel42,OMX_VIDEO_AVCProfileBaseline},
- {22080,589824,135000000,OMX_VIDEO_AVCLevel5,OMX_VIDEO_AVCProfileBaseline},
- {36864,983040,240000000,OMX_VIDEO_AVCLevel51,OMX_VIDEO_AVCProfileBaseline},
{0,0,0,0,0},
{99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileHigh},
@@ -111,10 +98,6 @@ static const unsigned int h264_profile_level_table[][5]=
{3600,108000,17500000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileHigh},
{5120,216000,25000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileHigh},
{8192,245760,25000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileHigh},
- {8192,245760,50000000,OMX_VIDEO_AVCLevel41,OMX_VIDEO_AVCProfileHigh},
- {8704,522240,50000000,OMX_VIDEO_AVCLevel42,OMX_VIDEO_AVCProfileHigh},
- {22080,589824,135000000,OMX_VIDEO_AVCLevel5,OMX_VIDEO_AVCProfileHigh},
- {36864,983040,240000000,OMX_VIDEO_AVCLevel51,OMX_VIDEO_AVCProfileHigh},
{0,0,0,0,0},
{99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileMain},
@@ -129,10 +112,6 @@ static const unsigned int h264_profile_level_table[][5]=
{3600,108000,14000000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileMain},
{5120,216000,20000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileMain},
{8192,245760,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileMain},
- {8192,245760,50000000,OMX_VIDEO_AVCLevel41,OMX_VIDEO_AVCProfileMain},
- {8704,522240,50000000,OMX_VIDEO_AVCLevel42,OMX_VIDEO_AVCProfileMain},
- {22080,589824,135000000,OMX_VIDEO_AVCLevel5,OMX_VIDEO_AVCProfileMain},
- {36864,983040,240000000,OMX_VIDEO_AVCLevel51,OMX_VIDEO_AVCProfileMain},
{0,0,0,0,0}
};
@@ -149,8 +128,6 @@ static const unsigned int h263_profile_level_table[][5]=
{396,19800,4096000,OMX_VIDEO_H263Level50,OMX_VIDEO_H263ProfileBaseline},
{810,40500,8192000,OMX_VIDEO_H263Level60,OMX_VIDEO_H263ProfileBaseline},
{1620,81000,16384000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
- {32400,972000,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
- {34560,1036800,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
{0,0,0,0,0}
};
@@ -165,16 +142,12 @@ char inputfilename [] = "/data/input.yuv";
FILE *outputBufferFile1;
char outputfilename [] = "/data/output-bitstream.\0\0\0\0";
#endif
-
//constructor
venc_dev::venc_dev(class omx_venc *venc_class)
{
- //nothing to do
- int i = 0;
- venc_handle = venc_class;
- etb_count=0;
- for (i = 0; i < MAX_PORT; i++)
- streaming[i] = false;
+//nothing to do
+venc_handle = venc_class;
+etb_count=0;
}
venc_dev::~venc_dev()
@@ -186,231 +159,87 @@ void* async_venc_message_thread (void *input)
{
struct venc_timeout timeout;
struct venc_msg venc_msg;
- omx_video* omx_venc_base = NULL;
- omx_venc *omx = reinterpret_cast<omx_venc*>(input);
- omx_venc_base = reinterpret_cast<omx_video*>(input);
- OMX_BUFFERHEADERTYPE* omxhdr = NULL;
+ omx_video* omx_venc_base = NULL;
+ omx_venc *omx = reinterpret_cast<omx_venc*>(input);
+ omx_venc_base = reinterpret_cast<omx_video*>(input);
+ OMX_BUFFERHEADERTYPE* omxhdr = NULL;
+
prctl(PR_SET_NAME, (unsigned long)"VideoEncCallBackThread", 0, 0, 0);
timeout.millisec = VEN_TIMEOUT_INFINITE;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
+ struct v4l2_plane plane;
struct pollfd pfd;
- struct v4l2_buffer v4l2_buf;
+ struct v4l2_buffer v4l2_buf ={0};
struct v4l2_event dqevent;
pfd.events = POLLIN | POLLRDNORM | POLLOUT | POLLWRNORM | POLLRDBAND | POLLPRI;
pfd.fd = omx->handle->m_nDriver_fd;
int error_code = 0,rc=0;
-
- memset(&v4l2_buf, 0, sizeof(v4l2_buf));
while(1)
{
- rc = poll(&pfd, 1, POLL_TIMEOUT);
+ rc = poll(&pfd, 1, TIMEOUT);
if (!rc) {
- DEBUG_PRINT_ERROR("Poll timedout\n");
+ printf("Poll timedout\n");
break;
} else if (rc < 0) {
- DEBUG_PRINT_ERROR("Error while polling: %d\n", rc);
+ printf("Error while polling: %d\n", rc);
break;
}
-
if ((pfd.revents & POLLIN) || (pfd.revents & POLLRDNORM)) {
v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
v4l2_buf.memory = V4L2_MEMORY_USERPTR;
- v4l2_buf.length = omx->handle->num_planes;
- v4l2_buf.m.planes = plane;
- while(!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) {
- venc_msg.msgcode=VEN_MSG_OUTPUT_BUFFER_DONE;
- venc_msg.statuscode=VEN_S_SUCCESS;
- omxhdr=omx_venc_base->m_out_mem_ptr+v4l2_buf.index;
- venc_msg.buf.len= v4l2_buf.m.planes->bytesused;
- venc_msg.buf.offset = 0;
- venc_msg.buf.flags = 0;
- venc_msg.buf.ptrbuffer = (OMX_U8 *)omx_venc_base->m_pOutput_pmem[v4l2_buf.index].buffer;
- venc_msg.buf.clientdata=(void*)omxhdr;
- venc_msg.buf.timestamp = v4l2_buf.timestamp.tv_sec * 1000000 + v4l2_buf.timestamp.tv_usec;
-
- /* TODO: ideally report other types of frames as well
- * for now it doesn't look like IL client cares about
- * other types
- */
- if (v4l2_buf.flags & V4L2_BUF_FLAG_KEYFRAME)
- venc_msg.buf.flags |= OMX_BUFFERFLAG_SYNCFRAME;
- if(v4l2_buf.flags & V4L2_QCOM_BUF_FLAG_CODECCONFIG)
- venc_msg.buf.flags |= OMX_BUFFERFLAG_CODECCONFIG;
- if(v4l2_buf.flags & V4L2_BUF_FLAG_EOS)
- venc_msg.buf.flags |= OMX_BUFFERFLAG_EOS;
- if(omx->handle->num_planes > 1 && v4l2_buf.m.planes->bytesused)
- venc_msg.buf.flags |= OMX_BUFFERFLAG_EXTRADATA;
- if(omx->async_message_process(input,&venc_msg) < 0)
- {
- DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message");
- break;
- }
+ v4l2_buf.length = 1;
+ v4l2_buf.m.planes = &plane;
+ rc = ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf);
+ if (rc) {
+ printf("Failed to dequeue buf: %d from capture capability\n", rc);
+ break;
}
- }
- if((pfd.revents & POLLOUT) || (pfd.revents & POLLWRNORM)) {
+ venc_msg.msgcode=VEN_MSG_OUTPUT_BUFFER_DONE;
+ venc_msg.statuscode=VEN_S_SUCCESS;
+ omxhdr=omx_venc_base->m_out_mem_ptr+v4l2_buf.index;
+ venc_msg.buf.len= v4l2_buf.m.planes->bytesused;
+ venc_msg.buf.offset = v4l2_buf.m.planes->reserved[1];
+ venc_msg.buf.ptrbuffer = (OMX_U8 *)omx_venc_base->m_pOutput_pmem[v4l2_buf.index].buffer;
+
+ venc_msg.buf.clientdata=(void*)omxhdr;
+ } else if((pfd.revents & POLLOUT) || (pfd.revents & POLLWRNORM)) {
v4l2_buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
v4l2_buf.memory = V4L2_MEMORY_USERPTR;
- v4l2_buf.m.planes = plane;
- v4l2_buf.length = 1;
- while(!ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf)) {
- venc_msg.msgcode=VEN_MSG_INPUT_BUFFER_DONE;
- venc_msg.statuscode=VEN_S_SUCCESS;
- omxhdr=omx_venc_base->m_inp_mem_ptr+v4l2_buf.index;
- venc_msg.buf.clientdata=(void*)omxhdr;
- if(omx->async_message_process(input,&venc_msg) < 0)
- {
- DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message");
- break;
- }
+ v4l2_buf.m.planes = &plane;
+ rc = ioctl(pfd.fd, VIDIOC_DQBUF, &v4l2_buf);
+ if (rc) {
+ printf("Failed to dequeue buf: %d from output capability\n", rc);
+ break;
}
- }
- if (pfd.revents & POLLPRI) {
+ venc_msg.msgcode=VEN_MSG_INPUT_BUFFER_DONE;
+ venc_msg.statuscode=VEN_S_SUCCESS;
+ omxhdr=omx_venc_base->m_inp_mem_ptr+v4l2_buf.index;
+ venc_msg.buf.clientdata=(void*)omxhdr;
+ } else if (pfd.revents & POLLPRI){
rc = ioctl(pfd.fd, VIDIOC_DQEVENT, &dqevent);
- if(dqevent.type == V4L2_EVENT_MSM_VIDC_CLOSE_DONE) {
- DEBUG_PRINT_HIGH("CLOSE DONE\n");
+ printf("\n Data Recieved = %d \n",dqevent.u.data[0]);
+ if(dqevent.u.data[0] == MSM_VIDC_CLOSE_DONE){
break;
- } else if (dqevent.type == V4L2_EVENT_MSM_VIDC_FLUSH_DONE) {
- venc_msg.msgcode = VEN_MSG_FLUSH_INPUT_DONE;
- venc_msg.statuscode = VEN_S_SUCCESS;
- if (omx->async_message_process(input,&venc_msg) < 0) {
- DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message");
- break;
- }
- venc_msg.msgcode = VEN_MSG_FLUSH_OUPUT_DONE;
- venc_msg.statuscode = VEN_S_SUCCESS;
- if (omx->async_message_process(input,&venc_msg) < 0) {
- DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message");
- break;
- }
- } else if (dqevent.type == V4L2_EVENT_MSM_VIDC_SYS_ERROR){
- DEBUG_PRINT_ERROR("\n HW Error recieved \n");
- venc_msg.statuscode=VEN_S_EFAIL;
- if (omx->async_message_process(input,&venc_msg) < 0) {
- DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message");
- break;
- }
- }
+ }
+ } else {
+ /*TODO: How to handle this case */
+ continue;
}
- }
- DEBUG_PRINT_HIGH("omx_venc: Async Thread exit\n");
- return NULL;
-}
-static const int event_type[] = {
- V4L2_EVENT_MSM_VIDC_FLUSH_DONE,
- V4L2_EVENT_MSM_VIDC_CLOSE_DONE,
- V4L2_EVENT_MSM_VIDC_SYS_ERROR
-};
-
-static OMX_ERRORTYPE subscribe_to_events(int fd)
-{
- OMX_ERRORTYPE eRet = OMX_ErrorNone;
- struct v4l2_event_subscription sub;
- int array_sz = sizeof(event_type)/sizeof(int);
- int i,rc;
- memset(&sub, 0, sizeof(sub));
- if (fd < 0) {
- printf("Invalid input: %d\n", fd);
- return OMX_ErrorBadParameter;
- }
-
- for (i = 0; i < array_sz; ++i) {
- memset(&sub, 0, sizeof(sub));
- sub.type = event_type[i];
- rc = ioctl(fd, VIDIOC_SUBSCRIBE_EVENT, &sub);
- if (rc) {
- printf("Failed to subscribe event: 0x%x\n", sub.type);
+ if(omx->async_message_process(input,&venc_msg) < 0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Wrong ioctl message");
break;
}
- }
- if (i < array_sz) {
- for (--i; i >=0 ; i--) {
- memset(&sub, 0, sizeof(sub));
- sub.type = event_type[i];
- rc = ioctl(fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub);
- if (rc)
- printf("Failed to unsubscribe event: 0x%x\n", sub.type);
- }
- eRet = OMX_ErrorNotImplemented;
- }
- return eRet;
-}
-
-bool venc_dev::handle_extradata(void *buffer, int index)
-{
- OMX_BUFFERHEADERTYPE *p_bufhdr = (OMX_BUFFERHEADERTYPE *) buffer;
- OMX_OTHER_EXTRADATATYPE *p_extra = NULL;
- if (!extradata_info.uaddr) {
- DEBUG_PRINT_ERROR("Extradata buffers not allocated\n");
- return false;
- }
- p_extra = (OMX_OTHER_EXTRADATATYPE *) ((unsigned)(p_bufhdr->pBuffer + p_bufhdr->nOffset + p_bufhdr->nFilledLen + 3)&(~3));
- char *p_extradata = extradata_info.uaddr + index * extradata_info.buffer_size;
- if ((OMX_U8*)p_extra > (p_bufhdr->pBuffer + p_bufhdr->nAllocLen)){
- DEBUG_PRINT_ERROR("Insufficient buffer size\n");
- p_extra = NULL;
- return false;
- }
- memcpy(p_extra, p_extradata, extradata_info.buffer_size);
- return true;
-}
-
-OMX_ERRORTYPE venc_dev::allocate_extradata()
-{
- if (extradata_info.allocated) {
- DEBUG_PRINT_ERROR("2nd allocation return");
- return OMX_ErrorNone;
- }
-#ifdef USE_ION
- if (extradata_info.buffer_size) {
- if (extradata_info.ion.ion_alloc_data.handle) {
- munmap((void *)extradata_info.uaddr, extradata_info.size);
- close(extradata_info.ion.fd_ion_data.fd);
- free_ion_memory(&extradata_info.ion);
- }
- extradata_info.size = (extradata_info.size + 4095) & (~4095);
-
- extradata_info.ion.ion_device_fd = alloc_map_ion_memory(
- extradata_info.size,
- &extradata_info.ion.ion_alloc_data,
- &extradata_info.ion.fd_ion_data, 0);
- if (extradata_info.ion.ion_device_fd < 0) {
- DEBUG_PRINT_ERROR("Failed to alloc extradata memory\n");
- return OMX_ErrorInsufficientResources;
- }
- extradata_info.uaddr = (char *)mmap(NULL,
- extradata_info.size,
- PROT_READ|PROT_WRITE, MAP_SHARED,
- extradata_info.ion.fd_ion_data.fd , 0);
- if (extradata_info.uaddr == MAP_FAILED) {
- DEBUG_PRINT_ERROR("Failed to map extradata memory\n");
- close(extradata_info.ion.fd_ion_data.fd);
- free_ion_memory(&extradata_info.ion);
- return OMX_ErrorInsufficientResources;
- }
- }
-#endif
- extradata_info.allocated = 1;
- return OMX_ErrorNone;
-}
-
-void venc_dev::free_extradata() {
-#ifdef USE_ION
- if (extradata_info.uaddr) {
- munmap((void *)extradata_info.uaddr, extradata_info.size);
- close(extradata_info.ion.fd_ion_data.fd);
- free_ion_memory(&extradata_info.ion);
}
- memset(&extradata_info, 0, sizeof(extradata_info));
-#endif
+ DEBUG_PRINT_HIGH("omx_venc: Async Thread exit\n");
+ return NULL;
}
bool venc_dev::venc_open(OMX_U32 codec)
{
int r;
- unsigned int alignment = 0,buffer_size = 0, temp =0;
- struct v4l2_control control;
+ unsigned int alignment = 0,buffer_size = 0, temp =0;
m_nDriver_fd = open ("/dev/video33",O_RDWR);
if(m_nDriver_fd == 0)
@@ -426,6 +255,19 @@ bool venc_dev::venc_open(OMX_U32 codec)
}
DEBUG_PRINT_LOW("\nm_nDriver_fd = %d\n", m_nDriver_fd);
+#ifdef SINGLE_ENCODER_INSTANCE
+ OMX_U32 num_instances = 0;
+ if(/*ioctl (m_nDriver_fd, VEN_IOCTL_GET_NUMBER_INSTANCES, (void*)&ioctl_msg) < */0 )
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request number of encoder instances failed");
+ }
+ else if (num_instances > 1)
+ {
+ DEBUG_PRINT_ERROR("\nSecond encoder instance rejected!");
+ venc_close();
+ return false;
+ }
+#endif
// set the basic configuration of the video encoder driver
m_sVenc_cfg.input_width = OMX_CORE_QCIF_WIDTH;
m_sVenc_cfg.input_height= OMX_CORE_QCIF_HEIGHT;
@@ -462,27 +304,23 @@ bool venc_dev::venc_open(OMX_U32 codec)
strcat(outputfilename, "264");
#endif
}
-if (codec == OMX_VIDEO_CodingVPX)
- {
- m_sVenc_cfg.codectype = V4L2_PIX_FMT_VP8;
- codec_profile.profile = V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE;
- profile_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_1_0;
-#ifdef OUTPUT_BUFFER_LOG
- strcat(outputfilename, "ivf");
-#endif
- }
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_BASE_CFG,(void*)&ioctl_msg) < */0 )
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting base configuration failed");
+ return false;
+ }
#ifdef INPUT_BUFFER_LOG
inputBufferFile1 = fopen (inputfilename, "ab");
- if (!inputBufferFile1)
- DEBUG_PRINT_ERROR("Input File open failed");
#endif
#ifdef OUTPUT_BUFFER_LOG
outputBufferFile1 = fopen (outputfilename, "ab");
#endif
int ret;
- ret = subscribe_to_events(m_nDriver_fd);
+ struct v4l2_event_subscription sub;
+ sub.type=V4L2_EVENT_ALL;
+ ret = ioctl(m_nDriver_fd, VIDIOC_SUBSCRIBE_EVENT, &sub);
if (ret) {
- DEBUG_PRINT_ERROR("\n Subscribe Event Failed \n");
+ printf("\n Subscribe Event Failed \n");
return false;
}
struct v4l2_capability cap;
@@ -492,38 +330,33 @@ if (codec == OMX_VIDEO_CodingVPX)
ret = ioctl(m_nDriver_fd, VIDIOC_QUERYCAP, &cap);
if (ret) {
- DEBUG_PRINT_ERROR("Failed to query capabilities\n");
+ printf("Failed to query capabilities\n");
} else {
- DEBUG_PRINT_LOW("Capabilities: driver_name = %s, card = %s, bus_info = %s,"
+ printf("Capabilities: driver_name = %s, card = %s, bus_info = %s,"
" version = %d, capabilities = %x\n", cap.driver, cap.card,
cap.bus_info, cap.version, cap.capabilities);
}
+ //printf(" \n VIDIOC_QUERYCAP Successful \n ");
ret=0;
fdesc.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
fdesc.index=0;
while (ioctl(m_nDriver_fd, VIDIOC_ENUM_FMT, &fdesc) == 0) {
- DEBUG_PRINT_LOW("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
+ printf("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
fdesc.pixelformat, fdesc.flags);
fdesc.index++;
}
+ //printf("\n VIDIOC_ENUM_FMT CAPTURE Successful \n ");
fdesc.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
fdesc.index=0;
while (ioctl(m_nDriver_fd, VIDIOC_ENUM_FMT, &fdesc) == 0) {
- DEBUG_PRINT_LOW("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
+
+ printf("fmt: description: %s, fmt: %x, flags = %x\n", fdesc.description,
fdesc.pixelformat, fdesc.flags);
fdesc.index++;
}
+ //printf(" \n VIDIOC_ENUM_FMT OUTPUT Successful \n ");
m_sOutput_buff_property.alignment=m_sInput_buff_property.alignment=4096;
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
- fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
- fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype;
-
- /*TODO: Return values not handled properly in this function anywhere.
- * Need to handle those.*/
- ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt);
- m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
@@ -531,67 +364,91 @@ if (codec == OMX_VIDEO_CodingVPX)
fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12;
ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt);
+ //printf(" \n VIDIOC_S_FMT OUTPUT Successful \n ");
m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
+ //printf("m_sInput_buff_property.datasize = %d\n",m_sInput_buff_property.datasize);
+
+ fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
+ fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
+ fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_H264;
+
+ ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt);
+ //printf(" \n VIDIOC_S_FMT CAPTURE Successful \n ");
+ m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
+ //printf("m_sOutput_buff_property.datasize = %d\n",m_sOutput_buff_property.datasize);
+// struct v4l2_requestbuffers bufreq;
bufreq.memory = V4L2_MEMORY_USERPTR;
bufreq.count = 2;
bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq);
- m_sInput_buff_property.mincount = m_sInput_buff_property.actualcount = bufreq.count;
-
+ m_sInput_buff_property.mincount=m_sInput_buff_property.maxcount=m_sInput_buff_property.actualcount=bufreq.count;
+ //printf(" \n VIDIOC_REQBUFS OUTPUT Successful \n ");
+ //printf("m_sInput_buff_property.datasize = %d\n",m_sInput_buff_property.datasize);
+ //printf("m_sInput_buff_property.mincount = %d\n",m_sInput_buff_property.mincount);
bufreq.type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
bufreq.count = 2;
ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq);
- m_sOutput_buff_property.mincount = m_sOutput_buff_property.actualcount = bufreq.count;
-
-
- stopped = 0;
- metadatamode = 0;
+ m_sOutput_buff_property.mincount=m_sOutput_buff_property.maxcount=m_sOutput_buff_property.actualcount=bufreq.count;
+ //printf(" \n VIDIOC_REQBUFS CAPTURE Successful \n ");
+ //printf("m_sInput_buff_property.mincount = %d\n",m_sOutput_buff_property.mincount);
- control.id = V4L2_CID_MPEG_VIDEO_HEADER_MODE;
- control.value = V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE;
-
- DEBUG_PRINT_LOW("Calling IOCTL to disable seq_hdr in sync_frame id=%d, val=%d\n", control.id, control.value);
- if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control))
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_GET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for getting i/p buffer requirement failed");
+ return false;
+ }
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_GET_OUTPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for getting o/p buffer requirement failed");
+ return false;
+ }
+ ///printf("\n \n Setting Profile and Level \n \n ");
+ //m_profile_set = false;
+ //m_level_set = false;
+ if(/*venc_set_profile_level(0, 0)*/0)
+ {
+ DEBUG_PRINT_HIGH("\n %s(): Init Profile/Level setting success",
+ __func__);
+ }
+ recon_buffers_count = MAX_RECON_BUFFERS;
return true;
}
-
-static OMX_ERRORTYPE unsubscribe_to_events(int fd)
-{
- OMX_ERRORTYPE eRet = OMX_ErrorNone;
- struct v4l2_event_subscription sub;
- int array_sz = sizeof(event_type)/sizeof(int);
- int i,rc;
- if (fd < 0) {
- printf("Invalid input: %d\n", fd);
- return OMX_ErrorBadParameter;
- }
-
- for (i = 0; i < array_sz; ++i) {
- memset(&sub, 0, sizeof(sub));
- sub.type = event_type[i];
- rc = ioctl(fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub);
- if (rc) {
- printf("Failed to unsubscribe event: 0x%x\n", sub.type);
- break;
- }
- }
- return eRet;
-}
-
void venc_dev::venc_close()
{
- struct v4l2_encoder_cmd enc;
DEBUG_PRINT_LOW("\nvenc_close: fd = %d", m_nDriver_fd);
if((int)m_nDriver_fd >= 0)
{
- enc.cmd = V4L2_ENC_CMD_STOP;
- ioctl(m_nDriver_fd, VIDIOC_ENCODER_CMD, &enc);
- pthread_join(m_tid,NULL);
- unsubscribe_to_events(m_nDriver_fd);
+ DEBUG_PRINT_HIGH("\n venc_close(): Calling VEN_IOCTL_CMD_STOP_READ_MSG");
+ //(void)ioctl(m_nDriver_fd, VEN_IOCTL_CMD_STOP_READ_MSG,
+ // NULL);
+ DEBUG_PRINT_LOW("\nCalling close()\n");
+
+ int rc=0;
+ enum v4l2_buf_type btype;
+ btype = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &btype);
+ if (rc) {
+ /* STREAMOFF will never fail */
+ printf("\n Failed to call streamoff on OUTPUT Port \n");
+ }
+ btype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+
+ rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &btype);
+ if (rc) {
+ /* STREAMOFF will never fail */
+ printf("\n Failed to call streamoff on CAPTURE Port \n");
+ }
+ struct v4l2_event_subscription sub;
+ sub.type=V4L2_EVENT_ALL;
+ rc = ioctl(m_nDriver_fd, VIDIOC_UNSUBSCRIBE_EVENT, &sub);
+ if (rc) {
+ printf("Failed to get control\n");
+ return ;
+ }
close(m_nDriver_fd);
m_nDriver_fd = -1;
}
@@ -617,6 +474,12 @@ bool venc_dev::venc_set_buf_req(unsigned long *min_buff_count,
{
temp_count = m_sInput_buff_property.actualcount;
m_sInput_buff_property.actualcount = *actual_buff_count;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting i/p buffer requirement failed");
+ m_sInput_buff_property.actualcount = temp_count;
+ return false;
+ }
DEBUG_PRINT_LOW("\n I/P Count set to %lu\n", *actual_buff_count);
}
}
@@ -626,6 +489,12 @@ bool venc_dev::venc_set_buf_req(unsigned long *min_buff_count,
{
temp_count = m_sOutput_buff_property.actualcount;
m_sOutput_buff_property.actualcount = *actual_buff_count;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_OUTPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting o/p buffer requirement failed");
+ m_sOutput_buff_property.actualcount = temp_count;
+ return false;
+ }
DEBUG_PRINT_LOW("\n O/P Count set to %lu\n", *actual_buff_count);
}
}
@@ -667,80 +536,80 @@ bool venc_dev::venc_get_buf_req(unsigned long *min_buff_count,
{
struct v4l2_format fmt;
struct v4l2_requestbuffers bufreq;
- unsigned int buf_size = 0, extra_data_size = 0, client_extra_data_size = 0;
int ret;
if(port == 0)
{
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_GET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for getting i/p buffer requirement failed");
+ return false;
+ }
+
fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12;
- ret = ioctl(m_nDriver_fd, VIDIOC_G_FMT, &fmt);
- m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
- bufreq.memory = V4L2_MEMORY_USERPTR;
- if (*actual_buff_count)
- bufreq.count = *actual_buff_count;
- else
+ ret = ioctl(m_nDriver_fd, VIDIOC_G_FMT, &fmt);
+ //printf(" \n VIDIOC_S_FMT OUTPUT Successful \n ");
+ m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
+
+bufreq.memory = V4L2_MEMORY_USERPTR;
bufreq.count = 2;
- bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq);
- if (ret) {
- DEBUG_PRINT_ERROR("\n VIDIOC_REQBUFS OUTPUT_MPLANE Failed \n ");
- return false;
- }
- m_sInput_buff_property.mincount = m_sInput_buff_property.actualcount = bufreq.count;
+
+ bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ ret = ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq);
+ m_sInput_buff_property.mincount=m_sInput_buff_property.maxcount=m_sInput_buff_property.actualcount=bufreq.count;
+
+
*min_buff_count = m_sInput_buff_property.mincount;
*actual_buff_count = m_sInput_buff_property.actualcount;
#ifdef USE_ION
-// For ION memory allocations of the allocated buffer size
-// must be 4k aligned, hence aligning the input buffer
-// size to 4k.
- m_sInput_buff_property.datasize = (m_sInput_buff_property.datasize + 4095) & (~4095);
+ // For ION memory allocations of the allocated buffer size
+ // must be 4k aligned, hence aligning the input buffer
+ // size to 4k.
+ m_sInput_buff_property.datasize = (m_sInput_buff_property.datasize + 4095)
+ & (~4095);
#endif
- *buff_size = m_sInput_buff_property.datasize;
- }
- else
- {
- int extra_idx = 0;
+ *buff_size = m_sInput_buff_property.datasize;
+ }
+ else
+ {
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_GET_OUTPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for getting o/p buffer requirement failed");
+ return false;
+ }
+
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
- fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype;
+ fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_H264;
ret = ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt);
+ //printf(" \n VIDIOC_S_FMT CAPTURE Successful \n ");
m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
- fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype;
-
+ fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_H264;
+
ret = ioctl(m_nDriver_fd, VIDIOC_G_FMT, &fmt);
+ //printf(" \n VIDIOC_S_FMT CAPTURE Successful \n ");
m_sOutput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
- *min_buff_count = m_sOutput_buff_property.mincount;
- *actual_buff_count = m_sOutput_buff_property.actualcount;
- *buff_size = m_sOutput_buff_property.datasize;
-
- num_planes = fmt.fmt.pix_mp.num_planes;
- extra_idx = EXTRADATA_IDX(num_planes);
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- extra_data_size = fmt.fmt.pix_mp.plane_fmt[extra_idx].sizeimage;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index is more than allowed: %d\n", extra_idx);
- return OMX_ErrorBadParameter;
- }
- extradata_info.buffer_size = extra_data_size;
- extradata_info.count = m_sOutput_buff_property.actualcount;
- extradata_info.size = extradata_info.buffer_size * extradata_info.count;
- }
- return true;
+
+
+ *min_buff_count = m_sOutput_buff_property.mincount;
+ *actual_buff_count = m_sOutput_buff_property.actualcount;
+ *buff_size = m_sOutput_buff_property.datasize;
+ }
+
+ return true;
+
}
bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
{
DEBUG_PRINT_LOW("venc_set_param:: venc-720p\n");
- struct v4l2_format fmt;
- struct v4l2_requestbuffers bufreq;
- int ret;
switch(index)
{
case OMX_IndexParamPortDefinition:
@@ -750,10 +619,6 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
DEBUG_PRINT_LOW("venc_set_param: OMX_IndexParamPortDefinition\n");
if(portDefn->nPortIndex == PORT_INDEX_IN)
{
- if(!venc_set_encode_framerate(portDefn->format.video.xFramerate, 0))
- {
- return false;
- }
if(!venc_set_color_format(portDefn->format.video.eColorFormat))
{
return false;
@@ -764,74 +629,115 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
DEBUG_PRINT_LOW("\n Basic parameter has changed");
m_sVenc_cfg.input_height = portDefn->format.video.nFrameHeight;
m_sVenc_cfg.input_width = portDefn->format.video.nFrameWidth;
- fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
- fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
- fmt.fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12;
- if(ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt)) {
- DEBUG_PRINT_ERROR("\n VIDIOC_S_FMT OUTPUT_MPLANE Failed \n ");
- return false;
- }
- m_sInput_buff_property.datasize=fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
- bufreq.memory = V4L2_MEMORY_USERPTR;
- bufreq.count = portDefn->nBufferCountActual;
- bufreq.type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- if(ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq)) {
- DEBUG_PRINT_ERROR("\n VIDIOC_REQBUFS OUTPUT_MPLANE Failed \n ");
- return false;
- }
- if(bufreq.count == portDefn->nBufferCountActual)
- m_sInput_buff_property.mincount = m_sInput_buff_property.actualcount = bufreq.count;
- if(portDefn->nBufferCountActual >= m_sInput_buff_property.mincount)
- m_sInput_buff_property.actualcount = portDefn->nBufferCountActual;
+
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_BASE_CFG,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting base config failed");
+ return false;
+ }
+
+ DEBUG_PRINT_LOW("\n Updating the buffer count/size for the new resolution");
+ if(/*ioctl (m_nDriver_fd, VEN_IOCTL_GET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for getting i/p bufreq failed");
+ return false;
+ }
+ DEBUG_PRINT_LOW("\n Got updated m_sInput_buff_property values: "
+ "datasize = %u, maxcount = %u, actualcnt = %u, "
+ "mincount = %u", m_sInput_buff_property.datasize,
+ m_sInput_buff_property.maxcount, m_sInput_buff_property.actualcount,
+ m_sInput_buff_property.mincount);
+
+ if(/*ioctl (m_nDriver_fd, VEN_IOCTL_GET_OUTPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for getting o/p bufreq failed");
+ return false;
+ }
+
+ DEBUG_PRINT_LOW("\n Got updated m_sOutput_buff_property values: "
+ "datasize = %u, maxcount = %u, actualcnt = %u, "
+ "mincount = %u", m_sOutput_buff_property.datasize,
+ m_sOutput_buff_property.maxcount, m_sOutput_buff_property.actualcount,
+ m_sOutput_buff_property.mincount);
+ if(/*ioctl (m_nDriver_fd, VEN_IOCTL_SET_OUTPUT_BUFFER_REQ,(void*)&ioctl_msg) <*/ 0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting o/p bufreq failed");
+ return false;
+ }
+
+ if((portDefn->nBufferCountActual >= m_sInput_buff_property.mincount) &&
+ (portDefn->nBufferCountActual <= m_sInput_buff_property.maxcount))
+ {
+ m_sInput_buff_property.actualcount = portDefn->nBufferCountActual;
+ if(/*ioctl(m_nDriver_fd,VEN_IOCTL_SET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting i/p buffer requirements failed");
+ return false;
+ }
+ }
+ if(m_sInput_buff_property.datasize != portDefn->nBufferSize)
+ {
+ DEBUG_PRINT_ERROR("\nWARNING: Requested i/p bufsize[%u],"
+ "Driver's updated i/p bufsize = %u", portDefn->nBufferSize,
+ m_sInput_buff_property.datasize);
+ }
+ m_level_set = false;
+ if(venc_set_profile_level(0, 0))
+ {
+ DEBUG_PRINT_HIGH("\n %s(): Profile/Level setting success", __func__);
+ }
+ }
+ else
+ {
+ if((portDefn->nBufferCountActual >= m_sInput_buff_property.mincount) &&
+ (m_sInput_buff_property.maxcount >= portDefn->nBufferCountActual) &&
+ (m_sInput_buff_property.datasize == portDefn->nBufferSize))
+ {
+ m_sInput_buff_property.actualcount = portDefn->nBufferCountActual;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_INPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: ioctl VEN_IOCTL_SET_INPUT_BUFFER_REQ failed");
+ return false;
+ }
+ }
+ else
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Setting Input buffer requirements failed");
+ return false;
+ }
}
- DEBUG_PRINT_LOW("input: actual: %d, min: %d, count_req: %d\n",
- portDefn->nBufferCountActual, m_sInput_buff_property.mincount, bufreq.count);
}
else if(portDefn->nPortIndex == PORT_INDEX_OUT)
{
- fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- fmt.fmt.pix_mp.height = m_sVenc_cfg.input_height;
- fmt.fmt.pix_mp.width = m_sVenc_cfg.input_width;
- fmt.fmt.pix_mp.pixelformat = m_sVenc_cfg.codectype;
- if(ioctl(m_nDriver_fd, VIDIOC_S_FMT, &fmt)) {
- DEBUG_PRINT_ERROR("\n VIDIOC_S_FMT CAPTURE_MPLANE Failed \n ");
- return false;
- }
- m_sOutput_buff_property.datasize = fmt.fmt.pix_mp.plane_fmt[0].sizeimage;
+ if(!venc_set_encode_framerate(portDefn->format.video.xFramerate, 0))
+ {
+ return false;
+ }
if(!venc_set_target_bitrate(portDefn->format.video.nBitrate, 0))
{
return false;
}
- if((portDefn->nBufferCountActual >= m_sOutput_buff_property.mincount)
- && (m_sOutput_buff_property.datasize == portDefn->nBufferSize))
+ if( (portDefn->nBufferCountActual >= m_sOutput_buff_property.mincount)
+ &&
+ (m_sOutput_buff_property.maxcount >= portDefn->nBufferCountActual)
+ &&
+ (m_sOutput_buff_property.datasize == portDefn->nBufferSize)
+ )
{
m_sOutput_buff_property.actualcount = portDefn->nBufferCountActual;
- bufreq.memory = V4L2_MEMORY_USERPTR;
- bufreq.count = portDefn->nBufferCountActual;
- bufreq.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- if(ioctl(m_nDriver_fd,VIDIOC_REQBUFS, &bufreq))
- {
- DEBUG_PRINT_ERROR("\nERROR: Request for setting o/p buffer count failed: requested: %lu, current: %lu",
- portDefn->nBufferCountActual, m_sOutput_buff_property.actualcount);
- return false;
- }
- if(bufreq.count == portDefn->nBufferCountActual)
- m_sOutput_buff_property.mincount = m_sOutput_buff_property.actualcount = bufreq.count;
- if(portDefn->nBufferCountActual >= m_sOutput_buff_property.mincount)
- m_sOutput_buff_property.actualcount = portDefn->nBufferCountActual;
- if (num_planes > 1)
- extradata_info.count = m_sOutput_buff_property.actualcount;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_OUTPUT_BUFFER_REQ,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: ioctl VEN_IOCTL_SET_OUTPUT_BUFFER_REQ failed");
+ return false;
+ }
}
else
{
DEBUG_PRINT_ERROR("\nERROR: Setting Output buffer requirements failed");
return false;
}
- DEBUG_PRINT_LOW("Output: actual: %d, min: %d, count_req: %d\n",
- portDefn->nBufferCountActual, m_sOutput_buff_property.mincount, bufreq.count);
}
else
{
@@ -1026,6 +932,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
if(!venc_set_inloop_filter (pParam->eLoopFilterMode))
{
DEBUG_PRINT_ERROR("\nERROR: Request for setting Inloop filter failed");
+ printf("\n \n Returned here line line 903 \n \n ");
return false;
}
if(!venc_set_multislice_cfg(OMX_IndexParamVideoAvc, pParam->nSliceHeaderSpacing))
@@ -1048,7 +955,7 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
(OMX_VIDEO_PARAM_INTRAREFRESHTYPE *)paramData;
if(intra_refresh->nPortIndex == (OMX_U32) PORT_INDEX_OUT)
{
- if(venc_set_intra_refresh(intra_refresh->eRefreshMode, intra_refresh->nCirMBs) == false)
+ if(/*venc_set_intra_refresh(intra_refresh->eRefreshMode, intra_refresh->nCirMBs) == */false)
{
DEBUG_PRINT_ERROR("\nERROR: Setting Intra refresh failed");
return false;
@@ -1122,39 +1029,6 @@ bool venc_dev::venc_set_param(void *paramData,OMX_INDEXTYPE index )
}
break;
}
- case OMX_QcomIndexEnableSliceDeliveryMode:
- {
- QOMX_EXTNINDEX_PARAMTYPE* pParam =
- (QOMX_EXTNINDEX_PARAMTYPE*)paramData;
- if(pParam->nPortIndex == PORT_INDEX_OUT)
- {
- if(venc_set_slice_delivery_mode(pParam->bEnable) == false)
- {
- DEBUG_PRINT_ERROR("Setting slice delivery mode failed");
- return OMX_ErrorUnsupportedSetting;
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("OMX_QcomIndexEnableSliceDeliveryMode "
- "called on wrong port(%d)", pParam->nPortIndex);
- return OMX_ErrorBadPortIndex;
- }
- break;
- }
- case OMX_ExtraDataVideoEncoderSliceInfo:
- {
- DEBUG_PRINT_LOW("venc_set_param: OMX_ExtraDataVideoEncoderSliceInfo");
- OMX_U32 extra_data = *(OMX_U32 *)paramData;
- if(venc_set_extradata(extra_data) == false)
- {
- DEBUG_PRINT_ERROR("ERROR: Setting "
- "OMX_ExtraDataVideoEncoderSliceInfo failed");
- return false;
- }
- extradata = true;
- break;
- }
case OMX_IndexParamVideoSliceFMO:
default:
DEBUG_PRINT_ERROR("\nERROR: Unsupported parameter in venc_set_param: %u",
@@ -1271,34 +1145,8 @@ bool venc_dev::venc_set_config(void *configData, OMX_INDEXTYPE index)
unsigned venc_dev::venc_stop( void)
{
- struct venc_msg venc_msg;
- int rc = 0;
- if(!stopped) {
- enum v4l2_buf_type cap_type;
- if (streaming[OUTPUT_PORT]) {
- cap_type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &cap_type);
- if (rc) {
- DEBUG_PRINT_ERROR("Failed to call streamoff on driver: capability: %d, %d\n",
- cap_type, rc);
- } else
- streaming[OUTPUT_PORT] = false;
- }
- if (!rc && streaming[CAPTURE_PORT]) {
- cap_type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &cap_type);
- if (rc) {
- DEBUG_PRINT_ERROR("Failed to call streamoff on driver: capability: %d, %d\n",
- cap_type, rc);
- } else
- streaming[CAPTURE_PORT] = false;
- }
- if (!rc) {
- venc_stop_done();
- stopped = 1;
- }
- }
- return rc;
+ pmem_free();
+ return 0;
}
unsigned venc_dev::venc_pause(void)
@@ -1314,8 +1162,8 @@ unsigned venc_dev::venc_resume(void)
unsigned venc_dev::venc_start_done(void)
{
struct venc_msg venc_msg;
- venc_msg.msgcode = VEN_MSG_START;
- venc_msg.statuscode = VEN_S_SUCCESS;
+ venc_msg.msgcode=VEN_MSG_START;
+ venc_msg.statuscode=VEN_S_SUCCESS;
venc_handle->async_message_process(venc_handle,&venc_msg);
return 0;
}
@@ -1323,20 +1171,12 @@ unsigned venc_dev::venc_start_done(void)
unsigned venc_dev::venc_stop_done(void)
{
struct venc_msg venc_msg;
- free_extradata();
venc_msg.msgcode=VEN_MSG_STOP;
venc_msg.statuscode=VEN_S_SUCCESS;
venc_handle->async_message_process(venc_handle,&venc_msg);
return 0;
}
-unsigned venc_dev::venc_set_message_thread_id(pthread_t tid)
-{
- m_tid=tid;
- return 0;
-}
-
-
unsigned venc_dev::venc_start(void)
{
enum v4l2_buf_type buf_type;
@@ -1355,64 +1195,238 @@ unsigned venc_dev::venc_start(void)
}
venc_config_print();
- buf_type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
+
+ if((codec_profile.profile == V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE) ||
+ (codec_profile.profile == V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE) ||
+ (codec_profile.profile == VEN_PROFILE_H263_BASELINE))
+ recon_buffers_count = MAX_RECON_BUFFERS - 2;
+ else
+ recon_buffers_count = MAX_RECON_BUFFERS;
+
+ buf_type=V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ DEBUG_PRINT_LOW("send_command_proxy(): Idle-->Executing\n");
ret=ioctl(m_nDriver_fd, VIDIOC_STREAMON,&buf_type);
- if (ret)
+ if (ret) {
return -1;
+ }
+ else {
+ return 0;
+ }
+}
- streaming[CAPTURE_PORT] = true;
- return 0;
+OMX_U32 venc_dev::pmem_allocate(OMX_U32 size, OMX_U32 alignment, OMX_U32 count)
+{
+ OMX_U32 pmem_fd = -1;
+ OMX_U32 width, height;
+ void *buf_addr = NULL;
+ struct pmem_allocation allocation;
+ struct venc_recon_addr recon_addr;
+ int rc = 0;
+
+#ifdef USE_ION
+ recon_buff[count].ion_device_fd = open (MEM_DEVICE,O_RDONLY|O_DSYNC);
+ if(recon_buff[count].ion_device_fd < 0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: ION Device open() Failed");
+ return -1;
+ }
+
+ recon_buff[count].alloc_data.len = size;
+ recon_buff[count].alloc_data.flags = 0x1 << MEM_HEAP_ID;
+ recon_buff[count].alloc_data.align = clip2(alignment);
+ if (recon_buff[count].alloc_data.align != 8192)
+ recon_buff[count].alloc_data.align = 8192;
+
+ rc = ioctl(recon_buff[count].ion_device_fd,ION_IOC_ALLOC,&recon_buff[count].alloc_data);
+ if(rc || !recon_buff[count].alloc_data.handle) {
+ DEBUG_PRINT_ERROR("\n ION ALLOC memory failed ");
+ recon_buff[count].alloc_data.handle=NULL;
+ return -1;
+ }
+
+ recon_buff[count].ion_alloc_fd.handle = recon_buff[count].alloc_data.handle;
+ rc = ioctl(recon_buff[count].ion_device_fd,ION_IOC_MAP,&recon_buff[count].ion_alloc_fd);
+ if(rc) {
+ DEBUG_PRINT_ERROR("\n ION MAP failed ");
+ recon_buff[count].ion_alloc_fd.fd =-1;
+ recon_buff[count].ion_alloc_fd.fd =-1;
+ return -1;
+ }
+ pmem_fd = recon_buff[count].ion_alloc_fd.fd;
+#else
+ pmem_fd = open(MEM_DEVICE, O_RDWR);
+
+ if ((int)(pmem_fd) < 0)
+ {
+ DEBUG_PRINT_ERROR("\n Failed to get an pmem handle");
+ return -1;
+ }
+
+ allocation.size = size;
+ allocation.align = clip2(alignment);
+
+ if (allocation.align != 8192)
+ allocation.align = 8192;
+
+ if (ioctl(pmem_fd, PMEM_ALLOCATE_ALIGNED, &allocation) < 0)
+ {
+ DEBUG_PRINT_ERROR("\n Aligment(%u) failed with pmem driver Sz(%lu)",
+ allocation.align, allocation.size);
+ return -1;
+ }
+#endif
+ buf_addr = mmap(NULL, size,
+ PROT_READ | PROT_WRITE,
+ MAP_SHARED, pmem_fd, 0);
+
+ if (buf_addr == (void*) MAP_FAILED)
+ {
+ close(pmem_fd);
+ pmem_fd = -1;
+ DEBUG_PRINT_ERROR("Error returned in allocating recon buffers buf_addr: %p\n",buf_addr);
+#ifdef USE_ION
+ if(ioctl(recon_buff[count].ion_device_fd,ION_IOC_FREE,
+ &recon_buff[count].alloc_data.handle)) {
+ DEBUG_PRINT_ERROR("ion recon buffer free failed");
+ }
+ recon_buff[count].alloc_data.handle = NULL;
+ recon_buff[count].ion_alloc_fd.fd =-1;
+ close(recon_buff[count].ion_device_fd);
+ recon_buff[count].ion_device_fd =-1;
+#endif
+ return -1;
+ }
+
+ DEBUG_PRINT_HIGH("\n Allocated virt:%p, FD: %d of size %d \n", buf_addr, pmem_fd, size);
+
+ recon_addr.buffer_size = size;
+ recon_addr.pmem_fd = pmem_fd;
+ recon_addr.offset = 0;
+ recon_addr.pbuffer = (unsigned char *)buf_addr;
+
+
+ if (/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_RECON_BUFFER, (void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("Failed to set the Recon_buffers\n");
+ return -1;
+ }
+
+ recon_buff[count].virtual_address = (unsigned char *) buf_addr;
+ recon_buff[count].size = size;
+ recon_buff[count].offset = 0;
+ recon_buff[count].pmem_fd = pmem_fd;
+
+ DEBUG_PRINT_ERROR("\n Allocated virt:%p, FD: %d of size %d at index: %d\n", recon_buff[count].virtual_address,
+ recon_buff[count].pmem_fd, recon_buff[count].size, count);
+ return 0;
}
+OMX_U32 venc_dev::pmem_free()
+{
+ int cnt = 0;
+ struct venc_recon_addr recon_addr;
+ for (cnt = 0; cnt < recon_buffers_count; cnt++)
+ {
+ if(recon_buff[cnt].pmem_fd)
+ {
+ recon_addr.pbuffer = recon_buff[cnt].virtual_address;
+ recon_addr.offset = recon_buff[cnt].offset;
+ recon_addr.pmem_fd = recon_buff[cnt].pmem_fd;
+ recon_addr.buffer_size = recon_buff[cnt].size;
+ if(/*ioctl(m_nDriver_fd, VEN_IOCTL_FREE_RECON_BUFFER ,&ioctl_msg) < */0)
+ DEBUG_PRINT_ERROR("VEN_IOCTL_FREE_RECON_BUFFER failed");
+ munmap(recon_buff[cnt].virtual_address, recon_buff[cnt].size);
+ close(recon_buff[cnt].pmem_fd);
+#ifdef USE_ION
+ if(ioctl(recon_buff[cnt].ion_device_fd,ION_IOC_FREE,
+ &recon_buff[cnt].alloc_data.handle)) {
+ DEBUG_PRINT_ERROR("ion recon buffer free failed");
+ }
+ recon_buff[cnt].alloc_data.handle = NULL;
+ recon_buff[cnt].ion_alloc_fd.fd =-1;
+ close(recon_buff[cnt].ion_device_fd);
+ recon_buff[cnt].ion_device_fd =-1;
+#endif
+ DEBUG_PRINT_LOW("\n cleaning Index %d of size %d \n",cnt,recon_buff[cnt].size);
+ recon_buff[cnt].pmem_fd = -1;
+ recon_buff[cnt].virtual_address = NULL;
+ recon_buff[cnt].offset = 0;
+ recon_buff[cnt].alignment = 0;
+ recon_buff[cnt].size = 0;
+ }
+ }
+ return 0;
+}
void venc_dev::venc_config_print()
{
- DEBUG_PRINT_HIGH("\nENC_CONFIG: Codec: %ld, Profile %ld, level : %ld",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: Codec: %d, Profile %d, level : %d",
m_sVenc_cfg.codectype, codec_profile.profile, profile_level.level);
- DEBUG_PRINT_HIGH("\n ENC_CONFIG: Width: %ld, Height:%ld, Fps: %ld",
+ DEBUG_PRINT_HIGH("\n ENC_CONFIG: Width: %d, Height:%d, Fps: %d",
m_sVenc_cfg.input_width, m_sVenc_cfg.input_height,
m_sVenc_cfg.fps_num/m_sVenc_cfg.fps_den);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: Bitrate: %ld, RC: %ld, I-Period: %ld",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: Bitrate: %d, RC: %d, I-Period: %d",
bitrate.target_bitrate, rate_ctrl.rcmode, intra_period.num_pframes);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: qpI: %ld, qpP: %ld, qpb: %ld",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: qpI: %d, qpP: %d, qpb: %d",
session_qp.iframeqp, session_qp.pframqp,session_qp.bframqp);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: VOP_Resolution: %ld, Slice-Mode: %ld, Slize_Size: %ld",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: VOP_Resolution: %d, Slice-Mode: %d, Slize_Size: %d",
voptimecfg.voptime_resolution, multislice.mslice_mode,
multislice.mslice_size);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: EntropyMode: %d, CabacModel: %ld",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: EntropyMode: %d, CabacModel: %d",
entropy.longentropysel, entropy.cabacmodel);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: DB-Mode: %ld, alpha: %ld, Beta: %ld\n",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: DB-Mode: %d, alpha: %d, Beta: %d\n",
dbkfilter.db_mode, dbkfilter.slicealpha_offset,
dbkfilter.slicebeta_offset);
- DEBUG_PRINT_HIGH("\nENC_CONFIG: IntraMB/Frame: %ld, HEC: %ld\n",
+ DEBUG_PRINT_HIGH("\nENC_CONFIG: IntraMB/Frame: %d, HEC: %d\n",
intra_refresh.mbcount, hec.header_extension);
}
unsigned venc_dev::venc_flush( unsigned port)
{
- struct v4l2_encoder_cmd enc;
- DEBUG_PRINT_LOW("in %s", __func__);
+ struct venc_bufferflush buffer_index;
- enc.cmd = V4L2_ENC_QCOM_CMD_FLUSH;
- enc.flags = V4L2_QCOM_CMD_FLUSH_OUTPUT | V4L2_QCOM_CMD_FLUSH_CAPTURE;
+ if(port == PORT_INDEX_IN)
+ {
+ int rc=0;
+ enum v4l2_buf_type btype;
+ btype = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &btype);
+ if (rc) {
+ /* STREAMOFF should never fail */
+ printf("\n Failed to call streamoff on OUTPUT Port \n");
+ return -1;
+ }
- if (ioctl(m_nDriver_fd, VIDIOC_ENCODER_CMD, &enc))
+ return 0;
+ }
+ else if(port == PORT_INDEX_OUT)
+ {
+ int rc=0;
+ enum v4l2_buf_type btype;
+ btype = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ rc = ioctl(m_nDriver_fd, VIDIOC_STREAMOFF, &btype);
+ if (rc) {
+ /* STREAMOFF should never fail */
+ printf("\n Failed to call streamoff on OUTPUT Port \n");
+ return -1;
+ }
+
+ return 0;
+
+ }
+ else
{
- DEBUG_PRINT_ERROR("\n Flush Port (%d) Failed ", port);
return -1;
}
- return 0;
-
}
//allocating I/P memory from pmem and register with the device
@@ -1421,80 +1435,87 @@ unsigned venc_dev::venc_flush( unsigned port)
bool venc_dev::venc_use_buf(void *buf_addr, unsigned port,unsigned index)
{
- struct pmem *pmem_tmp;
- struct v4l2_buffer buf;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
- int rc = 0, extra_idx;
+ struct pmem *pmem_tmp;
+
+ struct v4l2_buffer buf;
+ struct v4l2_plane plane;
+ int rc=0;
+
+ pmem_tmp = (struct pmem *)buf_addr;
+
+ DEBUG_PRINT_LOW("\n venc_use_buf:: pmem_tmp = %p", pmem_tmp);
+
+ if(port == PORT_INDEX_IN)
+ {
- pmem_tmp = (struct pmem *)buf_addr;
- DEBUG_PRINT_LOW("\n venc_use_buf:: pmem_tmp = %p", pmem_tmp);
+ buf.index = index;
+ buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ buf.memory = V4L2_MEMORY_USERPTR;
+ plane.length = pmem_tmp->size;
+ plane.m.userptr = (unsigned long)pmem_tmp->buffer;
+ plane.reserved[0] = pmem_tmp->fd;
+ plane.reserved[1] = 0;
+ plane.data_offset = pmem_tmp->offset;
+ buf.m.planes = &plane;
+ buf.length = 1;
- if(port == PORT_INDEX_IN)
- {
- buf.index = index;
- buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- buf.memory = V4L2_MEMORY_USERPTR;
- plane[0].length = pmem_tmp->size;
- plane[0].m.userptr = (unsigned long)pmem_tmp->buffer;
- plane[0].reserved[0] = pmem_tmp->fd;
- plane[0].reserved[1] = 0;
- plane[0].data_offset = pmem_tmp->offset;
- buf.m.planes = plane;
- buf.length = 1;
-
- rc = ioctl(m_nDriver_fd, VIDIOC_PREPARE_BUF, &buf);
- if (rc)
- DEBUG_PRINT_ERROR("VIDIOC_PREPARE_BUF Failed\n");
+
+ rc = ioctl(m_nDriver_fd, VIDIOC_PREPARE_BUF, &buf);
+
+ if (rc) {
+ printf("VIDIOC_PREPARE_BUF Failed at line 1387 \n");
}
- else if(port == PORT_INDEX_OUT)
- {
- extra_idx = EXTRADATA_IDX(num_planes);
- if ((num_planes > 1) && (extra_idx)) {
- rc = allocate_extradata();
- if (rc)
- DEBUG_PRINT_ERROR("Failed to allocate extradata: %d\n", rc);
- }
- buf.index = index;
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- buf.memory = V4L2_MEMORY_USERPTR;
- plane[0].length = pmem_tmp->size;
- plane[0].m.userptr = (unsigned long)pmem_tmp->buffer;
- plane[0].reserved[0] = pmem_tmp->fd;
- plane[0].reserved[1] = 0;
- plane[0].data_offset = pmem_tmp->offset;
- buf.m.planes = plane;
- buf.length = num_planes;
-
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- plane[extra_idx].length = extradata_info.buffer_size;
- plane[extra_idx].m.userptr = (unsigned long) (extradata_info.uaddr + index * extradata_info.buffer_size);
-#ifdef USE_ION
- plane[extra_idx].reserved[0] = extradata_info.ion.fd_ion_data.fd;
-#endif
- plane[extra_idx].reserved[1] = extradata_info.buffer_size * index;
- plane[extra_idx].data_offset = 0;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index is more than allowed: %d\n", extra_idx);
- return OMX_ErrorBadParameter;
- }
- rc = ioctl(m_nDriver_fd, VIDIOC_PREPARE_BUF, &buf);
- if (rc)
- DEBUG_PRINT_ERROR("VIDIOC_PREPARE_BUF Failed\n");
- } else {
- DEBUG_PRINT_ERROR("\nERROR: venc_use_buf:Invalid Port Index ");
- return false;
+
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_INPUT_BUFFER,&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: venc_use_buf:set input buffer failed ");
+ return false;
+ }
+ }
+ else if(port == PORT_INDEX_OUT)
+ {
+
+ buf.index = index;
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ buf.memory = V4L2_MEMORY_USERPTR;
+ plane.length = pmem_tmp->size;
+ plane.m.userptr = (unsigned long)pmem_tmp->buffer;
+ plane.reserved[0] = pmem_tmp->fd;
+ plane.reserved[1] = 0;
+ plane.data_offset = pmem_tmp->offset;
+ buf.m.planes = &plane;
+ buf.length = 1;
+
+ rc = ioctl(m_nDriver_fd, VIDIOC_PREPARE_BUF, &buf);
+
+ if (rc) {
+ printf("VIDIOC_PREPARE_BUF Failed at line 1414 \n");
}
- return true;
+
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_OUTPUT_BUFFER,&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: venc_use_buf:set output buffer failed ");
+ return false;
+ }
+ }
+ else
+ {
+ DEBUG_PRINT_ERROR("\nERROR: venc_use_buf:Invalid Port Index ");
+ return false;
+ }
+
+ return true;
}
bool venc_dev::venc_free_buf(void *buf_addr, unsigned port)
{
struct pmem *pmem_tmp;
- struct venc_bufferpayload dev_buffer;
+ struct venc_bufferpayload dev_buffer = {0};
- memset(&dev_buffer, 0, sizeof(dev_buffer));
pmem_tmp = (struct pmem *)buf_addr;
+ DEBUG_PRINT_LOW("\n venc_use_buf:: pmem_tmp = %p", pmem_tmp);
+
if(port == PORT_INDEX_IN)
{
dev_buffer.pbuffer = (OMX_U8 *)pmem_tmp->buffer;
@@ -1508,6 +1529,11 @@ bool venc_dev::venc_free_buf(void *buf_addr, unsigned port)
dev_buffer.offset, \
dev_buffer.maped_size);
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_CMD_FREE_INPUT_BUFFER,&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: venc_free_buf: free input buffer failed ");
+ return false;
+ }
}
else if(port == PORT_INDEX_OUT)
{
@@ -1522,27 +1548,33 @@ bool venc_dev::venc_free_buf(void *buf_addr, unsigned port)
dev_buffer.fd, \
dev_buffer.offset, \
dev_buffer.maped_size);
+
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_CMD_FREE_OUTPUT_BUFFER,&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: venc_free_buf: free output buffer failed ");
+ return false;
+ }
}
else
{
DEBUG_PRINT_ERROR("\nERROR: venc_free_buf:Invalid Port Index ");
return false;
}
+
return true;
}
-bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf, unsigned index, unsigned fd)
+bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf,unsigned index,unsigned fd)
{
struct pmem *temp_buffer;
- struct v4l2_buffer buf;
- struct v4l2_plane plane;
- int rc=0;
+
+ struct v4l2_buffer buf;
+ struct v4l2_plane plane;
+ int rc=0;
struct OMX_BUFFERHEADERTYPE *bufhdr;
- encoder_media_buffer_type * meta_buf = NULL;
+
temp_buffer = (struct pmem *)buffer;
-
- memset (&buf, 0, sizeof(buf));
- memset (&plane, 0, sizeof(plane));
+
if(buffer == NULL)
{
@@ -1551,183 +1583,126 @@ bool venc_dev::venc_empty_buf(void *buffer, void *pmem_data_buf, unsigned index,
}
bufhdr = (OMX_BUFFERHEADERTYPE *)buffer;
- DEBUG_PRINT_LOW("\n Input buffer length %d",bufhdr->nFilledLen);
+DEBUG_PRINT_LOW("\n Input buffer length %d",bufhdr->nFilledLen);
if(pmem_data_buf)
{
DEBUG_PRINT_LOW("\n Internal PMEM addr for i/p Heap UseBuf: %p", pmem_data_buf);
plane.m.userptr = (unsigned long)pmem_data_buf;
- plane.data_offset = bufhdr->nOffset;
- plane.length = bufhdr->nAllocLen;
- plane.bytesused = bufhdr->nFilledLen;
}
else
{
DEBUG_PRINT_LOW("\n Shared PMEM addr for i/p PMEM UseBuf/AllocateBuf: %p", bufhdr->pBuffer);
- if (metadatamode) {
- meta_buf = (encoder_media_buffer_type *)bufhdr->pBuffer;
- if (!meta_buf) {
- return false;
- }
- plane.m.userptr = index;
- plane.data_offset = meta_buf->meta_handle->data[1];
- plane.length = meta_buf->meta_handle->data[2];
- plane.bytesused = meta_buf->meta_handle->data[2];
+ plane.m.userptr = (unsigned long)bufhdr->pBuffer;
+ }
+
+ buf.index = index;
+ buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ buf.memory = V4L2_MEMORY_USERPTR;
+ plane.length = bufhdr->nAllocLen;
+ plane.bytesused = bufhdr->nFilledLen;
+ plane.reserved[0] = fd;
+ plane.reserved[1] = 0;
+ plane.data_offset = bufhdr->nOffset;
+ buf.m.planes = &plane;
+ buf.length = 1;
+
+
+ rc = ioctl(m_nDriver_fd, VIDIOC_QBUF, &buf);
+ if (rc) {
+ printf("Failed to qbuf to driver");
+ return false;
}
- else
+
+ etb_count++;
+
+ if(etb_count == 1)
{
- plane.m.userptr = (unsigned long) bufhdr->pBuffer;
- plane.data_offset = bufhdr->nOffset;
- plane.length = bufhdr->nAllocLen;
- plane.bytesused = bufhdr->nFilledLen;
+ enum v4l2_buf_type buf_type;
+ buf_type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
+ int ret;
+ ret = ioctl(m_nDriver_fd, VIDIOC_STREAMON, &buf_type);
+ if (ret) {
+ printf("Failed to call streamon\n");
+ }
+
}
- }
- buf.index = index;
- buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- buf.memory = V4L2_MEMORY_USERPTR;
- plane.reserved[0] = fd;
- plane.reserved[1] = 0;
- buf.m.planes = &plane;
- buf.length = 1;
- if (bufhdr->nFlags & OMX_BUFFERFLAG_EOS)
- buf.flags = V4L2_BUF_FLAG_EOS;
- buf.timestamp.tv_sec = bufhdr->nTimeStamp / 1000000;
- buf.timestamp.tv_usec = (bufhdr->nTimeStamp % 1000000);
- rc = ioctl(m_nDriver_fd, VIDIOC_QBUF, &buf);
- if (rc) {
- DEBUG_PRINT_ERROR("Failed to qbuf (etb) to driver");
- return false;
+ if(/*ioctl(m_nDriver_fd,VEN_IOCTL_CMD_ENCODE_FRAME,&ioctl_msg) < */0)
+ {
+ /*Generate an async error and move to invalid state*/
+ return false;
}
+#ifdef INPUT_BUFFER_LOG
- etb_count++;
+ int y_size = 0;
+ int c_offset = 0;
- if(etb_count == 1)
+ y_size = m_sVenc_cfg.input_width * m_sVenc_cfg.input_height;
+ //chroma offset is y_size aligned to the 2k boundary
+ c_offset= (y_size + 2047) & (~(2047));
+
+ if(inputBufferFile1)
{
- enum v4l2_buf_type buf_type;
- buf_type=V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- int ret;
- ret = ioctl(m_nDriver_fd, VIDIOC_STREAMON, &buf_type);
- if (ret) {
- DEBUG_PRINT_ERROR("Failed to call streamon\n");
- } else {
- streaming[OUTPUT_PORT] = true;
- }
+ fwrite((const char *)frameinfo.ptrbuffer, y_size, 1,inputBufferFile1);
+ fwrite((const char *)(frameinfo.ptrbuffer + c_offset), (y_size>>1), 1,inputBufferFile1);
}
-#ifdef INPUT_BUFFER_LOG
- int i;
- int stride = VENUS_Y_STRIDE(COLOR_FMT_NV12, m_sVenc_cfg.input_width);
- int scanlines = VENUS_Y_SCANLINES(COLOR_FMT_NV12, m_sVenc_cfg.input_height);
- char *temp = (char *)bufhdr->pBuffer;
- for (i = 0; i < m_sVenc_cfg.input_height; i++) {
- fwrite(temp, m_sVenc_cfg.input_width, 1, inputBufferFile1);
- temp += stride;
- }
- temp = (char *)bufhdr->pBuffer + (stride * scanlines);
- for(i = 0; i < m_sVenc_cfg.input_height/2; i++) {
- fwrite(temp, m_sVenc_cfg.input_width, 1, inputBufferFile1);
- temp += stride;
- }
#endif
+
return true;
}
bool venc_dev::venc_fill_buf(void *buffer, void *pmem_data_buf,unsigned index,unsigned fd)
{
- struct pmem *temp_buffer = NULL;
- struct venc_buffer frameinfo;
- struct v4l2_buffer buf;
- struct v4l2_plane plane[VIDEO_MAX_PLANES];
- int rc = 0, extra_idx;
- struct OMX_BUFFERHEADERTYPE *bufhdr;
-
- if(buffer == NULL)
- return false;
- bufhdr = (OMX_BUFFERHEADERTYPE *)buffer;
+ struct pmem *temp_buffer = NULL;
+ struct venc_buffer frameinfo;
+ struct v4l2_buffer buf;
+ struct v4l2_plane plane;
+ int rc=0;
+ struct OMX_BUFFERHEADERTYPE *bufhdr;
- if(pmem_data_buf)
- {
- DEBUG_PRINT_LOW("\n Internal PMEM addr for o/p Heap UseBuf: %p", pmem_data_buf);
- plane[0].m.userptr = (unsigned long)pmem_data_buf;
- } else {
- DEBUG_PRINT_LOW("\n Shared PMEM addr for o/p PMEM UseBuf/AllocateBuf: %p", bufhdr->pBuffer);
- plane[0].m.userptr = (unsigned long)bufhdr->pBuffer;
- }
+ if(buffer == NULL)
+ {
+ return false;
+ }
+ bufhdr = (OMX_BUFFERHEADERTYPE *)buffer;
+
+if(pmem_data_buf)
+ {
+ DEBUG_PRINT_LOW("\n Internal PMEM addr for o/p Heap UseBuf: %p", pmem_data_buf);
+ plane.m.userptr = (unsigned long)pmem_data_buf;
+ }
+ else
+ {
+ DEBUG_PRINT_LOW("\n Shared PMEM addr for o/p PMEM UseBuf/AllocateBuf: %p", bufhdr->pBuffer);
+ plane.m.userptr = (unsigned long)bufhdr->pBuffer;
+ }
+
+ buf.index = index;
+ buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
+ buf.memory = V4L2_MEMORY_USERPTR;
+ plane.length = bufhdr->nAllocLen;
+ plane.bytesused = bufhdr->nFilledLen;
+ plane.reserved[0] = fd;
+ plane.reserved[1] = 0;
+ plane.data_offset = bufhdr->nOffset;
+ buf.m.planes = &plane;
+ buf.length = 1;
- buf.index = index;
- buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
- buf.memory = V4L2_MEMORY_USERPTR;
- plane[0].length = bufhdr->nAllocLen;
- plane[0].bytesused = bufhdr->nFilledLen;
- plane[0].reserved[0] = fd;
- plane[0].reserved[1] = 0;
- plane[0].data_offset = bufhdr->nOffset;
- buf.m.planes = plane;
- buf.length = num_planes;
-
- extra_idx = EXTRADATA_IDX(num_planes);
- if (extra_idx && (extra_idx < VIDEO_MAX_PLANES)) {
- plane[extra_idx].bytesused = 0;
- plane[extra_idx].length = extradata_info.buffer_size;
- plane[extra_idx].m.userptr = (unsigned long) (extradata_info.uaddr + index * extradata_info.buffer_size);
-#ifdef USE_ION
- plane[extra_idx].reserved[0] = extradata_info.ion.fd_ion_data.fd;
-#endif
- plane[extra_idx].reserved[1] = extradata_info.buffer_size * index;
- plane[extra_idx].data_offset = 0;
- } else if (extra_idx >= VIDEO_MAX_PLANES) {
- DEBUG_PRINT_ERROR("Extradata index higher than expected: %d\n", extra_idx);
- return false;
- }
rc = ioctl(m_nDriver_fd, VIDIOC_QBUF, &buf);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to qbuf (ftb) to driver");
+ printf("Failed to qbuf to driver");
return false;
}
- return true;
-}
-bool venc_dev::venc_set_extradata(OMX_U32 extra_data)
-{
- struct v4l2_control control;
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_EXTRADATA;
- control.value = V4L2_MPEG_VIDC_EXTRADATA_MULTISLICE_INFO;
- DEBUG_PRINT_HIGH("venc_set_extradata:: %x", (int) extra_data);
- if (ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_ERROR("ERROR: Request for setting extradata failed");
- return false;
- }
- return true;
-}
-bool venc_dev::venc_set_slice_delivery_mode(OMX_U32 enable)
-{
- struct v4l2_control control;
- if (enable) {
- control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_DELIVERY_MODE;
- control.value = 1;
- DEBUG_PRINT_LOW("Set slice_delivery_mode: %d", control.value);
- if(multislice.mslice_mode == V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB && m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264)
- {
- if(ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control)) {
- DEBUG_PRINT_ERROR("Request for setting slice delivery mode failed");
- return false;
- }
- else
- DEBUG_PRINT_LOW("Successfully set Slice delivery mode id: %d, value=%d\n", control.id, control.value);
- }
- else
- {
- DEBUG_PRINT_ERROR("Failed to set slice delivery mode, slice_mode [%d] "
- "is not MB BASED or [%lu] is not H264 codec ", multislice.mslice_mode,
- m_sVenc_cfg.codectype);
- }
- }
- else
- {
- DEBUG_PRINT_ERROR("Slice_DELIVERY_MODE not enabled\n");
- }
- return true;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER,&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: ioctl VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER failed");
+ return false;
+ }
+
+ return true;
}
bool venc_dev::venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp,OMX_U32 b_frame_qp)
@@ -1738,25 +1713,25 @@ bool venc_dev::venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp,OMX_U3
control.id = V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP;
control.value = i_frame_qp;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
session_qp.iframeqp = control.value;
control.id = V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP;
control.value = p_frame_qp;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
session_qp.pframqp = control.value;
@@ -1767,24 +1742,29 @@ bool venc_dev::venc_set_session_qp(OMX_U32 i_frame_qp, OMX_U32 p_frame_qp,OMX_U3
control.id = V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP;
control.value = b_frame_qp;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
session_qp.bframqp = control.value;
}
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_SESSION_QP,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting session qp failed");
+ return false;
+ }
return true;
}
bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
{
- struct venc_profile requested_profile = {0};
- struct ven_profilelevel requested_level = {0};
+ struct venc_profile requested_profile;
+ struct ven_profilelevel requested_level;
unsigned const int *profile_tbl = NULL;
unsigned long mb_per_frame = 0, mb_per_sec = 0;
DEBUG_PRINT_LOW("venc_set_profile_level:: eProfile = %d, Level = %d",
@@ -1887,36 +1867,12 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
}
else if(m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263)
{
-
- switch (eProfile) {
- case OMX_VIDEO_H263ProfileBaseline:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_BASELINE;
- break;
- case OMX_VIDEO_H263ProfileH320Coding:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_H320CODING;
- break;
- case OMX_VIDEO_H263ProfileBackwardCompatible:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_BACKWARDCOMPATIBLE;
- break;
- case OMX_VIDEO_H263ProfileISWV2:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_ISWV2;
- break;
- case OMX_VIDEO_H263ProfileISWV3:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_ISWV3;
- break;
- case OMX_VIDEO_H263ProfileHighCompression:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_HIGHCOMPRESSION;
- break;
- case OMX_VIDEO_H263ProfileInternet:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_INTERNET;
- break;
- case OMX_VIDEO_H263ProfileInterlace:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_INTERLACE;
- break;
- case OMX_VIDEO_H263ProfileHighLatency:
- requested_profile.profile = V4L2_MPEG_VIDC_VIDEO_H263_PROFILE_HIGHLATENCY;
- break;
- default:
+ if(eProfile == OMX_VIDEO_H263ProfileBaseline)
+ {
+ requested_profile.profile = VEN_PROFILE_H263_BASELINE;
+ }
+ else
+ {
DEBUG_PRINT_LOW("\nERROR: Unsupported H.263 profile = %u",
requested_profile.profile);
return false;
@@ -1925,32 +1881,32 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
switch(eLevel)
{
case OMX_VIDEO_H263Level10:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_1_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_10;
+ break;
case OMX_VIDEO_H263Level20:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_2_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_20;
+ break;
case OMX_VIDEO_H263Level30:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_3_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_30;
+ break;
case OMX_VIDEO_H263Level40:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_4_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_40;
+ break;
case OMX_VIDEO_H263Level45:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_4_5;
- break;
+ requested_level.level = VEN_LEVEL_H263_45;
+ break;
case OMX_VIDEO_H263Level50:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_5_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_50;
+ break;
case OMX_VIDEO_H263Level60:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_6_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_60;
+ break;
case OMX_VIDEO_H263Level70:
- requested_level.level = V4L2_MPEG_VIDC_VIDEO_H263_LEVEL_7_0;
- break;
+ requested_level.level = VEN_LEVEL_H263_70;
+ break;
default:
- return false;
- break;
+ return false;
+ break;
}
}
else if(m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264)
@@ -2041,9 +1997,9 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
requested_level.level = V4L2_MPEG_VIDEO_H264_LEVEL_5_1;
break;
default :
- DEBUG_PRINT_ERROR("\nERROR: Unsupported H.264 level= %lu",
+ DEBUG_PRINT_ERROR("\nERROR: Unsupported H.264 level= %u",
requested_level.level);
- return false;
+ return false;
break;
}
}
@@ -2051,32 +2007,24 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
{
int rc;
struct v4l2_control control;
- if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) {
- control.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE;
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) {
- control.id = V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE;
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_H263_PROFILE;
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) {
- DEBUG_PRINT_ERROR("\n No Profile and LEVEL Setting for VP8 \n");
- m_profile_set = true;
- m_level_set = true;
- return true;
- } else {
- DEBUG_PRINT_ERROR("\n Wrong CODEC \n");
- return false;
- }
+ control.id = V4L2_CID_MPEG_VIDEO_H264_PROFILE;
control.value = requested_profile.profile;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_CODEC_PROFILE,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting profile failed");
+ return false;
+ }
codec_profile.profile = control.value;
m_profile_set = true;
}
@@ -2085,27 +2033,21 @@ bool venc_dev::venc_set_profile_level(OMX_U32 eProfile,OMX_U32 eLevel)
{
int rc;
struct v4l2_control control;
- if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H264) {
- control.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL;
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) {
- control.id = V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL;
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263) {
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_H263_LEVEL;
- } else {
- DEBUG_PRINT_ERROR("\n Wrong CODEC \n");
- return false;
- }
-
+ control.id = V4L2_CID_MPEG_VIDEO_H264_LEVEL;
control.value = requested_level.level;
-
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_PROFILE_LEVEL,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting profile level failed");
+ return false;
+ }
profile_level.level = control.value;
m_level_set = true;
}
@@ -2123,6 +2065,12 @@ bool venc_dev::venc_set_voptiming_cfg( OMX_U32 TimeIncRes)
vop_timing_cfg.voptime_resolution = TimeIncRes;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_VOP_TIMING_CFG,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting Vop Timing failed");
+ return false;
+ }
+
voptimecfg.voptime_resolution = vop_timing_cfg.voptime_resolution;
return true;
}
@@ -2146,30 +2094,38 @@ bool venc_dev::venc_set_intra_period(OMX_U32 nPFrames, OMX_U32 nBFrames)
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
intra_period.num_pframes = control.value;
control.id = V4L2_CID_MPEG_VIDC_VIDEO_NUM_B_FRAMES;
control.value = nBFrames;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_INTRA_PERIOD,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting intra period failed");
+ return false;
+ }
intra_period.num_bframes = control.value;
return true;
}
bool venc_dev::venc_set_entropy_config(OMX_BOOL enable, OMX_U32 i_cabac_level)
{
- int rc = 0;
+ //struct venc_entropycfg entropy_cfg;
+
+ // memset(&entropy_cfg,0,sizeof(entropy_cfg));
+ int rc;
struct v4l2_control control;
DEBUG_PRINT_LOW("\n venc_set_entropy_config: CABAC = %u level: %u", enable, i_cabac_level);
@@ -2179,13 +2135,13 @@ bool venc_dev::venc_set_entropy_config(OMX_BOOL enable, OMX_U32 i_cabac_level)
control.value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC;
control.id = V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
entropy.longentropysel = control.value;
if (i_cabac_level == 0) {
control.value = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL_0;
@@ -2199,32 +2155,40 @@ bool venc_dev::venc_set_entropy_config(OMX_BOOL enable, OMX_U32 i_cabac_level)
control.id = V4L2_CID_MPEG_VIDC_VIDEO_H264_CABAC_MODEL;
//control.value = entropy_cfg.cabacmodel;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
entropy.longentropysel=control.value;
}
else if(!enable){
control.value = V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC;
control.id = V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
entropy.longentropysel=control.value;
+ //entropy_cfg.longentropysel = control.value;
}
else{
DEBUG_PRINT_ERROR("\nInvalid Entropy mode for Baseline Profile");
return false;
}
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_ENTROPY_CFG,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting entropy config failed");
+ return false;
+ }
+ //entropy.longentropysel = entropy_cfg.longentropysel;
+ //entropy.cabacmodel = entropy_cfg.cabacmodel;
return true;
}
@@ -2233,37 +2197,54 @@ bool venc_dev::venc_set_multislice_cfg(OMX_INDEXTYPE Codec, OMX_U32 nSlicesize)
int rc;
struct v4l2_control control;
bool status = true;
+ //struct venc_multiclicecfg multislice_cfg;
if((Codec != OMX_IndexParamVideoH263) && (nSlicesize)){
+ // multislice_cfg.mslice_mode = VEN_MSLICE_CNT_MB;
+ //multislice_cfg.mslice_size = nSlicesize;
control.value = V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB;
}
else{
control.value = V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE;
+ //multislice_cfg.mslice_mode = VEN_MSLICE_OFF;
+ //multislice_cfg.mslice_size = 0;
}
control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
multislice.mslice_mode=control.value;
if(multislice.mslice_mode!=V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE){
control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB;
control.value = nSlicesize;
- DEBUG_PRINT_LOW("Calling SLICE_MB IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
multislice.mslice_size=control.value;
}
+
+
+ if(/*ioctl (m_nDriver_fd, VEN_IOCTL_SET_MULTI_SLICE_CFG,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting multi-slice cfg failed");
+ status = false;
+ }
+ else
+ {
+ //multislice.mslice_mode = multislice_cfg.mslice_mode;
+ //multislice.mslice_size = nSlicesize;
+ }
return status;
}
@@ -2277,7 +2258,6 @@ bool venc_dev::venc_set_intra_refresh(OMX_VIDEO_INTRAREFRESHTYPE ir_mode, OMX_U3
if (irMBs == 0 || ir_mode == OMX_VIDEO_IntraRefreshMax)
{
control_mode.value = V4L2_CID_MPEG_VIDC_VIDEO_INTRA_REFRESH_NONE;
- return status;
}
else if ((ir_mode == OMX_VIDEO_IntraRefreshCyclic) &&
(irMBs < ((m_sVenc_cfg.input_width * m_sVenc_cfg.input_height)>>8)))
@@ -2301,102 +2281,98 @@ bool venc_dev::venc_set_intra_refresh(OMX_VIDEO_INTRAREFRESHTYPE ir_mode, OMX_U3
else
{
DEBUG_PRINT_ERROR("\nERROR: Invalid IntraRefresh Parameters:"
- "mb count: %lu, mb mode:%d", irMBs, ir_mode);
+ "mb count: %d, mb mode:%d", irMBs, ir_mode);
return false;
}
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%lu, val=%lu\n", control_mode.id, control_mode.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control_mode.id, control_mode.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control_mode);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control_mode.id, control_mode.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control_mode.id, control_mode.value);
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control_mbs.id, control_mbs.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control_mbs.id, control_mbs.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control_mbs);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control_mbs.id, control_mbs.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control_mbs.id, control_mbs.value);
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_INTRA_REFRESH,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting Intra Refresh failed");
+ status = false;
+ }
+ else
+ {
intra_refresh.irmode = control_mode.value;
intra_refresh.mbcount = control_mbs.value;
-
+ }
return status;
}
bool venc_dev::venc_set_error_resilience(OMX_VIDEO_PARAM_ERRORCORRECTIONTYPE* error_resilience)
{
- bool status = true;
- struct venc_headerextension hec_cfg;
- struct venc_multiclicecfg multislice_cfg;
- int rc;
- struct v4l2_control control;
-
- memset(&control, 0, sizeof(control));
- if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) {
- if (error_resilience->bEnableHEC) {
- hec_cfg.header_extension = 1;
- } else {
- hec_cfg.header_extension = 0;
- }
- hec.header_extension = error_resilience->bEnableHEC;
- }
-
- if (error_resilience->bEnableRVLC) {
- DEBUG_PRINT_ERROR("\n RVLC is not Supported");
- return false;
- }
-
- if (( m_sVenc_cfg.codectype != V4L2_PIX_FMT_H263) &&
- (error_resilience->bEnableDataPartitioning)) {
- DEBUG_PRINT_ERROR("\n DataPartioning are not Supported for MPEG4/H264");
- return false;
- }
+ bool status = true;
+ struct venc_headerextension hec_cfg;
+ struct venc_multiclicecfg multislice_cfg;
- if (( m_sVenc_cfg.codectype != V4L2_PIX_FMT_H263) &&
- (error_resilience->nResynchMarkerSpacing)) {
- multislice_cfg.mslice_mode = VEN_MSLICE_CNT_BYTE;
- multislice_cfg.mslice_size = error_resilience->nResynchMarkerSpacing;
- control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE;
- control.value = V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES;
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_H263 &&
- error_resilience->bEnableDataPartitioning) {
- multislice_cfg.mslice_mode = VEN_MSLICE_GOB;
- multislice_cfg.mslice_size = error_resilience->nResynchMarkerSpacing;
- control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE;
- control.value = V4L2_MPEG_VIDEO_MULTI_SLICE_GOB;
- } else {
- multislice_cfg.mslice_mode = VEN_MSLICE_OFF;
- multislice_cfg.mslice_size = 0;
- control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE;
- control.value = V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE;
- }
- DEBUG_PRINT_LOW("\n %s(): mode = %u, size = %u", __func__,
- multislice_cfg.mslice_mode, multislice_cfg.mslice_size);
- printf("Calling IOCTL set control for id=%x, val=%d\n", control.id, control.value);
- rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
- if (rc) {
- printf("Failed to set Slice mode control\n");
- return false;
- }
- printf("Success IOCTL set control for id=%x, value=%d\n", control.id, control.value);
- multislice.mslice_mode=control.value;
+ if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4) {
+ if (error_resilience->bEnableHEC) {
+ hec_cfg.header_extension = 1;
+ }
+ else {
+ hec_cfg.header_extension = 0;
+ }
- control.id = V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES;
- control.value = error_resilience->nResynchMarkerSpacing;
- printf("Calling IOCTL set control for id=%x, val=%d\n", control.id, control.value);
- rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
- if (rc) {
- printf("Failed to set MAX MB control\n");
- return false;
- }
- printf("Success IOCTL set control for id=%x, value=%d\n", control.id, control.value);
- multislice.mslice_mode = multislice_cfg.mslice_mode;
- multislice.mslice_size = multislice_cfg.mslice_size;
- return status;
+ if (/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_HEC,(void*)&ioctl_msg) < */0) {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting HEader Error correction failed");
+ return false;
+ }
+ hec.header_extension = error_resilience->bEnableHEC;
+ }
+
+ if (error_resilience->bEnableRVLC) {
+ DEBUG_PRINT_ERROR("\n RVLC is not Supported");
+ return false;
+ }
+
+ if (( m_sVenc_cfg.codectype != OMX_VIDEO_CodingH263) &&
+ (error_resilience->bEnableDataPartitioning)) {
+ DEBUG_PRINT_ERROR("\n DataPartioning are not Supported for MPEG4/H264");
+ return false;
+ }
+
+ if (( m_sVenc_cfg.codectype != OMX_VIDEO_CodingH263) &&
+ (error_resilience->nResynchMarkerSpacing)) {
+ multislice_cfg.mslice_mode = VEN_MSLICE_CNT_BYTE;
+ multislice_cfg.mslice_size = error_resilience->nResynchMarkerSpacing;
+ }
+ else if (m_sVenc_cfg.codectype == OMX_VIDEO_CodingH263 &&
+ error_resilience->bEnableDataPartitioning) {
+ multislice_cfg.mslice_mode = VEN_MSLICE_GOB;
+ multislice_cfg.mslice_size = 0;
+ }
+ else {
+ multislice_cfg.mslice_mode = VEN_MSLICE_OFF;
+ multislice_cfg.mslice_size = 0;
+ }
+ DEBUG_PRINT_LOW("\n %s(): mode = %u, size = %u", __func__, multislice_cfg.mslice_mode,
+ multislice_cfg.mslice_size);
+ if (/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_MULTI_SLICE_CFG,(void*)&ioctl_msg) < */0) {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting multi-slice cfg failed");
+ status = false;
+ }
+ else
+ {
+ multislice.mslice_mode = multislice_cfg.mslice_mode ;
+ multislice.mslice_size = multislice_cfg.mslice_size;
+
+ }
+ return status;
}
bool venc_dev::venc_set_inloop_filter(OMX_VIDEO_AVCLOOPFILTERTYPE loopfilter)
@@ -2414,34 +2390,40 @@ bool venc_dev::venc_set_inloop_filter(OMX_VIDEO_AVCLOOPFILTERTYPE loopfilter)
control.value=V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY;
}
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
dbkfilter.db_mode=control.value;
control.id=V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA;
control.value=0;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
control.id=V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA;
control.value=0;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_DEBLOCKING_CFG,(void*)&ioctl_msg)< */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting inloop filter failed");
+ return false;
+ }
+
dbkfilter.slicealpha_offset = dbkfilter.slicebeta_offset = 0;
return true;
}
@@ -2451,27 +2433,32 @@ bool venc_dev::venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config)
DEBUG_PRINT_LOW("\n venc_set_target_bitrate: bitrate = %u",
nTargetBitrate);
struct v4l2_control control;
- int rc = 0;
+ int rc;
control.id = V4L2_CID_MPEG_VIDEO_BITRATE;
- control.value = nTargetBitrate;
+ control.value = nTargetBitrate/1000;
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
- m_sVenc_cfg.targetbitrate = control.value;
- bitrate.target_bitrate = control.value;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_TARGET_BITRATE,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting bit rate failed");
+ return false;
+ }
+ m_sVenc_cfg.targetbitrate = control.value*1000;
+ bitrate.target_bitrate = control.value*1000;
if(!config)
{
m_level_set = false;
if(venc_set_profile_level(0, 0))
{
- DEBUG_PRINT_HIGH("Calling set level (Bitrate) with %lu\n",profile_level.level);
+ DEBUG_PRINT_HIGH("Calling set level (Bitrate) with %d\n",profile_level.level);
}
}
return true;
@@ -2479,27 +2466,33 @@ bool venc_dev::venc_set_target_bitrate(OMX_U32 nTargetBitrate, OMX_U32 config)
bool venc_dev::venc_set_encode_framerate(OMX_U32 encode_framerate, OMX_U32 config)
{
- struct v4l2_streamparm parm;
- int rc = 0;
- struct venc_framerate frame_rate_cfg;
- Q16ToFraction(encode_framerate,frame_rate_cfg.fps_numerator,frame_rate_cfg.fps_denominator);
- parm.type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE;
- parm.parm.output.timeperframe.numerator = frame_rate_cfg.fps_denominator;
- parm.parm.output.timeperframe.denominator = frame_rate_cfg.fps_numerator;
- if(frame_rate_cfg.fps_numerator > 0)
- rc = ioctl(m_nDriver_fd, VIDIOC_S_PARM, &parm);
- if (rc) {
- DEBUG_PRINT_ERROR("ERROR: Request for setting framerate failed\n");
+
+ struct v4l2_control control;
+ int rc;
+ control.id = V4L2_CID_MPEG_VIDC_VIDEO_FRAME_RATE;
+ control.value = encode_framerate;
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
+ if (rc) {
+ printf("Failed to set control\n");
+ return false;
+ }
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ if(//ioctl(m_nDriver_fd, VEN_IOCTL_SET_FRAME_RATE,
+ /*(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting framerate failed");
return false;
}
- m_sVenc_cfg.fps_den = frame_rate_cfg.fps_denominator;
- m_sVenc_cfg.fps_num = frame_rate_cfg.fps_numerator;
+
+ m_sVenc_cfg.fps_den = 1;
+ m_sVenc_cfg.fps_num = control.value;
if(!config)
{
m_level_set = false;
if(venc_set_profile_level(0, 0))
{
- DEBUG_PRINT_HIGH("Calling set level (Framerate) with %lu\n",profile_level.level);
+ DEBUG_PRINT_HIGH("Calling set level (Framerate) with %d\n",profile_level.level);
}
}
return true;
@@ -2519,6 +2512,11 @@ bool venc_dev::venc_set_color_format(OMX_COLOR_FORMATTYPE color_format)
m_sVenc_cfg.inputformat= VEN_INPUTFMT_NV12_16M2KA;
DEBUG_PRINT_HIGH("\n Default color format YUV420SemiPlanar is set");
}
+ if (/*ioctl(m_nDriver_fd, VEN_IOCTL_SET_BASE_CFG, (void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting color format failed");
+ return false;
+ }
return true;
}
@@ -2527,17 +2525,11 @@ bool venc_dev::venc_set_intra_vop_refresh(OMX_BOOL intra_vop_refresh)
DEBUG_PRINT_LOW("\n venc_set_intra_vop_refresh: intra_vop = %uc", intra_vop_refresh);
if(intra_vop_refresh == OMX_TRUE)
{
- struct v4l2_control control;
- int rc;
- control.id = V4L2_CID_MPEG_VIDC_VIDEO_REQUEST_IFRAME;
- control.value = 1;
- printf("Calling IOCTL set control for id=%x, val=%d\n", control.id, control.value);
- rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
- if (rc) {
- printf("Failed to set Intra Frame Request control\n");
- return false;
- }
- printf("Success IOCTL set control for id=%x, value=%d\n", control.id, control.value);
+ if(/*ioctl(m_nDriver_fd, VEN_IOCTL_CMD_REQUEST_IFRAME, NULL) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting Intra VOP Refresh failed");
+ return false;
+ }
}
else
{
@@ -2550,7 +2542,7 @@ bool venc_dev::venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate)
{
bool status = true;
struct v4l2_control control;
- int rc = 0;
+ int rc;
control.id = V4L2_CID_MPEG_VIDC_VIDEO_RATE_CONTROL;
switch(eControlRate)
{
@@ -2577,15 +2569,22 @@ bool venc_dev::venc_set_ratectrl_cfg(OMX_VIDEO_CONTROLRATETYPE eControlRate)
if(status)
{
- DEBUG_PRINT_LOW("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
+ printf("Calling IOCTL set control for id=%d, val=%d\n", control.id, control.value);
rc = ioctl(m_nDriver_fd, VIDIOC_S_CTRL, &control);
if (rc) {
- DEBUG_PRINT_ERROR("Failed to set control\n");
+ printf("Failed to set control\n");
return false;
}
- DEBUG_PRINT_LOW("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+ printf("Success IOCTL set control for id=%d, value=%d\n", control.id, control.value);
+
- rate_ctrl.rcmode = control.value;
+ if(/*ioctl (m_nDriver_fd,VEN_IOCTL_SET_RATE_CTRL_CFG,(void*)&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR("\nERROR: Request for setting rate control failed");
+ status = false;
+ }
+ else
+ rate_ctrl.rcmode = control.value;
}
return status;
}
@@ -2942,9 +2941,6 @@ bool venc_dev::venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel)
DEBUG_PRINT_LOW("\n Unsupported H.263 profile type %lu", *eProfile);
return false;
}
- } else if (m_sVenc_cfg.codectype == V4L2_PIX_FMT_VP8) {
- DEBUG_PRINT_HIGH("Disregarding profile/level setting for VP8\n");
- return true;
}
else
{
@@ -2955,11 +2951,11 @@ bool venc_dev::venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel)
mb_per_frame = ((m_sVenc_cfg.input_height + 15) >> 4)*
((m_sVenc_cfg.input_width + 15)>> 4);
- if((mb_per_frame >= 3600) && (m_sVenc_cfg.codectype == (unsigned long) V4L2_PIX_FMT_MPEG4))
+ if((mb_per_frame >= 3600) && (m_sVenc_cfg.codectype == V4L2_PIX_FMT_MPEG4))
{
- if(codec_profile.profile == (unsigned long) V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE)
+ if(codec_profile.profile == V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE)
profile_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5;
- if(codec_profile.profile == (unsigned long) V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE)
+ if(codec_profile.profile == V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE)
profile_level.level = V4L2_MPEG_VIDEO_MPEG4_LEVEL_5;
{
new_level = profile_level.level;
@@ -2971,11 +2967,11 @@ bool venc_dev::venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel)
mb_per_sec = mb_per_frame * m_sVenc_cfg.fps_num / m_sVenc_cfg.fps_den;
do{
- if(mb_per_frame <= (unsigned int)profile_tbl[0])
+ if(mb_per_frame <= (int)profile_tbl[0])
{
- if(mb_per_sec <= (unsigned int)profile_tbl[1])
+ if(mb_per_sec <= (int)profile_tbl[1])
{
- if(m_sVenc_cfg.targetbitrate <= (unsigned int)profile_tbl[2])
+ if(m_sVenc_cfg.targetbitrate <= (int)profile_tbl[2])
{
new_level = (int)profile_tbl[3];
new_profile = (int)profile_tbl[4];
@@ -3007,7 +3003,11 @@ bool venc_dev::venc_validate_profile_level(OMX_U32 *eProfile, OMX_U32 *eLevel)
#ifdef _ANDROID_ICS_
bool venc_dev::venc_set_meta_mode(bool mode)
{
- metadatamode = 1;
- return true;
+ if(/*ioctl(m_nDriver_fd,VEN_IOCTL_SET_METABUFFER_MODE,&ioctl_msg) < */0)
+ {
+ DEBUG_PRINT_ERROR(" Set meta buffer mode failed");
+ return false;
+ }
+ return true;
}
#endif
diff --git a/mm-video/vidc/venc/test/camera_test.cpp b/mm-video/vidc/venc/test/camera_test.cpp
index f5ae6db..bb3e73c 100644
--- a/mm-video/vidc/venc/test/camera_test.cpp
+++ b/mm-video/vidc/venc/test/camera_test.cpp
@@ -1,93 +1,93 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "camera_test.h"
-// #include "camera_class.h"
-
-EXTERN_C_START
-
-// static android::Camera* pCamera = NULL;
-
-int CameraTest_Initialize(int nFrameRate,
- int nFrameWidth,
- int nFrameHeight,
- CameraPreviewCallback pfnPreviewCallback)
-{
- int result = 0;
-
-// pCamera = new android::Camera;
-// if (!pCamera)
-// return 1;
-
-// pCamera->init_camera(nFrameWidth,
-// nFrameHeight,
-// nFrameRate,
-// pfnPreviewCallback);
-
- return result;
-}
-
-int CameraTest_Run()
-{
- int result = 0;
-
-// if (pCamera)
-// pCamera->startPreview();
-// else
-// return 1;
-
- return result;
-}
-
-int CameraTest_ReleaseFrame(void* pPhys, void* pVirt)
-{
- int result = 0;
-
-// if (pCamera)
-// pCamera->releaseFrame(pPhys, pVirt);
-// else
-// return 1;
-
- return result;
-}
-
-int CameraTest_Exit()
-{
- int result = 0;
-
-// if (pCamera)
-// {
-// pCamera->stopPreview();
-// delete pCamera;
-// }
-// pCamera = NULL;
-
- return result;
-}
-
-
-EXTERN_C_END
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "camera_test.h"
+// #include "camera_class.h"
+
+EXTERN_C_START
+
+// static android::Camera* pCamera = NULL;
+
+int CameraTest_Initialize(int nFrameRate,
+ int nFrameWidth,
+ int nFrameHeight,
+ CameraPreviewCallback pfnPreviewCallback)
+{
+ int result = 0;
+
+// pCamera = new android::Camera;
+// if (!pCamera)
+// return 1;
+
+// pCamera->init_camera(nFrameWidth,
+// nFrameHeight,
+// nFrameRate,
+// pfnPreviewCallback);
+
+ return result;
+}
+
+int CameraTest_Run()
+{
+ int result = 0;
+
+// if (pCamera)
+// pCamera->startPreview();
+// else
+// return 1;
+
+ return result;
+}
+
+int CameraTest_ReleaseFrame(void* pPhys, void* pVirt)
+{
+ int result = 0;
+
+// if (pCamera)
+// pCamera->releaseFrame(pPhys, pVirt);
+// else
+// return 1;
+
+ return result;
+}
+
+int CameraTest_Exit()
+{
+ int result = 0;
+
+// if (pCamera)
+// {
+// pCamera->stopPreview();
+// delete pCamera;
+// }
+// pCamera = NULL;
+
+ return result;
+}
+
+
+EXTERN_C_END
diff --git a/mm-video/vidc/venc/test/fb_test.c b/mm-video/vidc/venc/test/fb_test.c
index 6479a3e..06e6f2f 100644
--- a/mm-video/vidc/venc/test/fb_test.c
+++ b/mm-video/vidc/venc/test/fb_test.c
@@ -1,48 +1,48 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "fb_test.h"
-
-int FBTest_Initialize(int nFrameWidth,
- int nFrameHeight)
-{
- return 0;
-}
-int FBTest_DisplayImage(int nPmemFd, int nOffset)
-{
- return 0;
-}
-
-int FBTest_Exit()
-{
- return 0;
-}
-
-int FBTest_RunTest()
-{
- return 0;
-}
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "fb_test.h"
+
+int FBTest_Initialize(int nFrameWidth,
+ int nFrameHeight)
+{
+ return 0;
+}
+int FBTest_DisplayImage(int nPmemFd, int nOffset)
+{
+ return 0;
+}
+
+int FBTest_Exit()
+{
+ return 0;
+}
+
+int FBTest_RunTest()
+{
+ return 0;
+}
diff --git a/mm-video/vidc/venc/test/queue.c b/mm-video/vidc/venc/test/queue.c
index 94756b0..f645720 100644
--- a/mm-video/vidc/venc/test/queue.c
+++ b/mm-video/vidc/venc/test/queue.c
@@ -1,174 +1,174 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "queue.h"
-
-int check_if_queue_empty ( unsigned int queuetocheck, void* queuecontext )
-{
- struct video_queue_context *ptr_q = NULL;
- /*
- * queuetocheck - 0 command queue
- * queuetocheck - 1 data queue
- */
- if ( queuecontext == NULL || (queuetocheck > 1 ) )
- {
- return 1;
- }
- ptr_q = (struct video_queue_context *)queuecontext;
-
- if (queuetocheck == 0)
- {
- if (ptr_q->read_comq == ptr_q->write_comq)
- {
- return 1;
- }
- }
- else if (queuetocheck == 1)
- {
- if (ptr_q->write_dataq == ptr_q->read_dataq)
- {
- return 1;
- }
- }
-
- return 0;
-}
-
-
-
-struct video_msgq * queue_get_cmd (void* queuecontext )
-{
- struct video_queue_context *ptr_q = NULL;
- struct video_msgq *pitem = NULL;
-
- if( NULL == queuecontext )
- {
- printf("\n queue_get_cmd: Invalid Input parameter\n");
- return NULL;
- }
-
- ptr_q = (struct video_queue_context *)queuecontext;
-
- /* Wait on the semaphore till it is released */
- sem_wait(&ptr_q->sem_message);
-
- /* Lock the mutex to protect the critical section */
- pthread_mutex_lock(&ptr_q->mutex);
-
- if (ptr_q->read_comq != ptr_q->write_comq)
- {
- pitem = &ptr_q->ptr_cmdq [ptr_q->read_comq];
- ptr_q->read_comq = (ptr_q->read_comq + 1) % \
- ptr_q->commandq_size;
- }
- else if (ptr_q->write_dataq != ptr_q->read_dataq)
- {
- pitem = &ptr_q->ptr_dataq [ptr_q->read_dataq];
- ptr_q->read_dataq = (ptr_q->read_dataq + 1) % \
- ptr_q->dataq_size;
- }
-
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
-
- return pitem;
-}
-
-
-int queue_post_cmdq ( void* queuecontext,
- struct video_msgq *pitem
- )
-{
- struct video_queue_context *ptr_q = NULL;
-
- if (pitem == NULL || queuecontext == NULL)
- {
- return -1;
- }
- ptr_q = (struct video_queue_context *)queuecontext;
-
- /* Lock the mutex to protect the critical section */
- pthread_mutex_lock(&ptr_q->mutex);
-
- if ((ptr_q->write_comq + 1) % ptr_q->commandq_size == ptr_q->read_comq)
- {
- printf("\n QUEUE is FULL");
- return 0;
- }
- else
- {
- /* Store the command in the Message Queue & increment write offset */
- memcpy ( &ptr_q->ptr_cmdq [ptr_q->write_comq],pitem, \
- sizeof (struct video_msgq));
- ptr_q->write_comq = (ptr_q->write_comq + 1) % ptr_q->commandq_size;
- }
-
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
-
- /* Post the semaphore */
- sem_post(&ptr_q->sem_message);
- return 1;
-}
-
-
-int queue_post_dataq ( void *queuecontext,
- struct video_msgq *pitem
- )
-{
- struct video_queue_context *ptr_q = NULL;
-
- if (pitem == NULL || queuecontext == NULL)
- {
- return -1;
- }
- ptr_q = (struct video_queue_context *)queuecontext;
-
- /* Lock the mutex to protect the critical section */
- pthread_mutex_lock(&ptr_q->mutex);
-
- if ((ptr_q->write_dataq + 1) % ptr_q->dataq_size == ptr_q->read_dataq)
- {
- printf("\n QUEUE is FULL");
- return 0;
- }
- else
- {
- /* Store the command in the Message Queue & increment write offset */
- memcpy ( &ptr_q->ptr_dataq [ptr_q->write_dataq],pitem, \
- sizeof (struct video_msgq));
- ptr_q->write_dataq = (ptr_q->write_dataq + 1) % ptr_q->dataq_size;
- }
-
- /* Unlock the mutex to release the critical section */
- pthread_mutex_unlock(&ptr_q->mutex);
-
- /* Post the semaphore */
- sem_post(&ptr_q->sem_message);
- return 1;
-
-}
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "queue.h"
+
+int check_if_queue_empty ( unsigned int queuetocheck, void* queuecontext )
+{
+ struct video_queue_context *ptr_q = NULL;
+ /*
+ * queuetocheck - 0 command queue
+ * queuetocheck - 1 data queue
+ */
+ if ( queuecontext == NULL || (queuetocheck > 1 ) )
+ {
+ return 1;
+ }
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ if (queuetocheck == 0)
+ {
+ if (ptr_q->read_comq == ptr_q->write_comq)
+ {
+ return 1;
+ }
+ }
+ else if (queuetocheck == 1)
+ {
+ if (ptr_q->write_dataq == ptr_q->read_dataq)
+ {
+ return 1;
+ }
+ }
+
+ return 0;
+}
+
+
+
+struct video_msgq * queue_get_cmd (void* queuecontext )
+{
+ struct video_queue_context *ptr_q = NULL;
+ struct video_msgq *pitem = NULL;
+
+ if( NULL == queuecontext )
+ {
+ printf("\n queue_get_cmd: Invalid Input parameter\n");
+ return NULL;
+ }
+
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ /* Wait on the semaphore till it is released */
+ sem_wait(&ptr_q->sem_message);
+
+ /* Lock the mutex to protect the critical section */
+ pthread_mutex_lock(&ptr_q->mutex);
+
+ if (ptr_q->read_comq != ptr_q->write_comq)
+ {
+ pitem = &ptr_q->ptr_cmdq [ptr_q->read_comq];
+ ptr_q->read_comq = (ptr_q->read_comq + 1) % \
+ ptr_q->commandq_size;
+ }
+ else if (ptr_q->write_dataq != ptr_q->read_dataq)
+ {
+ pitem = &ptr_q->ptr_dataq [ptr_q->read_dataq];
+ ptr_q->read_dataq = (ptr_q->read_dataq + 1) % \
+ ptr_q->dataq_size;
+ }
+
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+
+ return pitem;
+}
+
+
+int queue_post_cmdq ( void* queuecontext,
+ struct video_msgq *pitem
+ )
+{
+ struct video_queue_context *ptr_q = NULL;
+
+ if (pitem == NULL || queuecontext == NULL)
+ {
+ return -1;
+ }
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ /* Lock the mutex to protect the critical section */
+ pthread_mutex_lock(&ptr_q->mutex);
+
+ if ((ptr_q->write_comq + 1) % ptr_q->commandq_size == ptr_q->read_comq)
+ {
+ printf("\n QUEUE is FULL");
+ return 0;
+ }
+ else
+ {
+ /* Store the command in the Message Queue & increment write offset */
+ memcpy ( &ptr_q->ptr_cmdq [ptr_q->write_comq],pitem, \
+ sizeof (struct video_msgq));
+ ptr_q->write_comq = (ptr_q->write_comq + 1) % ptr_q->commandq_size;
+ }
+
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+
+ /* Post the semaphore */
+ sem_post(&ptr_q->sem_message);
+ return 1;
+}
+
+
+int queue_post_dataq ( void *queuecontext,
+ struct video_msgq *pitem
+ )
+{
+ struct video_queue_context *ptr_q = NULL;
+
+ if (pitem == NULL || queuecontext == NULL)
+ {
+ return -1;
+ }
+ ptr_q = (struct video_queue_context *)queuecontext;
+
+ /* Lock the mutex to protect the critical section */
+ pthread_mutex_lock(&ptr_q->mutex);
+
+ if ((ptr_q->write_dataq + 1) % ptr_q->dataq_size == ptr_q->read_dataq)
+ {
+ printf("\n QUEUE is FULL");
+ return 0;
+ }
+ else
+ {
+ /* Store the command in the Message Queue & increment write offset */
+ memcpy ( &ptr_q->ptr_dataq [ptr_q->write_dataq],pitem, \
+ sizeof (struct video_msgq));
+ ptr_q->write_dataq = (ptr_q->write_dataq + 1) % ptr_q->dataq_size;
+ }
+
+ /* Unlock the mutex to release the critical section */
+ pthread_mutex_unlock(&ptr_q->mutex);
+
+ /* Post the semaphore */
+ sem_post(&ptr_q->sem_message);
+ return 1;
+
+}
diff --git a/mm-video/vidc/venc/test/venc_test.cpp b/mm-video/vidc/venc/test/venc_test.cpp
index 7afb5bd..a2db4b3 100644
--- a/mm-video/vidc/venc/test/venc_test.cpp
+++ b/mm-video/vidc/venc/test/venc_test.cpp
@@ -1,5 +1,5 @@
/*--------------------------------------------------------------------------
-Copyright (c) 2010-2013, The Linux Foundation. All rights reserved.
+Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
@@ -8,7 +8,7 @@ modification, are permitted provided that the following conditions are met:
* 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 The Linux Foundation nor
+ * Neither the name of Code Aurora nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
@@ -70,25 +70,22 @@ REFERENCES
#ifdef USE_ION
#include <linux/msm_ion.h>
#endif
-#ifdef _MSM8974_
-#include <media/msm_media_info.h>
-#endif
//////////////////////////
// MACROS
//////////////////////////
-#define CHK(result) if ((result != OMX_ErrorNone) && (result != OMX_ErrorNoMore)) { E("*************** error *************"); exit(0); }
+#define CHK(result) if (result != OMX_ErrorNone) { E("*************** error *************"); exit(0); }
#define TEST_LOG
#ifdef VENC_SYSLOG
-#include <cutils/log.h>
+#include "cutils/log.h"
/// Debug message macro
-#define D(fmt, ...) ALOGE("venc_test Debug %s::%d "fmt, \
+#define D(fmt, ...) LOGE("venc_test Debug %s::%d "fmt"\n", \
__FUNCTION__, __LINE__, \
## __VA_ARGS__)
/// Error message macro
-#define E(fmt, ...) ALOGE("venc_test Error %s::%d "fmt, \
+#define E(fmt, ...) LOGE("venc_test Error %s::%d "fmt"\n", \
__FUNCTION__, __LINE__, \
## __VA_ARGS__)
@@ -135,10 +132,6 @@ static const unsigned int mpeg4_profile_level_table[][5]=
{1200,36000,4000000,OMX_VIDEO_MPEG4Level4a,OMX_VIDEO_MPEG4ProfileSimple},
{1620,40500,8000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
{3600,108000,12000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
-#ifdef _MSM8974_
- {32400,972000,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
- {34560,1036800,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileSimple},
-#endif
{0,0,0,0,0},
{99,1485,128000,OMX_VIDEO_MPEG4Level0,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
@@ -147,10 +140,6 @@ static const unsigned int mpeg4_profile_level_table[][5]=
{396,11880,768000,OMX_VIDEO_MPEG4Level3,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
{792,23760,3000000,OMX_VIDEO_MPEG4Level4,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
{1620,48600,8000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
-#ifdef _MSM8974_
- {32400,972000,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
- {34560,1036800,20000000,OMX_VIDEO_MPEG4Level5,OMX_VIDEO_MPEG4ProfileAdvancedSimple},
-#endif
{0,0,0,0,0},
};
@@ -170,10 +159,6 @@ static const unsigned int h264_profile_level_table[][5]=
{3600,108000,14000000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileBaseline},
{5120,216000,20000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileBaseline},
{8192,245760,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileBaseline},
-#ifdef _MSM8974_
- {32400,972000,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileBaseline},
- {34560,1036800,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileBaseline},
-#endif
{0,0,0,0,0},
{99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileHigh},
@@ -188,10 +173,6 @@ static const unsigned int h264_profile_level_table[][5]=
{3600,108000,17500000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileHigh},
{5120,216000,25000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileHigh},
{8192,245760,25000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileHigh},
-#ifdef _MSM8974_
- {32400,972000,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileHigh},
- {34560,1036800,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileHigh},
-#endif
{0,0,0,0,0},
{99,1485,64000,OMX_VIDEO_AVCLevel1,OMX_VIDEO_AVCProfileMain},
@@ -206,10 +187,6 @@ static const unsigned int h264_profile_level_table[][5]=
{3600,108000,14000000,OMX_VIDEO_AVCLevel31,OMX_VIDEO_AVCProfileMain},
{5120,216000,20000000,OMX_VIDEO_AVCLevel32,OMX_VIDEO_AVCProfileMain},
{8192,245760,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileMain},
-#ifdef _MSM8974_
- {32400,972000,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileMain},
- {34560,1036800,20000000,OMX_VIDEO_AVCLevel4,OMX_VIDEO_AVCProfileMain},
-#endif
{0,0,0,0,0}
};
@@ -226,29 +203,8 @@ static const unsigned int h263_profile_level_table[][5]=
{396,19800,4096000,OMX_VIDEO_H263Level50,OMX_VIDEO_H263ProfileBaseline},
{810,40500,8192000,OMX_VIDEO_H263Level60,OMX_VIDEO_H263ProfileBaseline},
{1620,81000,16384000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
-#ifdef _MSM8974_
- {32400,972000,20000000,OMX_VIDEO_H263Level60,OMX_VIDEO_H263ProfileBaseline},
- {34560,1036800,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
-#endif
- {0,0,0,0,0}
-};
-#ifdef _MSM8974_
-static const unsigned int VP8_profile_level_table[][5]=
-{
- /*max mb per frame, max mb per sec, max bitrate, level, profile*/
- {99,1485,64000,OMX_VIDEO_H263Level10,OMX_VIDEO_H263ProfileBaseline},
- {396,5940,128000,OMX_VIDEO_H263Level20,OMX_VIDEO_H263ProfileBaseline},
- {396,11880,384000,OMX_VIDEO_H263Level30,OMX_VIDEO_H263ProfileBaseline},
- {396,11880,2048000,OMX_VIDEO_H263Level40,OMX_VIDEO_H263ProfileBaseline},
- {99,1485,128000,OMX_VIDEO_H263Level45,OMX_VIDEO_H263ProfileBaseline},
- {396,19800,4096000,OMX_VIDEO_H263Level50,OMX_VIDEO_H263ProfileBaseline},
- {810,40500,8192000,OMX_VIDEO_H263Level60,OMX_VIDEO_H263ProfileBaseline},
- {1620,81000,16384000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
- {32400,972000,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
- {34560,1036800,20000000,OMX_VIDEO_H263Level70,OMX_VIDEO_H263ProfileBaseline},
{0,0,0,0,0}
};
-#endif
#define Log2(number, power) { OMX_U32 temp = number; power = 0; while( (0 == (temp & 0x1)) && power < 16) { temp >>=0x1; power++; } }
#define FractionToQ16(q,num,den) { OMX_U32 power; Log2(den,power); q = num << (16 - power); }
@@ -265,7 +221,7 @@ struct ProfileType
OMX_U32 nFrameWidth;
OMX_U32 nFrameHeight;
OMX_U32 nFrameBytes;
-#ifdef _MSM8974_
+#ifdef BADGER
OMX_U32 nFramestride;
OMX_U32 nFrameScanlines;
OMX_U32 nFrameRead;
@@ -407,7 +363,7 @@ void* PmemMalloc(OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO* pMem, int nSize)
return NULL;
#ifdef USE_ION
- ion_data.ion_device_fd = open (PMEM_DEVICE, O_RDONLY);
+ ion_data.ion_device_fd = open (PMEM_DEVICE,O_RDONLY);
if(ion_data.ion_device_fd < 0)
{
E("\nERROR: ION Device open() Failed");
@@ -417,11 +373,11 @@ void* PmemMalloc(OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO* pMem, int nSize)
ion_data.alloc_data.len = nSize;
ion_data.alloc_data.heap_mask = 0x1 << ION_CP_MM_HEAP_ID;
ion_data.alloc_data.align = 4096;
- ion_data.alloc_data.flags = ION_SECURE;
+ ion_data.alloc_data.flags = 0;
rc = ioctl(ion_data.ion_device_fd,ION_IOC_ALLOC,&ion_data.alloc_data);
if(rc || !ion_data.alloc_data.handle) {
- E("\n ION ALLOC memory failed rc: %d, handle: %p", rc, ion_data.alloc_data.handle);
+ E("\n ION ALLOC memory failed ");
ion_data.alloc_data.handle=NULL;
return NULL;
}
@@ -461,7 +417,7 @@ void* PmemMalloc(OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO* pMem, int nSize)
#endif
return NULL;
}
- D("allocated pMem->fd = %lu pvirt=0x%p, pMem->phys=0x%lx, size = %d", pMem->pmem_fd,
+ D("allocated pMem->fd = %d pvirt=0x%x, pMem->phys=0x%x, size = %d", pMem->pmem_fd,
pvirt, pMem->offset, nSize);
return pvirt;
}
@@ -489,41 +445,41 @@ int PmemFree(OMX_QCOM_PLATFORM_PRIVATE_PMEM_INFO* pMem, void* pvirt, int nSize)
}
void PrintFramePackArrangement(OMX_QCOM_FRAME_PACK_ARRANGEMENT framePackingArrangement)
{
- printf("id (%lu)\n",
+ printf("id (%d)\n",
framePackingArrangement.id);
- printf("cancel_flag (%lu)\n",
+ printf("cancel_flag (%d)\n",
framePackingArrangement.cancel_flag);
- printf("type (%lu)\n",
+ printf("type (%d)\n",
framePackingArrangement.type);
- printf("quincunx_sampling_flag (%lu)\n",
+ printf("quincunx_sampling_flag (%d)\n",
framePackingArrangement.quincunx_sampling_flag);
- printf("content_interpretation_type (%lu)\n",
+ printf("content_interpretation_type (%d)\n",
framePackingArrangement.content_interpretation_type);
- printf("spatial_flipping_flag (%lu)\n",
+ printf("spatial_flipping_flag (%d)\n",
framePackingArrangement.spatial_flipping_flag);
- printf("frame0_flipped_flag (%lu)\n",
+ printf("frame0_flipped_flag (%d)\n",
framePackingArrangement.frame0_flipped_flag);
- printf("field_views_flag (%lu)\n",
+ printf("field_views_flag (%d)\n",
framePackingArrangement.field_views_flag);
- printf("current_frame_is_frame0_flag (%lu)\n",
+ printf("current_frame_is_frame0_flag (%d)\n",
framePackingArrangement.current_frame_is_frame0_flag);
- printf("frame0_self_contained_flag (%lu)\n",
+ printf("frame0_self_contained_flag (%d)\n",
framePackingArrangement.frame0_self_contained_flag);
- printf("frame1_self_contained_flag (%lu)\n",
+ printf("frame1_self_contained_flag (%d)\n",
framePackingArrangement.frame1_self_contained_flag);
- printf("frame0_grid_position_x (%lu)\n",
+ printf("frame0_grid_position_x (%d)\n",
framePackingArrangement.frame0_grid_position_x);
- printf("frame0_grid_position_y (%lu)\n",
+ printf("frame0_grid_position_y (%d)\n",
framePackingArrangement.frame0_grid_position_y);
- printf("frame1_grid_position_x (%lu)\n",
+ printf("frame1_grid_position_x (%d)\n",
framePackingArrangement.frame1_grid_position_x);
- printf("frame1_grid_position_y (%lu)\n",
+ printf("frame1_grid_position_y (%d)\n",
framePackingArrangement.frame1_grid_position_y);
- printf("reserved_byte (%lu)\n",
+ printf("reserved_byte (%d)\n",
framePackingArrangement.reserved_byte);
- printf("repetition_period (%lu)\n",
+ printf("repetition_period (%d)\n",
framePackingArrangement.repetition_period);
- printf("extension_flag (%lu)\n",
+ printf("extension_flag (%d)\n",
framePackingArrangement.extension_flag);
}
void SetState(OMX_STATETYPE eState)
@@ -576,7 +532,7 @@ OMX_ERRORTYPE ConfigureEncoder()
portdef.format.video.nFrameWidth = m_sProfile.nFrameWidth;
portdef.format.video.nFrameHeight = m_sProfile.nFrameHeight;
- E ("\n Height %lu width %lu bit rate %lu",portdef.format.video.nFrameHeight
+ E ("\n Height %d width %d bit rate %d",portdef.format.video.nFrameHeight
,portdef.format.video.nFrameWidth,portdef.format.video.nBitrate);
result = OMX_SetParameter(m_hHandle,
OMX_IndexParamPortDefinition,
@@ -633,27 +589,22 @@ result = OMX_SetParameter(m_hHandle,
{
profile_tbl = (unsigned int const *)h263_profile_level_table;
}
-#ifdef _MSM8974_
- else if(m_sProfile.eCodec == OMX_VIDEO_CodingVPX)
- {
- profile_tbl = (unsigned int const *)VP8_profile_level_table;
- }
-#endif
+
mb_per_frame = ((m_sProfile.nFrameHeight+15)>>4)*
((m_sProfile.nFrameWidth+15)>>4);
mb_per_sec = mb_per_frame*(m_sProfile.nFramerate);
do{
- if(mb_per_frame <= (unsigned int)profile_tbl[0])
+ if(mb_per_frame <= (int)profile_tbl[0])
{
- if(mb_per_sec <= (unsigned int)profile_tbl[1])
+ if(mb_per_sec <= (int)profile_tbl[1])
{
- if(m_sProfile.nBitrate <= (unsigned int)profile_tbl[2])
+ if(m_sProfile.nBitrate <= (int)profile_tbl[2])
{
eLevel = (int)profile_tbl[3];
eProfile = (int)profile_tbl[4];
- E("\n profile/level found: %lu/%lu\n",eProfile, eLevel);
+ E("\n profile/level found: %d/%d\n",eProfile/eLevel);
profile_level_found = true;
break;
}
@@ -714,7 +665,7 @@ result = OMX_SetParameter(m_hHandle,
OMX_IndexParamVideoProfileLevelCurrent,
&profileLevel);
E("\n OMX_IndexParamVideoProfileLevelCurrent Get Paramter port");
- D ("\n Profile = %lu level = %lu",profileLevel.eProfile,profileLevel.eLevel);
+ D ("\n Profile = %d level = %d",profileLevel.eProfile,profileLevel.eLevel);
CHK(result);
if (m_sProfile.eCodec == OMX_VIDEO_CodingMPEG4)
@@ -840,8 +791,7 @@ result = OMX_SetParameter(m_hHandle,
else if (m_sProfile.eCodec == OMX_VIDEO_CodingH263)
{
//H263
- //eResyncMarkerType = RESYNC_MARKER_GOB;
- eResyncMarkerType = RESYNC_MARKER_NONE;
+ eResyncMarkerType = RESYNC_MARKER_GOB;
nResyncMarkerSpacing = 0;
}
else if (m_sProfile.eCodec == OMX_VIDEO_CodingAVC)
@@ -865,8 +815,8 @@ result = OMX_SetParameter(m_hHandle,
}
else
{
- eResyncMarkerType = RESYNC_MARKER_NONE;
- nResyncMarkerSpacing = 0;
+ eResyncMarkerType = RESYNC_MARKER_MB;
+ nResyncMarkerSpacing = 50;
}
}
@@ -1227,16 +1177,6 @@ OMX_ERRORTYPE VencTest_Initialize()
&sCallbacks);
CHK(result);
}
-#ifdef _MSM8974_
- else if (m_sProfile.eCodec == OMX_VIDEO_CodingVPX)
- {
- result = OMX_GetHandle(&m_hHandle,
- "OMX.qcom.video.encoder.vp8",
- NULL,
- &sCallbacks);
- CHK(result);
- }
-#endif
else
{
result = OMX_GetHandle(&m_hHandle,
@@ -1490,45 +1430,24 @@ OMX_ERRORTYPE VencTest_ReadAndEmpty(OMX_BUFFERHEADERTYPE* pYUVBuffer)
{
OMX_ERRORTYPE result = OMX_ErrorNone;
#ifdef T_ARM
-#if defined(MAX_RES_720P) && !defined(_MSM8974_)
+#ifdef MAX_RES_720P
if (read(m_nInFd,
pYUVBuffer->pBuffer,
m_sProfile.nFrameBytes) != m_sProfile.nFrameBytes)
{
return OMX_ErrorUndefined;
}
-#elif _MSM8974_
- int i, lscanl, lstride, cscanl, cstride, height, width;
- int bytes = 0, read_bytes = 0;
- OMX_U8 *yuv = pYUVBuffer->pBuffer;
- height = m_sProfile.nFrameHeight;
- width = m_sProfile.nFrameWidth;
- lstride = VENUS_Y_STRIDE(COLOR_FMT_NV12, width);
- lscanl = VENUS_Y_SCANLINES(COLOR_FMT_NV12, height);
- cstride = VENUS_UV_STRIDE(COLOR_FMT_NV12, width);
- cscanl = VENUS_UV_SCANLINES(COLOR_FMT_NV12, height);
-
- for(i = 0; i < height; i++) {
- bytes = read(m_nInFd, yuv, width);
- if (bytes != width) {
- E("read failed: %d != %d\n", read, width);
- return OMX_ErrorUndefined;
- }
- read_bytes += bytes;
- yuv += lstride;
- }
- yuv = pYUVBuffer->pBuffer + (lscanl * lstride);
- for (i = 0; i < ((height + 1) >> 1); i++) {
- bytes = read(m_nInFd, yuv, width);
- if (bytes != width) {
- E("read failed: %d != %d\n", read, width);
- return OMX_ErrorUndefined;
- }
- read_bytes += bytes;
- yuv += cstride;
- }
- m_sProfile.nFrameRead = VENUS_BUFFER_SIZE(COLOR_FMT_NV12, width, height);
- E("\n\nActual read bytes: %d, NV12 buffer size: %d\n\n\n", read_bytes, m_sProfile.nFrameRead);
+#elif BADGER
+ int bytes;
+ E("will read YUV now: %d bytes to buffer %p\n", m_sProfile.nFrameRead, pYUVBuffer->pBuffer);
+ E("W: %d H: %d Str: %d scal: %d \n", m_sProfile.nFrameWidth, m_sProfile.nFrameHeight,
+ m_sProfile.nFramestride, m_sProfile.nFrameScanlines);
+ bytes = read(m_nInFd, pYUVBuffer->pBuffer, m_sProfile.nFrameRead);
+ if (bytes != m_sProfile.nFrameRead) {
+ E("read failed: %d != %d\n", read, m_sProfile.nFrameRead);
+ return OMX_ErrorUndefined;
+ }
+ E("\n\nRead %d bytes\n\n\n", m_sProfile.nFrameRead);
#else
OMX_U32 bytestoread = m_sProfile.nFrameWidth*m_sProfile.nFrameHeight;
// read Y first
@@ -1569,7 +1488,7 @@ OMX_ERRORTYPE VencTest_ReadAndEmpty(OMX_BUFFERHEADERTYPE* pYUVBuffer)
D("about to call VencTest_EncodeFrame...");
pthread_mutex_lock(&m_mutex);
++m_nFrameIn;
-#ifdef _MSM8974_
+#ifdef BADGER
pYUVBuffer->nFilledLen = m_sProfile.nFrameRead;
#else
pYUVBuffer->nFilledLen = m_sProfile.nFrameBytes;
@@ -1927,22 +1846,6 @@ void parseArgs(int argc, char** argv)
m_sProfile.nFrameBytes = 1920*1080*3/2;
m_sProfile.eLevel = OMX_VIDEO_MPEG4Level1;
}
-#ifdef _MSM8974_
- else if (strcmp("4K2K", argv[2]) == 0)
- {
- m_sProfile.nFrameWidth = 4096;
- m_sProfile.nFrameHeight = 2160;
- m_sProfile.nFrameBytes = 4096*2160*3/2;
- m_sProfile.eLevel = OMX_VIDEO_MPEG4Level1;
- }
- else if (strcmp("2160P", argv[2]) == 0)
- {
- m_sProfile.nFrameWidth = 3840;
- m_sProfile.nFrameHeight = 2160;
- m_sProfile.nFrameBytes = 3840*2160*3/2;
- m_sProfile.eLevel = OMX_VIDEO_MPEG4Level1;
- }
-#endif
else if (parseWxH(argv[2], &m_sProfile.nFrameWidth, &m_sProfile.nFrameHeight))
{
m_sProfile.nFrameBytes = m_sProfile.nFrameWidth*m_sProfile.nFrameHeight*3/2;
@@ -1953,10 +1856,12 @@ void parseArgs(int argc, char** argv)
usage(argv[0]);
}
-#ifdef _MSM8974_
+#ifdef BADGER
m_sProfile.nFramestride = (m_sProfile.nFrameWidth + 31) & (~31);
m_sProfile.nFrameScanlines = (m_sProfile.nFrameHeight + 31) & (~31);
m_sProfile.nFrameBytes = ((m_sProfile.nFramestride * m_sProfile.nFrameScanlines * 3/2) + 4095) & (~4095);
+ E("stride: %d, Scanlines: %d, Size: %d",
+ m_sProfile.nFramestride, m_sProfile.nFrameScanlines, m_sProfile.nFrameBytes);
m_sProfile.nFrameRead = m_sProfile.nFramestride * m_sProfile.nFrameScanlines * 3/2;
#endif
if (m_eMode == MODE_DISPLAY ||
@@ -1982,12 +1887,6 @@ void parseArgs(int argc, char** argv)
{
m_sProfile.eCodec = OMX_VIDEO_CodingAVC;
}
-#ifdef _MSM8974_
- else if ((!strcmp(argv[3], "VP8")) || (!strcmp(argv[3], "vp8")))
- {
- m_sProfile.eCodec = OMX_VIDEO_CodingVPX;
- }
-#endif
else
{
usage(argv[0]);
@@ -2036,21 +1935,13 @@ int main(int argc, char** argv)
m_nFrameOut = 0;
memset(&m_sMsgQ, 0, sizeof(MsgQ));
- memset(&m_sProfile, 0, sizeof(m_sProfile));
parseArgs(argc, argv);
- D("fps=%f, bitrate=%u, width=%u, height=%u, frame bytes=%u",
+ D("fps=%d, bitrate=%d, width=%d, height=%d",
m_sProfile.nFramerate,
m_sProfile.nBitrate,
m_sProfile.nFrameWidth,
- m_sProfile.nFrameHeight,
- m_sProfile.nFrameBytes);
-#ifdef _MSM8974_
- D("Frame stride=%u, scanlines=%u, read=%u",
- m_sProfile.nFramestride,
- m_sProfile.nFrameScanlines,
- m_sProfile.nFrameRead);
-#endif
+ m_sProfile.nFrameHeight);
//if (m_eMode != MODE_PREVIEW && m_eMode != MODE_DISPLAY)
@@ -2162,7 +2053,8 @@ int main(int argc, char** argv)
result = OMX_GetParameter(m_hHandle, OMX_IndexParamPortDefinition, &portDef);
CHK(result);
- D("allocating & calling usebuffer for Output port");
+ D("allocating output buffers");
+ D("Calling UseBuffer for Output port");
num_out_buffers = portDef.nBufferCountActual;
for (i = 0; i < portDef.nBufferCountActual; i++)
{
diff --git a/mm-video/vidc/venc/test/venc_util.c b/mm-video/vidc/venc/test/venc_util.c
index 4e4688e..ed7f976 100644
--- a/mm-video/vidc/venc/test/venc_util.c
+++ b/mm-video/vidc/venc/test/venc_util.c
@@ -1,51 +1,51 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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.
---------------------------------------------------------------------------*/
-/*============================================================================
- V E N C _ U T I L. C
-
-DESCRIPTION
-
-
-REFERENCES
-
-============================================================================*/
-
-#include "venc_util.h"
-#include <time.h>
-#include <sys/time.h>
-
-long long GetTimeStamp()
-{
- struct timeval tv;
- long long microsec;
- gettimeofday(&tv, NULL);
- microsec = (tv.tv_sec * 1000000) + (tv.tv_usec);
- return microsec;
-
-}
-
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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.
+--------------------------------------------------------------------------*/
+/*============================================================================
+ V E N C _ U T I L. C
+
+DESCRIPTION
+
+
+REFERENCES
+
+============================================================================*/
+
+#include "venc_util.h"
+#include <time.h>
+#include <sys/time.h>
+
+long long GetTimeStamp()
+{
+ struct timeval tv;
+ long long microsec;
+ gettimeofday(&tv, NULL);
+ microsec = (tv.tv_sec * 1000000) + (tv.tv_usec);
+ return microsec;
+
+}
+
diff --git a/mm-video/vidc/venc/test/video_encoder_test.c b/mm-video/vidc/venc/test/video_encoder_test.c
index 567d081..f32214c 100644
--- a/mm-video/vidc/venc/test/video_encoder_test.c
+++ b/mm-video/vidc/venc/test/video_encoder_test.c
@@ -1,1064 +1,1064 @@
-/*--------------------------------------------------------------------------
-Copyright (c) 2010-2011, The Linux Foundation. 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 The Linux Foundation 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, FITNESS FOR A PARTICULAR PURPOSE AND
-NON-INFRINGEMENT 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 "video_encoder_test.h"
-
-#define DEBUG_PRINT printf
-/************************************************************************/
-/* #DEFINES */
-/************************************************************************/
-
-#define VOP_START_CODE 0x000001B6
-#define SHORT_HEADER_START_CODE 0x00008000
-#define H264_START_CODE 0x00000001
-
-/************************************************************************/
-/* STATIC VARIABLES */
-/************************************************************************/
-
-static int Code_type;
-static int total_frames = 0;
-static unsigned int header_code = 0;
-static pthread_mutex_t read_lock;
-
-static unsigned int read_frame ( unsigned char *dataptr,unsigned int length,
- FILE * inputBufferFile
- );
-static unsigned clp2(unsigned x)
-{
- x = x - 1;
- x = x | (x >> 1);
- x = x | (x >> 2);
- x = x | (x >> 4);
- x = x | (x >> 8);
- x = x | (x >>16);
- return x + 1;
-}
-
-
-static void* video_thread (void *);
-static void* async_thread (void *);
-
-
-
-int main (int argc, char **argv)
-{
- struct video_encoder_context *encoder_context = NULL;
- char *file_name = NULL;
- FILE *file_ptr = NULL;
- int temp1 =0,temp2 =0;
- int error = 1;
- unsigned int i = 0;
-
- file_name = argv [1];
- file_ptr = fopen (file_name,"rb");
-
- if (file_ptr == NULL)
- {
- DEBUG_PRINT("\n File is not located ");
- return -1;
- }
-
-
- encoder_context = (struct video_encoder_context *) \
- calloc (sizeof (struct video_encoder_context),1);
- if (encoder_context == NULL)
- {
- return -1;
- }
- encoder_context->outputBufferFile = NULL;
- encoder_context->inputBufferFile = NULL;
- encoder_context->video_driver_fd = -1;
- encoder_context->inputBufferFile = file_ptr;
- encoder_context->input_width = 176;
- encoder_context->input_height = 144;
- encoder_context->codectype = VEN_CODEC_MPEG4;
- encoder_context->fps_num = 60;
- encoder_context->fps_den = 2;
- encoder_context->inputformat = VEN_INPUTFMT_NV12;
- encoder_context->targetbitrate = 128000;
-
- file_ptr = fopen ("/data/output.m4v","wb");
- if (file_ptr == NULL)
- {
- DEBUG_PRINT("\n File can't be created");
- free (encoder_context);
- return -1;
- }
- encoder_context->outputBufferFile = file_ptr;
-
- switch (atoi(argv[2]))
- {
- case 0:
- DEBUG_PRINT("\n MPEG4 codec selected");
- encoder_context->codectype = VEN_CODEC_MPEG4;
- Code_type = 0;
- break;
- case 1:
- DEBUG_PRINT("\n H.263");
- encoder_context->codectype = VEN_CODEC_H263;
- Code_type = 0;
- break;
- case 2:
- DEBUG_PRINT("\n H.264");
- encoder_context->codectype = VEN_CODEC_H264;
- Code_type = 1;
- break;
- default:
- DEBUG_PRINT("\n Wrong codec type");
- error = -1;
- break;
- }
-
- if (error != -1)
- {
- temp1 = atoi(argv[3]);
- temp2 = atoi(argv[4]);
-
- if (((temp1%16) != 0) || ((temp2%16) != 0))
- {
- error = -1;
- }
- else
- {
- encoder_context->input_width = temp1;
- encoder_context->input_height = temp2;
- }
- }
-
- switch (atoi(argv[5]))
- {
- case 0:
- DEBUG_PRINT("\n No Sink");
- encoder_context->outputBufferFile = NULL;
- break;
- }
-
- if (error != -1)
- {
- encoder_context->targetbitrate = atoi (argv[6]);
- }
-
- if ( error != -1 && (init_encoder (encoder_context) == -1 ))
- {
- DEBUG_PRINT("\n Init decoder fails ");
- error = -1;
- }
- DEBUG_PRINT("\n Decoder open successfull");
-
-
- /*Allocate input and output buffers*/
- if (error != -1 && (allocate_buffer (0,encoder_context)== -1))
- {
- DEBUG_PRINT("\n Error in input Buffer allocation");
- error = -1;
- }
-
- if (error != -1 && (allocate_buffer (1,encoder_context)== -1))
- {
- DEBUG_PRINT("\n Error in output Buffer allocation");
- error = -1;
- }
-
-
- if (error != -1 && (start_encoding (encoder_context) == -1))
- {
- DEBUG_PRINT("\n Error in start decoding call");
- error = -1;
- }
-
- if (error != -1 && (stop_encoding (encoder_context) == -1))
- {
- DEBUG_PRINT("\n Error in stop decoding call");
- error = -1;
- }
-
- DEBUG_PRINT("\n De-init the decoder");
- if ((deinit_encoder (encoder_context) == -1))
- {
- error = -1;
- }
-
-
- (void)free_buffer (INPUT_BUFFER,encoder_context);
- (void)free_buffer (OUTPUT_BUFFER,encoder_context);
-
- if (encoder_context->inputBufferFile != NULL)
- {
- fclose (encoder_context->inputBufferFile);
- }
- if (encoder_context->outputBufferFile != NULL)
- {
- fclose (encoder_context->outputBufferFile);
- }
- DEBUG_PRINT ("\n Total Number of frames decoded %d",total_frames);
- DEBUG_PRINT("\n closing the driver");
- free (encoder_context);
-
- return error;
-}
-
-int init_encoder ( struct video_encoder_context *init_decode )
-{
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- struct venc_basecfg basecfg;
- struct video_queue_context *queue_ptr = NULL;
- struct venc_ratectrlcfg ratecrl;
- pthread_mutexattr_t init_values;
- struct venc_profile profile;
- struct ven_profilelevel profilelevel;
-
- DEBUG_PRINT("\n Before calling the open");
-
- init_decode->video_driver_fd = open ("/dev/msm_vidc_enc", \
- O_RDWR | O_NONBLOCK);
-
-
-
- if (init_decode->video_driver_fd < 0)
- {
- DEBUG_PRINT("\n Open failed");
- return -1;
- }
-
- basecfg.codectype = init_decode->codectype;
- basecfg.dvs_height = 0;
- basecfg.dvs_width = 0;
- basecfg.fps_den = init_decode->fps_den;
- basecfg.fps_num = init_decode->fps_num;
- basecfg.input_height = init_decode->input_height;
- basecfg.input_width = init_decode->input_width;
- basecfg.inputformat = init_decode->inputformat;
- basecfg.targetbitrate = init_decode->targetbitrate;
-
- /*Initialize Decoder with codec type and resolution*/
- ioctl_msg.in = &basecfg;
- ioctl_msg.out = NULL;
-
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_BASE_CFG,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set base config type failed");
- return -1;
- }
-
- /*Initialize Decoder with codec type and resolution*/
- DEBUG_PRINT ("\n Switch off rate control");
- ioctl_msg.in = &ratecrl;
- ioctl_msg.out = NULL;
- ratecrl.rcmode = VEN_RC_OFF;
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_RATE_CTRL_CFG,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set rate control failed");
- return -1;
- }
-
- if (basecfg.codectype == VEN_CODEC_H264)
- {
- DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
- ioctl_msg.in = &profile;
- ioctl_msg.out = NULL;
- profile.profile = VEN_PROFILE_H264_BASELINE;
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_CODEC_PROFILE,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
- return -1;
- }
-
- DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
- ioctl_msg.in = &profilelevel;
- ioctl_msg.out = NULL;
- profilelevel.level = VEN_LEVEL_H264_1p1;
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_PROFILE_LEVEL,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
- return -1;
- }
-
- if (basecfg.input_width > 720)
- {
- DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
- ioctl_msg.in = &profile;
- ioctl_msg.out = NULL;
- profile.profile = VEN_PROFILE_H264_HIGH;
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_CODEC_PROFILE,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
- return -1;
- }
-
- DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
- ioctl_msg.in = &profilelevel;
- ioctl_msg.out = NULL;
- profilelevel.level = VEN_LEVEL_H264_3p1;
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_PROFILE_LEVEL,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
- return -1;
- }
- }
- }
-
- DEBUG_PRINT("\n Query Input bufffer requirements");
- /*Get the Buffer requirements for input and output ports*/
-
-
-
- ioctl_msg.in = NULL;
- ioctl_msg.out = &init_decode->input_buffer;
-
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_GET_INPUT_BUFFER_REQ,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Requesting for input buffer requirements failed");
- return -1;
- }
-
- DEBUG_PRINT("\n input Size=%d min count =%d actual count = %d", \
- (int)init_decode->input_buffer.datasize,\
- (int)init_decode->input_buffer.mincount,\
- (int)init_decode->input_buffer.actualcount);
-
-
- ioctl_msg.in = &init_decode->input_buffer;
- ioctl_msg.out = NULL;
- init_decode->input_buffer.actualcount = init_decode->input_buffer.mincount + 2;
-
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_INPUT_BUFFER_REQ,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Set Buffer Requirements Failed");
- return -1;
- }
-
-
- DEBUG_PRINT("\n Query output bufffer requirements");
- ioctl_msg.in = NULL;
- ioctl_msg.out = &init_decode->output_buffer;
-
- if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_GET_OUTPUT_BUFFER_REQ,
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Requesting for output buffer requirements failed");
- return -1;
- }
-
- DEBUG_PRINT("\n output Size=%d min count =%d actual count = %d", \
- (int)init_decode->output_buffer.datasize,\
- (int)init_decode->output_buffer.mincount,\
- (int)init_decode->output_buffer.actualcount);
-
- /*Create Queue related data structures*/
- queue_ptr = &init_decode->queue_context;
- queue_ptr->commandq_size = 50;
- queue_ptr->dataq_size = 50;
-
- sem_init(&queue_ptr->sem_message,0, 0);
- sem_init(&init_decode->sem_synchronize,0, 0);
-
- pthread_mutexattr_init (&init_values);
- pthread_mutex_init (&queue_ptr->mutex,&init_values);
- pthread_mutex_init (&read_lock,&init_values);
- DEBUG_PRINT("\n create Queues");
- queue_ptr->ptr_cmdq = (struct video_msgq*) \
- calloc (sizeof (struct video_msgq),
- queue_ptr->commandq_size);
- queue_ptr->ptr_dataq = (struct video_msgq*) \
- calloc (sizeof (struct video_msgq),
- queue_ptr->dataq_size
- );
-
- if ( queue_ptr->ptr_cmdq == NULL ||
- queue_ptr->ptr_dataq == NULL
- )
- {
- return -1;
- }
- DEBUG_PRINT("\n create Threads");
- /*Create two threads*/
- if ( (pthread_create (&init_decode->videothread_id,NULL,video_thread,
- init_decode) < 0) ||
- (pthread_create (&init_decode->asyncthread_id,NULL,async_thread,
- init_decode) < 0)
- )
- {
- return -1;
- }
-
- return 1;
-}
-
-
-
-int free_buffer ( unsigned int buffer_dir,
- struct video_encoder_context *encoder_context
- )
-{
- unsigned int buffercount = 0,i=0;
- struct venc_bufferpayload **ptemp = NULL;
-
- if (encoder_context == NULL)
- {
- return -1;
- }
-
- if (buffer_dir == INPUT_BUFFER && encoder_context->ptr_inputbuffer)
- {
- buffercount = encoder_context->input_buffer.actualcount;
- ptemp = encoder_context->ptr_inputbuffer;
-
- for (i=0;i<buffercount;i++)
- {
- if (ptemp [i])
- {
- if (ptemp [i]->fd != -1)
- {
- munmap ( ptemp [i]->pbuffer,ptemp [i]->maped_size);
- ptemp [i]->pbuffer = NULL;
- close (ptemp [i]->fd);
- }
- free (ptemp [i]);
- ptemp [i] = NULL;
- }
- }
- free (encoder_context->ptr_inputbuffer);
- encoder_context->ptr_inputbuffer = NULL;
- }
- else if ( buffer_dir == OUTPUT_BUFFER && encoder_context->ptr_outputbuffer )
- {
- buffercount = encoder_context->output_buffer.actualcount;
- ptemp = encoder_context->ptr_outputbuffer;
-
- if (ptemp)
- {
- for (i=0;i<buffercount;i++)
- {
- if (ptemp [i])
- {
- if (ptemp [i]->fd != -1)
- {
- munmap ( ptemp [i]->pbuffer,ptemp [i]->maped_size);
- ptemp [i]->pbuffer = NULL;
- close (ptemp [i]->fd);
- }
- free (ptemp [i]);
- ptemp [i] = NULL;
- }
- }
- free (ptemp);
- encoder_context->ptr_outputbuffer = NULL;
- }
- }
-
- return 1;
-}
-
-int allocate_buffer ( unsigned int buffer_dir,
- struct video_encoder_context *encoder_context
- )
-{
- struct venc_bufferpayload **ptemp = NULL;
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- unsigned int buffercount = 0,i=0,alignedsize=0;
- unsigned int buffersize = 0;
-
- if ( encoder_context == NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: context is NULL");
- return -1;
- }
-
- if ( buffer_dir == INPUT_BUFFER )
- {
- /*Check if buffers are allocated*/
- if (encoder_context->ptr_inputbuffer != NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: encoder_context->ptr_inputbuffer is set");
- return -1;
- }
-
- buffercount = encoder_context->input_buffer.actualcount;
- alignedsize = encoder_context->input_buffer.alignment;
- buffersize = encoder_context->input_buffer.datasize;
- buffersize = (buffersize + alignedsize) & (~alignedsize);
- }
- else if (buffer_dir == OUTPUT_BUFFER)
- {
- /*Check if buffers are allocated*/
- if (encoder_context->ptr_outputbuffer != NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: Double allcoate output");
- return -1;
- }
-
- buffercount = encoder_context->output_buffer.actualcount;
- alignedsize = encoder_context->output_buffer.alignment;
- buffersize = encoder_context->output_buffer.datasize;
- buffersize = (buffersize + alignedsize) & (~alignedsize);
-
- }
- else
- {
- DEBUG_PRINT ("\nallocate_buffer: Wrong buffer directions");
- return -1;
- }
-
- ptemp = (struct venc_bufferpayload **)\
- calloc (sizeof (struct venc_bufferpayload *),buffercount);
-
- if (ptemp == NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: venc_bufferpayload failure");
- return -1;
- }
-
-
- if (buffer_dir == OUTPUT_BUFFER)
- {
- DEBUG_PRINT ("\nallocate_buffer: OUT");
- encoder_context->ptr_outputbuffer = ptemp;
- }
- else
- {
- DEBUG_PRINT ("\nallocate_buffer: IN");
- encoder_context->ptr_inputbuffer = ptemp;
- }
-
- /*Allocate buffer headers*/
- for (i=0; i< buffercount; i++)
- {
- ptemp [i] = (struct venc_bufferpayload*)\
- calloc (sizeof (struct venc_bufferpayload),1);
-
- if (ptemp [i] == NULL)
- {
- DEBUG_PRINT ("\nallocate_buffer: ptemp [i] calloc failure");
- return -1;
- }
- ptemp [i]->fd = -1;
- }
-
- for (i=0; i< buffercount; i++)
- {
- ptemp [i]->fd = open ("/dev/pmem_adsp",O_RDWR);
-
- if (ptemp [i]->fd < 0)
- {
- DEBUG_PRINT ("\nallocate_buffer: open pmem_adsp failed");
- return -1;
- }
-
- ptemp [i]->pbuffer = mmap(NULL,clp2(buffersize),PROT_READ|PROT_WRITE,
- MAP_SHARED,ptemp [i]->fd,0);
- DEBUG_PRINT ("\n pmem fd = %d virt addr = %p",ptemp [i]->fd,\
- ptemp [i]->pbuffer);
- if (ptemp [i]->pbuffer == MAP_FAILED)
- {
- ptemp [i]->pbuffer = NULL;
- DEBUG_PRINT ("\nallocate_buffer: MMAP failed");
- return -1;
- }
- ptemp [i]->sz = buffersize;
- ptemp [i]->maped_size = clp2 (buffersize);
-
- ioctl_msg.in = ptemp [i];
- ioctl_msg.out = NULL;
-
- if (buffer_dir == OUTPUT_BUFFER)
- {
- if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_SET_OUTPUT_BUFFER,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT ("\nallocate_buffer: Set Output Buffer IOCTL failed");
- return -1;
- }
- }
- else
- {
- if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_SET_INPUT_BUFFER,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT ("\nallocate_buffer: Set input Buffer IOCTL failed");
- return -1;
- }
- }
-
- }
- DEBUG_PRINT ("\nallocate_buffer: Success");
- return 1;
-}
-
-
-
-int start_encoding (struct video_encoder_context *encoder_context)
-{
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- struct venc_buffer enc_buffer;
- unsigned int i = 0;
- unsigned int data_len =0;
-
-
- if (encoder_context == NULL)
- {
- return -1;
- }
-
- if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_CMD_START,
- NULL) < 0)
- {
- DEBUG_PRINT("\n Start failed");
- return -1;
- }
-
- DEBUG_PRINT("\n Start Issued successfully waiting for Start Done");
- /*Wait for Start command response*/
- sem_wait (&encoder_context->sem_synchronize);
-
- /*Push output Buffers*/
- i = 0;
- while (i < encoder_context->output_buffer.actualcount)
- {
- enc_buffer.clientdata = (void *)encoder_context->ptr_outputbuffer [i];
- enc_buffer.flags = 0;
- enc_buffer.sz = encoder_context->ptr_outputbuffer [i]->sz;
- enc_buffer.len = 0;
- enc_buffer.ptrbuffer = encoder_context->ptr_outputbuffer [i]->pbuffer;
- enc_buffer.offset = 0;
- enc_buffer.timestamp = 0;
-
- DEBUG_PRINT ("\n Client Data on output = %p",(void *)enc_buffer.clientdata);
- ioctl_msg.in = &enc_buffer;
- ioctl_msg.out = NULL;
-
- if (ioctl (encoder_context->video_driver_fd,
- VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n fill output frame failed");
- return -1;
- }
- i++;
- }
-
-
- /*push input buffers*/
- i = 0;
- while (i < encoder_context->input_buffer.actualcount)
- {
- DEBUG_PRINT("\n Read Frame from File");
-
- enc_buffer.clientdata = (void *)encoder_context->ptr_inputbuffer [i];
- enc_buffer.flags = 0;
- enc_buffer.sz = encoder_context->ptr_inputbuffer [i]->sz;
- enc_buffer.len = 0;
- enc_buffer.ptrbuffer = encoder_context->ptr_inputbuffer [i]->pbuffer;
- enc_buffer.offset = 0;
- enc_buffer.timestamp = total_frames *
- ((encoder_context->fps_den * 1000000)/encoder_context->fps_num);
- enc_buffer.len = (encoder_context->input_height *
- encoder_context->input_width *3)/2;
- data_len = read_frame ( enc_buffer.ptrbuffer,
- enc_buffer.len,
- encoder_context->inputBufferFile);
- if (data_len == 0)
- {
- DEBUG_PRINT("\n Length is zero error");
- return -1;
- }
- enc_buffer.len = data_len;
- DEBUG_PRINT("\n Read Frame from File szie = %d",(int)data_len);
-
- DEBUG_PRINT ("\n Client Data on output = %p",(void *)enc_buffer.clientdata);
- ioctl_msg.in = &enc_buffer;
- ioctl_msg.out = NULL;
-
- if (ioctl (encoder_context->video_driver_fd,
- VEN_IOCTL_CMD_ENCODE_FRAME,&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Encode input frame failed");
- return -1;
- }
- total_frames++;
- i++;
- }
- DEBUG_PRINT ("\n Wait for EOS");
- /*Wait for EOS or Error condition*/
- sem_wait (&encoder_context->sem_synchronize);
- DEBUG_PRINT ("\n Reached EOS");
-
- return 1;
-}
-
-int stop_encoding (struct video_encoder_context *encoder_context)
-{
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- struct venc_bufferflush buffer_flush;
-
- if (encoder_context == NULL)
- {
- return -1;
- }
- buffer_flush.flush_mode = VEN_FLUSH_INPUT;
- ioctl_msg.in = &buffer_flush;
- ioctl_msg.out = NULL;
-
- if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_FLUSH,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Flush input failed");
- }
- else
- {
- sem_wait (&encoder_context->sem_synchronize);
- }
-
- buffer_flush.flush_mode = VEN_FLUSH_OUTPUT;
- ioctl_msg.in = &buffer_flush;
- ioctl_msg.out = NULL;
-
- if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_FLUSH,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Flush output failed");
- }
- else
- {
- sem_wait (&encoder_context->sem_synchronize);
- }
-
- DEBUG_PRINT("\n Stop VEN_IOCTL_CMD_STOP");
- if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_STOP,NULL) < 0)
- {
- DEBUG_PRINT("\n Stop failed");
- }
- else
- {
- sem_wait (&encoder_context->sem_synchronize);
- }
- return 1;
-}
-
-int deinit_encoder (struct video_encoder_context *init_decode)
-{
- if (init_decode == NULL)
- {
- return -1;
- }
-
- /*Close the driver*/
- if (init_decode->video_driver_fd != -1)
- {
- close (init_decode->video_driver_fd);
- }
-
- if (init_decode->queue_context.ptr_cmdq)
- {
- free (init_decode->queue_context.ptr_cmdq);
- init_decode->queue_context.ptr_cmdq = NULL;
- }
-
- if (init_decode->queue_context.ptr_dataq)
- {
- free (init_decode->queue_context.ptr_dataq);
- init_decode->queue_context.ptr_dataq = NULL;
- }
-
- sem_destroy (&init_decode->queue_context.sem_message);
- sem_destroy (&init_decode->sem_synchronize);
-
- pthread_mutex_destroy(&init_decode->queue_context.mutex);
- pthread_mutex_destroy (&read_lock);
-
- return 1;
-}
-
-static void* video_thread (void *context)
-{
- struct video_encoder_context *encoder_context = NULL;
- struct video_msgq *queueitem = NULL;
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- struct venc_bufferpayload *tempbuffer = NULL;
- struct venc_buffer enc_buffer;
- unsigned int data_len =0;
-
-
- if (context == NULL)
- {
- DEBUG_PRINT("\n video thread recieved NULL context");
- return NULL;
- }
- encoder_context = (struct video_encoder_context *) context;
-
- /* Thread function which will accept commands from async thread
- * or main thread
- */
- while (1)
- {
- queueitem = queue_get_cmd (&encoder_context ->queue_context);
- if (queueitem != NULL)
- {
- switch (queueitem->cmd)
- {
- case VEN_MSG_START:
- DEBUG_PRINT("\n recived start done command");
- sem_post (&encoder_context->sem_synchronize);
- break;
-
- case VEN_MSG_STOP:
- DEBUG_PRINT("\n recieved stop done");
- sem_post (&encoder_context->sem_synchronize);
- break;
-
- case VEN_MSG_INPUT_BUFFER_DONE:
-
- tempbuffer = (struct venc_bufferpayload *)queueitem->clientdata;
- if (tempbuffer == NULL)
- {
- DEBUG_PRINT("\n FATAL ERROR input buffer address is bad");
- sem_post (&encoder_context->sem_synchronize);
- break;
- }
- tempbuffer->filled_len = (encoder_context->input_height *
- encoder_context->input_width *3)/2;
-
- data_len = read_frame ( tempbuffer->pbuffer,
- tempbuffer->filled_len,
- encoder_context->inputBufferFile);
-
- if (data_len == 0)
- {
- DEBUG_PRINT ("\n End of stream reached");
- sem_post (&encoder_context->sem_synchronize);
- break;
- }
- enc_buffer.clientdata = (void *)tempbuffer;
- enc_buffer.flags = 0;
- enc_buffer.ptrbuffer = tempbuffer->pbuffer;
- enc_buffer.sz = tempbuffer->sz;
- enc_buffer.len = tempbuffer->filled_len;
- enc_buffer.offset = 0;
- enc_buffer.timestamp = total_frames *
- ((encoder_context->fps_den * 1000000)/encoder_context->fps_num);
-
- /*TODO: Time stamp needs to be updated*/
- ioctl_msg.in = &enc_buffer;
- ioctl_msg.out = NULL;
- total_frames++;
- if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_ENCODE_FRAME,
- &ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Decoder frame failed");
- sem_post (&encoder_context->sem_synchronize);
- }
- DEBUG_PRINT("\n Input buffer done send next buffer current value = %d",\
- total_frames);
- break;
-
- case VEN_MSG_OUTPUT_BUFFER_DONE:
-
- tempbuffer = (struct venc_bufferpayload *)queueitem->clientdata;
- if (tempbuffer == NULL)
- {
- DEBUG_PRINT("\n FATAL ERROR input buffer address is bad");
- sem_post (&encoder_context->sem_synchronize);
- break;
- }
-
- if (encoder_context->outputBufferFile != NULL)
- {
- fwrite (tempbuffer->pbuffer,1,tempbuffer->filled_len,
- encoder_context->outputBufferFile);
- }
-
-
- DEBUG_PRINT("\n recieved output buffer consume outbuffer");
- DEBUG_PRINT("\nValues outputbuffer->bufferaddr = %p",\
- tempbuffer->pbuffer);
- enc_buffer.clientdata = (void *)tempbuffer;
- enc_buffer.flags = 0;
- enc_buffer.sz = tempbuffer->sz;
- enc_buffer.len = 0;
- enc_buffer.ptrbuffer = tempbuffer->pbuffer;
- enc_buffer.offset = 0;
- enc_buffer.timestamp = 0;
-
- ioctl_msg.in = &enc_buffer;
- ioctl_msg.out = NULL;
-
- if (ioctl (encoder_context->video_driver_fd,
- VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Decoder frame failed");
- return NULL;
- }
-
- break;
-
- case VEN_MSG_FLUSH_INPUT_DONE:
- DEBUG_PRINT("\n Flush input complete");
- sem_post (&encoder_context->sem_synchronize);
- break;
-
- case VEN_MSG_FLUSH_OUPUT_DONE:
- DEBUG_PRINT("\n Flush output complete");
- sem_post (&encoder_context->sem_synchronize);
- break;
- }
-
- if (queueitem->cmd == VEN_MSG_STOP)
- {
- DEBUG_PRINT("\n Playback has ended thread will exit");
- return NULL;
- }
- }
- else
- {
- DEBUG_PRINT("\n Error condition recieved NULL from Queue");
- }
-
- }
-}
-
-static void* async_thread (void *context)
-{
- struct video_encoder_context *encoder_context = NULL;
- struct video_msgq queueitem ;
- struct venc_msg venc_msg;
- struct venc_bufferpayload *tempbuffer = NULL;
- struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
- int result = -1;
-
- if (context == NULL)
- {
- DEBUG_PRINT("\n aynsc thread recieved NULL context");
- return NULL;
- }
- encoder_context = (struct video_encoder_context *) context;
- DEBUG_PRINT("\n Entering the async thread");
-
- while (1)
- {
- ioctl_msg.in = NULL;
- ioctl_msg.out = (void*)&venc_msg;
- DEBUG_PRINT ("\n Sizeof venc_msginfo = %d ",sizeof (venc_msg));
- DEBUG_PRINT("\n Address of Venc msg in async thread %p",\
- ioctl_msg.out);
- if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_CMD_READ_NEXT_MSG,\
- (void*)&ioctl_msg) < 0)
- {
- DEBUG_PRINT("\n Error in ioctl read next msg");
- }
- else
- {
- switch (venc_msg.msgcode)
- {
- case VEN_MSG_START:
- case VEN_MSG_STOP:
- case VEN_MSG_INDICATION:
- DEBUG_PRINT("\nSTOP/START Indiacation");
- queueitem.cmd = venc_msg.msgcode;
- queueitem.status = venc_msg.statuscode;
- queueitem.clientdata = NULL;
- break;
-
- case VEN_MSG_INPUT_BUFFER_DONE:
- DEBUG_PRINT("\nINPUT buffer done Indiacation");
- queueitem.cmd = venc_msg.msgcode;
- queueitem.status = venc_msg.statuscode;
- queueitem.clientdata = (void *)venc_msg.buf.clientdata;
- DEBUG_PRINT("\nInput Client data pointer is %p",queueitem.clientdata);
- tempbuffer = (struct venc_bufferpayload *) queueitem.clientdata;
- DEBUG_PRINT ("\n Input Address of tempbuffer %p",tempbuffer);
- tempbuffer->filled_len = venc_msg.buf.len;
- DEBUG_PRINT ("\n Input value of tempbuffer tempbuffer->filled_len %d",(int)tempbuffer->filled_len);
- break;
- case VEN_MSG_OUTPUT_BUFFER_DONE:
- DEBUG_PRINT("\nOUPUT buffer done Indiacation");
- queueitem.cmd = venc_msg.msgcode;
- queueitem.status = venc_msg.statuscode;
- queueitem.clientdata = (void *)venc_msg.buf.clientdata;
- DEBUG_PRINT("\nOutput Client data pointer is %p",queueitem.clientdata);
- tempbuffer = (struct venc_bufferpayload *) queueitem.clientdata;
- DEBUG_PRINT ("\n Output Address of tempbuffer %p",tempbuffer);
- tempbuffer->filled_len = venc_msg.buf.len;
- DEBUG_PRINT ("\n Output value of tempbuffer tempbuffer->filled_len %d",(int)tempbuffer->filled_len);
- break;
-
- default:
- DEBUG_PRINT("\nIn Default of get next message %d",(int)venc_msg.msgcode);
- queueitem.cmd = venc_msg.msgcode;
- queueitem.status = venc_msg.statuscode;
- queueitem.clientdata = NULL;
- break;
- }
- result = queue_post_cmdq (&encoder_context->queue_context,&queueitem);
- while (result == 0)
- {
- result = queue_post_cmdq (&encoder_context->queue_context,&queueitem);
- }
-
- if (result == -1)
- {
- DEBUG_PRINT("\n FATAL ERROR WITH Queue");
- }
- }
- if (venc_msg.msgcode == VEN_MSG_STOP)
- {
- /*Thread can exit at this point*/
- return NULL;
- }
- }
-}
-
-
-static unsigned int read_frame (unsigned char *dataptr, unsigned int length,
- FILE * inputBufferFile)
-{
-
- unsigned int readOffset = 0;
- int bytes_read = 0;
- unsigned int code = 0;
- int found = 0;
-
- DEBUG_PRINT ("\n Inside the readframe");
-
- if (dataptr == NULL && length == 0)
- {
- DEBUG_PRINT ("\n dataptr = %p length = %d",dataptr,(int)length);
- return 0;
- }
-
- pthread_mutex_lock(&read_lock);
- bytes_read = fread(&dataptr[readOffset],1,length,inputBufferFile);
- pthread_mutex_unlock(&read_lock);
-
- return bytes_read;
-}
+/*--------------------------------------------------------------------------
+Copyright (c) 2010-2011, Code Aurora Forum. 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 Code Aurora 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, FITNESS FOR A PARTICULAR PURPOSE AND
+NON-INFRINGEMENT 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 "video_encoder_test.h"
+
+#define DEBUG_PRINT printf
+/************************************************************************/
+/* #DEFINES */
+/************************************************************************/
+
+#define VOP_START_CODE 0x000001B6
+#define SHORT_HEADER_START_CODE 0x00008000
+#define H264_START_CODE 0x00000001
+
+/************************************************************************/
+/* STATIC VARIABLES */
+/************************************************************************/
+
+static int Code_type;
+static int total_frames = 0;
+static unsigned int header_code = 0;
+static pthread_mutex_t read_lock;
+
+static unsigned int read_frame ( unsigned char *dataptr,unsigned int length,
+ FILE * inputBufferFile
+ );
+static unsigned clp2(unsigned x)
+{
+ x = x - 1;
+ x = x | (x >> 1);
+ x = x | (x >> 2);
+ x = x | (x >> 4);
+ x = x | (x >> 8);
+ x = x | (x >>16);
+ return x + 1;
+}
+
+
+static void* video_thread (void *);
+static void* async_thread (void *);
+
+
+
+int main (int argc, char **argv)
+{
+ struct video_encoder_context *encoder_context = NULL;
+ char *file_name = NULL;
+ FILE *file_ptr = NULL;
+ int temp1 =0,temp2 =0;
+ int error = 1;
+ unsigned int i = 0;
+
+ file_name = argv [1];
+ file_ptr = fopen (file_name,"rb");
+
+ if (file_ptr == NULL)
+ {
+ DEBUG_PRINT("\n File is not located ");
+ return -1;
+ }
+
+
+ encoder_context = (struct video_encoder_context *) \
+ calloc (sizeof (struct video_encoder_context),1);
+ if (encoder_context == NULL)
+ {
+ return -1;
+ }
+ encoder_context->outputBufferFile = NULL;
+ encoder_context->inputBufferFile = NULL;
+ encoder_context->video_driver_fd = -1;
+ encoder_context->inputBufferFile = file_ptr;
+ encoder_context->input_width = 176;
+ encoder_context->input_height = 144;
+ encoder_context->codectype = VEN_CODEC_MPEG4;
+ encoder_context->fps_num = 60;
+ encoder_context->fps_den = 2;
+ encoder_context->inputformat = VEN_INPUTFMT_NV12;
+ encoder_context->targetbitrate = 128000;
+
+ file_ptr = fopen ("/data/output.m4v","wb");
+ if (file_ptr == NULL)
+ {
+ DEBUG_PRINT("\n File can't be created");
+ free (encoder_context);
+ return -1;
+ }
+ encoder_context->outputBufferFile = file_ptr;
+
+ switch (atoi(argv[2]))
+ {
+ case 0:
+ DEBUG_PRINT("\n MPEG4 codec selected");
+ encoder_context->codectype = VEN_CODEC_MPEG4;
+ Code_type = 0;
+ break;
+ case 1:
+ DEBUG_PRINT("\n H.263");
+ encoder_context->codectype = VEN_CODEC_H263;
+ Code_type = 0;
+ break;
+ case 2:
+ DEBUG_PRINT("\n H.264");
+ encoder_context->codectype = VEN_CODEC_H264;
+ Code_type = 1;
+ break;
+ default:
+ DEBUG_PRINT("\n Wrong codec type");
+ error = -1;
+ break;
+ }
+
+ if (error != -1)
+ {
+ temp1 = atoi(argv[3]);
+ temp2 = atoi(argv[4]);
+
+ if (((temp1%16) != 0) || ((temp2%16) != 0))
+ {
+ error = -1;
+ }
+ else
+ {
+ encoder_context->input_width = temp1;
+ encoder_context->input_height = temp2;
+ }
+ }
+
+ switch (atoi(argv[5]))
+ {
+ case 0:
+ DEBUG_PRINT("\n No Sink");
+ encoder_context->outputBufferFile = NULL;
+ break;
+ }
+
+ if (error != -1)
+ {
+ encoder_context->targetbitrate = atoi (argv[6]);
+ }
+
+ if ( error != -1 && (init_encoder (encoder_context) == -1 ))
+ {
+ DEBUG_PRINT("\n Init decoder fails ");
+ error = -1;
+ }
+ DEBUG_PRINT("\n Decoder open successfull");
+
+
+ /*Allocate input and output buffers*/
+ if (error != -1 && (allocate_buffer (0,encoder_context)== -1))
+ {
+ DEBUG_PRINT("\n Error in input Buffer allocation");
+ error = -1;
+ }
+
+ if (error != -1 && (allocate_buffer (1,encoder_context)== -1))
+ {
+ DEBUG_PRINT("\n Error in output Buffer allocation");
+ error = -1;
+ }
+
+
+ if (error != -1 && (start_encoding (encoder_context) == -1))
+ {
+ DEBUG_PRINT("\n Error in start decoding call");
+ error = -1;
+ }
+
+ if (error != -1 && (stop_encoding (encoder_context) == -1))
+ {
+ DEBUG_PRINT("\n Error in stop decoding call");
+ error = -1;
+ }
+
+ DEBUG_PRINT("\n De-init the decoder");
+ if ((deinit_encoder (encoder_context) == -1))
+ {
+ error = -1;
+ }
+
+
+ (void)free_buffer (INPUT_BUFFER,encoder_context);
+ (void)free_buffer (OUTPUT_BUFFER,encoder_context);
+
+ if (encoder_context->inputBufferFile != NULL)
+ {
+ fclose (encoder_context->inputBufferFile);
+ }
+ if (encoder_context->outputBufferFile != NULL)
+ {
+ fclose (encoder_context->outputBufferFile);
+ }
+ DEBUG_PRINT ("\n Total Number of frames decoded %d",total_frames);
+ DEBUG_PRINT("\n closing the driver");
+ free (encoder_context);
+
+ return error;
+}
+
+int init_encoder ( struct video_encoder_context *init_decode )
+{
+ struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct venc_basecfg basecfg;
+ struct video_queue_context *queue_ptr = NULL;
+ struct venc_ratectrlcfg ratecrl;
+ pthread_mutexattr_t init_values;
+ struct venc_profile profile;
+ struct ven_profilelevel profilelevel;
+
+ DEBUG_PRINT("\n Before calling the open");
+
+ init_decode->video_driver_fd = open ("/dev/msm_vidc_enc", \
+ O_RDWR | O_NONBLOCK);
+
+
+
+ if (init_decode->video_driver_fd < 0)
+ {
+ DEBUG_PRINT("\n Open failed");
+ return -1;
+ }
+
+ basecfg.codectype = init_decode->codectype;
+ basecfg.dvs_height = 0;
+ basecfg.dvs_width = 0;
+ basecfg.fps_den = init_decode->fps_den;
+ basecfg.fps_num = init_decode->fps_num;
+ basecfg.input_height = init_decode->input_height;
+ basecfg.input_width = init_decode->input_width;
+ basecfg.inputformat = init_decode->inputformat;
+ basecfg.targetbitrate = init_decode->targetbitrate;
+
+ /*Initialize Decoder with codec type and resolution*/
+ ioctl_msg.in = &basecfg;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_BASE_CFG,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set base config type failed");
+ return -1;
+ }
+
+ /*Initialize Decoder with codec type and resolution*/
+ DEBUG_PRINT ("\n Switch off rate control");
+ ioctl_msg.in = &ratecrl;
+ ioctl_msg.out = NULL;
+ ratecrl.rcmode = VEN_RC_OFF;
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_RATE_CTRL_CFG,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set rate control failed");
+ return -1;
+ }
+
+ if (basecfg.codectype == VEN_CODEC_H264)
+ {
+ DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
+ ioctl_msg.in = &profile;
+ ioctl_msg.out = NULL;
+ profile.profile = VEN_PROFILE_H264_BASELINE;
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_CODEC_PROFILE,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
+ return -1;
+ }
+
+ DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
+ ioctl_msg.in = &profilelevel;
+ ioctl_msg.out = NULL;
+ profilelevel.level = VEN_LEVEL_H264_1p1;
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_PROFILE_LEVEL,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
+ return -1;
+ }
+
+ if (basecfg.input_width > 720)
+ {
+ DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
+ ioctl_msg.in = &profile;
+ ioctl_msg.out = NULL;
+ profile.profile = VEN_PROFILE_H264_HIGH;
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_CODEC_PROFILE,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
+ return -1;
+ }
+
+ DEBUG_PRINT ("\n Set the VEN_IOCTL_SET_CODEC_PROFILE High");
+ ioctl_msg.in = &profilelevel;
+ ioctl_msg.out = NULL;
+ profilelevel.level = VEN_LEVEL_H264_3p1;
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_PROFILE_LEVEL,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set VEN_IOCTL_SET_CODEC_PROFILE failed");
+ return -1;
+ }
+ }
+ }
+
+ DEBUG_PRINT("\n Query Input bufffer requirements");
+ /*Get the Buffer requirements for input and output ports*/
+
+
+
+ ioctl_msg.in = NULL;
+ ioctl_msg.out = &init_decode->input_buffer;
+
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_GET_INPUT_BUFFER_REQ,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Requesting for input buffer requirements failed");
+ return -1;
+ }
+
+ DEBUG_PRINT("\n input Size=%d min count =%d actual count = %d", \
+ (int)init_decode->input_buffer.datasize,\
+ (int)init_decode->input_buffer.mincount,\
+ (int)init_decode->input_buffer.actualcount);
+
+
+ ioctl_msg.in = &init_decode->input_buffer;
+ ioctl_msg.out = NULL;
+ init_decode->input_buffer.actualcount = init_decode->input_buffer.mincount + 2;
+
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_SET_INPUT_BUFFER_REQ,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Set Buffer Requirements Failed");
+ return -1;
+ }
+
+
+ DEBUG_PRINT("\n Query output bufffer requirements");
+ ioctl_msg.in = NULL;
+ ioctl_msg.out = &init_decode->output_buffer;
+
+ if (ioctl (init_decode->video_driver_fd,VEN_IOCTL_GET_OUTPUT_BUFFER_REQ,
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Requesting for output buffer requirements failed");
+ return -1;
+ }
+
+ DEBUG_PRINT("\n output Size=%d min count =%d actual count = %d", \
+ (int)init_decode->output_buffer.datasize,\
+ (int)init_decode->output_buffer.mincount,\
+ (int)init_decode->output_buffer.actualcount);
+
+ /*Create Queue related data structures*/
+ queue_ptr = &init_decode->queue_context;
+ queue_ptr->commandq_size = 50;
+ queue_ptr->dataq_size = 50;
+
+ sem_init(&queue_ptr->sem_message,0, 0);
+ sem_init(&init_decode->sem_synchronize,0, 0);
+
+ pthread_mutexattr_init (&init_values);
+ pthread_mutex_init (&queue_ptr->mutex,&init_values);
+ pthread_mutex_init (&read_lock,&init_values);
+ DEBUG_PRINT("\n create Queues");
+ queue_ptr->ptr_cmdq = (struct video_msgq*) \
+ calloc (sizeof (struct video_msgq),
+ queue_ptr->commandq_size);
+ queue_ptr->ptr_dataq = (struct video_msgq*) \
+ calloc (sizeof (struct video_msgq),
+ queue_ptr->dataq_size
+ );
+
+ if ( queue_ptr->ptr_cmdq == NULL ||
+ queue_ptr->ptr_dataq == NULL
+ )
+ {
+ return -1;
+ }
+ DEBUG_PRINT("\n create Threads");
+ /*Create two threads*/
+ if ( (pthread_create (&init_decode->videothread_id,NULL,video_thread,
+ init_decode) < 0) ||
+ (pthread_create (&init_decode->asyncthread_id,NULL,async_thread,
+ init_decode) < 0)
+ )
+ {
+ return -1;
+ }
+
+ return 1;
+}
+
+
+
+int free_buffer ( unsigned int buffer_dir,
+ struct video_encoder_context *encoder_context
+ )
+{
+ unsigned int buffercount = 0,i=0;
+ struct venc_bufferpayload **ptemp = NULL;
+
+ if (encoder_context == NULL)
+ {
+ return -1;
+ }
+
+ if (buffer_dir == INPUT_BUFFER && encoder_context->ptr_inputbuffer)
+ {
+ buffercount = encoder_context->input_buffer.actualcount;
+ ptemp = encoder_context->ptr_inputbuffer;
+
+ for (i=0;i<buffercount;i++)
+ {
+ if (ptemp [i])
+ {
+ if (ptemp [i]->fd != -1)
+ {
+ munmap ( ptemp [i]->pbuffer,ptemp [i]->maped_size);
+ ptemp [i]->pbuffer = NULL;
+ close (ptemp [i]->fd);
+ }
+ free (ptemp [i]);
+ ptemp [i] = NULL;
+ }
+ }
+ free (encoder_context->ptr_inputbuffer);
+ encoder_context->ptr_inputbuffer = NULL;
+ }
+ else if ( buffer_dir == OUTPUT_BUFFER && encoder_context->ptr_outputbuffer )
+ {
+ buffercount = encoder_context->output_buffer.actualcount;
+ ptemp = encoder_context->ptr_outputbuffer;
+
+ if (ptemp)
+ {
+ for (i=0;i<buffercount;i++)
+ {
+ if (ptemp [i])
+ {
+ if (ptemp [i]->fd != -1)
+ {
+ munmap ( ptemp [i]->pbuffer,ptemp [i]->maped_size);
+ ptemp [i]->pbuffer = NULL;
+ close (ptemp [i]->fd);
+ }
+ free (ptemp [i]);
+ ptemp [i] = NULL;
+ }
+ }
+ free (ptemp);
+ encoder_context->ptr_outputbuffer = NULL;
+ }
+ }
+
+ return 1;
+}
+
+int allocate_buffer ( unsigned int buffer_dir,
+ struct video_encoder_context *encoder_context
+ )
+{
+ struct venc_bufferpayload **ptemp = NULL;
+ struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
+ unsigned int buffercount = 0,i=0,alignedsize=0;
+ unsigned int buffersize = 0;
+
+ if ( encoder_context == NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: context is NULL");
+ return -1;
+ }
+
+ if ( buffer_dir == INPUT_BUFFER )
+ {
+ /*Check if buffers are allocated*/
+ if (encoder_context->ptr_inputbuffer != NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: encoder_context->ptr_inputbuffer is set");
+ return -1;
+ }
+
+ buffercount = encoder_context->input_buffer.actualcount;
+ alignedsize = encoder_context->input_buffer.alignment;
+ buffersize = encoder_context->input_buffer.datasize;
+ buffersize = (buffersize + alignedsize) & (~alignedsize);
+ }
+ else if (buffer_dir == OUTPUT_BUFFER)
+ {
+ /*Check if buffers are allocated*/
+ if (encoder_context->ptr_outputbuffer != NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Double allcoate output");
+ return -1;
+ }
+
+ buffercount = encoder_context->output_buffer.actualcount;
+ alignedsize = encoder_context->output_buffer.alignment;
+ buffersize = encoder_context->output_buffer.datasize;
+ buffersize = (buffersize + alignedsize) & (~alignedsize);
+
+ }
+ else
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Wrong buffer directions");
+ return -1;
+ }
+
+ ptemp = (struct venc_bufferpayload **)\
+ calloc (sizeof (struct venc_bufferpayload *),buffercount);
+
+ if (ptemp == NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: venc_bufferpayload failure");
+ return -1;
+ }
+
+
+ if (buffer_dir == OUTPUT_BUFFER)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: OUT");
+ encoder_context->ptr_outputbuffer = ptemp;
+ }
+ else
+ {
+ DEBUG_PRINT ("\nallocate_buffer: IN");
+ encoder_context->ptr_inputbuffer = ptemp;
+ }
+
+ /*Allocate buffer headers*/
+ for (i=0; i< buffercount; i++)
+ {
+ ptemp [i] = (struct venc_bufferpayload*)\
+ calloc (sizeof (struct venc_bufferpayload),1);
+
+ if (ptemp [i] == NULL)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: ptemp [i] calloc failure");
+ return -1;
+ }
+ ptemp [i]->fd = -1;
+ }
+
+ for (i=0; i< buffercount; i++)
+ {
+ ptemp [i]->fd = open ("/dev/pmem_adsp",O_RDWR);
+
+ if (ptemp [i]->fd < 0)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: open pmem_adsp failed");
+ return -1;
+ }
+
+ ptemp [i]->pbuffer = mmap(NULL,clp2(buffersize),PROT_READ|PROT_WRITE,
+ MAP_SHARED,ptemp [i]->fd,0);
+ DEBUG_PRINT ("\n pmem fd = %d virt addr = %p",ptemp [i]->fd,\
+ ptemp [i]->pbuffer);
+ if (ptemp [i]->pbuffer == MAP_FAILED)
+ {
+ ptemp [i]->pbuffer = NULL;
+ DEBUG_PRINT ("\nallocate_buffer: MMAP failed");
+ return -1;
+ }
+ ptemp [i]->sz = buffersize;
+ ptemp [i]->maped_size = clp2 (buffersize);
+
+ ioctl_msg.in = ptemp [i];
+ ioctl_msg.out = NULL;
+
+ if (buffer_dir == OUTPUT_BUFFER)
+ {
+ if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_SET_OUTPUT_BUFFER,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Set Output Buffer IOCTL failed");
+ return -1;
+ }
+ }
+ else
+ {
+ if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_SET_INPUT_BUFFER,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT ("\nallocate_buffer: Set input Buffer IOCTL failed");
+ return -1;
+ }
+ }
+
+ }
+ DEBUG_PRINT ("\nallocate_buffer: Success");
+ return 1;
+}
+
+
+
+int start_encoding (struct video_encoder_context *encoder_context)
+{
+ struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct venc_buffer enc_buffer;
+ unsigned int i = 0;
+ unsigned int data_len =0;
+
+
+ if (encoder_context == NULL)
+ {
+ return -1;
+ }
+
+ if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_CMD_START,
+ NULL) < 0)
+ {
+ DEBUG_PRINT("\n Start failed");
+ return -1;
+ }
+
+ DEBUG_PRINT("\n Start Issued successfully waiting for Start Done");
+ /*Wait for Start command response*/
+ sem_wait (&encoder_context->sem_synchronize);
+
+ /*Push output Buffers*/
+ i = 0;
+ while (i < encoder_context->output_buffer.actualcount)
+ {
+ enc_buffer.clientdata = (void *)encoder_context->ptr_outputbuffer [i];
+ enc_buffer.flags = 0;
+ enc_buffer.sz = encoder_context->ptr_outputbuffer [i]->sz;
+ enc_buffer.len = 0;
+ enc_buffer.ptrbuffer = encoder_context->ptr_outputbuffer [i]->pbuffer;
+ enc_buffer.offset = 0;
+ enc_buffer.timestamp = 0;
+
+ DEBUG_PRINT ("\n Client Data on output = %p",(void *)enc_buffer.clientdata);
+ ioctl_msg.in = &enc_buffer;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (encoder_context->video_driver_fd,
+ VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n fill output frame failed");
+ return -1;
+ }
+ i++;
+ }
+
+
+ /*push input buffers*/
+ i = 0;
+ while (i < encoder_context->input_buffer.actualcount)
+ {
+ DEBUG_PRINT("\n Read Frame from File");
+
+ enc_buffer.clientdata = (void *)encoder_context->ptr_inputbuffer [i];
+ enc_buffer.flags = 0;
+ enc_buffer.sz = encoder_context->ptr_inputbuffer [i]->sz;
+ enc_buffer.len = 0;
+ enc_buffer.ptrbuffer = encoder_context->ptr_inputbuffer [i]->pbuffer;
+ enc_buffer.offset = 0;
+ enc_buffer.timestamp = total_frames *
+ ((encoder_context->fps_den * 1000000)/encoder_context->fps_num);
+ enc_buffer.len = (encoder_context->input_height *
+ encoder_context->input_width *3)/2;
+ data_len = read_frame ( enc_buffer.ptrbuffer,
+ enc_buffer.len,
+ encoder_context->inputBufferFile);
+ if (data_len == 0)
+ {
+ DEBUG_PRINT("\n Length is zero error");
+ return -1;
+ }
+ enc_buffer.len = data_len;
+ DEBUG_PRINT("\n Read Frame from File szie = %d",(int)data_len);
+
+ DEBUG_PRINT ("\n Client Data on output = %p",(void *)enc_buffer.clientdata);
+ ioctl_msg.in = &enc_buffer;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (encoder_context->video_driver_fd,
+ VEN_IOCTL_CMD_ENCODE_FRAME,&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Encode input frame failed");
+ return -1;
+ }
+ total_frames++;
+ i++;
+ }
+ DEBUG_PRINT ("\n Wait for EOS");
+ /*Wait for EOS or Error condition*/
+ sem_wait (&encoder_context->sem_synchronize);
+ DEBUG_PRINT ("\n Reached EOS");
+
+ return 1;
+}
+
+int stop_encoding (struct video_encoder_context *encoder_context)
+{
+ struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct venc_bufferflush buffer_flush;
+
+ if (encoder_context == NULL)
+ {
+ return -1;
+ }
+ buffer_flush.flush_mode = VEN_FLUSH_INPUT;
+ ioctl_msg.in = &buffer_flush;
+ ioctl_msg.out = NULL;
+
+ if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_FLUSH,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Flush input failed");
+ }
+ else
+ {
+ sem_wait (&encoder_context->sem_synchronize);
+ }
+
+ buffer_flush.flush_mode = VEN_FLUSH_OUTPUT;
+ ioctl_msg.in = &buffer_flush;
+ ioctl_msg.out = NULL;
+
+ if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_FLUSH,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Flush output failed");
+ }
+ else
+ {
+ sem_wait (&encoder_context->sem_synchronize);
+ }
+
+ DEBUG_PRINT("\n Stop VEN_IOCTL_CMD_STOP");
+ if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_STOP,NULL) < 0)
+ {
+ DEBUG_PRINT("\n Stop failed");
+ }
+ else
+ {
+ sem_wait (&encoder_context->sem_synchronize);
+ }
+ return 1;
+}
+
+int deinit_encoder (struct video_encoder_context *init_decode)
+{
+ if (init_decode == NULL)
+ {
+ return -1;
+ }
+
+ /*Close the driver*/
+ if (init_decode->video_driver_fd != -1)
+ {
+ close (init_decode->video_driver_fd);
+ }
+
+ if (init_decode->queue_context.ptr_cmdq)
+ {
+ free (init_decode->queue_context.ptr_cmdq);
+ init_decode->queue_context.ptr_cmdq = NULL;
+ }
+
+ if (init_decode->queue_context.ptr_dataq)
+ {
+ free (init_decode->queue_context.ptr_dataq);
+ init_decode->queue_context.ptr_dataq = NULL;
+ }
+
+ sem_destroy (&init_decode->queue_context.sem_message);
+ sem_destroy (&init_decode->sem_synchronize);
+
+ pthread_mutex_destroy(&init_decode->queue_context.mutex);
+ pthread_mutex_destroy (&read_lock);
+
+ return 1;
+}
+
+static void* video_thread (void *context)
+{
+ struct video_encoder_context *encoder_context = NULL;
+ struct video_msgq *queueitem = NULL;
+ struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
+ struct venc_bufferpayload *tempbuffer = NULL;
+ struct venc_buffer enc_buffer;
+ unsigned int data_len =0;
+
+
+ if (context == NULL)
+ {
+ DEBUG_PRINT("\n video thread recieved NULL context");
+ return NULL;
+ }
+ encoder_context = (struct video_encoder_context *) context;
+
+ /* Thread function which will accept commands from async thread
+ * or main thread
+ */
+ while (1)
+ {
+ queueitem = queue_get_cmd (&encoder_context ->queue_context);
+ if (queueitem != NULL)
+ {
+ switch (queueitem->cmd)
+ {
+ case VEN_MSG_START:
+ DEBUG_PRINT("\n recived start done command");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+
+ case VEN_MSG_STOP:
+ DEBUG_PRINT("\n recieved stop done");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+
+ case VEN_MSG_INPUT_BUFFER_DONE:
+
+ tempbuffer = (struct venc_bufferpayload *)queueitem->clientdata;
+ if (tempbuffer == NULL)
+ {
+ DEBUG_PRINT("\n FATAL ERROR input buffer address is bad");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+ }
+ tempbuffer->filled_len = (encoder_context->input_height *
+ encoder_context->input_width *3)/2;
+
+ data_len = read_frame ( tempbuffer->pbuffer,
+ tempbuffer->filled_len,
+ encoder_context->inputBufferFile);
+
+ if (data_len == 0)
+ {
+ DEBUG_PRINT ("\n End of stream reached");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+ }
+ enc_buffer.clientdata = (void *)tempbuffer;
+ enc_buffer.flags = 0;
+ enc_buffer.ptrbuffer = tempbuffer->pbuffer;
+ enc_buffer.sz = tempbuffer->sz;
+ enc_buffer.len = tempbuffer->filled_len;
+ enc_buffer.offset = 0;
+ enc_buffer.timestamp = total_frames *
+ ((encoder_context->fps_den * 1000000)/encoder_context->fps_num);
+
+ /*TODO: Time stamp needs to be updated*/
+ ioctl_msg.in = &enc_buffer;
+ ioctl_msg.out = NULL;
+ total_frames++;
+ if (ioctl(encoder_context->video_driver_fd,VEN_IOCTL_CMD_ENCODE_FRAME,
+ &ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Decoder frame failed");
+ sem_post (&encoder_context->sem_synchronize);
+ }
+ DEBUG_PRINT("\n Input buffer done send next buffer current value = %d",\
+ total_frames);
+ break;
+
+ case VEN_MSG_OUTPUT_BUFFER_DONE:
+
+ tempbuffer = (struct venc_bufferpayload *)queueitem->clientdata;
+ if (tempbuffer == NULL)
+ {
+ DEBUG_PRINT("\n FATAL ERROR input buffer address is bad");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+ }
+
+ if (encoder_context->outputBufferFile != NULL)
+ {
+ fwrite (tempbuffer->pbuffer,1,tempbuffer->filled_len,
+ encoder_context->outputBufferFile);
+ }
+
+
+ DEBUG_PRINT("\n recieved output buffer consume outbuffer");
+ DEBUG_PRINT("\nValues outputbuffer->bufferaddr = %p",\
+ tempbuffer->pbuffer);
+ enc_buffer.clientdata = (void *)tempbuffer;
+ enc_buffer.flags = 0;
+ enc_buffer.sz = tempbuffer->sz;
+ enc_buffer.len = 0;
+ enc_buffer.ptrbuffer = tempbuffer->pbuffer;
+ enc_buffer.offset = 0;
+ enc_buffer.timestamp = 0;
+
+ ioctl_msg.in = &enc_buffer;
+ ioctl_msg.out = NULL;
+
+ if (ioctl (encoder_context->video_driver_fd,
+ VEN_IOCTL_CMD_FILL_OUTPUT_BUFFER,&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Decoder frame failed");
+ return NULL;
+ }
+
+ break;
+
+ case VEN_MSG_FLUSH_INPUT_DONE:
+ DEBUG_PRINT("\n Flush input complete");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+
+ case VEN_MSG_FLUSH_OUPUT_DONE:
+ DEBUG_PRINT("\n Flush output complete");
+ sem_post (&encoder_context->sem_synchronize);
+ break;
+ }
+
+ if (queueitem->cmd == VEN_MSG_STOP)
+ {
+ DEBUG_PRINT("\n Playback has ended thread will exit");
+ return NULL;
+ }
+ }
+ else
+ {
+ DEBUG_PRINT("\n Error condition recieved NULL from Queue");
+ }
+
+ }
+}
+
+static void* async_thread (void *context)
+{
+ struct video_encoder_context *encoder_context = NULL;
+ struct video_msgq queueitem ;
+ struct venc_msg venc_msg;
+ struct venc_bufferpayload *tempbuffer = NULL;
+ struct venc_ioctl_msg ioctl_msg = {NULL,NULL};
+ int result = -1;
+
+ if (context == NULL)
+ {
+ DEBUG_PRINT("\n aynsc thread recieved NULL context");
+ return NULL;
+ }
+ encoder_context = (struct video_encoder_context *) context;
+ DEBUG_PRINT("\n Entering the async thread");
+
+ while (1)
+ {
+ ioctl_msg.in = NULL;
+ ioctl_msg.out = (void*)&venc_msg;
+ DEBUG_PRINT ("\n Sizeof venc_msginfo = %d ",sizeof (venc_msg));
+ DEBUG_PRINT("\n Address of Venc msg in async thread %p",\
+ ioctl_msg.out);
+ if (ioctl (encoder_context->video_driver_fd,VEN_IOCTL_CMD_READ_NEXT_MSG,\
+ (void*)&ioctl_msg) < 0)
+ {
+ DEBUG_PRINT("\n Error in ioctl read next msg");
+ }
+ else
+ {
+ switch (venc_msg.msgcode)
+ {
+ case VEN_MSG_START:
+ case VEN_MSG_STOP:
+ case VEN_MSG_INDICATION:
+ DEBUG_PRINT("\nSTOP/START Indiacation");
+ queueitem.cmd = venc_msg.msgcode;
+ queueitem.status = venc_msg.statuscode;
+ queueitem.clientdata = NULL;
+ break;
+
+ case VEN_MSG_INPUT_BUFFER_DONE:
+ DEBUG_PRINT("\nINPUT buffer done Indiacation");
+ queueitem.cmd = venc_msg.msgcode;
+ queueitem.status = venc_msg.statuscode;
+ queueitem.clientdata = (void *)venc_msg.buf.clientdata;
+ DEBUG_PRINT("\nInput Client data pointer is %p",queueitem.clientdata);
+ tempbuffer = (struct venc_bufferpayload *) queueitem.clientdata;
+ DEBUG_PRINT ("\n Input Address of tempbuffer %p",tempbuffer);
+ tempbuffer->filled_len = venc_msg.buf.len;
+ DEBUG_PRINT ("\n Input value of tempbuffer tempbuffer->filled_len %d",(int)tempbuffer->filled_len);
+ break;
+ case VEN_MSG_OUTPUT_BUFFER_DONE:
+ DEBUG_PRINT("\nOUPUT buffer done Indiacation");
+ queueitem.cmd = venc_msg.msgcode;
+ queueitem.status = venc_msg.statuscode;
+ queueitem.clientdata = (void *)venc_msg.buf.clientdata;
+ DEBUG_PRINT("\nOutput Client data pointer is %p",queueitem.clientdata);
+ tempbuffer = (struct venc_bufferpayload *) queueitem.clientdata;
+ DEBUG_PRINT ("\n Output Address of tempbuffer %p",tempbuffer);
+ tempbuffer->filled_len = venc_msg.buf.len;
+ DEBUG_PRINT ("\n Output value of tempbuffer tempbuffer->filled_len %d",(int)tempbuffer->filled_len);
+ break;
+
+ default:
+ DEBUG_PRINT("\nIn Default of get next message %d",(int)venc_msg.msgcode);
+ queueitem.cmd = venc_msg.msgcode;
+ queueitem.status = venc_msg.statuscode;
+ queueitem.clientdata = NULL;
+ break;
+ }
+ result = queue_post_cmdq (&encoder_context->queue_context,&queueitem);
+ while (result == 0)
+ {
+ result = queue_post_cmdq (&encoder_context->queue_context,&queueitem);
+ }
+
+ if (result == -1)
+ {
+ DEBUG_PRINT("\n FATAL ERROR WITH Queue");
+ }
+ }
+ if (venc_msg.msgcode == VEN_MSG_STOP)
+ {
+ /*Thread can exit at this point*/
+ return NULL;
+ }
+ }
+}
+
+
+static unsigned int read_frame (unsigned char *dataptr, unsigned int length,
+ FILE * inputBufferFile)
+{
+
+ unsigned int readOffset = 0;
+ int bytes_read = 0;
+ unsigned int code = 0;
+ int found = 0;
+
+ DEBUG_PRINT ("\n Inside the readframe");
+
+ if (dataptr == NULL && length == 0)
+ {
+ DEBUG_PRINT ("\n dataptr = %p length = %d",dataptr,(int)length);
+ return 0;
+ }
+
+ pthread_mutex_lock(&read_lock);
+ bytes_read = fread(&dataptr[readOffset],1,length,inputBufferFile);
+ pthread_mutex_unlock(&read_lock);
+
+ return bytes_read;
+}