diff options
Diffstat (limited to 'sec_mm')
-rw-r--r-- | sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c | 22 | ||||
-rw-r--r-- | sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h | 2 |
2 files changed, 23 insertions, 1 deletions
diff --git a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c index c1bd4ef..eff5dec 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c +++ b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.c @@ -1235,6 +1235,28 @@ OMX_ERRORTYPE SEC_OMX_VideoEncodeSetParameter( ret = OMX_ErrorNone; } break; + case OMX_IndexParamPortDefinition: + { + OMX_PARAM_PORTDEFINITIONTYPE *pPortDefinition = + (OMX_PARAM_PORTDEFINITIONTYPE *)ComponentParameterStructure; + ret = SEC_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure); + if (ret != OMX_ErrorNone) { + goto EXIT; + } + + if (pPortDefinition->nPortIndex == INPUT_PORT_INDEX) { + SEC_OMX_BASEPORT *pSECInputPort = &pSECComponent->pSECPort[INPUT_PORT_INDEX]; + OMX_U32 width = pSECInputPort->portDefinition.format.video.nFrameWidth; + OMX_U32 height = pSECInputPort->portDefinition.format.video.nFrameHeight; + SEC_OMX_BASEPORT *pSECOutputPort = &pSECComponent->pSECPort[OUTPUT_PORT_INDEX]; + pSECOutputPort->portDefinition.format.video.nFrameWidth = width; + pSECOutputPort->portDefinition.format.video.nFrameHeight = height; + pSECOutputPort->portDefinition.nBufferSize = (width * height * 3) / 2; + SEC_OSAL_Log(SEC_LOG_TRACE, "pSECOutputPort->portDefinition.nBufferSize: %d", + pSECOutputPort->portDefinition.nBufferSize); + } + } + break; default: { ret = SEC_OMX_SetParameter(hComponent, nIndex, ComponentParameterStructure); diff --git a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h index 4654a24..93d2800 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h +++ b/sec_mm/sec_omx/sec_omx_component/video/enc/SEC_OMX_Venc.h @@ -42,7 +42,7 @@ #define DEFAULT_VIDEO_INPUT_BUFFER_SIZE ALIGN_TO_8KB(ALIGN_TO_128B(DEFAULT_FRAME_WIDTH) * ALIGN_TO_32B(DEFAULT_FRAME_HEIGHT)) \ + ALIGN_TO_8KB(ALIGN_TO_128B(DEFAULT_FRAME_WIDTH) * ALIGN_TO_32B(DEFAULT_FRAME_HEIGHT / 2)) /* (DEFAULT_FRAME_WIDTH * DEFAULT_FRAME_HEIGHT * 3) / 2 */ -#define DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE 1024 * 1024 +#define DEFAULT_VIDEO_OUTPUT_BUFFER_SIZE DEFAULT_VIDEO_INPUT_BUFFER_SIZE #define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 3 #define OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX 1 |