diff options
author | Jamie Gennis <jgennis@google.com> | 2011-08-04 14:04:46 -0700 |
---|---|---|
committer | Jamie Gennis <jgennis@google.com> | 2011-08-04 14:09:09 -0700 |
commit | c40b6cc54765030d29acb54bd957c38f633cd5ea (patch) | |
tree | 168dc94f7e8e90ed8500962d04f2c4d3d02bbf26 /sec_mm | |
parent | efdcd63634d650955ffa4a5940b3b016f54725c4 (diff) | |
download | device_samsung_crespo-c40b6cc54765030d29acb54bd957c38f633cd5ea.zip device_samsung_crespo-c40b6cc54765030d29acb54bd957c38f633cd5ea.tar.gz device_samsung_crespo-c40b6cc54765030d29acb54bd957c38f633cd5ea.tar.bz2 |
Reduce buffer count in Android native buffer mode
This change makes nBufferCountMin and nBufferCountActual be 1 for the
output port of video decoders that are in Android native buffer mode.
Because the decode is done to internally allocated buffers, which are
then copied to the Gralloc buffer only one buffer is needed.
Change-Id: I157d0d6c6f66ee39f204c6c8871ef08e6d13f9d6
Bug: 5091988
Diffstat (limited to 'sec_mm')
-rw-r--r-- | sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.c | 11 | ||||
-rw-r--r-- | sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.h | 3 |
2 files changed, 14 insertions, 0 deletions
diff --git a/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.c b/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.c index 6dd72a1..30a1acb 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.c +++ b/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.c @@ -1208,6 +1208,17 @@ OMX_ERRORTYPE SEC_OMX_VideoDecodeSetParameter( } ret = enableAndroidNativeBuffer(hComponent, ComponentParameterStructure); + if (ret == OMX_ErrorNone) { + SEC_OMX_BASECOMPONENT *pOMXComponent = (OMX_COMPONENTTYPE *)hComponent; + SEC_OMX_BASEPORT *pSECPort = &pSECComponent->pSECPort[OUTPUT_PORT_INDEX]; + if (pSECPort->bUseAndroidNativeBuffer) { + pSECPort->portDefinition.nBufferCountActual = ANDROID_MAX_VIDEO_OUTPUTBUFFER_NUM; + pSECPort->portDefinition.nBufferCountMin = ANDROID_MAX_VIDEO_OUTPUTBUFFER_NUM; + } else { + pSECPort->portDefinition.nBufferCountActual = MAX_VIDEO_OUTPUTBUFFER_NUM; + pSECPort->portDefinition.nBufferCountMin = MAX_VIDEO_OUTPUTBUFFER_NUM; + } + } } break; case OMX_IndexParamUseAndroidNativeBuffer: diff --git a/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.h b/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.h index b7f71da..d9e9d9e 100644 --- a/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.h +++ b/sec_mm/sec_omx/sec_omx_component/video/dec/SEC_OMX_Vdec.h @@ -48,6 +48,9 @@ #define INPUT_PORT_SUPPORTFORMAT_NUM_MAX 1 #define OUTPUT_PORT_SUPPORTFORMAT_NUM_MAX 3 +#ifdef USE_ANDROID_EXTENSION +#define ANDROID_MAX_VIDEO_OUTPUTBUFFER_NUM 1 +#endif typedef struct { |