#define MAX_INPUTBUFFER_NUM_DYNAMIC 0 /* Dynamic number of metadata buffer */
+#define PLATFORM_DISPLAY_BUFFER 2
+
typedef struct
{
void *pAddrY;
pVideoDec->bDTSMode = pDTSParam->bDTSMode;
}
break;
+ case OMX_IndexParamEnableThumbnailMode:
+ {
+ EXYNOS_OMX_VIDEO_THUMBNAILMODE *pThumbnailMode = (EXYNOS_OMX_VIDEO_THUMBNAILMODE *)ComponentParameterStructure;
+ EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
+
+ ret = Exynos_OMX_Check_SizeVersion(pThumbnailMode, sizeof(EXYNOS_OMX_VIDEO_THUMBNAILMODE));
+ if (ret != OMX_ErrorNone) {
+ goto EXIT;
+ }
+
+ pVideoDec->bThumbnailMode = pThumbnailMode->bEnable;
+ if (pVideoDec->bThumbnailMode == OMX_TRUE) {
+ EXYNOS_OMX_BASEPORT *pExynosOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
+ pExynosOutputPort->portDefinition.nBufferCountMin = 1;
+ pExynosOutputPort->portDefinition.nBufferCountActual = 1;
+ }
+
+ ret = OMX_ErrorNone;
+ }
+ break;
default:
{
ret = Exynos_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure);
}
switch (nIndex) {
- case OMX_IndexVendorThumbnailMode:
- {
- EXYNOS_OMX_VIDEODEC_COMPONENT *pVideoDec = (EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle;
- pVideoDec->bThumbnailMode = *((OMX_BOOL *)pComponentConfigStructure);
-
- ret = OMX_ErrorNone;
- }
- break;
#ifdef USE_QOS_CTRL
case OMX_IndexVendorSetQosRatio:
{
#endif
#ifdef USE_ANB
- if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_ANB) == 0)
+ if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_ANB) == 0) {
*pIndexType = (OMX_INDEXTYPE) OMX_IndexParamEnableAndroidBuffers;
- else if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_GET_ANB) == 0)
+ goto EXIT;
+ }
+ if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_GET_ANB) == 0) {
*pIndexType = (OMX_INDEXTYPE) OMX_IndexParamGetAndroidNativeBuffer;
- else if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_USE_ANB) == 0)
+ goto EXIT;
+ }
+ if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_USE_ANB) == 0) {
*pIndexType = (OMX_INDEXTYPE) OMX_IndexParamUseAndroidNativeBuffer;
- else
- ret = Exynos_OMX_GetExtensionIndex(hComponent, cParameterName, pIndexType);
-#else
- ret = Exynos_OMX_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+ goto EXIT;
+ }
#endif
+ if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) {
+ *pIndexType = OMX_IndexParamEnableThumbnailMode;
+ goto EXIT;
+ }
+
+ ret = Exynos_OMX_GetExtensionIndex(hComponent, cParameterName, pIndexType);
+
EXIT:
FunctionOut();
/* get dpb count */
pH264Dec->hMFCH264Handle.maxDPBNum = pDecOps->Get_ActualBufferCount(hMFCHandle);
- if (pVideoDec->bThumbnailMode == OMX_FALSE)
+ if (pVideoDec->bThumbnailMode == OMX_FALSE) {
pH264Dec->hMFCH264Handle.maxDPBNum += EXTRA_DPB_NUM;
+ } else {
+ pH264Dec->hMFCH264Handle.maxDPBNum += PLATFORM_DISPLAY_BUFFER;
+ }
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "H264CodecSetup nOutbufs: %d", pH264Dec->hMFCH264Handle.maxDPBNum);
pH264Dec->hMFCH264Handle.bConfiguredMFCSrc = OMX_TRUE;
pInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
pInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
- pOutputPort->portDefinition.nBufferCountActual = pH264Dec->hMFCH264Handle.maxDPBNum - 2;
- pOutputPort->portDefinition.nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum - 2;
+ pOutputPort->portDefinition.nBufferCountActual = pH264Dec->hMFCH264Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER;
+ pOutputPort->portDefinition.nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER;
Exynos_UpdateFrameSize(pOMXComponent);
goto EXIT;
}
- if (pVideoDec->bThumbnailMode == OMX_TRUE)
- pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if (pVideoDec->bThumbnailMode == OMX_TRUE) {
+ pDecOps->Set_IFrameDecoding(hMFCHandle);
+ }
if ((pDecOps->Enable_DTSMode != NULL) &&
(pVideoDec->bDTSMode == OMX_TRUE))
goto EXIT;
}
- 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;
- }
#ifdef USE_S3D_SUPPORT
- else if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_GET_S3D) == 0) {
+ if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_GET_S3D) == 0) {
*pIndexType = OMX_IndexVendorS3DMode;
ret = OMX_ErrorNone;
+ goto EXIT;
}
#endif
- else {
- ret = Exynos_OMX_VideoDecodeGetExtensionIndex(hComponent, cParameterName, pIndexType);
- }
+
+ ret = Exynos_OMX_VideoDecodeGetExtensionIndex(hComponent, cParameterName, pIndexType);
EXIT:
FunctionOut();
goto EXIT;
}
- if (pVideoDec->bThumbnailMode == OMX_TRUE)
- pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if (pVideoDec->bThumbnailMode == OMX_TRUE) {
+ pDecOps->Set_IFrameDecoding(hMFCHandle);
+ }
if ((pDecOps->Enable_DTSMode != NULL) &&
(pVideoDec->bDTSMode == OMX_TRUE))
/* get dpb count */
pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum = pDecOps->Get_ActualBufferCount(hMFCHandle);
- if (pVideoDec->bThumbnailMode == OMX_FALSE)
+ if (pVideoDec->bThumbnailMode == OMX_FALSE) {
pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum += EXTRA_DPB_NUM;
+ } else {
+ pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum += PLATFORM_DISPLAY_BUFFER;
+ }
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Mpeg4CodecSetup nOutbufs: %d", pMpeg4Dec->hMFCMpeg4Handle.maxDPBNum);
pMpeg4Dec->hMFCMpeg4Handle.bConfiguredMFCSrc = OMX_TRUE;
goto EXIT;
}
- 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 {
- ret = Exynos_OMX_VideoDecodeGetExtensionIndex(hComponent, cParameterName, pIndexType);
- }
+ ret = Exynos_OMX_VideoDecodeGetExtensionIndex(hComponent, cParameterName, pIndexType);
EXIT:
FunctionOut();
goto EXIT;
}
- if (pVideoDec->bThumbnailMode == OMX_TRUE)
- pDecOps->Set_DisplayDelay(hMFCHandle, 0);
+ if (pVideoDec->bThumbnailMode == OMX_TRUE) {
+ pDecOps->Set_IFrameDecoding(hMFCHandle);
+ }
if ((pDecOps->Enable_DTSMode != NULL) &&
(pVideoDec->bDTSMode == OMX_TRUE))
/* get dpb count */
pVp8Dec->hMFCVp8Handle.maxDPBNum = pDecOps->Get_ActualBufferCount(hMFCHandle);
- if (pVideoDec->bThumbnailMode == OMX_FALSE)
+ if (pVideoDec->bThumbnailMode == OMX_FALSE) {
pVp8Dec->hMFCVp8Handle.maxDPBNum += EXTRA_DPB_NUM;
+ } else {
+ pVp8Dec->hMFCVp8Handle.maxDPBNum += PLATFORM_DISPLAY_BUFFER;
+ }
Exynos_OSAL_Log(EXYNOS_LOG_TRACE, "Vp8CodecSetup nOutbufs: %d", pVp8Dec->hMFCVp8Handle.maxDPBNum);
pVp8Dec->hMFCVp8Handle.bConfiguredMFCSrc = OMX_TRUE;
pExynosInputPort->portDefinition.format.video.nStride = ((pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
pExynosInputPort->portDefinition.format.video.nSliceHeight = ((pVp8Dec->hMFCVp8Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
- pExynosOutputPort->portDefinition.nBufferCountActual = pVp8Dec->hMFCVp8Handle.maxDPBNum - 2;
- pExynosOutputPort->portDefinition.nBufferCountMin = pVp8Dec->hMFCVp8Handle.maxDPBNum - 2;
+ pExynosOutputPort->portDefinition.nBufferCountActual = pVp8Dec->hMFCVp8Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER;
+ pExynosOutputPort->portDefinition.nBufferCountMin = pVp8Dec->hMFCVp8Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER;
Exynos_UpdateFrameSize(pOMXComponent);
goto EXIT;
}
- if (Exynos_OSAL_Strcmp(cParameterName, EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL) == 0) {
- EXYNOS_VP8DEC_HANDLE *pVp8Dec = (EXYNOS_VP8DEC_HANDLE *)((EXYNOS_OMX_VIDEODEC_COMPONENT *)pExynosComponent->hComponentHandle)->hCodecHandle;
- *pIndexType = OMX_IndexVendorThumbnailMode;
- ret = OMX_ErrorNone;
- } else {
- ret = Exynos_OMX_VideoDecodeGetExtensionIndex(hComponent, cParameterName, pIndexType);
- }
+ ret = Exynos_OMX_VideoDecodeGetExtensionIndex(hComponent, cParameterName, pIndexType);
EXIT:
FunctionOut();
typedef enum _EXYNOS_OMX_INDEXTYPE
{
-#define EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL "OMX.SEC.index.ThumbnailMode"
- OMX_IndexVendorThumbnailMode = 0x7F000001,
+#define EXYNOS_INDEX_PARAM_ENABLE_THUMBNAIL "OMX.SEC.index.enableThumbnailMode"
+ OMX_IndexParamEnableThumbnailMode = 0x7F000001,
#define EXYNOS_INDEX_CONFIG_VIDEO_INTRAPERIOD "OMX.SEC.index.VideoIntraPeriod"
OMX_IndexConfigVideoIntraPeriod = 0x7F000002,
#ifdef USE_S3D_SUPPORT
OMX_S32 level;
} EXYNOS_OMX_VIDEO_PROFILELEVEL;
+typedef struct _EXYNOS_OMX_VIDEO_THUMBNAILMODE {
+ OMX_U32 nSize;
+ OMX_VERSIONTYPE nVersion;
+ OMX_U32 nPortIndex;
+ OMX_BOOL bEnable;
+} EXYNOS_OMX_VIDEO_THUMBNAILMODE;
+
#ifdef USE_S3D_SUPPORT
typedef enum _EXYNOS_OMX_FPARGMT_TYPE
{