summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSejun Park <sejun79.park@samsung.com>2017-09-13 14:46:33 +0900
committerSejun Park <sejun79.park@samsung.com>2017-09-15 18:01:49 +0900
commit9f4cd896b6d87a225a52cf950916d941a12cf016 (patch)
tree8390e0b6b8419bdb9d4ca3724e97823d477ae34b
parent209a5e483e5bf95c12e79cac71a0018225b62c06 (diff)
downloadlibomxil-e3250-v4l2-9f4cd896b6d87a225a52cf950916d941a12cf016.tar.gz
libomxil-e3250-v4l2-9f4cd896b6d87a225a52cf950916d941a12cf016.tar.bz2
libomxil-e3250-v4l2-9f4cd896b6d87a225a52cf950916d941a12cf016.zip
Remove build warnings and fixed svace issuessubmit/tizen_4.0/20170915.094212submit/tizen/20170918.101803
Change-Id: Ifa13b0b45b54aa57ca72477b0e238ac8edf82f71
-rwxr-xr-xexynos/libv4l2/exynos_mc.c18
-rwxr-xr-xexynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c1
-rwxr-xr-xopenmax/component/audio/dec/Exynos_OMX_Adec.c50
-rwxr-xr-xopenmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c8
-rwxr-xr-xopenmax/component/common/Exynos_OMX_Basecomponent.c11
-rwxr-xr-x[-rw-r--r--]openmax/component/common/Exynos_OMX_Basecomponent.h4
-rwxr-xr-xopenmax/component/common/Exynos_OMX_Baseport.c8
-rwxr-xr-xopenmax/component/common/Exynos_OMX_Baseport.h5
-rwxr-xr-xopenmax/component/common/Exynos_OMX_Resourcemanager.c3
-rwxr-xr-x[-rw-r--r--]openmax/component/video/dec/Exynos_OMX_Vdec.c71
-rwxr-xr-x[-rw-r--r--]openmax/component/video/dec/Exynos_OMX_Vdec.h2
-rwxr-xr-x[-rw-r--r--]openmax/component/video/dec/Exynos_OMX_VdecControl.c55
-rwxr-xr-x[-rw-r--r--]openmax/component/video/dec/Exynos_OMX_VdecControl.h6
-rwxr-xr-xopenmax/component/video/dec/h264/Exynos_OMX_H264dec.c80
-rwxr-xr-xopenmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c67
-rwxr-xr-xopenmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c86
-rwxr-xr-xopenmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c83
-rw-r--r--[-rwxr-xr-x]openmax/component/video/enc/Exynos_OMX_Venc.c48
-rwxr-xr-xopenmax/component/video/enc/Exynos_OMX_Venc.h2
-rwxr-xr-xopenmax/component/video/enc/Exynos_OMX_VencControl.c77
-rwxr-xr-x[-rw-r--r--]openmax/component/video/enc/Exynos_OMX_VencControl.h17
-rwxr-xr-xopenmax/component/video/enc/h264/Exynos_OMX_H264enc.c94
-rwxr-xr-x[-rw-r--r--]openmax/component/video/enc/h264/Exynos_OMX_H264enc.h7
-rwxr-xr-xopenmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c118
-rwxr-xr-x[-rw-r--r--]openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h6
-rwxr-xr-x[-rw-r--r--]openmax/core/Exynos_OMX_Component_Register.c9
-rw-r--r--openmax/core/Exynos_OMX_Core.c11
-rwxr-xr-x[-rw-r--r--]openmax/osal/Exynos_OSAL_Event.c1
-rwxr-xr-x[-rw-r--r--]openmax/osal/Exynos_OSAL_Mutex.c2
-rwxr-xr-xopenmax/osal/Exynos_OSAL_Platform_Specific.c10
-rwxr-xr-xopenmax/osal/Exynos_OSAL_SharedMemory.c2
31 files changed, 217 insertions, 745 deletions
diff --git a/exynos/libv4l2/exynos_mc.c b/exynos/libv4l2/exynos_mc.c
index 66ec719..03e066c 100755
--- a/exynos/libv4l2/exynos_mc.c
+++ b/exynos/libv4l2/exynos_mc.c
@@ -27,6 +27,7 @@
*
*/
+#include <unistd.h>
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
@@ -179,11 +180,11 @@ static int __media_get_devname_sysfs(struct media_entity *entity)
char *p;
int ret;
- sprintf(sysname, "/sys/dev/char/%u:%u", entity->info.v4l.major,
+ snprintf(sysname, sizeof(sysname), "/sys/dev/char/%u:%u", entity->info.v4l.major,
entity->info.v4l.minor);
ret = readlink(sysname, target, sizeof(target));
- if (ret < 0)
+ if (ret < 0 || ret >= (int)sizeof(target))
return -errno;
target[ret] = '\0';
@@ -191,21 +192,16 @@ static int __media_get_devname_sysfs(struct media_entity *entity)
if (p == NULL)
return -EINVAL;
- sprintf(devname, "/tmp/%s", p + 1);
+ snprintf(devname, sizeof(devname), "/tmp/%s", p + 1);
ret = mknod(devname, 0666 | S_IFCHR, MKDEV(81, entity->info.v4l.minor));
- strcpy(entity->devname, devname);
+ strncpy(entity->devname, devname, sizeof(devname) - 1);
return 0;
}
static int __media_get_media_fd(const char *filename, struct media_device *media)
{
- ssize_t num;
- int media_node;
- char *ptr;
- char media_buf[6];
-
ALOGD("%s: %s", __func__, filename);
media->fd = open(filename, O_RDWR, 0);
@@ -231,6 +227,10 @@ static int __media_enum_entities(struct media_device *media)
for (id = 0, ret = 0; ; id = entity->info.id) {
size = (media->entities_count + 1) * sizeof(*media->entities);
media->entities = (struct media_entity*)realloc(media->entities, size);
+ if (media->entities == NULL) {
+ ret = -ENOMEM;
+ break;
+ }
entity = &media->entities[media->entities_count];
memset(entity, 0, sizeof(*entity));
diff --git a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c
index 31217df..06c2eed 100755
--- a/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c
+++ b/exynos4/libcodec/video/v4l2/dec/ExynosVideoDecoder.c
@@ -1742,7 +1742,6 @@ static ExynosVideoBuffer *MFC_Decoder_Dequeue_Outbuf(void *pHandle)
}
#endif
switch (buf.flags & (0x7 << 3)) {
- ALOGV("%s: frameType: %d", __func__, buf.flags & (0x7 << 3));
case V4L2_BUF_FLAG_KEYFRAME:
pOutbuf->frameType = VIDEO_FRAME_I;
break;
diff --git a/openmax/component/audio/dec/Exynos_OMX_Adec.c b/openmax/component/audio/dec/Exynos_OMX_Adec.c
index 734d16a..0de66dc 100755
--- a/openmax/component/audio/dec/Exynos_OMX_Adec.c
+++ b/openmax/component/audio/dec/Exynos_OMX_Adec.c
@@ -241,8 +241,6 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer(
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL;
- OMX_U8 *temp_buffer = NULL;
OMX_U32 i = 0;
FunctionIn();
@@ -318,29 +316,12 @@ EXIT:
OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL;
- OMX_U8 *temp_buffer = NULL;
- OMX_U32 bufferSize = 0;
- OMX_PARAM_PORTDEFINITIONTYPE portDefinition;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT* pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE* temp_bufferHeader = NULL;
- OMX_U8 *temp_buffer = NULL;
- OMX_U32 bufferSize = 0;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
@@ -350,11 +331,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
OMX_IN OMX_U32 nTunneledPort,
OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosComponent)
@@ -419,7 +396,6 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
dataBuffer->nFlags = 0;
dataBuffer->timeStamp = 0;
-EXIT:
FunctionOut();
return ret;
@@ -526,7 +502,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
dataBuffer->nFlags = 0;
dataBuffer->timeStamp = 0;
-EXIT:
FunctionOut();
return ret;
@@ -770,7 +745,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess(OMX_HANDLETYPE hComponent)
EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port1WayDataBuffer.dataBuffer;
EXYNOS_OMX_DATA *inputData = &exynosInputPort->processData;
EXYNOS_OMX_DATA *outputData = &exynosOutputPort->processData;
- OMX_U32 copySize = 0;
pExynosComponent->reInputData = OMX_FALSE;
@@ -824,7 +798,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess(OMX_HANDLETYPE hComponent)
Exynos_OSAL_MutexUnlock(outputUseBuffer->bufferMutex);
Exynos_OSAL_MutexUnlock(inputUseBuffer->bufferMutex);
- if (ret == OMX_ErrorInputDataDecodeYet)
+ if (ret == (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet)
pExynosComponent->reInputData = OMX_TRUE;
else
pExynosComponent->reInputData = OMX_FALSE;
@@ -835,8 +809,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess(OMX_HANDLETYPE hComponent)
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -870,7 +842,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
EXYNOS_OMX_DATABUFFER *flushPortBuffer = NULL;
OMX_BUFFERHEADERTYPE *bufferHeader = NULL;
EXYNOS_OMX_MESSAGE *message = NULL;
- OMX_U32 flushNum = 0;
OMX_S32 semValue = 0;
FunctionIn();
@@ -926,7 +897,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
pExynosPort->processData.timeStamp = 0;
pExynosPort->processData.usedDataLen = 0;
-EXIT:
FunctionOut();
return ret;
@@ -936,10 +906,8 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_AUDIODEC_COMPONENT *pAudioDec = NULL;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_DATABUFFER *flushPortBuffer = NULL;
- OMX_U32 i = 0, cnt = 0;
FunctionIn();
#ifdef TIZEN_FEATURE_E3250
@@ -960,7 +928,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n
goto EXIT;
}
pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- pAudioDec = (EXYNOS_OMX_AUDIODEC_COMPONENT *)pExynosComponent->hComponentHandle;
Exynos_OSAL_SignalSet(pExynosComponent->pauseEvent);
@@ -1014,7 +981,6 @@ OMX_ERRORTYPE Exynos_OMX_AudioDecodeGetParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
FunctionIn();
@@ -1124,7 +1090,6 @@ OMX_ERRORTYPE Exynos_OMX_AudioDecodeSetParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
FunctionIn();
@@ -1159,10 +1124,8 @@ OMX_ERRORTYPE Exynos_OMX_AudioDecodeSetParameter(
{
OMX_AUDIO_PARAM_PORTFORMATTYPE *portFormat = (OMX_AUDIO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure;
OMX_U32 portIndex = portFormat->nPortIndex;
- OMX_U32 index = portFormat->nIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_PARAM_PORTDEFINITIONTYPE *portDefinition = NULL;
- OMX_U32 supportFormatNum = 0; /* supportFormatNum = N-1 */
ret = Exynos_OMX_Check_SizeVersion(portFormat, sizeof(OMX_AUDIO_PARAM_PORTFORMATTYPE));
if (ret != OMX_ErrorNone) {
@@ -1350,8 +1313,6 @@ static OMX_ERRORTYPE Exynos_OMX_BufferProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pSECComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -1364,7 +1325,6 @@ static OMX_ERRORTYPE Exynos_OMX_BufferProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pSECComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_BufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -1390,7 +1350,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent)
Exynos_OMX_BufferProcessThread,
pOMXComponent);
-EXIT:
FunctionOut();
return ret;
@@ -1419,7 +1378,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent)
Exynos_OSAL_ThreadTerminate(pAudioDec->hBufferProcessThread);
pAudioDec->hBufferProcessThread = NULL;
-EXIT:
FunctionOut();
return ret;
diff --git a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c
index 56cc7d5..1ba3815 100755
--- a/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c
+++ b/openmax/component/audio/dec/mp3/Exynos_OMX_Mp3dec.c
@@ -130,7 +130,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_GetParameter(
break;
case OMX_IndexParamStandardComponentRole:
{
- OMX_S32 codecType;
OMX_PARAM_COMPONENTROLETYPE *pComponentRole = (OMX_PARAM_COMPONENTROLETYPE *)pComponentParameterStructure;
ret = Exynos_OMX_Check_SizeVersion(pComponentRole, sizeof(OMX_PARAM_COMPONENTROLETYPE));
@@ -397,7 +396,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_ComponentRoleEnum(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- OMX_S32 codecType;
FunctionIn();
@@ -458,7 +456,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
outFile = fopen("/data/OutFile.pcm", "w+");
#endif
-EXIT:
FunctionOut();
return ret;
@@ -467,7 +464,6 @@ EXIT:
OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
FunctionIn();
@@ -476,7 +472,6 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
fclose(outFile);
#endif
-EXIT:
FunctionOut();
return ret;
@@ -678,7 +673,7 @@ OMX_ERRORTYPE Exynos_SRP_Mp3Dec_bufferProcess(OMX_COMPONENTTYPE *pOMXComponent,
ret = Exynos_SRP_Mp3_Decode_Block(pOMXComponent, pInputData, pOutputData);
if (ret != OMX_ErrorNone) {
- if (ret == OMX_ErrorInputDataDecodeYet) {
+ if (ret == (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) {
pOutputData->usedDataLen = 0;
pOutputData->remainDataLen = pOutputData->dataLen;
} else {
@@ -717,7 +712,6 @@ OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent
unsigned int outputBufferSize = 0;
unsigned int outputBufferNum = 0;
OMX_S32 returnCodec;
- int i = 0;
FunctionIn();
diff --git a/openmax/component/common/Exynos_OMX_Basecomponent.c b/openmax/component/common/Exynos_OMX_Basecomponent.c
index b440efe..4cf6289 100755
--- a/openmax/component/common/Exynos_OMX_Basecomponent.c
+++ b/openmax/component/common/Exynos_OMX_Basecomponent.c
@@ -172,7 +172,6 @@ OMX_ERRORTYPE Exynos_OMX_ComponentStateSet(OMX_COMPONENTTYPE *pOMXComponent, OMX
OMX_STATETYPE destState = messageParam;
OMX_STATETYPE currentState = pExynosComponent->currentState;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_S32 countValue = 0;
unsigned int i = 0, j = 0;
int k = 0;
@@ -677,7 +676,6 @@ static OMX_ERRORTYPE Exynos_StateSet(EXYNOS_OMX_BASECOMPONENT *pExynosComponent,
static OMX_ERRORTYPE Exynos_SetPortFlush(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nParam)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_S32 portIndex = nParam;
OMX_U16 i = 0, cnt = 0, index = 0;
@@ -716,7 +714,7 @@ static OMX_ERRORTYPE Exynos_SetPortEnable(EXYNOS_OMX_BASECOMPONENT *pExynosCompo
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_S32 portIndex = nParam;
- OMX_U16 i = 0, cnt = 0;
+ OMX_U16 i = 0;
FunctionIn();
@@ -759,7 +757,7 @@ static OMX_ERRORTYPE Exynos_SetPortDisable(EXYNOS_OMX_BASECOMPONENT *pExynosComp
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_S32 portIndex = nParam;
- OMX_U16 i = 0, cnt = 0;
+ OMX_U16 i = 0;
FunctionIn();
@@ -795,10 +793,6 @@ EXIT:
static OMX_ERRORTYPE Exynos_SetMarkBuffer(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nParam)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_U32 portIndex = nParam;
- OMX_U16 i = 0, cnt = 0;
-
if (nParam >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
@@ -853,7 +847,6 @@ OMX_ERRORTYPE Exynos_OMX_SendCommand(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
diff --git a/openmax/component/common/Exynos_OMX_Basecomponent.h b/openmax/component/common/Exynos_OMX_Basecomponent.h
index 6e889f8..5572639 100644..100755
--- a/openmax/component/common/Exynos_OMX_Basecomponent.h
+++ b/openmax/component/common/Exynos_OMX_Basecomponent.h
@@ -104,8 +104,8 @@ typedef struct _EXYNOS_OMX_BASECOMPONENT
OMX_ERRORTYPE (*exynos_AllocateTunnelBuffer)(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex);
OMX_ERRORTYPE (*exynos_FreeTunnelBuffer)(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex);
- OMX_ERRORTYPE (*exynos_BufferProcessCreate)(OMX_COMPONENTTYPE *pOMXComponent);
- OMX_ERRORTYPE (*exynos_BufferProcessTerminate)(OMX_COMPONENTTYPE *pOMXComponent);
+ OMX_ERRORTYPE (*exynos_BufferProcessCreate)(OMX_HANDLETYPE pOMXComponent);
+ OMX_ERRORTYPE (*exynos_BufferProcessTerminate)(OMX_HANDLETYPE pOMXComponent);
OMX_ERRORTYPE (*exynos_BufferFlush)(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);
} EXYNOS_OMX_BASECOMPONENT;
diff --git a/openmax/component/common/Exynos_OMX_Baseport.c b/openmax/component/common/Exynos_OMX_Baseport.c
index 552fa4d..999155c 100755
--- a/openmax/component/common/Exynos_OMX_Baseport.c
+++ b/openmax/component/common/Exynos_OMX_Baseport.c
@@ -99,9 +99,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OM
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_S32 portIndex = 0;
- EXYNOS_OMX_DATABUFFER *flushPortBuffer[2] = {NULL, NULL};
OMX_U32 i = 0, cnt = 0;
FunctionIn();
@@ -155,7 +153,6 @@ OMX_ERRORTYPE Exynos_OMX_EnablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 po
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_U32 i = 0, cnt = 0;
FunctionIn();
#ifdef TIZEN_FEATURE_E3250
@@ -173,7 +170,6 @@ OMX_ERRORTYPE Exynos_OMX_EnablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 po
ret = OMX_ErrorNone;
-EXIT:
FunctionOut();
return ret;
@@ -242,7 +238,6 @@ OMX_ERRORTYPE Exynos_OMX_DisablePort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 p
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_U32 i = 0, elemNum = 0;
EXYNOS_OMX_MESSAGE *message;
FunctionIn();
@@ -280,10 +275,8 @@ OMX_ERRORTYPE Exynos_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OM
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_S32 portIndex = 0;
OMX_U32 i = 0, cnt = 0;
- EXYNOS_OMX_DATABUFFER *flushPortBuffer[2] = {NULL, NULL};
FunctionIn();
@@ -566,7 +559,6 @@ OMX_ERRORTYPE Exynos_OMX_Port_Constructor(OMX_HANDLETYPE hComponent)
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_BASEPORT *pExynosInputPort = NULL;
EXYNOS_OMX_BASEPORT *pExynosOutputPort = NULL;
- int i = 0;
FunctionIn();
diff --git a/openmax/component/common/Exynos_OMX_Baseport.h b/openmax/component/common/Exynos_OMX_Baseport.h
index df52a3c..ee297c8 100755
--- a/openmax/component/common/Exynos_OMX_Baseport.h
+++ b/openmax/component/common/Exynos_OMX_Baseport.h
@@ -201,6 +201,9 @@ typedef struct _EXYNOS_OMX_BASEPORT
extern "C" {
#endif
+OMX_ERRORTYPE Exynos_OMX_FillThisBuffer(
+ OMX_IN OMX_HANDLETYPE hComponent,
+ OMX_IN OMX_BUFFERHEADERTYPE *pBuffer);
OMX_ERRORTYPE Exynos_OMX_PortEnableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex);
OMX_ERRORTYPE Exynos_OMX_PortDisableProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex);
OMX_ERRORTYPE Exynos_OMX_BufferFlushProcess(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);
@@ -210,6 +213,8 @@ OMX_ERRORTYPE Exynos_ResetDataBuffer(EXYNOS_OMX_DATABUFFER *pDataBuffer);
OMX_ERRORTYPE Exynos_ResetCodecData(EXYNOS_OMX_DATA *pData);
OMX_ERRORTYPE Exynos_Shared_BufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_PLANE nPlane);
OMX_ERRORTYPE Exynos_Shared_DataToBuffer(EXYNOS_OMX_DATA *pData, EXYNOS_OMX_DATABUFFER *pUseBuffer);
+OMX_ERRORTYPE Exynos_OMX_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, OMX_BUFFERHEADERTYPE* bufferHeader);
+OMX_ERRORTYPE Exynos_OMX_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, OMX_BUFFERHEADERTYPE* bufferHeader);
#ifdef __cplusplus
};
diff --git a/openmax/component/common/Exynos_OMX_Resourcemanager.c b/openmax/component/common/Exynos_OMX_Resourcemanager.c
index 7c3aa37..279a436 100755
--- a/openmax/component/common/Exynos_OMX_Resourcemanager.c
+++ b/openmax/component/common/Exynos_OMX_Resourcemanager.c
@@ -163,7 +163,6 @@ int searchLowPriority(EXYNOS_OMX_RM_COMPONENT_LIST *RMComp_list, OMX_U32 inComp_
else
ret = 1;
-EXIT:
return ret;
}
@@ -258,7 +257,7 @@ OMX_ERRORTYPE Exynos_OMX_ResourceManager_Deinit()
ghVideoRMComponentListMutex = NULL;
ret = OMX_ErrorNone;
-EXIT:
+
FunctionOut();
return ret;
diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.c b/openmax/component/video/dec/Exynos_OMX_Vdec.c
index d426153..3fa4f06 100644..100755
--- a/openmax/component/video/dec/Exynos_OMX_Vdec.c
+++ b/openmax/component/video/dec/Exynos_OMX_Vdec.c
@@ -35,10 +35,12 @@
#include "Exynos_OMX_Vdec.h"
#include "Exynos_OMX_VdecControl.h"
#include "Exynos_OMX_Basecomponent.h"
+#include "Exynos_OMX_Baseport.h"
#include "Exynos_OSAL_Thread.h"
#include "Exynos_OSAL_Semaphore.h"
#include "Exynos_OSAL_Mutex.h"
#include "Exynos_OSAL_ETC.h"
+#include "Exynos_OSAL_SharedMemory.h"
#ifdef USE_PB
#include "Exynos_OSAL_Platform_Specific.h"
@@ -173,7 +175,6 @@ OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosCompo
OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
CODEC_DEC_BUFFER *pInputCodecBuffer = (CODEC_DEC_BUFFER *)codecBuffer;
pData->buffer.singlePlaneBuffer.dataBuffer = pInputCodecBuffer->pVirAddr[0];
@@ -217,8 +218,6 @@ OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosC
void Exynos_Wait_ProcessPause(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex)
{
- EXYNOS_OMX_BASEPORT *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *exynosOMXPort = NULL;
FunctionIn();
@@ -249,7 +248,6 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer;
- OMX_U32 copySize = 0;
DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL;
#ifdef TIZEN_FEATURE_E3250
MMVideoBuffer *pSlpOutBuf = NULL;
@@ -313,8 +311,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
pSlpOutBuf->handle.dmabuf_fd[2]);
ret = OMX_TRUE;
- goto EXIT;
-#endif
+#else
pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[0];
pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.dataBuffer[1];
@@ -327,9 +324,9 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
csc_get_method(pVideoDec->csc_handle, &csc_method);
#ifdef USE_DMA_BUF
if (csc_method == CSC_METHOD_HW) {
- pSrcBuf[0] = dstOutputData->buffer.multiPlaneBuffer.fd[0];
- pSrcBuf[1] = dstOutputData->buffer.multiPlaneBuffer.fd[1];
- pSrcBuf[2] = dstOutputData->buffer.multiPlaneBuffer.fd[2];
+ pSrcBuf[0] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[0]);
+ pSrcBuf[1] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[1]);
+ pSrcBuf[2] = (unsigned char *)(&dstOutputData->buffer.multiPlaneBuffer.fd[2]);
}
#endif
@@ -356,7 +353,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
#ifdef USE_DMA_BUF
if ((exynosOutputPort->bIsPBEnabled == OMX_FALSE) &&
(csc_method == CSC_METHOD_HW)) {
- pYUVBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoDec->hSharedMemory, pOutputBuf);
+ pYUVBuf[0] = Exynos_OSAL_SharedMemory_VirtToION(pVideoDec->hSharedMemory, (OMX_PTR)pOutputBuf);
pYUVBuf[1] = NULL;
pYUVBuf[2] = NULL;
}
@@ -402,7 +399,7 @@ OMX_BOOL Exynos_CSC_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
ret = OMX_FALSE;
else
ret = OMX_TRUE;
-
+#endif
#ifdef USE_PB
if (exynosOutputPort->bIsPBEnabled == OMX_TRUE) {
#ifdef TIZEN_FEATURE_E3250
@@ -423,7 +420,6 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
{
OMX_BOOL ret = OMX_FALSE;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_DATABUFFER *inputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer;
OMX_U32 copySize = 0;
@@ -445,6 +441,7 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
Exynos_Shared_BufferToData(inputUseBuffer, srcInputData, ONE_PLANE);
#ifndef TIZEN_FEATURE_E3250
+ EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
if (pVideoDec->bDRMPlayerMode == OMX_TRUE) {
OMX_PTR dataBuffer = NULL;
@@ -526,12 +523,10 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
{
OMX_BOOL ret = OMX_FALSE;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_OMX_BASEPORT *exynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_DATABUFFER *outputUseBuffer = &exynosOutputPort->way.port2WayDataBuffer.outputDataBuffer;
OMX_U32 copySize = 0;
- DECODE_CODEC_EXTRA_BUFFERINFO *pBufferInfo = NULL;
FunctionIn();
@@ -585,15 +580,7 @@ OMX_BOOL Exynos_Postprocess_OutputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
}
if (exynosOutputPort->bufferProcessType & BUFFER_COPY) {
- OMX_U32 width = 0, height = 0;
- int imageSize = 0;
- void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer;
-
- pBufferInfo = (DECODE_CODEC_EXTRA_BUFFERINFO *)dstOutputData->extInfo;
-
- width = pBufferInfo->imageWidth;
- height = pBufferInfo->imageHeight;
- imageSize = width * height;
+ //void *pOutputBuf = (void *)outputUseBuffer->bufferHeader->pBuffer;
if ((dstOutputData->remainDataLen <= (outputUseBuffer->allocSize - outputUseBuffer->dataLen)) &&
(!CHECK_PORT_BEING_FLUSHED(exynosOutputPort))) {
@@ -685,7 +672,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent)
EXYNOS_OMX_DATABUFFER *srcInputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer;
EXYNOS_OMX_DATA *pSrcInputData = &exynosInputPort->processData;
OMX_BOOL bCheckInputData = OMX_FALSE;
- OMX_BOOL bValidCodecData = OMX_FALSE;
OMX_BOOL bCodecConfigured = OMX_FALSE;
FunctionIn();
@@ -699,13 +685,13 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent)
Exynos_OSAL_SleepMillisec(0);
if ((CHECK_PORT_BEING_FLUSHED(exynosInputPort)) ||
- ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == OMX_ErrorInputDataDecodeYet)))
+ ((exynosOutputPort->exceptionFlag == NEED_PORT_DISABLE) && (ret == (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet)))
break;
if (exynosInputPort->portState != OMX_StateIdle)
break;
Exynos_OSAL_MutexLock(srcInputUseBuffer->bufferMutex);
- if (ret != OMX_ErrorInputDataDecodeYet) {
+ if (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) {
if (exynosInputPort->bufferProcessType & BUFFER_COPY) {
OMX_PTR codecBuffer;
@@ -751,7 +737,7 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent)
ret = pVideoDec->exynos_codec_srcInputProcess(pOMXComponent, pSrcInputData);
- if (ret == OMX_ErrorCorruptedFrame) {
+ if (ret == (OMX_ERRORTYPE)OMX_ErrorCorruptedFrame) {
if (exynosInputPort->bufferProcessType & BUFFER_COPY) {
OMX_PTR codecBuffer;
codecBuffer = pSrcInputData->pPrivate;
@@ -764,17 +750,15 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent)
}
}
- if (ret != OMX_ErrorInputDataDecodeYet) {
+ if (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) {
Exynos_ResetCodecData(pSrcInputData);
}
Exynos_OSAL_MutexUnlock(srcInputUseBuffer->bufferMutex);
- if (ret == OMX_ErrorCodecInit)
+ if (ret == (OMX_ERRORTYPE)OMX_ErrorCodecInit)
pVideoDec->bExitBufferProcessThread = OMX_TRUE;
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -825,8 +809,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent)
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -858,7 +840,7 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent)
break;
Exynos_OSAL_MutexLock(dstInputUseBuffer->bufferMutex);
- if (ret != OMX_ErrorOutputBufferUseYet) {
+ if (ret != (OMX_ERRORTYPE)OMX_ErrorOutputBufferUseYet) {
if (exynosOutputPort->bufferProcessType & BUFFER_COPY) {
OMX_PTR codecBuffer;
ret = Exynos_CodecBufferDeQueue(pExynosComponent, OUTPUT_PORT_INDEX, &codecBuffer);
@@ -900,15 +882,13 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent)
}
ret = pVideoDec->exynos_codec_dstInputProcess(pOMXComponent, &dstInputData);
- if (ret != OMX_ErrorOutputBufferUseYet) {
+ if (ret != (OMX_ERRORTYPE)OMX_ErrorOutputBufferUseYet) {
Exynos_ResetCodecData(&dstInputData);
}
Exynos_OSAL_MutexUnlock(dstInputUseBuffer->bufferMutex);
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -973,8 +953,6 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent)
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -984,8 +962,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -998,7 +974,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_SrcInputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -1013,8 +988,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -1027,7 +1000,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_SrcOutputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -1042,8 +1014,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -1056,7 +1026,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_DstInputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -1071,8 +1040,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -1085,7 +1052,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_DstOutputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -1123,7 +1089,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent)
Exynos_OMX_SrcInputProcessThread,
pOMXComponent);
-EXIT:
FunctionOut();
return ret;
@@ -1136,7 +1101,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent)
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
OMX_S32 countValue = 0;
- unsigned int i = 0;
FunctionIn();
@@ -1174,7 +1138,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent)
Exynos_OSAL_ThreadTerminate(pVideoDec->hDstOutputThread);
pVideoDec->hDstOutputThread = NULL;
-EXIT:
FunctionOut();
return ret;
diff --git a/openmax/component/video/dec/Exynos_OMX_Vdec.h b/openmax/component/video/dec/Exynos_OMX_Vdec.h
index 89fe484..d125bd9 100644..100755
--- a/openmax/component/video/dec/Exynos_OMX_Vdec.h
+++ b/openmax/component/video/dec/Exynos_OMX_Vdec.h
@@ -168,6 +168,8 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent);
OMX_ERRORTYPE Exynos_OMX_VideoDecodeComponentInit(OMX_IN OMX_HANDLETYPE hComponent);
OMX_ERRORTYPE Exynos_OMX_VideoDecodeComponentDeinit(OMX_IN OMX_HANDLETYPE hComponent);
+OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent);
+OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent);
#ifdef __cplusplus
}
#endif
diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.c b/openmax/component/video/dec/Exynos_OMX_VdecControl.c
index b6db0e5..3a23044 100644..100755
--- a/openmax/component/video/dec/Exynos_OMX_VdecControl.c
+++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.c
@@ -38,6 +38,7 @@
#include "Exynos_OSAL_Mutex.h"
#include "Exynos_OSAL_ETC.h"
#include "Exynos_OSAL_SharedMemory.h"
+#include "Exynos_OMX_Baseport.h"
#ifdef USE_PB
#include "Exynos_OSAL_Platform_Specific.h"
@@ -144,7 +145,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer(
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "\nPlatformBuffer: buf %d pYUVBuf[0]:0x%x , pYUVBuf[1]:0x%x ",
i, pExynosPort->extendBufferHeader[i].pYUVBuf[0], pExynosPort->extendBufferHeader[i].pYUVBuf[1]);
} else if ((pVideoDec->bDRMPlayerMode == OMX_TRUE) && (nPortIndex == INPUT_PORT_INDEX)) {
- pExynosPort->extendBufferHeader[i].buf_fd[0] = pBuffer;
+ pExynosPort->extendBufferHeader[i].buf_fd[0] = (int)pBuffer;
} else if(nPortIndex == INPUT_PORT_INDEX){
MMVideoBuffer * pSlpOutBuf = (MMVideoBuffer *)pBuffer;
temp_bufferHeader->pBuffer = pSlpOutBuf->data[0];
@@ -270,7 +271,7 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer(
pExynosPort->bufferStateAllocate[i] = (BUFFER_STATE_ALLOCATED | HEADER_STATE_ALLOCATED);
INIT_SET_SIZE_VERSION(temp_bufferHeader, OMX_BUFFERHEADERTYPE);
if (mem_type == SECURE_MEMORY)
- temp_bufferHeader->pBuffer = temp_buffer_fd;
+ temp_bufferHeader->pBuffer = (OMX_U8 *)temp_buffer_fd;
else
temp_bufferHeader->pBuffer = temp_buffer;
temp_bufferHeader->nAllocLen = nSizeBytes;
@@ -313,8 +314,6 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer(
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL;
- OMX_U8 *temp_buffer = NULL;
OMX_U32 i = 0;
FunctionIn();
@@ -396,29 +395,13 @@ EXIT:
OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE *temp_bufferHeader = NULL;
- OMX_U8 *temp_buffer = NULL;
- OMX_U32 bufferSize = 0;
- OMX_PARAM_PORTDEFINITIONTYPE portDefinition;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer(EXYNOS_OMX_BASEPORT *pOMXBasePort, OMX_U32 nPortIndex)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT* pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE* temp_bufferHeader = NULL;
- OMX_U8 *temp_buffer = NULL;
- OMX_U32 bufferSize = 0;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
@@ -428,11 +411,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
OMX_IN OMX_U32 nTunneledPort,
OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_DATABUFFER *pDataBuffer[])
@@ -450,7 +429,6 @@ OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS
pDataBuffer[1] = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer);
}
-EXIT:
FunctionOut();
return ret;
@@ -465,7 +443,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
OMX_BUFFERHEADERTYPE *bufferHeader = NULL;
EXYNOS_OMX_DATABUFFER *pDataPortBuffer[2] = {NULL, NULL};
EXYNOS_OMX_MESSAGE *message = NULL;
- OMX_U32 flushNum = 0;
OMX_S32 semValue = 0;
int i = 0, maxBufferNum = 0;
FunctionIn();
@@ -548,7 +525,6 @@ OMX_ERRORTYPE Exynos_OMX_FlushPort(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 por
}
Exynos_OSAL_ResetQueue(&pExynosPort->bufferQ);
-EXIT:
FunctionOut();
return ret;
@@ -561,7 +537,7 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 n
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_DATABUFFER *flushPortBuffer[2] = {NULL, NULL};
- OMX_U32 i = 0, cnt = 0;
+
FunctionIn();
#ifdef TIZEN_FEATURE_E3250
@@ -700,7 +676,6 @@ OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
/* reset dataBuffer */
Exynos_ResetDataBuffer(dataBuffer);
-EXIT:
FunctionOut();
return ret;
@@ -745,7 +720,6 @@ OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EX
/* reset dataBuffer */
Exynos_ResetDataBuffer(dataBuffer);
-EXIT:
FunctionOut();
return ret;
@@ -856,7 +830,6 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent)
/* reset dataBuffer */
Exynos_ResetDataBuffer(dataBuffer);
-EXIT:
FunctionOut();
return ret;
@@ -866,7 +839,6 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_BUFFERHEADERTYPE *bufferHeader = NULL;
FunctionIn();
@@ -901,7 +873,6 @@ OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, E
/* reset dataBuffer */
Exynos_ResetDataBuffer(dataBuffer);
-EXIT:
FunctionOut();
return ret;
@@ -1043,13 +1014,13 @@ OMX_ERRORTYPE Exynos_CodecBufferDeQueue(EXYNOS_OMX_BASECOMPONENT *pExynosCompone
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_U32 tempData;
+ void *tempData;
FunctionIn();
pExynosPort = &pExynosComponent->pExynosPort[PortIndex];
Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID);
- tempData = (OMX_U32)Exynos_OSAL_Dequeue(&pExynosPort->codecBufferQ);
+ tempData = Exynos_OSAL_Dequeue(&pExynosPort->codecBufferQ);
if (tempData == NULL) {
*data = NULL;
ret = OMX_ErrorUndefined;
@@ -1080,7 +1051,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset(EXYNOS_OMX_BASECOMPONENT *pExynosComponent
goto EXIT;
}
while (1) {
- int cnt = 0;
+ OMX_S32 cnt = 0;
Exynos_OSAL_Get_SemaphoreCount(pExynosPort->codecSemID, &cnt);
if (cnt > 0)
Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID);
@@ -1103,7 +1074,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeGetParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
FunctionIn();
@@ -1245,7 +1215,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
FunctionIn();
@@ -1280,10 +1249,8 @@ OMX_ERRORTYPE Exynos_OMX_VideoDecodeSetParameter(
{
OMX_VIDEO_PARAM_PORTFORMATTYPE *portFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)ComponentParameterStructure;
OMX_U32 portIndex = portFormat->nPortIndex;
- OMX_U32 index = portFormat->nIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
OMX_PARAM_PORTDEFINITIONTYPE *portDefinition = NULL;
- OMX_U32 supportFormatNum = 0;
ret = Exynos_OMX_Check_SizeVersion(portFormat, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
if (ret != OMX_ErrorNone) {
diff --git a/openmax/component/video/dec/Exynos_OMX_VdecControl.h b/openmax/component/video/dec/Exynos_OMX_VdecControl.h
index ca12a6b..c2ecef6 100644..100755
--- a/openmax/component/video/dec/Exynos_OMX_VdecControl.h
+++ b/openmax/component/video/dec/Exynos_OMX_VdecControl.h
@@ -92,6 +92,12 @@ OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent);
OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);
OMX_ERRORTYPE Exynos_FlushInputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer);
OMX_ERRORTYPE Exynos_FlushOutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATABUFFER *dataBuffer);
+OMX_ERRORTYPE Exynos_CodecBufferReset(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 PortIndex);
+OMX_ERRORTYPE Exynos_CodecBufferEnQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 PortIndex, OMX_PTR data);
+OMX_BUFFERHEADERTYPE *Exynos_OutputBufferGetQueue_Direct(EXYNOS_OMX_BASECOMPONENT *pExynosComponent);
+OMX_ERRORTYPE Exynos_OutputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent);
+OMX_ERRORTYPE Exynos_CodecBufferDeQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 PortIndex, OMX_PTR *data);
+OMX_ERRORTYPE Exynos_InputBufferGetQueue(EXYNOS_OMX_BASECOMPONENT *pExynosComponent);
#ifdef USE_PB
OMX_ERRORTYPE Exynos_Shared_PlatformBufferToData(EXYNOS_OMX_DATABUFFER *pUseBuffer, EXYNOS_OMX_DATA *pData, EXYNOS_OMX_BASEPORT *pExynosPort, EXYNOS_OMX_PLANE nPlane);
diff --git a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c
index 62f2380..dd203ab 100755
--- a/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c
+++ b/openmax/component/video/dec/h264/Exynos_OMX_H264dec.c
@@ -41,6 +41,7 @@
#include "ExynosVideoApi.h"
#include "Exynos_OSAL_SharedMemory.h"
#include "Exynos_OSAL_Event.h"
+#include "Exynos_OMX_VdecControl.h"
@@ -112,16 +113,13 @@ EXYNOS_OMX_VIDEO_PROFILELEVEL supportedAVCProfileLevels[] ={
static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
-static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[])
+static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[])
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- ExynosVideoBuffer *pCodecBuffer;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ ExynosVideoBuffer *pCodecBuffer = NULL;
if (codecBuffer == NULL) {
ret = OMX_ErrorBadParameter;
@@ -412,7 +410,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -438,7 +435,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
}
hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
@@ -459,7 +455,6 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -484,7 +479,6 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex
}
hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
@@ -513,7 +507,6 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
ExynosVideoGeometry bufferConf;
OMX_U32 inputBufferNumber = 0;
int i, plane;
@@ -610,16 +603,20 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
/* Register input buffer */
for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) {
ExynosVideoPlane plane;
+#if 0
if (pVideoDec->bDRMPlayerMode == OMX_TRUE) {
-#ifdef TIZEN_FEATURE_E3250
+#endif
+#ifdef TIZEN_FEATURE_E54XX
/* IL Client assigns FD value in pBuffer */
plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer;
#else
plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
#endif
+#if 0
} else {
plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer;
}
+#endif
plane.allocSize = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->nAllocLen;
plane.fd = pExynosInputPort->extendBufferHeader[i].buf_fd[0];
if (pInbufOps->Register(hMFCHandle, &plane, MFC_INPUT_BUFFER_PLANE) != VIDEO_ERROR_NONE) {
@@ -640,10 +637,6 @@ EXIT:
OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
EXYNOS_H264DEC_HANDLE *pH264Dec = NULL;
@@ -665,10 +658,6 @@ OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent,
goto EXIT;
}
- hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
- pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
- pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
if (nPortIndex == INPUT_PORT_INDEX) {
if (pH264Dec->bSourceStart == OMX_FALSE) {
@@ -699,8 +688,6 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
int i, nOutbufs;
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
@@ -728,7 +715,6 @@ OMX_ERRORTYPE H264CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pH264Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
@@ -797,7 +783,6 @@ EXIT:
OMX_ERRORTYPE H264CodecDstFreeCodecBuffers(
OMX_COMPONENTTYPE *pOMXComponent)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle;
@@ -938,8 +923,6 @@ OMX_ERRORTYPE H264CodecResetupAllElement(
EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
- int i, j, nOutbufs;
-
FunctionIn();
if ((nPortIndex == INPUT_PORT_INDEX) &&
@@ -989,19 +972,15 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
ExynosVideoGeometry bufferConf;
- OMX_U32 inputBufferNumber = 0;
- int i;
FunctionIn();
@@ -1082,11 +1061,9 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
int i, nOutbufs;
@@ -1221,10 +1198,7 @@ OMX_ERRORTYPE H264CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
- ExynosVideoGeometry bufferConf;
- int i;
FunctionIn();
@@ -1875,7 +1849,6 @@ OMX_ERRORTYPE Exynos_H264Dec_GetExtensionIndex(
}
if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) {
- EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
*pIndexType = OMX_IndexVendorThumbnailMode;
ret = OMX_ErrorNone;
}
@@ -1901,8 +1874,6 @@ OMX_ERRORTYPE Exynos_H264Dec_ComponentRoleEnum(
OMX_U32 nIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
FunctionIn();
@@ -1932,11 +1903,6 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle;
- OMX_PTR hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
-
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
CSC_METHOD csc_method = CSC_METHOD_SW;
int i, plane;
@@ -1954,10 +1920,6 @@ OMX_ERRORTYPE Exynos_H264Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
goto EXIT;
}
- pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
- pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
- pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
-
if (pExynosInputPort->bufferProcessType & BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
@@ -2055,13 +2017,8 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- OMX_PTR hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
-
- int i, plane;
+ int i;
FunctionIn();
@@ -2113,7 +2070,7 @@ OMX_ERRORTYPE Exynos_H264Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
}
H264CodecClose(pH264Dec);
-EXIT:
+
FunctionOut();
return ret;
@@ -2126,15 +2083,11 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
OMX_BOOL bInStartCode = OMX_FALSE;
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
- int i;
FunctionIn();
@@ -2215,7 +2168,6 @@ OMX_ERRORTYPE Exynos_H264Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pH264Dec->hMFCH264Handle.pInbufOps;
ExynosVideoBuffer *pVideoBuffer;
@@ -2273,7 +2225,6 @@ OMX_ERRORTYPE Exynos_H264Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
@@ -2326,7 +2277,6 @@ OMX_ERRORTYPE Exynos_H264Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)pVideoDec->hCodecHandle;
void *hMFCHandle = pH264Dec->hMFCH264Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
@@ -2485,7 +2435,7 @@ OMX_ERRORTYPE Exynos_H264Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_H264DEC_HANDLE *pH264Dec = (EXYNOS_H264DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
+
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
FunctionIn();
@@ -2501,8 +2451,8 @@ OMX_ERRORTYPE Exynos_H264Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon
ret = Exynos_H264Dec_SrcIn(pOMXComponent, pSrcInputData);
if ((ret != OMX_ErrorNone) &&
- (ret != OMX_ErrorInputDataDecodeYet) &&
- (ret != OMX_ErrorCorruptedFrame)) {
+ (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) &&
+ (ret != (OMX_ERRORTYPE)OMX_ErrorCorruptedFrame)) {
pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,
pExynosComponent->callbackData,
OMX_EventError, ret, 0, NULL);
diff --git a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
index cb77ee1..e5ecb8c 100755
--- a/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
+++ b/openmax/component/video/dec/mpeg2/Exynos_OMX_Mpeg2dec.c
@@ -41,6 +41,7 @@
#include "ExynosVideoApi.h"
#include "Exynos_OSAL_SharedMemory.h"
#include "Exynos_OSAL_Event.h"
+#include "Exynos_OMX_VdecControl.h"
#ifdef USE_PB
#include "Exynos_OSAL_Platform_Specific.h"
@@ -62,16 +63,13 @@
static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
-static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[])
+static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[])
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- ExynosVideoBuffer *pCodecBuffer;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ ExynosVideoBuffer *pCodecBuffer = NULL;
if (codecBuffer == NULL) {
ret = OMX_ErrorBadParameter;
@@ -279,7 +277,6 @@ OMX_ERRORTYPE Mpeg2CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -305,7 +302,6 @@ OMX_ERRORTYPE Mpeg2CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd
}
hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
@@ -326,7 +322,6 @@ OMX_ERRORTYPE Mpeg2CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -351,7 +346,6 @@ OMX_ERRORTYPE Mpeg2CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
}
hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
@@ -371,10 +365,6 @@ EXIT:
OMX_ERRORTYPE Mpeg2CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = NULL;
@@ -396,11 +386,6 @@ OMX_ERRORTYPE Mpeg2CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent,
goto EXIT;
}
- hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
- pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
- pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
-
if (nPortIndex == INPUT_PORT_INDEX) {
if (pMpeg2Dec->bSourceStart == OMX_FALSE) {
Exynos_OSAL_SignalSet(pMpeg2Dec->hSourceStartEvent);
@@ -430,8 +415,6 @@ OMX_ERRORTYPE Mpeg2CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
int i, nOutbufs;
ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
@@ -454,7 +437,6 @@ OMX_ERRORTYPE Mpeg2CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pMpeg2Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
@@ -682,11 +664,8 @@ OMX_ERRORTYPE Mpeg2CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
int i, nOutbufs;
@@ -1255,7 +1234,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_GetExtensionIndex(
}
if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) {
- EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
*pIndexType = OMX_IndexVendorThumbnailMode;
ret = OMX_ErrorNone;
} else {
@@ -1274,8 +1252,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_ComponentRoleEnum(
OMX_U32 nIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
FunctionIn();
@@ -1305,11 +1281,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)pVideoDec->hCodecHandle;
- OMX_PTR hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
+
CSC_METHOD csc_method = CSC_METHOD_SW;
int i, plane;
@@ -1327,10 +1300,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
goto EXIT;
}
- pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
- pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
- pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
-
if ((pExynosInputPort->bufferProcessType & BUFFER_COPY) == BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
@@ -1410,13 +1379,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- OMX_PTR hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
-
- int i, plane;
+ int i;
FunctionIn();
@@ -1479,7 +1443,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
}
Mpeg2CodecClose(pMpeg2Dec);
-EXIT:
FunctionOut();
return ret;
@@ -1489,17 +1452,12 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
- int i;
FunctionIn();
@@ -1558,7 +1516,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pMpeg2Dec->hMFCMpeg2Handle.pInbufOps;
ExynosVideoBuffer *pVideoBuffer;
@@ -1612,11 +1569,8 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
@@ -1655,10 +1609,10 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
+ EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg2Dec->hMFCMpeg2Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
+
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pMpeg2Dec->hMFCMpeg2Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg2Dec->hMFCMpeg2Handle.pOutbufOps;
@@ -1786,7 +1740,6 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_MPEG2DEC_HANDLE *pMpeg2Dec = (EXYNOS_MPEG2DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
FunctionIn();
@@ -1801,7 +1754,7 @@ OMX_ERRORTYPE Exynos_Mpeg2Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo
}
ret = Exynos_Mpeg2Dec_SrcIn(pOMXComponent, pSrcInputData);
- if ((ret != OMX_ErrorNone) && (ret != OMX_ErrorInputDataDecodeYet)) {
+ if ((ret != OMX_ErrorNone) && (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet)) {
pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,
pExynosComponent->callbackData,
OMX_EventError, ret, 0, NULL);
diff --git a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
index 7d99bcf..acb4037 100755
--- a/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
+++ b/openmax/component/video/dec/mpeg4/Exynos_OMX_Mpeg4dec.c
@@ -42,6 +42,7 @@
#include "ExynosVideoApi.h"
#include "Exynos_OSAL_SharedMemory.h"
#include "Exynos_OSAL_Event.h"
+#include "Exynos_OMX_VdecControl.h"
#ifdef USE_PB
#include "Exynos_OSAL_Platform_Specific.h"
@@ -122,16 +123,13 @@ EXYNOS_OMX_VIDEO_PROFILELEVEL supportedH263ProfileLevels[] = {
static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
-static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[])
+static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[])
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- ExynosVideoBuffer *pCodecBuffer;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ ExynosVideoBuffer *pCodecBuffer = NULL;
if (codecBuffer == NULL) {
ret = OMX_ErrorBadParameter;
@@ -355,7 +353,7 @@ static OMX_BOOL Check_Stream_StartCode(
}
}
-static void getAByte(char *buff, int *code)
+static void getAByte(OMX_U8 *buff, int *code)
{
int byte;
@@ -463,15 +461,11 @@ OMX_ERRORTYPE Mpeg4CodecOpen(EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec)
}
/* alloc context, open, querycap */
- if (pMpeg4Dec->hMFCMpeg4Handle.bShareableBuf == OMX_TRUE) {
#ifdef USE_DMA_BUF
- pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
+ pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
#else
- pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_USERPTR);
+ pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_USERPTR);
#endif
- } else {
- pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.pDecOps->Init(V4L2_MEMORY_DMABUF);
- }
if (pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to allocate context buffer");
ret = OMX_ErrorInsufficientResources;
@@ -550,7 +544,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -576,7 +569,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd
}
hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
@@ -597,7 +589,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -622,7 +613,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
}
hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
@@ -651,7 +641,6 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
ExynosVideoGeometry bufferConf;
OMX_U32 inputBufferNumber = 0;
int i, plane;
@@ -751,7 +740,7 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
for (i = 0; i < pExynosInputPort->portDefinition.nBufferCountActual; i++) {
ExynosVideoPlane plane;
if (pVideoDec->bDRMPlayerMode == OMX_TRUE) {
- plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
+ plane.addr = Exynos_OSAL_SharedMemory_IONToVirt(pVideoDec->hSharedMemory, (int)pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer);
} else {
plane.addr = pExynosInputPort->extendBufferHeader[i].OMXBufferHeader->pBuffer;
}
@@ -776,10 +765,6 @@ EXIT:
OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = NULL;
@@ -801,11 +786,6 @@ OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent,
goto EXIT;
}
- hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
- pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
- pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
-
if (nPortIndex == INPUT_PORT_INDEX) {
if (pMpeg4Dec->bSourceStart == OMX_FALSE) {
Exynos_OSAL_SignalSet(pMpeg4Dec->hSourceStartEvent);
@@ -835,8 +815,6 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)pVideoDec->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
int i, nOutbufs;
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
@@ -864,7 +842,6 @@ OMX_ERRORTYPE Mpeg4CodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pMpeg4Dec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
@@ -888,7 +865,6 @@ EXIT:
OMX_ERRORTYPE Mpeg4CodecDstFreeCodecBuffers(
OMX_COMPONENTTYPE *pOMXComponent)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)pVideoDec->hCodecHandle;
@@ -1026,8 +1002,6 @@ OMX_ERRORTYPE Mpeg4CodecResetupAllElement(
EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
- int i, j, nOutbufs;
-
FunctionIn();
if ((nPortIndex == INPUT_PORT_INDEX) &&
@@ -1078,19 +1052,15 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
ExynosVideoGeometry bufferConf;
- OMX_U32 inputBufferNumber = 0;
- int i;
FunctionIn();
@@ -1180,11 +1150,8 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
int i, nOutbufs;
@@ -1313,10 +1280,7 @@ OMX_ERRORTYPE Mpeg4CodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
- ExynosVideoGeometry bufferConf;
- int i;
FunctionIn();
@@ -1972,7 +1936,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_GetExtensionIndex(
}
if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) {
- EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
*pIndexType = OMX_IndexVendorThumbnailMode;
ret = OMX_ErrorNone;
} else {
@@ -2041,11 +2004,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)pVideoDec->hCodecHandle;
- OMX_PTR hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
-
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
CSC_METHOD csc_method = CSC_METHOD_SW;
int i, plane;
@@ -2063,10 +2021,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Init(OMX_COMPONENTTYPE *pOMXComponent)
goto EXIT;
}
- pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
- pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
- pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
-
if (pExynosInputPort->bufferProcessType & BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
@@ -2157,13 +2111,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- OMX_PTR hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
-
- int i, plane;
+ int i;
FunctionIn();
@@ -2195,6 +2144,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) {
if (pVideoDec->pMFCDecInputBuffer[i] != NULL) {
#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
+ int plane;
for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
if (pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane] != NULL)
Exynos_OSAL_SharedMemory_Free(pVideoDec->hSharedMemory, pVideoDec->pMFCDecInputBuffer[i]->pVirAddr[plane]);
@@ -2215,7 +2165,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
}
Mpeg4CodecClose(pMpeg4Dec);
-EXIT:
FunctionOut();
return ret;
@@ -2225,18 +2174,13 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
OMX_BOOL bInStartCode = OMX_FALSE;
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
- int i;
FunctionIn();
@@ -2308,7 +2252,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pMpeg4Dec->hMFCMpeg4Handle.pInbufOps;
ExynosVideoBuffer *pVideoBuffer;
@@ -2366,7 +2309,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
@@ -2419,7 +2361,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Dec->hMFCMpeg4Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pMpeg4Dec->hMFCMpeg4Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pMpeg4Dec->hMFCMpeg4Handle.pOutbufOps;
@@ -2568,7 +2509,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_MPEG4DEC_HANDLE *pMpeg4Dec = (EXYNOS_MPEG4DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
FunctionIn();
@@ -2584,8 +2524,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Dec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo
ret = Exynos_Mpeg4Dec_SrcIn(pOMXComponent, pSrcInputData);
if ((ret != OMX_ErrorNone) &&
- (ret != OMX_ErrorInputDataDecodeYet) &&
- (ret != OMX_ErrorCorruptedFrame)) {
+ (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet) &&
+ (ret != (OMX_ERRORTYPE)OMX_ErrorCorruptedFrame)) {
pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,
pExynosComponent->callbackData,
OMX_EventError, ret, 0, NULL);
diff --git a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c
index cbd65e9..b809ed9 100755
--- a/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c
+++ b/openmax/component/video/dec/vc1/Exynos_OMX_Wmvdec.c
@@ -44,6 +44,7 @@
#include "ExynosVideoApi.h"
#include "Exynos_OSAL_SharedMemory.h"
#include "Exynos_OSAL_Event.h"
+#include "Exynos_OMX_VdecControl.h"
#ifdef USE_PB
#include "Exynos_OSAL_Platform_Specific.h"
@@ -75,16 +76,13 @@ const OMX_U32 wmva = 0x41564d57;
static OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, void *pVirtAddr, OMX_U32 *dataSize)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
-static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, void *addr[], int size[])
+static OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[])
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- ExynosVideoBuffer *pCodecBuffer;
+ OMX_ERRORTYPE ret = OMX_ErrorNone;
+ ExynosVideoBuffer *pCodecBuffer = NULL;
if (codecBuffer == NULL) {
ret = OMX_ErrorBadParameter;
@@ -271,7 +269,7 @@ static OMX_BOOL Make_Stream_MetaData(
switch (wmvFormat) {
case WMV_FORMAT_WMV3:
- if (*pStreamSize >= BITMAPINFOHEADER_SIZE) {
+
#ifndef TIZEN_FEATURE_E3250
BitmapInfoHhr *pBitmapInfoHeader;
pBitmapInfoHeader = (BitmapInfoHhr *)pInputStream;
@@ -319,10 +317,6 @@ static OMX_BOOL Make_Stream_MetaData(
*pStreamSize = currPos;
return OMX_TRUE;
- } else {
- Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "%s: *pStreamSize is too small to contain metadata(%d)", __FUNCTION__, *pStreamSize);
- return OMX_FALSE;
- }
break;
case WMV_FORMAT_VC1:
if (*pStreamSize >= BITMAPINFOHEADER_ASFBINDING_SIZE) {
@@ -351,7 +345,6 @@ static OMX_BOOL Make_Stream_StartCode(
/* first 4 bytes : size of Frame, second 4 bytes : present Time stamp */
OMX_U8 frameStartCode2[8] = {0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00};
#endif
- OMX_U32 i;
switch (wmvFormat) {
case WMV_FORMAT_WMV3:
@@ -383,10 +376,8 @@ OMX_ERRORTYPE Process_Wmv_CodecConfigData(OMX_COMPONENTTYPE *pOMXComponent, void
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle;
- OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
+
#ifdef TIZEN_FEATURE_E3250
EXYNOS_OMX_DATABUFFER *pSrcInputData = (EXYNOS_OMX_DATA *)pConfig;
OMX_U8 *pInputStream = pSrcInputData->bufferHeader->pBuffer;
@@ -592,7 +583,6 @@ OMX_ERRORTYPE WmvCodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -618,7 +608,6 @@ OMX_ERRORTYPE WmvCodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex
}
hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
@@ -639,7 +628,6 @@ OMX_ERRORTYPE WmvCodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
ExynosVideoDecBufferOps *pInbufOps = NULL;
ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
@@ -664,7 +652,6 @@ OMX_ERRORTYPE WmvCodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
}
hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
@@ -690,11 +677,9 @@ OMX_ERRORTYPE WmvCodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
ExynosVideoGeometry bufferConf;
OMX_U32 inputBufferNumber = 0;
int i, plane;
@@ -817,10 +802,6 @@ EXIT:
OMX_ERRORTYPE WmvCodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
EXYNOS_WMVDEC_HANDLE *pWmvDec = NULL;
@@ -842,11 +823,6 @@ OMX_ERRORTYPE WmvCodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, O
goto EXIT;
}
- hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
- pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
- pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
-
if (nPortIndex == INPUT_PORT_INDEX) {
if (pWmvDec->bSourceStart == OMX_FALSE) {
Exynos_OSAL_SignalSet(pWmvDec->hSourceStartEvent);
@@ -876,8 +852,6 @@ OMX_ERRORTYPE WmvCodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
int i, nOutbufs;
ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
@@ -905,7 +879,6 @@ OMX_ERRORTYPE WmvCodecEnQueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pWmvDec->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[MFC_OUTPUT_BUFFER_PLANE] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
@@ -928,7 +901,6 @@ EXIT:
OMX_ERRORTYPE WmvCodecDstFreeCodecBuffers(
OMX_COMPONENTTYPE *pOMXComponent)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle;
@@ -1066,8 +1038,6 @@ OMX_ERRORTYPE WmvCodecResetupAllElement(
EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
- int i, j, nOutbufs;
-
FunctionIn();
if ((nPortIndex == INPUT_PORT_INDEX) &&
@@ -1117,11 +1087,9 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
OMX_BOOL bMetaData = OMX_FALSE;
@@ -1129,8 +1097,6 @@ OMX_ERRORTYPE WmvCodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
ExynosVideoGeometry bufferConf;
- OMX_U32 inputBufferNumber = 0;
- int i;
FunctionIn();
@@ -1235,11 +1201,8 @@ OMX_ERRORTYPE WmvCodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
int i, nOutbufs;
@@ -1367,10 +1330,7 @@ OMX_ERRORTYPE WmvCodecCheckResolutionChange(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
- ExynosVideoGeometry bufferConf;
- int i;
FunctionIn();
@@ -1865,7 +1825,6 @@ OMX_ERRORTYPE Exynos_WmvDec_GetExtensionIndex(
}
if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) {
- EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
*pIndexType = OMX_IndexVendorThumbnailMode;
ret = OMX_ErrorNone;
} else {
@@ -1884,8 +1843,6 @@ OMX_ERRORTYPE Exynos_WmvDec_ComponentRoleEnum(
OMX_U32 nIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
FunctionIn();
@@ -1915,11 +1872,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Init(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)pVideoDec->hCodecHandle;
- OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
-
- ExynosVideoDecOps *pDecOps = NULL;
- ExynosVideoDecBufferOps *pInbufOps = NULL;
- ExynosVideoDecBufferOps *pOutbufOps = NULL;
CSC_METHOD csc_method = CSC_METHOD_SW;
int i, plane;
@@ -1937,10 +1889,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Init(OMX_COMPONENTTYPE *pOMXComponent)
goto EXIT;
}
- pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
- pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
- pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
-
if (pExynosInputPort->bufferProcessType & BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
@@ -2028,11 +1976,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- OMX_PTR hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
-
- ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
- ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
int i, plane;
@@ -2085,7 +2028,6 @@ OMX_ERRORTYPE Exynos_WmvDec_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
}
WmvCodecClose(pWmvDec);
-EXIT:
FunctionOut();
return ret;
@@ -2095,18 +2037,13 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
OMX_BOOL bStartCode = OMX_FALSE;
ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
- int i;
FunctionIn();
@@ -2191,7 +2128,6 @@ OMX_ERRORTYPE Exynos_WmvDec_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
ExynosVideoDecBufferOps *pInbufOps = pWmvDec->hMFCWmvHandle.pInbufOps;
ExynosVideoBuffer *pVideoBuffer;
@@ -2249,7 +2185,6 @@ OMX_ERRORTYPE Exynos_WmvDec_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_D
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
OMX_U32 dataLen[2] = {0,};
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
@@ -2303,7 +2238,6 @@ OMX_ERRORTYPE Exynos_WmvDec_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pWmvDec->hMFCWmvHandle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoDecOps *pDecOps = pWmvDec->hMFCWmvHandle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pWmvDec->hMFCWmvHandle.pOutbufOps;
@@ -2451,7 +2385,6 @@ OMX_ERRORTYPE Exynos_WmvDec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompone
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_WMVDEC_HANDLE *pWmvDec = (EXYNOS_WMVDEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
FunctionIn();
@@ -2466,7 +2399,7 @@ OMX_ERRORTYPE Exynos_WmvDec_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompone
}
ret = Exynos_WmvDec_SrcIn(pOMXComponent, pSrcInputData);
- if ((ret != OMX_ErrorNone) && (ret != OMX_ErrorInputDataDecodeYet)) {
+ if ((ret != OMX_ErrorNone) && (ret != (OMX_ERRORTYPE)OMX_ErrorInputDataDecodeYet)) {
pExynosComponent->pCallbacks->EventHandler((OMX_HANDLETYPE)pOMXComponent,
pExynosComponent->callbackData,
OMX_EventError, ret, 0, NULL);
diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.c b/openmax/component/video/enc/Exynos_OMX_Venc.c
index c66643c..1b1b0ed 100755..100644
--- a/openmax/component/video/enc/Exynos_OMX_Venc.c
+++ b/openmax/component/video/enc/Exynos_OMX_Venc.c
@@ -40,6 +40,7 @@
#include "Exynos_OSAL_ETC.h"
#include "ExynosVideoApi.h"
#include "csc.h"
+#include "Exynos_OSAL_SharedMemory.h"
#undef EXYNOS_LOG_TAG
#define EXYNOS_LOG_TAG "EXYNOS_VIDEO_ENC"
@@ -95,7 +96,6 @@ OMX_BOOL Exynos_Check_BufferProcess_State(EXYNOS_OMX_BASECOMPONENT *pExynosCompo
OMX_ERRORTYPE Exynos_Input_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_PTR codecBuffer, EXYNOS_OMX_DATA *pData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
CODEC_ENC_BUFFER *pInputCodecBuffer = (CODEC_ENC_BUFFER*)codecBuffer;
pData->buffer.multiPlaneBuffer.dataBuffer[0] = pInputCodecBuffer->pVirAddr[0];
@@ -137,8 +137,6 @@ OMX_ERRORTYPE Exynos_Output_CodecBufferToData(EXYNOS_OMX_BASECOMPONENT *pExynosC
void Exynos_Wait_ProcessPause(EXYNOS_OMX_BASECOMPONENT *pExynosComponent, OMX_U32 nPortIndex)
{
- EXYNOS_OMX_BASEPORT *exynosOMXInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *exynosOMXOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *exynosOMXPort = NULL;
FunctionIn();
@@ -171,7 +169,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
OMX_U32 nFrameHeight = exynosInputPort->portDefinition.format.video.nFrameHeight;
OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat;
OMX_BYTE checkInputStream = NULL;
- OMX_BOOL flagEOS = OMX_FALSE;
FunctionIn();
@@ -200,9 +197,9 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
csc_get_method(pVideoEnc->csc_handle, &csc_method);
if (csc_method == CSC_METHOD_HW) {
- pDstBuf[0] = srcInputData->buffer.multiPlaneBuffer.fd[0];
- pDstBuf[1] = srcInputData->buffer.multiPlaneBuffer.fd[1];
- pDstBuf[2] = srcInputData->buffer.multiPlaneBuffer.fd[2];
+ pDstBuf[0] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[0]);
+ pDstBuf[1] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[1]);
+ pDstBuf[2] = (unsigned char*)(&srcInputData->buffer.multiPlaneBuffer.fd[2]);
}
#ifdef USE_METADATABUFFERTYPE
@@ -306,7 +303,6 @@ OMX_BOOL Exynos_CSC_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DATA
ret = OMX_TRUE;
-EXIT:
FunctionOut();
return ret;
@@ -316,16 +312,10 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
{
OMX_BOOL ret = OMX_FALSE;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_OMX_BASEPORT *exynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_DATABUFFER *inputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer;
- OMX_U32 nFrameWidth = exynosInputPort->portDefinition.format.video.nFrameWidth;
- OMX_U32 nFrameHeight = exynosInputPort->portDefinition.format.video.nFrameHeight;
- OMX_COLOR_FORMATTYPE eColorFormat = exynosInputPort->portDefinition.format.video.eColorFormat;
OMX_U32 copySize = 0;
- OMX_BYTE checkInputStream = NULL;
OMX_U32 checkInputStreamLen = 0;
- OMX_BOOL flagEOS = OMX_FALSE;
FunctionIn();
@@ -349,6 +339,8 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
/* kMetadataBufferTypeCameraSource */
Exynos_OSAL_GetInfoFromMetaData((OMX_BYTE)inputUseBuffer->bufferHeader->pBuffer, ppBuf);
#ifdef USE_DMA_BUF
+ EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
+
srcInputData->buffer.multiPlaneBuffer.fd[0] = ppBuf[0];
srcInputData->buffer.multiPlaneBuffer.fd[1] = ppBuf[1];
allocSize[0] = nFrameWidth * nFrameHeight;
@@ -393,14 +385,12 @@ OMX_BOOL Exynos_Preprocessor_InputData(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_
/* reset dataBuffer */
Exynos_ResetDataBuffer(inputUseBuffer);
} else if (exynosInputPort->bufferProcessType & BUFFER_COPY) {
- checkInputStream = inputUseBuffer->bufferHeader->pBuffer + inputUseBuffer->usedDataLen;
checkInputStreamLen = inputUseBuffer->remainDataLen;
pExynosComponent->bUseFlagEOF = OMX_TRUE;
if (checkInputStreamLen == 0) {
inputUseBuffer->nFlags |= OMX_BUFFERFLAG_EOS;
- flagEOS = OMX_TRUE;
}
copySize = checkInputStreamLen;
@@ -550,7 +540,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent)
EXYNOS_OMX_DATABUFFER *srcInputUseBuffer = &exynosInputPort->way.port2WayDataBuffer.inputDataBuffer;
EXYNOS_OMX_DATA *pSrcInputData = &exynosInputPort->processData;
OMX_BOOL bCheckInputData = OMX_FALSE;
- OMX_BOOL bValidCodecData = OMX_FALSE;
FunctionIn();
@@ -601,13 +590,11 @@ OMX_ERRORTYPE Exynos_OMX_SrcInputBufferProcess(OMX_HANDLETYPE hComponent)
ret = pVideoEnc->exynos_codec_srcInputProcess(pOMXComponent, pSrcInputData);
Exynos_ResetCodecData(pSrcInputData);
Exynos_OSAL_MutexUnlock(srcInputUseBuffer->bufferMutex);
- if (ret == OMX_ErrorCodecInit)
+ if (ret == (OMX_ERRORTYPE)OMX_ErrorCodecInit)
pVideoEnc->bExitBufferProcessThread = OMX_TRUE;
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -658,8 +645,6 @@ OMX_ERRORTYPE Exynos_OMX_SrcOutputBufferProcess(OMX_HANDLETYPE hComponent)
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -725,8 +710,6 @@ OMX_ERRORTYPE Exynos_OMX_DstInputBufferProcess(OMX_HANDLETYPE hComponent)
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -791,8 +774,6 @@ OMX_ERRORTYPE Exynos_OMX_DstOutputBufferProcess(OMX_HANDLETYPE hComponent)
}
}
-EXIT:
-
FunctionOut();
return ret;
@@ -802,8 +783,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -816,7 +795,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcInputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_SrcInputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -831,8 +809,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -845,7 +821,6 @@ static OMX_ERRORTYPE Exynos_OMX_SrcOutputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_SrcOutputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -860,8 +835,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -874,7 +847,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstInputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_DstInputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -889,8 +861,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_MESSAGE *message = NULL;
FunctionIn();
@@ -903,7 +873,6 @@ static OMX_ERRORTYPE Exynos_OMX_DstOutputProcessThread(OMX_PTR threadData)
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
Exynos_OMX_DstOutputBufferProcess(pOMXComponent);
Exynos_OSAL_ThreadExit(NULL);
@@ -941,7 +910,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Create(OMX_HANDLETYPE hComponent)
Exynos_OMX_SrcInputProcessThread,
pOMXComponent);
-EXIT:
FunctionOut();
return ret;
@@ -954,7 +922,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent)
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
OMX_S32 countValue = 0;
- unsigned int i = 0;
FunctionIn();
@@ -992,7 +959,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferProcess_Terminate(OMX_HANDLETYPE hComponent)
Exynos_OSAL_ThreadTerminate(pVideoEnc->hDstOutputThread);
pVideoEnc->hDstOutputThread = NULL;
-EXIT:
FunctionOut();
return ret;
diff --git a/openmax/component/video/enc/Exynos_OMX_Venc.h b/openmax/component/video/enc/Exynos_OMX_Venc.h
index bdd3b08..53f77f9 100755
--- a/openmax/component/video/enc/Exynos_OMX_Venc.h
+++ b/openmax/component/video/enc/Exynos_OMX_Venc.h
@@ -126,7 +126,7 @@ typedef struct _EXYNOS_OMX_VIDEOENC_COMPONENT
int (*exynos_checkInputFrame) (OMX_U8 *pInputStream, OMX_U32 buffSize, OMX_U32 flag,
OMX_BOOL bPreviousFrameEOF, OMX_BOOL *pbEndOfFrame);
OMX_ERRORTYPE (*exynos_codec_getCodecInputPrivateData) (OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[]);
- OMX_ERRORTYPE (*exynos_codec_getCodecOutputPrivateData) (OMX_PTR codecBuffer, OMX_PTR addr, OMX_U32 *size);
+ OMX_ERRORTYPE (*exynos_codec_getCodecOutputPrivateData) (OMX_PTR codecBuffer, OMX_PTR *addr, OMX_U32 *size);
} EXYNOS_OMX_VIDEOENC_COMPONENT;
#ifdef __cplusplus
diff --git a/openmax/component/video/enc/Exynos_OMX_VencControl.c b/openmax/component/video/enc/Exynos_OMX_VencControl.c
index 7053059..5734400 100755
--- a/openmax/component/video/enc/Exynos_OMX_VencControl.c
+++ b/openmax/component/video/enc/Exynos_OMX_VencControl.c
@@ -91,8 +91,7 @@ OMX_ERRORTYPE Exynos_OMX_UseBuffer(
}
pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -222,8 +221,8 @@ OMX_ERRORTYPE Exynos_OMX_AllocateBuffer(
}
pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "[%p][%s] invalid parameter(0x%x)", pExynosComponent, __FUNCTION__, nPortIndex);
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -333,8 +332,8 @@ OMX_ERRORTYPE Exynos_OMX_FreeBuffer(
}
pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "[%p][%s] invalid parameter(0x%x)", pExynosComponent, __FUNCTION__, nPortIndex);
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -401,31 +400,14 @@ OMX_ERRORTYPE Exynos_OMX_AllocateTunnelBuffer(
EXYNOS_OMX_BASEPORT *pOMXBasePort,
OMX_U32 nPortIndex)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE *pTempBufferHdr = NULL;
- OMX_U8 *pTempBuffer = NULL;
- OMX_U32 nBufferSize = 0;
- OMX_PARAM_PORTDEFINITIONTYPE portDefinition;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_FreeTunnelBuffer(
EXYNOS_OMX_BASEPORT *pOMXBasePort,
OMX_U32 nPortIndex)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_BUFFERHEADERTYPE *pTempBufferHdr = NULL;
- OMX_U8 *pTempBuffer = NULL;
- OMX_U32 nBufferSize = 0;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
@@ -435,11 +417,7 @@ OMX_ERRORTYPE Exynos_OMX_ComponentTunnelRequest(
OMX_IN OMX_U32 nTunneledPort,
OMX_INOUT OMX_TUNNELSETUPTYPE *pTunnelSetup)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
- ret = OMX_ErrorTunnelingUnsupported;
-EXIT:
- return ret;
+ return OMX_ErrorTunnelingUnsupported;
}
OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(
@@ -459,7 +437,6 @@ OMX_ERRORTYPE Exynos_OMX_GetFlushBuffer(
pDataBuffer[1] = &(pExynosPort->way.port2WayDataBuffer.outputDataBuffer);
}
-EXIT:
FunctionOut();
return ret;
@@ -591,7 +568,6 @@ OMX_ERRORTYPE Exynos_OMX_BufferFlush(
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_DATABUFFER *pDataBuffer[2] = {NULL, NULL};
- OMX_U32 i = 0;
FunctionIn();
#ifdef TIZEN_FEATURE_E3250
@@ -1126,8 +1102,7 @@ OMX_ERRORTYPE Exynos_CodecBufferEnqueue(
goto EXIT;
}
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -1169,8 +1144,7 @@ OMX_ERRORTYPE Exynos_CodecBufferDequeue(
goto EXIT;
}
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -1206,8 +1180,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset(
goto EXIT;
}
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -1220,7 +1193,7 @@ OMX_ERRORTYPE Exynos_CodecBufferReset(
}
while (1) {
- int cnt = 0;
+ OMX_S32 cnt = 0;
Exynos_OSAL_Get_SemaphoreCount(pExynosPort->codecSemID, &cnt);
if (cnt > 0)
Exynos_OSAL_SemaphoreWait(pExynosPort->codecSemID);
@@ -1243,7 +1216,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
FunctionIn();
@@ -1302,8 +1274,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter(
goto EXIT;
}
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -1406,9 +1377,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter(
{
OMX_VIDEO_PARAM_QUANTIZATIONTYPE *pVideoQuantization = (OMX_VIDEO_PARAM_QUANTIZATIONTYPE *)pComponentParameterStructure;
OMX_U32 nPortIndex = pVideoQuantization->nPortIndex;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
- OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
if (nPortIndex != OUTPUT_PORT_INDEX) {
ret = OMX_ErrorBadPortIndex;
@@ -1419,8 +1388,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter(
ret = OMX_ErrorBadParameter;
goto EXIT;
}
- pExynosPort = &pExynosComponent->pExynosPort[nPortIndex];
- pPortDef = &pExynosPort->portDefinition;
pVideoQuantization->nQpI = pVideoEnc->quantization.nQpI;
pVideoQuantization->nQpP = pVideoEnc->quantization.nQpP;
@@ -1435,8 +1402,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetParameter(
OMX_U32 nPortIndex = pPortDef->nPortIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -1477,7 +1443,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
FunctionIn();
@@ -1513,17 +1478,14 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter(
{
OMX_VIDEO_PARAM_PORTFORMATTYPE *pPortFormat = (OMX_VIDEO_PARAM_PORTFORMATTYPE *)pComponentParameterStructure;
OMX_U32 nPortIndex = pPortFormat->nPortIndex;
- OMX_U32 nIndex = pPortFormat->nIndex;
OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
- OMX_U32 nSupportFormat = 0;
ret = Exynos_OMX_Check_SizeVersion(pPortFormat, sizeof(OMX_VIDEO_PARAM_PORTFORMATTYPE));
if (ret != OMX_ErrorNone) {
goto EXIT;
}
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
@@ -1538,7 +1500,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter(
{
OMX_VIDEO_PARAM_BITRATETYPE *pVideoBitrate = (OMX_VIDEO_PARAM_BITRATETYPE *)pComponentParameterStructure;
OMX_U32 nPortIndex = pVideoBitrate->nPortIndex;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
@@ -1563,9 +1524,7 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter(
{
OMX_VIDEO_PARAM_QUANTIZATIONTYPE *pVideoQuantization = (OMX_VIDEO_PARAM_QUANTIZATIONTYPE *)pComponentParameterStructure;
OMX_U32 nPortIndex = pVideoQuantization->nPortIndex;
- EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
- OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = NULL;
if (nPortIndex != OUTPUT_PORT_INDEX) {
ret = OMX_ErrorBadPortIndex;
@@ -1576,8 +1535,6 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter(
ret = OMX_ErrorBadParameter;
goto EXIT;
}
- pExynosPort = &pExynosComponent->pExynosPort[nPortIndex];
- pPortDef = &pExynosPort->portDefinition;
pVideoEnc->quantization.nQpI = pVideoQuantization->nQpI;
pVideoEnc->quantization.nQpP = pVideoQuantization->nQpP;
@@ -1591,10 +1548,8 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeSetParameter(
OMX_PARAM_PORTDEFINITIONTYPE *pPortDef = (OMX_PARAM_PORTDEFINITIONTYPE *)pComponentParameterStructure;
OMX_U32 nPortIndex = pPortDef->nPortIndex;
EXYNOS_OMX_BASEPORT *pExynosPort = NULL;
- OMX_U32 width, height, size;
- if ((nPortIndex < 0) ||
- (nPortIndex >= pExynosComponent->portParam.nPorts)) {
+ if (nPortIndex >= pExynosComponent->portParam.nPorts) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
diff --git a/openmax/component/video/enc/Exynos_OMX_VencControl.h b/openmax/component/video/enc/Exynos_OMX_VencControl.h
index f2bd4ed..3a7b5f4 100644..100755
--- a/openmax/component/video/enc/Exynos_OMX_VencControl.h
+++ b/openmax/component/video/enc/Exynos_OMX_VencControl.h
@@ -87,6 +87,23 @@ OMX_ERRORTYPE Exynos_OMX_VideoEncodeGetExtensionIndex(
OMX_IN OMX_HANDLETYPE hComponent,
OMX_IN OMX_STRING szParameterName,
OMX_OUT OMX_INDEXTYPE *pIndexType);
+OMX_ERRORTYPE Exynos_OutputBufferGetQueue(
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent);
+OMX_BUFFERHEADERTYPE *Exynos_OutputBufferGetQueue_Direct(
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent);
+OMX_ERRORTYPE Exynos_InputBufferGetQueue(
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent);
+OMX_ERRORTYPE Exynos_CodecBufferEnqueue(
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent,
+ OMX_U32 nPortIndex,
+ OMX_PTR pData);
+OMX_ERRORTYPE Exynos_CodecBufferReset(
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent,
+ OMX_U32 nPortIndex);
+OMX_ERRORTYPE Exynos_CodecBufferDequeue(
+ EXYNOS_OMX_BASECOMPONENT *pExynosComponent,
+ OMX_U32 nPortIndex,
+ OMX_PTR *pData);
OMX_ERRORTYPE Exynos_InputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent);
OMX_ERRORTYPE Exynos_OutputBufferReturn(OMX_COMPONENTTYPE *pOMXComponent);
OMX_ERRORTYPE Exynos_OMX_BufferFlush(OMX_COMPONENTTYPE *pOMXComponent, OMX_S32 nPortIndex, OMX_BOOL bEvent);
diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c
index 2173513..974bc0c 100755
--- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c
+++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.c
@@ -40,6 +40,7 @@
//#include "ExynosVideoApi.h"
#include "Exynos_OSAL_SharedMemory.h"
#include "Exynos_OSAL_Event.h"
+#include "Exynos_OMX_VencControl.h"
/* To use CSC_METHOD_HW in EXYNOS OMX, gralloc should allocate physical memory using FIMC */
/* It means GRALLOC_USAGE_HW_FIMC1 should be set on Native Window usage */
@@ -376,10 +377,7 @@ static void Change_H264Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent)
OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[])
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR *pVirtAddr, OMX_U32 *dataSize)
@@ -558,7 +556,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoEncOps *pEncOps = NULL;
ExynosVideoEncBufferOps *pInbufOps = NULL;
ExynosVideoEncBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
@@ -584,7 +581,6 @@ OMX_ERRORTYPE H264CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
}
hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
- pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
@@ -604,10 +600,10 @@ EXIT:
OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoEncOps *pEncOps = NULL;
- ExynosVideoEncBufferOps *pInbufOps = NULL;
+
+ void *hMFCHandle = NULL;
ExynosVideoEncBufferOps *pOutbufOps = NULL;
+ ExynosVideoEncBufferOps *pInbufOps = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
EXYNOS_H264ENC_HANDLE *pH264Enc = NULL;
@@ -628,9 +624,7 @@ OMX_ERRORTYPE H264CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex
ret = OMX_ErrorBadParameter;
goto EXIT;
}
-
hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
- pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
@@ -656,16 +650,14 @@ OMX_ERRORTYPE H264CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle;
void *hMFCHandle = pMFCH264Handle->hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
ExynosVideoEncParam *pEncParam = NULL;
ExynosVideoGeometry bufferConf;
OMX_U32 inputBufferNumber = 0;
- int i, nOutbufs;
+ int i;
FunctionIn();
@@ -795,10 +787,6 @@ EXIT:
OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoEncOps *pEncOps = NULL;
- ExynosVideoEncBufferOps *pInbufOps = NULL;
- ExynosVideoEncBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
EXYNOS_H264ENC_HANDLE *pH264Enc = NULL;
@@ -820,11 +808,6 @@ OMX_ERRORTYPE H264CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent,
goto EXIT;
}
- hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
- pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
- pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
- pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
-
if (nPortIndex == INPUT_PORT_INDEX) {
if (pH264Enc->bSourceStart == OMX_FALSE) {
Exynos_OSAL_SignalSet(pH264Enc->hSourceStartEvent);
@@ -854,11 +837,8 @@ OMX_ERRORTYPE H264CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- int i, nOutbufs;
+ int i;
- ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
@@ -884,7 +864,6 @@ OMX_ERRORTYPE H264CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U3
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pH264Enc->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[2] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
@@ -909,23 +888,10 @@ OMX_ERRORTYPE H264CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DAT
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle;
- void *hMFCHandle = pMFCH264Handle->hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
- ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
- ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
- ExynosVideoEncParam *pEncParam = NULL;
-
- ExynosVideoGeometry bufferConf;
- OMX_U32 inputBufferNumber = 0;
- int i, nOutbufs;
-
FunctionIn();
if ((oneFrameSize <= 0) && (pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS)) {
@@ -969,14 +935,11 @@ OMX_ERRORTYPE H264CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle;
void *hMFCHandle = pMFCH264Handle->hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
- ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
ExynosVideoGeometry bufferConf;
- int i, nOutbufs, nPlanes, OutBufferSize;
+ int i,nPlanes, OutBufferSize;
FunctionIn();
@@ -1545,7 +1508,6 @@ OMX_ERRORTYPE Exynos_H264Enc_SetConfig(
switch (nIndex) {
case OMX_IndexConfigVideoIntraPeriod:
{
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVEncBase = ((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle);
OMX_U32 nPFrames = (*((OMX_U32 *)pComponentConfigStructure)) - 1;
pH264Enc->AVCComponent[OUTPUT_PORT_INDEX].nPFrames = nPFrames;
@@ -1644,8 +1606,6 @@ EXIT:
OMX_ERRORTYPE Exynos_H264Enc_ComponentRoleEnum(OMX_HANDLETYPE hComponent, OMX_U8 *cRole, OMX_U32 nIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- OMX_COMPONENTTYPE *pOMXComponent = NULL;
- EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
FunctionIn();
@@ -1675,19 +1635,13 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;;
- EXYNOS_MFC_H264ENC_HANDLE *pMFCH264Handle = &pH264Enc->hMFCH264Handle;
- OMX_PTR hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
OMX_COLOR_FORMATTYPE eColorFormat;
- ExynosVideoEncOps *pEncOps = NULL;
- ExynosVideoEncBufferOps *pInbufOps = NULL;
- ExynosVideoEncBufferOps *pOutbufOps = NULL;
-
- CSC_METHOD csc_method = CSC_METHOD_SW;
int i = 0;
FunctionIn();
+ CSC_METHOD csc_method = CSC_METHOD_SW;
pH264Enc->hMFCH264Handle.bConfiguredMFCSrc = OMX_FALSE;
pH264Enc->hMFCH264Handle.bConfiguredMFCDst = OMX_FALSE;
pVideoEnc->bFirstOutput = OMX_FALSE;
@@ -1704,8 +1658,8 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
}
#endif
} else {
- if (eColorFormat == OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd ||
- eColorFormat == OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) {
+ if (eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd ||
+ eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) {
pExynosInputPort->bufferProcessType = BUFFER_SHARE;
} else {
pExynosInputPort->bufferProcessType = BUFFER_COPY;
@@ -1726,10 +1680,6 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
goto EXIT;
}
- pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
- pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
- pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
-
if (pExynosInputPort->bufferProcessType & BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
@@ -1802,6 +1752,7 @@ OMX_ERRORTYPE Exynos_H264Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
pExynosComponent->getAllDelayBuffer = OMX_FALSE;
#if 0//defined(USE_CSC_GSCALER)
+
csc_method = CSC_METHOD_HW; //in case of Use ION buffer.
#endif
pVideoEnc->csc_handle = csc_init(csc_method);
@@ -1826,13 +1777,8 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- OMX_PTR hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
-
- ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
- ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
- int i = 0, plane = 0;
+ int i = 0;
FunctionIn();
@@ -1895,7 +1841,6 @@ OMX_ERRORTYPE Exynos_H264Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
}
H264CodecClose(pH264Enc);
-EXIT:
FunctionOut();
return ret;
@@ -1909,13 +1854,10 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
- int i;
FunctionIn();
@@ -1933,9 +1875,8 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
pVideoEnc->configChange = OMX_FALSE;
}
- if ((pSrcInputData->dataLen >= 0) ||
- ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
- OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {NULL, NULL};
+ if ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
+ OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {0, };
ExynosVideoPlane planes[MFC_INPUT_BUFFER_PLANE];
int plane;
@@ -2037,7 +1978,6 @@ OMX_ERRORTYPE Exynos_H264Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pH264Enc->hMFCH264Handle.pInbufOps;
ExynosVideoBuffer *pVideoBuffer;
@@ -2096,10 +2036,8 @@ OMX_ERRORTYPE Exynos_H264Enc_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pH264Enc->hMFCH264Handle.hMFCHandle;
- ExynosVideoEncOps *pEncOps = pH264Enc->hMFCH264Handle.pEncOps;
ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
OMX_U32 dataLen = 0;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
@@ -2141,7 +2079,6 @@ OMX_ERRORTYPE Exynos_H264Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
ExynosVideoEncBufferOps *pOutbufOps = pH264Enc->hMFCH264Handle.pOutbufOps;
ExynosVideoBuffer *pVideoBuffer;
ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN;
- ExynosVideoGeometry bufferGeometry;
OMX_S32 indexTimestamp = 0;
FunctionIn();
@@ -2226,7 +2163,6 @@ OMX_ERRORTYPE Exynos_H264Enc_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompon
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_H264ENC_HANDLE *pH264Enc = (EXYNOS_H264ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
FunctionIn();
diff --git a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h
index caa606d..d988c02 100644..100755
--- a/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h
+++ b/openmax/component/video/enc/h264/Exynos_OMX_H264enc.h
@@ -52,9 +52,9 @@ typedef struct _EXYNOS_MFC_H264ENC_HANDLE
OMX_BOOL bPrependSpsPpsToIdr;
EXTRA_DATA headerData;
- ExynosVideoDecOps *pEncOps;
- ExynosVideoDecBufferOps *pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps;
+ ExynosVideoEncOps *pEncOps;
+ ExynosVideoEncBufferOps *pInbufOps;
+ ExynosVideoEncBufferOps *pOutbufOps;
ExynosVideoEncParam encParam;
} EXYNOS_MFC_H264ENC_HANDLE;
@@ -79,6 +79,7 @@ extern "C" {
OSCL_EXPORT_REF OMX_ERRORTYPE Exynos_OMX_ComponentInit(OMX_HANDLETYPE hComponent, OMX_STRING componentName);
OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent);
+OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR *pVirtAddr, OMX_U32 *dataSize);
#ifdef __cplusplus
};
diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c
index c582237..9b2f920 100755
--- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c
+++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.c
@@ -40,6 +40,7 @@
//#include "ExynosVideoApi.h"
#include "Exynos_OSAL_SharedMemory.h"
#include "Exynos_OSAL_Event.h"
+#include "Exynos_OMX_VencControl.h"
/* To use CSC_METHOD_HW in EXYNOS OMX, gralloc should allocate physical memory using FIMC */
/* It means GRALLOC_USAGE_HW_FIMC1 should be set on Native Window usage */
@@ -491,10 +492,7 @@ static void Change_H263Enc_Param(EXYNOS_OMX_BASECOMPONENT *pExynosComponent)
OMX_ERRORTYPE GetCodecInputPrivateData(OMX_PTR codecBuffer, OMX_PTR addr[], OMX_U32 size[])
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
OMX_ERRORTYPE GetCodecOutputPrivateData(OMX_PTR codecBuffer, OMX_PTR *pVirtAddr, OMX_U32 *dataSize)
@@ -673,7 +671,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoEncOps *pEncOps = NULL;
ExynosVideoEncBufferOps *pInbufOps = NULL;
ExynosVideoEncBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
@@ -699,7 +696,6 @@ OMX_ERRORTYPE Mpeg4CodecStart(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInd
}
hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
- pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
@@ -720,7 +716,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
void *hMFCHandle = NULL;
- ExynosVideoEncOps *pEncOps = NULL;
ExynosVideoEncBufferOps *pInbufOps = NULL;
ExynosVideoEncBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
@@ -745,7 +740,6 @@ OMX_ERRORTYPE Mpeg4CodecStop(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortInde
}
hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
- pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
@@ -771,16 +765,16 @@ OMX_ERRORTYPE Mpeg4CodecSrcInit(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle;
void *hMFCHandle = pMFCMpeg4Handle->hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
+
ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
+
ExynosVideoEncParam *pEncParam = NULL;
ExynosVideoGeometry bufferConf;
OMX_U32 inputBufferNumber = 0;
- int i, nOutbufs;
+ int i;
FunctionIn();
@@ -909,10 +903,6 @@ EXIT:
OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent, OMX_U32 nPortIndex)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- void *hMFCHandle = NULL;
- ExynosVideoEncOps *pEncOps = NULL;
- ExynosVideoEncBufferOps *pInbufOps = NULL;
- ExynosVideoEncBufferOps *pOutbufOps = NULL;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = NULL;
@@ -934,11 +924,6 @@ OMX_ERRORTYPE Mpeg4CodecOutputBufferProcessRun(OMX_COMPONENTTYPE *pOMXComponent,
goto EXIT;
}
- hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
- pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
- pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
- pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
-
if (nPortIndex == INPUT_PORT_INDEX) {
if (pMpeg4Enc->bSourceStart == OMX_FALSE) {
Exynos_OSAL_SignalSet(pMpeg4Enc->hSourceStartEvent);
@@ -968,11 +953,8 @@ OMX_ERRORTYPE Mpeg4CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- int i, nOutbufs;
+ int i;
- ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
@@ -998,7 +980,6 @@ OMX_ERRORTYPE Mpeg4CodecEnqueueAllBuffer(OMX_COMPONENTTYPE *pOMXComponent, OMX_U
pInbufOps->Clear_Queue(hMFCHandle);
} else if ((nPortIndex == OUTPUT_PORT_INDEX) &&
(pMpeg4Enc->bDestinationStart == OMX_TRUE)) {
- OMX_U32 dataLen[2] = {0, 0};
ExynosVideoBuffer *pBuffer = NULL;
Exynos_CodecBufferReset(pExynosComponent, OUTPUT_PORT_INDEX);
@@ -1023,23 +1004,10 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle;
- void *hMFCHandle = pMFCMpeg4Handle->hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
- ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
- ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
- ExynosVideoEncParam *pEncParam = NULL;
-
- ExynosVideoGeometry bufferConf;
- OMX_U32 inputBufferNumber = 0;
- int i, nOutbufs;
-
FunctionIn();
if ((oneFrameSize <= 0) && (pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS)) {
@@ -1052,9 +1020,10 @@ OMX_ERRORTYPE Mpeg4CodecSrcSetup(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX_DA
OMXBuffer->nTimeStamp = pSrcInputData->timeStamp;
OMXBuffer->nFlags = pSrcInputData->nFlags;
- Exynos_OMX_OutputBufferReturn(pOMXComponent, OMXBuffer);
-
- ret = OMX_ErrorNone;
+ ret = Exynos_OMX_OutputBufferReturn(pOMXComponent, OMXBuffer);
+ if (ret != OMX_ErrorNone) {
+ goto EXIT;
+ }
goto EXIT;
}
@@ -1087,14 +1056,11 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle;
void *hMFCHandle = pMFCMpeg4Handle->hMFCHandle;
- EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
- ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
- ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
ExynosVideoGeometry bufferConf;
- int i, nOutbufs, nPlanes, OutBufferSize;
+ int i, nPlanes, OutBufferSize;
FunctionIn();
@@ -1154,8 +1120,15 @@ OMX_ERRORTYPE Mpeg4CodecDstSetup(OMX_COMPONENTTYPE *pOMXComponent)
for (i = 0; i < MFC_OUTPUT_BUFFER_NUM_MAX; i++) {
ExynosVideoPlane plane;
pVideoEnc->pMFCEncOutputBuffer[i] = (CODEC_ENC_BUFFER *)Exynos_OSAL_Malloc(sizeof(CODEC_ENC_BUFFER));
+
+ if (pVideoEnc->pMFCEncOutputBuffer[i] == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Alloc output buffer");
+ ret = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] =
(void *)Exynos_OSAL_SharedMemory_Alloc(pVideoEnc->hSharedMemory, OutBufferSize, NORMAL_MEMORY);
+
if (pVideoEnc->pMFCEncOutputBuffer[i]->pVirAddr[0] == NULL) {
Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Alloc output buffer");
ret = OMX_ErrorInsufficientResources;
@@ -1686,7 +1659,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SetConfig(
pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)pVideoEnc->hCodecHandle;
- switch (nIndex) {
+ switch ((EXYNOS_OMX_INDEXTYPE)nIndex) {
case OMX_IndexConfigVideoIntraPeriod:
{
OMX_U32 nPFrames = (*((OMX_U32 *)pComponentConfigStructure)) - 1;
@@ -1816,15 +1789,11 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;;
- EXYNOS_MFC_MPEG4ENC_HANDLE *pMFCMpeg4Handle = &pMpeg4Enc->hMFCMpeg4Handle;
- OMX_PTR hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
OMX_COLOR_FORMATTYPE eColorFormat;
- ExynosVideoEncOps *pEncOps = NULL;
- ExynosVideoEncBufferOps *pInbufOps = NULL;
- ExynosVideoEncBufferOps *pOutbufOps = NULL;
CSC_METHOD csc_method = CSC_METHOD_SW;
+
int i = 0;
FunctionIn();
@@ -1845,8 +1814,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
}
#endif
} else {
- if (eColorFormat == OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd ||
- eColorFormat == OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) {
+ if (eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12L_DmaBuf_Fd ||
+ eColorFormat == (OMX_COLOR_FORMATTYPE)OMX_SEC_COLOR_FormatNV12T_DmaBuf_Fd) {
pExynosInputPort->bufferProcessType = BUFFER_SHARE;
} else {
pExynosInputPort->bufferProcessType = BUFFER_COPY;
@@ -1859,10 +1828,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
goto EXIT;
}
- pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
- pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
- pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
-
if (pExynosInputPort->bufferProcessType & BUFFER_COPY) {
Exynos_OSAL_SemaphoreCreate(&pExynosInputPort->codecSemID);
Exynos_OSAL_QueueCreate(&pExynosInputPort->codecBufferQ, MAX_QUEUE_ELEMENTS);
@@ -1870,6 +1835,11 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Init(OMX_COMPONENTTYPE *pOMXComponent)
if (pMpeg4Enc->hMFCMpeg4Handle.bShareableBuf == OMX_TRUE) {
for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) {
pVideoEnc->pMFCEncInputBuffer[i] = Exynos_OSAL_Malloc(sizeof(CODEC_ENC_BUFFER));
+ if (pVideoEnc->pMFCEncInputBuffer[i] == NULL) {
+ Exynos_OSAL_Log(EXYNOS_LOG_ERROR, "Failed to Alloc input buffer");
+ ret = OMX_ErrorInsufficientResources;
+ goto EXIT;
+ }
/* Use ION Allocator */
/*Alloc Y-Buffer */
pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[0] = (void *)Exynos_OSAL_SharedMemory_Alloc(pVideoEnc->hSharedMemory, DEFAULT_MFC_INPUT_YBUFFER_SIZE, NORMAL_MEMORY);
@@ -1959,13 +1929,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- OMX_PTR hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
-
- ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
- ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
- int i = 0, plane = 0;
+ int i = 0;
FunctionIn();
@@ -1986,7 +1951,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) {
if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) {
#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
- for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
+ for (int plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL)
Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]);
}
@@ -2010,7 +1975,7 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
for (i = 0; i < MFC_INPUT_BUFFER_NUM_MAX; i++) {
if (pVideoEnc->pMFCEncInputBuffer[i] != NULL) {
#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
- for (plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
+ for (int plane = 0; plane < MFC_INPUT_BUFFER_PLANE; plane++) {
if (pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane] != NULL)
Exynos_OSAL_SharedMemory_Free(pVideoEnc->hSharedMemory, pVideoEnc->pMFCEncInputBuffer[i]->pVirAddr[plane]);
}
@@ -2030,7 +1995,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_Terminate(OMX_COMPONENTTYPE *pOMXComponent)
}
Mpeg4CodecClose(pMpeg4Enc);
-EXIT:
FunctionOut();
return ret;
@@ -2044,13 +2008,10 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
OMX_U32 oneFrameSize = pSrcInputData->dataLen;
ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
- ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
- int i;
FunctionIn();
@@ -2074,9 +2035,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
}
- if ((pSrcInputData->dataLen >= 0) ||
- ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS)) {
- OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {NULL, NULL};
+ if ((pSrcInputData->nFlags & OMX_BUFFERFLAG_EOS) == OMX_BUFFERFLAG_EOS) {
+ OMX_U32 pMFCYUVDataSize[MFC_INPUT_BUFFER_PLANE] = {0, };
ExynosVideoPlane planes[MFC_INPUT_BUFFER_PLANE];
int plane;
@@ -2154,7 +2114,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_SrcOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
- ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
ExynosVideoEncBufferOps *pInbufOps = pMpeg4Enc->hMFCMpeg4Handle.pInbufOps;
ExynosVideoBuffer *pVideoBuffer;
@@ -2213,10 +2172,8 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstIn(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OMX
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
- ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
OMX_U32 dataLen = 0;
ExynosVideoErrorType codecReturn = VIDEO_ERROR_NONE;
@@ -2252,13 +2209,12 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
- EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
+ EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)pVideoEnc->hCodecHandle;
void *hMFCHandle = pMpeg4Enc->hMFCMpeg4Handle.hMFCHandle;
ExynosVideoEncOps *pEncOps = pMpeg4Enc->hMFCMpeg4Handle.pEncOps;
ExynosVideoEncBufferOps *pOutbufOps = pMpeg4Enc->hMFCMpeg4Handle.pOutbufOps;
ExynosVideoBuffer *pVideoBuffer;
ExynosVideoFrameStatusType displayStatus = VIDEO_FRAME_STATUS_UNKNOWN;
- ExynosVideoGeometry bufferGeometry;
OMX_S32 indexTimestamp = 0;
FunctionIn();
@@ -2287,7 +2243,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_DstOut(OMX_COMPONENTTYPE *pOMXComponent, EXYNOS_OM
pDstOutputData->bufferHeader = (OMX_BUFFERHEADERTYPE *)pVideoBuffer->pPrivate;
if (pVideoEnc->bFirstOutput == OMX_FALSE) {
- OMX_U8 *p = NULL;
pDstOutputData->timeStamp = 0;
pDstOutputData->nFlags |= OMX_BUFFERFLAG_CODECCONFIG;
@@ -2326,7 +2281,6 @@ OMX_ERRORTYPE Exynos_Mpeg4Enc_srcInputBufferProcess(OMX_COMPONENTTYPE *pOMXCompo
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = (EXYNOS_MPEG4ENC_HANDLE *)((EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
EXYNOS_OMX_BASEPORT *pExynosInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
FunctionIn();
@@ -2683,9 +2637,12 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent)
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
EXYNOS_MPEG4ENC_HANDLE *pMpeg4Enc = NULL;
+#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
+ EXYNOS_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
+ pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
+#endif
FunctionIn();
if (hComponent == NULL) {
@@ -2694,7 +2651,6 @@ OMX_ERRORTYPE Exynos_OMX_ComponentDeinit(OMX_HANDLETYPE hComponent)
}
pOMXComponent = (OMX_COMPONENTTYPE *)hComponent;
pExynosComponent = (EXYNOS_OMX_BASECOMPONENT *)pOMXComponent->pComponentPrivate;
- pVideoEnc = (EXYNOS_OMX_VIDEOENC_COMPONENT *)pExynosComponent->hComponentHandle;
#ifndef TIZEN_FEATURE_E3250 /* do not use ion */
Exynos_OSAL_SharedMemory_Close(pVideoEnc->hSharedMemory);
#endif
diff --git a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h
index 37792bb..6db3033 100644..100755
--- a/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h
+++ b/openmax/component/video/enc/mpeg4/Exynos_OMX_Mpeg4enc.h
@@ -49,9 +49,9 @@ typedef struct _EXYNOS_MFC_MPEG4ENC_HANDLE
OMX_BOOL bConfiguredMFCDst;
CODEC_TYPE codecType;
- ExynosVideoDecOps *pEncOps;
- ExynosVideoDecBufferOps *pInbufOps;
- ExynosVideoDecBufferOps *pOutbufOps;
+ ExynosVideoEncOps *pEncOps;
+ ExynosVideoEncBufferOps *pInbufOps;
+ ExynosVideoEncBufferOps *pOutbufOps;
ExynosVideoEncParam encParam;
} EXYNOS_MFC_MPEG4ENC_HANDLE;
diff --git a/openmax/core/Exynos_OMX_Component_Register.c b/openmax/core/Exynos_OMX_Component_Register.c
index 37415c2..544d4af 100644..100755
--- a/openmax/core/Exynos_OMX_Component_Register.c
+++ b/openmax/core/Exynos_OMX_Component_Register.c
@@ -48,10 +48,8 @@
OMX_ERRORTYPE Exynos_OMX_Component_Register(EXYNOS_OMX_COMPONENT_REGLIST **compList, OMX_U32 *compNum)
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
- int componentNum = 0, roleNum = 0, totalCompNum = 0;
- int read;
+ int componentNum = 0, totalCompNum = 0;
char *libName;
- size_t len;
const char *errorMsg;
DIR *dir;
struct dirent *d;
@@ -139,13 +137,10 @@ EXIT:
OMX_ERRORTYPE Exynos_OMX_Component_Unregister(EXYNOS_OMX_COMPONENT_REGLIST *componentList)
{
- OMX_ERRORTYPE ret = OMX_ErrorNone;
-
Exynos_OSAL_Memset(componentList, 0, sizeof(EXYNOS_OMX_COMPONENT_REGLIST) * MAX_OMX_COMPONENT_NUM);
Exynos_OSAL_Free(componentList);
-EXIT:
- return ret;
+ return OMX_ErrorNone;
}
OMX_ERRORTYPE Exynos_OMX_ComponentAPICheck(OMX_COMPONENTTYPE *component)
diff --git a/openmax/core/Exynos_OMX_Core.c b/openmax/core/Exynos_OMX_Core.c
index 0cabd0a..e783ea5 100644
--- a/openmax/core/Exynos_OMX_Core.c
+++ b/openmax/core/Exynos_OMX_Core.c
@@ -260,20 +260,14 @@ OMX_API OMX_ERRORTYPE OMX_APIENTRY Exynos_OMX_SetupTunnel(
OMX_IN OMX_HANDLETYPE hInput,
OMX_IN OMX_U32 nPortInput)
{
- OMX_ERRORTYPE ret = OMX_ErrorNotImplemented;
-
-EXIT:
- return ret;
+ return OMX_ErrorNotImplemented;
}
OMX_API OMX_ERRORTYPE Exynos_OMX_GetContentPipe(
OMX_OUT OMX_HANDLETYPE *hPipe,
OMX_IN OMX_STRING szURI)
{
- OMX_ERRORTYPE ret = OMX_ErrorNotImplemented;
-
-EXIT:
- return ret;
+ return OMX_ErrorNotImplemented;
}
OMX_API OMX_ERRORTYPE Exynos_OMX_GetComponentsOfRole (
@@ -283,7 +277,6 @@ OMX_API OMX_ERRORTYPE Exynos_OMX_GetComponentsOfRole (
{
OMX_ERRORTYPE ret = OMX_ErrorNone;
int max_role_num = 0;
- OMX_STRING RoleString[MAX_OMX_COMPONENT_ROLE_SIZE];
int i = 0, j = 0;
FunctionIn();
diff --git a/openmax/osal/Exynos_OSAL_Event.c b/openmax/osal/Exynos_OSAL_Event.c
index ef14f85..b686f4d 100644..100755
--- a/openmax/osal/Exynos_OSAL_Event.c
+++ b/openmax/osal/Exynos_OSAL_Event.c
@@ -30,6 +30,7 @@
#include <string.h>
#include <pthread.h>
#include <errno.h>
+#include <sys/time.h>
#include "Exynos_OSAL_Memory.h"
#include "Exynos_OSAL_Mutex.h"
diff --git a/openmax/osal/Exynos_OSAL_Mutex.c b/openmax/osal/Exynos_OSAL_Mutex.c
index 4ef773c..511a715 100644..100755
--- a/openmax/osal/Exynos_OSAL_Mutex.c
+++ b/openmax/osal/Exynos_OSAL_Mutex.c
@@ -66,7 +66,6 @@ OMX_ERRORTYPE Exynos_OSAL_MutexTerminate(OMX_HANDLETYPE mutexHandle)
OMX_ERRORTYPE Exynos_OSAL_MutexLock(OMX_HANDLETYPE mutexHandle)
{
pthread_mutex_t *mutex = (pthread_mutex_t *)mutexHandle;
- int result;
if (mutex == NULL)
return OMX_ErrorBadParameter;
@@ -80,7 +79,6 @@ OMX_ERRORTYPE Exynos_OSAL_MutexLock(OMX_HANDLETYPE mutexHandle)
OMX_ERRORTYPE Exynos_OSAL_MutexUnlock(OMX_HANDLETYPE mutexHandle)
{
pthread_mutex_t *mutex = (pthread_mutex_t *)mutexHandle;
- int result;
if (mutex == NULL)
return OMX_ErrorBadParameter;
diff --git a/openmax/osal/Exynos_OSAL_Platform_Specific.c b/openmax/osal/Exynos_OSAL_Platform_Specific.c
index e82d3d9..9ae846c 100755
--- a/openmax/osal/Exynos_OSAL_Platform_Specific.c
+++ b/openmax/osal/Exynos_OSAL_Platform_Specific.c
@@ -28,6 +28,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include <mm_types.h>
#include "Exynos_OSAL_Semaphore.h"
@@ -105,9 +106,9 @@ OMX_ERRORTYPE Exynos_OSAL_LockPBHandle(
vplanes[2].addr = vaddr[2];
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer locked: 0x%x", __func__, *vaddr);
-#endif
EXIT:
+#endif
FunctionOut();
return ret;
@@ -132,9 +133,10 @@ OMX_ERRORTYPE Exynos_OSAL_UnlockPBHandle(OMX_IN OMX_U32 handle)
}
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "%s: buffer unlocked: 0x%x", __func__, handle);
-#endif
EXIT:
+#endif
+
FunctionOut();
return ret;
@@ -177,7 +179,6 @@ OMX_ERRORTYPE Exynos_OSAL_LockPB(
*pStride = pANB->stride;
#endif
-EXIT:
FunctionOut();
return ret;
@@ -461,7 +462,6 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter(
OMX_ERRORTYPE ret = OMX_ErrorNone;
OMX_COMPONENTTYPE *pOMXComponent = NULL;
EXYNOS_OMX_BASECOMPONENT *pExynosComponent = NULL;
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = NULL;
FunctionIn();
@@ -492,8 +492,6 @@ OMX_ERRORTYPE Exynos_OSAL_SetPBParameter(
goto EXIT;
}
- pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
-
switch (nIndex) {
#ifdef TIZEN_FEATURE_E3250
case OMX_IndexParamEnablePlatformSpecificBuffers:
diff --git a/openmax/osal/Exynos_OSAL_SharedMemory.c b/openmax/osal/Exynos_OSAL_SharedMemory.c
index 93c2416..dff3cfa 100755
--- a/openmax/osal/Exynos_OSAL_SharedMemory.c
+++ b/openmax/osal/Exynos_OSAL_SharedMemory.c
@@ -38,7 +38,9 @@
#include <fcntl.h>
#include <sys/mman.h>
+#include "Exynos_OSAL_Memory.h"
#include "Exynos_OSAL_SharedMemory.h"
+#include "Exynos_OSAL_Mutex.h"
#include "ion.h"
#define EXYNOS_LOG_OFF