summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSunita Nadampalli <sunitan@ti.com>2016-05-14 22:22:21 -0500
committerSunita Nadampalli <sunitan@ti.com>2016-06-07 14:24:43 -0500
commit2e456a8ee205cabd386422e550939c5ea815cb34 (patch)
treef83e97fe2e24187ac81b1e7289a4bb6673b33600
parent104981c004421d93ecab113063c95a49cf34e6b9 (diff)
downloaddra7xx-2e456a8ee205cabd386422e550939c5ea815cb34.tar.gz
OMX: H264 VideoEncoder: Fixes for OMX Video Encoder Metadata mode
Meta data mode support is fixed to publish it only on Input port. Change-Id: I8fd7511a214691e96f23ae6d408cbf346f1439ee Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
-rw-r--r--omx/videoencode/omx_h264_enc/inc/omx_H264videoencoder.h9
-rw-r--r--omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c18
2 files changed, 21 insertions, 6 deletions
diff --git a/omx/videoencode/omx_h264_enc/inc/omx_H264videoencoder.h b/omx/videoencode/omx_h264_enc/inc/omx_H264videoencoder.h
index b1af7b4..12b1037 100644
--- a/omx/videoencode/omx_h264_enc/inc/omx_H264videoencoder.h
+++ b/omx/videoencode/omx_h264_enc/inc/omx_H264videoencoder.h
@@ -38,9 +38,16 @@ typedef struct OMX_H264_LVL_BITRATE {
typedef struct OMX_MetaDataBuffer {
int type;
void *handle;
- int offset;
+ //int offset;
}OMX_MetaDataBuffer;
+typedef struct OMX_StoreMetaDataInBuffersParams {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bStoreMetaData;
+}OMX_StoreMetaDataInBuffersParams;
+
/* OMX H264 Encoder Component */
typedef struct OMXH264VideoEncoderComponent {
/* base component handle */
diff --git a/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c b/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c
index ede336e..edeba5d 100644
--- a/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c
+++ b/omx/videoencode/omx_h264_enc/src/omx_H264videoencoder.c
@@ -962,11 +962,19 @@ static OMX_ERRORTYPE OMXH264VE_SetParameter(OMX_HANDLETYPE hComponent,
OSAL_ReleaseMutex(pH264VEComp->sBase.pMutex);
OMX_CHECK((nLCurState == OMX_StateLoaded), OMX_ErrorIncorrectStateOperation);
- hw_module_t const* module = NULL;
- eError = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
- if (eError == 0) {
- pH264VEComp->hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
- pH264VEComp->bInputMetaDataBufferMode = OMX_TRUE;
+ struct OMX_StoreMetaDataInBuffersParams *meta = (OMX_StoreMetaDataInBuffersParams *)pParamStruct;
+ nPortIndex = meta->nPortIndex;
+
+ if (nPortIndex == OMX_H264VE_INPUT_PORT) {
+ hw_module_t const* module = NULL;
+ eError = hw_get_module(GRALLOC_HARDWARE_MODULE_ID, &module);
+ if (eError == 0) {
+ pH264VEComp->hCC = (void *) ((IMG_gralloc_module_public_t const *)module);
+ pH264VEComp->bInputMetaDataBufferMode = OMX_TRUE;
+ pH264VEComp->sBase.pPorts[OMX_H264VE_INPUT_PORT]->sPortDef.nBufferSize = sizeof(OMX_MetaDataBuffer);
+ }
+ } else {
+ eError = OMX_ErrorUnsupportedSetting;
}
break;