diff options
| author | Tianmi Chen <tianmi.chen@intel.com> | 2014-04-02 16:30:22 +0800 |
|---|---|---|
| committer | Patrick Tjin <pattjin@google.com> | 2014-07-21 22:02:58 -0700 |
| commit | 03118b9de04779e0aca0da6fe6fe5b0b0704a11c (patch) | |
| tree | bd38e3b0aebcade6762d84313fd11a2762422c2c | |
| parent | 41b0a4ad3d79b54a6899bec9603bb40537a2db5c (diff) | |
| download | android_hardware_intel_common_omx-components-03118b9de04779e0aca0da6fe6fe5b0b0704a11c.tar.gz android_hardware_intel_common_omx-components-03118b9de04779e0aca0da6fe6fe5b0b0704a11c.tar.bz2 android_hardware_intel_common_omx-components-03118b9de04779e0aca0da6fe6fe5b0b0704a11c.zip | |
omx-component: set max buffer count in case of adaptive playback
BZ: 184541
set max buffer count in case of adaptive playback
Change-Id: I7ee45256a9219458f11fda2981ab6ca532d9ff81
Signed-off-by: Tianmi Chen <tianmi.chen@intel.com>
| -rw-r--r-- | videocodec/OMXVideoDecoderAVC.cpp | 9 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderAVC.h | 3 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderBase.cpp | 10 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderBase.h | 1 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderH263.cpp | 1 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderH263.h | 2 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderMPEG4.h | 1 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderVP8.cpp | 2 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderVP8.h | 2 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderWMV.cpp | 1 | ||||
| -rw-r--r-- | videocodec/OMXVideoDecoderWMV.h | 2 |
11 files changed, 33 insertions, 1 deletions
diff --git a/videocodec/OMXVideoDecoderAVC.cpp b/videocodec/OMXVideoDecoderAVC.cpp index cf6f4e3..875afd8 100644 --- a/videocodec/OMXVideoDecoderAVC.cpp +++ b/videocodec/OMXVideoDecoderAVC.cpp @@ -320,4 +320,13 @@ OMX_COLOR_FORMATTYPE OMXVideoDecoderAVC::GetOutputColorFormat(int width, int hei #endif } +OMX_ERRORTYPE OMXVideoDecoderAVC::SetMaxOutputBufferCount(OMX_PARAM_PORTDEFINITIONTYPE *p) { + OMX_ERRORTYPE ret; + CHECK_TYPE_HEADER(p); + CHECK_PORT_INDEX(p, OUTPORT_INDEX); + + p->nBufferCountActual = MAX_OUTPORT_BUFFER_COUNT; + return OMXVideoDecoderBase::SetMaxOutputBufferCount(p); +} + DECLARE_OMX_COMPONENT("OMX.Intel.VideoDecoder.AVC", "video_decoder.avc", OMXVideoDecoderAVC); diff --git a/videocodec/OMXVideoDecoderAVC.h b/videocodec/OMXVideoDecoderAVC.h index 86a8373..74195a4 100644 --- a/videocodec/OMXVideoDecoderAVC.h +++ b/videocodec/OMXVideoDecoderAVC.h @@ -39,6 +39,7 @@ protected: virtual OMX_ERRORTYPE PrepareDecodeBuffer(OMX_BUFFERHEADERTYPE *buffer, buffer_retain_t *retain, VideoDecodeBuffer *p); virtual OMX_ERRORTYPE BuildHandlerList(void); + virtual OMX_ERRORTYPE SetMaxOutputBufferCount(OMX_PARAM_PORTDEFINITIONTYPE *p); virtual OMX_COLOR_FORMATTYPE GetOutputColorFormat(int width, int height); DECLARE_HANDLER(OMXVideoDecoderAVC, ParamVideoAvc); DECLARE_HANDLER(OMXVideoDecoderAVC, ParamIntelAVCDecodeSettings); @@ -65,6 +66,8 @@ private: // a typical value for 1080p clips OUTPORT_NATIVE_BUFFER_COUNT = 11, + + MAX_OUTPORT_BUFFER_COUNT = 23, }; OMX_VIDEO_PARAM_AVCTYPE mParamAvc; diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp index c7eafbc..4815c3e 100644 --- a/videocodec/OMXVideoDecoderBase.cpp +++ b/videocodec/OMXVideoDecoderBase.cpp @@ -867,7 +867,11 @@ OMX_ERRORTYPE OMXVideoDecoderBase::SetNativeBufferMode(OMX_PTR pStructure) { OMX_PARAM_PORTDEFINITIONTYPE port_def; memcpy(&port_def,port->GetPortDefinition(),sizeof(port_def)); port_def.nBufferCountMin = 1; - port_def.nBufferCountActual = mNativeBufferCount; + if (mEnableAdaptivePlayback) { + SetMaxOutputBufferCount(&port_def); + } else { + port_def.nBufferCountActual = mNativeBufferCount; + } port_def.format.video.cMIMEType = (OMX_STRING)VA_VED_RAW_MIME_TYPE; port_def.format.video.eColorFormat = OMX_INTEL_COLOR_FormatYUV420PackedSemiPlanar; port_def.format.video.nFrameHeight = (port_def.format.video.nFrameHeight + 0x1f) & ~0x1f; @@ -968,3 +972,7 @@ OMX_COLOR_FORMATTYPE OMXVideoDecoderBase::GetOutputColorFormat(int width, int he } #endif } + +OMX_ERRORTYPE OMXVideoDecoderBase::SetMaxOutputBufferCount(OMX_PARAM_PORTDEFINITIONTYPE *p) { + return OMX_ErrorNone; +} diff --git a/videocodec/OMXVideoDecoderBase.h b/videocodec/OMXVideoDecoderBase.h index b63ac33..9ab7119 100644 --- a/videocodec/OMXVideoDecoderBase.h +++ b/videocodec/OMXVideoDecoderBase.h @@ -55,6 +55,7 @@ protected: OMX_U32 numberBuffers); virtual OMX_ERRORTYPE ProcessorReset(void); virtual bool IsAllBufferAvailable(void); + virtual OMX_ERRORTYPE SetMaxOutputBufferCount(OMX_PARAM_PORTDEFINITIONTYPE *p); virtual OMX_ERRORTYPE ProcessorPreFillBuffer(OMX_BUFFERHEADERTYPE* buffer); virtual OMX_ERRORTYPE ProcessorPreFreeBuffer(OMX_U32 nPortIndex,OMX_BUFFERHEADERTYPE * pBuffer); virtual OMX_ERRORTYPE PrepareConfigBuffer(VideoConfigBuffer *p); diff --git a/videocodec/OMXVideoDecoderH263.cpp b/videocodec/OMXVideoDecoderH263.cpp index 7e95125..b7e6f32 100644 --- a/videocodec/OMXVideoDecoderH263.cpp +++ b/videocodec/OMXVideoDecoderH263.cpp @@ -29,6 +29,7 @@ OMXVideoDecoderH263::OMXVideoDecoderH263() { if (!mVideoDecoder) { LOGE("createVideoDecoder failed for \"%s\"", H263_MIME_TYPE); } + mNativeBufferCount = OUTPORT_NATIVE_BUFFER_COUNT; BuildHandlerList(); } diff --git a/videocodec/OMXVideoDecoderH263.h b/videocodec/OMXVideoDecoderH263.h index 9dd7a50..47609fc 100644 --- a/videocodec/OMXVideoDecoderH263.h +++ b/videocodec/OMXVideoDecoderH263.h @@ -49,6 +49,8 @@ private: INPORT_MIN_BUFFER_COUNT = 1, INPORT_ACTUAL_BUFFER_COUNT = 5, INPORT_BUFFER_SIZE = 1382400, + + OUTPORT_NATIVE_BUFFER_COUNT = 9, }; OMX_VIDEO_PARAM_H263TYPE mParamH263; diff --git a/videocodec/OMXVideoDecoderMPEG4.h b/videocodec/OMXVideoDecoderMPEG4.h index 92902da..5c7a29f 100644 --- a/videocodec/OMXVideoDecoderMPEG4.h +++ b/videocodec/OMXVideoDecoderMPEG4.h @@ -50,6 +50,7 @@ private: INPORT_MIN_BUFFER_COUNT = 1, INPORT_ACTUAL_BUFFER_COUNT = 5, INPORT_BUFFER_SIZE = 1382400, + OUTPORT_NATIVE_BUFFER_COUNT = 15, }; diff --git a/videocodec/OMXVideoDecoderVP8.cpp b/videocodec/OMXVideoDecoderVP8.cpp index 9121866..db50a42 100644 --- a/videocodec/OMXVideoDecoderVP8.cpp +++ b/videocodec/OMXVideoDecoderVP8.cpp @@ -29,6 +29,8 @@ OMXVideoDecoderVP8::OMXVideoDecoderVP8() { if (!mVideoDecoder) { LOGE("createVideoDecoder failed for \"%s\"", VP8_MIME_TYPE); } + // Override default native buffer count defined in the base class + mNativeBufferCount = OUTPORT_NATIVE_BUFFER_COUNT; BuildHandlerList(); } diff --git a/videocodec/OMXVideoDecoderVP8.h b/videocodec/OMXVideoDecoderVP8.h index 962e5a6..566fbe0 100644 --- a/videocodec/OMXVideoDecoderVP8.h +++ b/videocodec/OMXVideoDecoderVP8.h @@ -49,6 +49,8 @@ private: INPORT_MIN_BUFFER_COUNT = 1, INPORT_ACTUAL_BUFFER_COUNT = 5, INPORT_BUFFER_SIZE = 1382400, + + OUTPORT_NATIVE_BUFFER_COUNT = 8, }; OMX_VIDEO_PARAM_VP8TYPE mParamVp8; diff --git a/videocodec/OMXVideoDecoderWMV.cpp b/videocodec/OMXVideoDecoderWMV.cpp index 9f46957..78274f8 100644 --- a/videocodec/OMXVideoDecoderWMV.cpp +++ b/videocodec/OMXVideoDecoderWMV.cpp @@ -29,6 +29,7 @@ OMXVideoDecoderWMV::OMXVideoDecoderWMV() { if (!mVideoDecoder) { LOGE("createVideoDecoder failed for \"%s\"", WMV_MIME_TYPE); } + mNativeBufferCount = OUTPORT_NATIVE_BUFFER_COUNT; BuildHandlerList(); } diff --git a/videocodec/OMXVideoDecoderWMV.h b/videocodec/OMXVideoDecoderWMV.h index b5780fe..cedc3c8 100644 --- a/videocodec/OMXVideoDecoderWMV.h +++ b/videocodec/OMXVideoDecoderWMV.h @@ -49,6 +49,8 @@ private: INPORT_MIN_BUFFER_COUNT = 1, INPORT_ACTUAL_BUFFER_COUNT = 5, INPORT_BUFFER_SIZE = 1382400, + + OUTPORT_NATIVE_BUFFER_COUNT = 9, }; OMX_VIDEO_PARAM_WMVTYPE mParamWmv; |
