diff options
author | Yuanjun Huang <yuanjun.huang@intel.com> | 2015-02-11 20:04:38 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-02-11 20:04:38 +0000 |
commit | 7ed7ddf7e571b6d490537f43e043ea067826fd72 (patch) | |
tree | 44bec01c8d2a0eb2fb121e7d1df2818ae9e6df36 | |
parent | a19c9a9ad413ce879944bf655a61e7a981f0dcb1 (diff) | |
parent | 15f60f1eccc69ecb05ec3ae6bd075e1ca0f59ff5 (diff) | |
download | android_hardware_intel_common_omx-components-7ed7ddf7e571b6d490537f43e043ea067826fd72.tar.gz android_hardware_intel_common_omx-components-7ed7ddf7e571b6d490537f43e043ea067826fd72.tar.bz2 android_hardware_intel_common_omx-components-7ed7ddf7e571b6d490537f43e043ea067826fd72.zip |
am 15f60f1e: Fix defect when native buffer mode fallbacks to byte-buffer mode (raw data mode). The color format needs to be set to default as non-Intel format.
* commit '15f60f1eccc69ecb05ec3ae6bd075e1ca0f59ff5':
Fix defect when native buffer mode fallbacks to byte-buffer mode (raw data mode). The color format needs to be set to default as non-Intel format.
-rw-r--r-- | videocodec/OMXVideoDecoderBase.cpp | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/videocodec/OMXVideoDecoderBase.cpp b/videocodec/OMXVideoDecoderBase.cpp index 6900d5c..7d1d830 100644 --- a/videocodec/OMXVideoDecoderBase.cpp +++ b/videocodec/OMXVideoDecoderBase.cpp @@ -884,16 +884,25 @@ OMX_ERRORTYPE OMXVideoDecoderBase::SetNativeBufferModeSpecific(OMX_PTR pStructur CHECK_TYPE_HEADER(param); CHECK_PORT_INDEX_RANGE(param); CHECK_SET_PARAM_STATE(); + + PortVideo *port = NULL; + port = static_cast<PortVideo *>(this->ports[OUTPORT_INDEX]); + OMX_PARAM_PORTDEFINITIONTYPE port_def; + memcpy(&port_def,port->GetPortDefinition(),sizeof(port_def)); + if (!param->enable) { mWorkingMode = RAWDATA_MODE; + // If it is fallback from native mode the color format has been + // already set to INTEL format. + // We need to set back the default color format and Native stuff. + port_def.format.video.eColorFormat = OMX_COLOR_FormatYUV420SemiPlanar; + port_def.format.video.pNativeRender = NULL; + port_def.format.video.pNativeWindow = NULL; + port->SetPortDefinition(&port_def,true); return OMX_ErrorNone; } - mWorkingMode = GRAPHICBUFFER_MODE; - PortVideo *port = NULL; - port = static_cast<PortVideo *>(this->ports[OUTPORT_INDEX]); - OMX_PARAM_PORTDEFINITIONTYPE port_def; - memcpy(&port_def,port->GetPortDefinition(),sizeof(port_def)); + mWorkingMode = GRAPHICBUFFER_MODE; port_def.nBufferCountMin = mNativeBufferCount; if (mEnableAdaptivePlayback) { SetMaxOutputBufferCount(&port_def); |