exynos: multimedia: add support for OMX_IndexParamVideoIntraRefresh parameter

filiprrs: This fixes miracast, and possibly resolves issues with features
like chromecast, screen recording, wifi display etc.

Change-Id: I35f789a9ae29df0198b21c98dc866d8886799893
tirimbino
Dheeraj CVR 10 years ago committed by Simon Shields
parent e95e9c31a1
commit 601bcef48e
  1. 53
      exynos/multimedia/openmax/component/video/enc/SEC_OMX_Venc.c
  2. 1
      exynos/multimedia/openmax/component/video/enc/SEC_OMX_Venc.h
  3. 10
      exynos/multimedia/openmax/component/video/enc/h264/SEC_OMX_H264enc.c
  4. 20
      exynos/multimedia/openmax/component/video/enc/mpeg4/SEC_OMX_Mpeg4enc.c

@ -1243,6 +1243,30 @@ OMX_ERRORTYPE SEC_OMX_VideoEncodeGetParameter(
portDefinition->nBufferSize = MAX_INPUT_METADATA_BUFFER_SIZE; portDefinition->nBufferSize = MAX_INPUT_METADATA_BUFFER_SIZE;
} }
#endif #endif
}
break;
case OMX_IndexParamVideoIntraRefresh:
{
OMX_VIDEO_PARAM_INTRAREFRESHTYPE *pIntraRefresh = (OMX_VIDEO_PARAM_INTRAREFRESHTYPE *)ComponentParameterStructure;
OMX_U32 nPortIndex = pIntraRefresh->nPortIndex;
SEC_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
ret = SEC_OMX_Check_SizeVersion(pIntraRefresh, sizeof(OMX_VIDEO_PARAM_INTRAREFRESHTYPE));
if (ret != OMX_ErrorNone)
goto EXIT;
if (nPortIndex != OUTPUT_PORT_INDEX) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
pVideoEnc = (SEC_OMX_VIDEOENC_COMPONENT *)pSECComponent->hComponentHandle;
pIntraRefresh->eRefreshMode = pVideoEnc->intraRefresh.eRefreshMode;
pIntraRefresh->nAirMBs = pVideoEnc->intraRefresh.nAirMBs;
pIntraRefresh->nAirRef = pVideoEnc->intraRefresh.nAirRef;
pIntraRefresh->nCirMBs = pVideoEnc->intraRefresh.nCirMBs;
ret = OMX_ErrorNone;
} }
break; break;
default: default:
@ -1414,6 +1438,35 @@ OMX_ERRORTYPE SEC_OMX_VideoEncodeSetParameter(
} }
break; break;
#endif #endif
case OMX_IndexParamVideoIntraRefresh:
{
OMX_VIDEO_PARAM_INTRAREFRESHTYPE *pIntraRefresh = (OMX_VIDEO_PARAM_INTRAREFRESHTYPE *)ComponentParameterStructure;
OMX_U32 nPortIndex = pIntraRefresh->nPortIndex;
SEC_OMX_VIDEOENC_COMPONENT *pVideoEnc = NULL;
ret = SEC_OMX_Check_SizeVersion(pIntraRefresh, sizeof(OMX_VIDEO_PARAM_INTRAREFRESHTYPE));
if (ret != OMX_ErrorNone)
goto EXIT;
if (nPortIndex != OUTPUT_PORT_INDEX) {
ret = OMX_ErrorBadPortIndex;
goto EXIT;
}
pVideoEnc = (SEC_OMX_VIDEOENC_COMPONENT *)pSECComponent->hComponentHandle;
if (pIntraRefresh->eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
pVideoEnc->intraRefresh.eRefreshMode = pIntraRefresh->eRefreshMode;
pVideoEnc->intraRefresh.nCirMBs = pIntraRefresh->nCirMBs;
SEC_OSAL_Log(SEC_LOG_TRACE, "OMX_VIDEO_IntraRefreshCyclic Enable, nCirMBs: %d",
pVideoEnc->intraRefresh.nCirMBs);
} else {
ret = OMX_ErrorUnsupportedSetting;
goto EXIT;
}
ret = OMX_ErrorNone;
}
break;
default: default:
{ {
ret = SEC_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure); ret = SEC_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure);

@ -92,6 +92,7 @@ typedef struct _SEC_OMX_VIDEOENC_COMPONENT
OMX_BOOL IntraRefreshVOP; OMX_BOOL IntraRefreshVOP;
OMX_VIDEO_CONTROLRATETYPE eControlRate[ALL_PORT_NUM]; OMX_VIDEO_CONTROLRATETYPE eControlRate[ALL_PORT_NUM];
OMX_VIDEO_PARAM_QUANTIZATIONTYPE quantization; OMX_VIDEO_PARAM_QUANTIZATIONTYPE quantization;
OMX_VIDEO_PARAM_INTRAREFRESHTYPE intraRefresh;
OMX_BOOL bFirstFrame; OMX_BOOL bFirstFrame;
MFC_ENC_INPUT_BUFFER MFCEncInputBuffer[MFC_INPUT_BUFFER_NUM_MAX]; MFC_ENC_INPUT_BUFFER MFCEncInputBuffer[MFC_INPUT_BUFFER_NUM_MAX];
OMX_U32 indexInputBuffer; OMX_U32 indexInputBuffer;

@ -205,7 +205,6 @@ void Set_H264Enc_Param(SSBSIP_MFC_ENC_H264_PARAM *pH264Arg, SEC_OMX_BASECOMPONEN
pH264Arg->SourceHeight = pSECOutputPort->portDefinition.format.video.nFrameHeight; pH264Arg->SourceHeight = pSECOutputPort->portDefinition.format.video.nFrameHeight;
pH264Arg->IDRPeriod = pH264Enc->AVCComponent[OUTPUT_PORT_INDEX].nPFrames + 1; pH264Arg->IDRPeriod = pH264Enc->AVCComponent[OUTPUT_PORT_INDEX].nPFrames + 1;
pH264Arg->SliceMode = 0; pH264Arg->SliceMode = 0;
pH264Arg->RandomIntraMBRefresh = 0;
pH264Arg->Bitrate = pSECOutputPort->portDefinition.format.video.nBitrate; pH264Arg->Bitrate = pSECOutputPort->portDefinition.format.video.nBitrate;
pH264Arg->QSCodeMax = 51; pH264Arg->QSCodeMax = 51;
pH264Arg->QSCodeMin = 10; pH264Arg->QSCodeMin = 10;
@ -259,6 +258,15 @@ void Set_H264Enc_Param(SSBSIP_MFC_ENC_H264_PARAM *pH264Arg, SEC_OMX_BASECOMPONEN
break; break;
} }
if (pVideoEnc->intraRefresh.eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
/* Cyclic Mode */
pH264Arg->RandomIntraMBRefresh = pVideoEnc->intraRefresh.nCirMBs;
SEC_OSAL_Log(SEC_LOG_TRACE, "RandomIntraMBRefresh: %d", pH264Arg->RandomIntraMBRefresh);
} else {
/* Don't support "Adaptive" and "Cyclic + Adaptive" */
pH264Arg->RandomIntraMBRefresh = 0;
}
switch ((SEC_OMX_COLOR_FORMATTYPE)pSECInputPort->portDefinition.format.video.eColorFormat) { switch ((SEC_OMX_COLOR_FORMATTYPE)pSECInputPort->portDefinition.format.video.eColorFormat) {
case OMX_SEC_COLOR_FormatNV12LPhysicalAddress: case OMX_SEC_COLOR_FormatNV12LPhysicalAddress:
case OMX_SEC_COLOR_FormatNV12LVirtualAddress: case OMX_SEC_COLOR_FormatNV12LVirtualAddress:

@ -201,7 +201,6 @@ void Set_Mpeg4Enc_Param(SSBSIP_MFC_ENC_MPEG4_PARAM *pMpeg4Param, SEC_OMX_BASECOM
pMpeg4Param->SourceHeight = pSECOutputPort->portDefinition.format.video.nFrameHeight; pMpeg4Param->SourceHeight = pSECOutputPort->portDefinition.format.video.nFrameHeight;
pMpeg4Param->IDRPeriod = pMpeg4Enc->mpeg4Component[OUTPUT_PORT_INDEX].nPFrames + 1; pMpeg4Param->IDRPeriod = pMpeg4Enc->mpeg4Component[OUTPUT_PORT_INDEX].nPFrames + 1;
pMpeg4Param->SliceMode = 0; pMpeg4Param->SliceMode = 0;
pMpeg4Param->RandomIntraMBRefresh = 0;
pMpeg4Param->Bitrate = pSECOutputPort->portDefinition.format.video.nBitrate; pMpeg4Param->Bitrate = pSECOutputPort->portDefinition.format.video.nBitrate;
pMpeg4Param->QSCodeMax = 30; pMpeg4Param->QSCodeMax = 30;
pMpeg4Param->QSCodeMin = 10; pMpeg4Param->QSCodeMin = 10;
@ -242,6 +241,15 @@ void Set_Mpeg4Enc_Param(SSBSIP_MFC_ENC_MPEG4_PARAM *pMpeg4Param, SEC_OMX_BASECOM
break; break;
} }
if (pVideoEnc->intraRefresh.eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
/* Cyclic Mode */
pMpeg4Param->RandomIntraMBRefresh = pVideoEnc->intraRefresh.nCirMBs;
SEC_OSAL_Log(SEC_LOG_TRACE, "RandomIntraMBRefresh: %d", pMpeg4Param->RandomIntraMBRefresh);
} else {
/* Don't support "Adaptive" and "Cyclic + Adaptive" */
pMpeg4Param->RandomIntraMBRefresh = 0;
}
switch ((SEC_OMX_COLOR_FORMATTYPE)pSECInputPort->portDefinition.format.video.eColorFormat) { switch ((SEC_OMX_COLOR_FORMATTYPE)pSECInputPort->portDefinition.format.video.eColorFormat) {
case OMX_SEC_COLOR_FormatNV12LPhysicalAddress: case OMX_SEC_COLOR_FormatNV12LPhysicalAddress:
case OMX_SEC_COLOR_FormatNV12LVirtualAddress: case OMX_SEC_COLOR_FormatNV12LVirtualAddress:
@ -322,7 +330,6 @@ void Set_H263Enc_Param(SSBSIP_MFC_ENC_H263_PARAM *pH263Param, SEC_OMX_BASECOMPON
pH263Param->SourceHeight = pSECOutputPort->portDefinition.format.video.nFrameHeight; pH263Param->SourceHeight = pSECOutputPort->portDefinition.format.video.nFrameHeight;
pH263Param->IDRPeriod = pMpeg4Enc->h263Component[OUTPUT_PORT_INDEX].nPFrames + 1; pH263Param->IDRPeriod = pMpeg4Enc->h263Component[OUTPUT_PORT_INDEX].nPFrames + 1;
pH263Param->SliceMode = 0; pH263Param->SliceMode = 0;
pH263Param->RandomIntraMBRefresh = 0;
pH263Param->Bitrate = pSECOutputPort->portDefinition.format.video.nBitrate; pH263Param->Bitrate = pSECOutputPort->portDefinition.format.video.nBitrate;
pH263Param->QSCodeMax = 30; pH263Param->QSCodeMax = 30;
pH263Param->QSCodeMin = 10; pH263Param->QSCodeMin = 10;
@ -356,6 +363,15 @@ void Set_H263Enc_Param(SSBSIP_MFC_ENC_H263_PARAM *pH263Param, SEC_OMX_BASECOMPON
break; break;
} }
if (pVideoEnc->intraRefresh.eRefreshMode == OMX_VIDEO_IntraRefreshCyclic) {
/* Cyclic Mode */
pH263Param->RandomIntraMBRefresh = pVideoEnc->intraRefresh.nCirMBs;
SEC_OSAL_Log(SEC_LOG_TRACE, "RandomIntraMBRefresh: %d", pH263Param->RandomIntraMBRefresh);
} else {
/* Don't support "Adaptive" and "Cyclic + Adaptive" */
pH263Param->RandomIntraMBRefresh = 0;
}
switch ((SEC_OMX_COLOR_FORMATTYPE)pSECInputPort->portDefinition.format.video.eColorFormat) { switch ((SEC_OMX_COLOR_FORMATTYPE)pSECInputPort->portDefinition.format.video.eColorFormat) {
case OMX_SEC_COLOR_FormatNV12LPhysicalAddress: case OMX_SEC_COLOR_FormatNV12LPhysicalAddress:
case OMX_SEC_COLOR_FormatNV12LVirtualAddress: case OMX_SEC_COLOR_FormatNV12LVirtualAddress:

Loading…
Cancel
Save