}
Exynos_ResetCodecData(&pExynosPort->processData);
- if (pVideoDec->bReconfigDPB == OMX_TRUE)
- maxBufferNum = pVideoDec->nSavedDPBCnt;
- else
- maxBufferNum = pExynosPort->portDefinition.nBufferCountActual;
+ maxBufferNum = pExynosPort->portDefinition.nBufferCountActual;
for (i = 0; i < maxBufferNum; i++) {
if (pExynosPort->extendBufferHeader[i].bBufferInOMX == OMX_TRUE) {
if (portIndex == OUTPUT_PORT_INDEX) {
return ret;
}
+OMX_ERRORTYPE Exynos_ResolutionUpdate(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_OMX_BASEPORT *pInputPort = &pExynosComponent->pExynosPort[INPUT_PORT_INDEX];
+ EXYNOS_OMX_BASEPORT *pOutputPort = &pExynosComponent->pExynosPort[OUTPUT_PORT_INDEX];
+
+ pOutputPort->cropRectangle.nTop = pOutputPort->newCropRectangle.nTop;
+ pOutputPort->cropRectangle.nLeft = pOutputPort->newCropRectangle.nLeft;
+ pOutputPort->cropRectangle.nWidth = pOutputPort->newCropRectangle.nWidth;
+ pOutputPort->cropRectangle.nHeight = pOutputPort->newCropRectangle.nHeight;
+
+ pInputPort->portDefinition.format.video.nFrameWidth = pInputPort->newPortDefinition.format.video.nFrameWidth;
+ pInputPort->portDefinition.format.video.nFrameHeight = pInputPort->newPortDefinition.format.video.nFrameHeight;
+ pInputPort->portDefinition.format.video.nStride = pInputPort->newPortDefinition.format.video.nStride;
+ pInputPort->portDefinition.format.video.nSliceHeight = pInputPort->newPortDefinition.format.video.nSliceHeight;
+
+ pOutputPort->portDefinition.nBufferCountActual = pOutputPort->newPortDefinition.nBufferCountActual;
+ pOutputPort->portDefinition.nBufferCountMin = pOutputPort->newPortDefinition.nBufferCountMin;
+
+ Exynos_UpdateFrameSize(pOMXComponent);
+
+ return ret;
+}
+
OMX_ERRORTYPE Exynos_InputBufferReturn(
OMX_COMPONENTTYPE *pOMXComponent,
EXYNOS_OMX_DATABUFFER *pDataBuffer)
pBufferOps->Clear_RegisteredBuffer(hMFCHandle);
pBufferOps->Cleanup_Buffer(hMFCHandle);
}
+
+ Exynos_ResolutionUpdate(pOMXComponent);
} else {
ret = OMX_ErrorBadParameter;
goto EXIT;
ExynosVideoDecOps *pDecOps = pH264Dec->hMFCH264Handle.pDecOps;
ExynosVideoDecBufferOps *pOutbufOps = pH264Dec->hMFCH264Handle.pOutbufOps;
+ OMX_CONFIG_RECTTYPE *pCropRectangle = NULL;
+ OMX_PARAM_PORTDEFINITIONTYPE *pInputPortDefinition = NULL;
+ OMX_PARAM_PORTDEFINITIONTYPE *pOutputPortDefinition = NULL;
+
FunctionIn();
/* get geometry for output */
Exynos_OSAL_Memset(&pH264Dec->hMFCH264Handle.codecOutbufConf, 0, sizeof(ExynosVideoGeometry));
pH264Dec->hMFCH264Handle.maxDPBNum = pDecOps->Get_ActualBufferCount(hMFCHandle);
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;
- pOutputPort->cropRectangle.nTop = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nTop;
- pOutputPort->cropRectangle.nLeft = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nLeft;
- pOutputPort->cropRectangle.nWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth;
- pOutputPort->cropRectangle.nHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight;
+ if (pVideoDec->bReconfigDPB != OMX_TRUE) {
+ pCropRectangle = &(pOutputPort->cropRectangle);
+ pInputPortDefinition = &(pInputPort->portDefinition);
+ pOutputPortDefinition = &(pOutputPort->portDefinition);
+ } else {
+ pCropRectangle = &(pOutputPort->newCropRectangle);
+ pInputPortDefinition = &(pInputPort->newPortDefinition);
+ pOutputPortDefinition = &(pOutputPort->newPortDefinition);
+ }
- if (pVideoDec->bReconfigDPB == OMX_TRUE)
- pVideoDec->nSavedDPBCnt = pOutputPort->portDefinition.nBufferCountActual;
+ pCropRectangle->nTop = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nTop;
+ pCropRectangle->nLeft = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nLeft;
+ pCropRectangle->nWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth;
+ pCropRectangle->nHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight;
if (pOutputPort->bufferProcessType & BUFFER_COPY) {
if ((pVideoDec->bReconfigDPB) ||
(pInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight)) {
pOutputPort->exceptionFlag = NEED_PORT_DISABLE;
- pInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth;
- pInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight;
- pInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
- pInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
-
- Exynos_UpdateFrameSize(pOMXComponent);
+ pInputPortDefinition->format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth;
+ pInputPortDefinition->format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight;
+ pInputPortDefinition->format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
+ pInputPortDefinition->format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
+ pOutputPortDefinition->nBufferCountActual = pOutputPort->portDefinition.nBufferCountActual;
+ pOutputPortDefinition->nBufferCountMin = pOutputPort->portDefinition.nBufferCountMin;
+ if (pVideoDec->bReconfigDPB != OMX_TRUE) {
+ Exynos_UpdateFrameSize(pOMXComponent);
+ }
/** Send Port Settings changed call back **/
(*(pExynosComponent->pCallbacks->EventHandler))
(pInputPort->portDefinition.format.video.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth) ||
(pInputPort->portDefinition.format.video.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight) ||
(pOutputPort->portDefinition.nBufferCountActual != pH264Dec->hMFCH264Handle.maxDPBNum)) {
- pOutputPort->exceptionFlag = NEED_PORT_DISABLE;
-
- pInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth;
- pInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight;
- 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 - PLATFORM_DISPLAY_BUFFER;
- pOutputPort->portDefinition.nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum - PLATFORM_DISPLAY_BUFFER;
+ pInputPortDefinition->format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth;
+ pInputPortDefinition->format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight;
+ pInputPortDefinition->format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
+ pInputPortDefinition->format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
- Exynos_UpdateFrameSize(pOMXComponent);
+ pOutputPortDefinition->nBufferCountActual = pH264Dec->hMFCH264Handle.maxDPBNum;
+ pOutputPortDefinition->nBufferCountMin = pH264Dec->hMFCH264Handle.maxDPBNum;
+ if (pVideoDec->bReconfigDPB != OMX_TRUE) {
+ Exynos_UpdateFrameSize(pOMXComponent);
+ }
+ pOutputPort->exceptionFlag = NEED_PORT_DISABLE;
/** Send Port Settings changed call back **/
(*(pExynosComponent->pCallbacks->EventHandler))
(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth != pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nWidth) ||
(pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight != pH264Dec->hMFCH264Handle.codecOutbufConf.cropRect.nHeight)) {
/* Check Crop */
- pInputPort->portDefinition.format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth;
- pInputPort->portDefinition.format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight;
- pInputPort->portDefinition.format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
- pInputPort->portDefinition.format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
- Exynos_UpdateFrameSize(pOMXComponent);
+ pInputPortDefinition->format.video.nFrameWidth = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth;
+ pInputPortDefinition->format.video.nFrameHeight = pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight;
+ pInputPortDefinition->format.video.nStride = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameWidth + 15) & (~15));
+ pInputPortDefinition->format.video.nSliceHeight = ((pH264Dec->hMFCH264Handle.codecOutbufConf.nFrameHeight + 15) & (~15));
+ if (pVideoDec->bReconfigDPB != OMX_TRUE) {
+ Exynos_UpdateFrameSize(pOMXComponent);
+ }
/** Send crop info call back **/
(*(pExynosComponent->pCallbacks->EventHandler))