diff options
Diffstat (limited to 'media')
-rw-r--r-- | media/filters/omx_video_decode_engine.cc | 20 | ||||
-rw-r--r-- | media/filters/omx_video_decode_engine.h | 2 |
2 files changed, 15 insertions, 7 deletions
diff --git a/media/filters/omx_video_decode_engine.cc b/media/filters/omx_video_decode_engine.cc index 8110cd8..db5b402 100644 --- a/media/filters/omx_video_decode_engine.cc +++ b/media/filters/omx_video_decode_engine.cc @@ -672,8 +672,8 @@ void OmxVideoDecodeEngine::FillThisBuffer( } // Reconfigure port -void OmxVideoDecodeEngine::OnPortSettingsChangedRun(OMX_INDEXTYPE index, - int port) { +void OmxVideoDecodeEngine::OnPortSettingsChangedRun(int port, + OMX_INDEXTYPE index) { DCHECK_EQ(message_loop_, MessageLoop::current()); DCHECK_EQ(client_state_, kClientRunning); DCHECK_EQ(port, output_port_); @@ -684,8 +684,11 @@ void OmxVideoDecodeEngine::OnPortSettingsChangedRun(OMX_INDEXTYPE index, return; } - if (index != OMX_IndexParamPortDefinition) - return; + // TODO(wjia): remove this checking when all vendors observe same spec. + if (index > OMX_IndexComponentStartUnused) { + if (index != OMX_IndexParamPortDefinition) + return; + } OMX_PARAM_PORTDEFINITIONTYPE port_format; ResetParamHeader(*this, &port_format); @@ -1297,8 +1300,13 @@ void OmxVideoDecodeEngine::EventHandlerCompleteTask(OMX_EVENTTYPE event, StopOnError(); break; case OMX_EventPortSettingsChanged: - OnPortSettingsChangedRun(static_cast<OMX_INDEXTYPE>(data1), - static_cast<int>(data2)); + // TODO(wjia): remove this hack when all vendors observe same spec. + if (data1 < OMX_IndexComponentStartUnused) + OnPortSettingsChangedRun(static_cast<int>(data1), + static_cast<OMX_INDEXTYPE>(data2)); + else + OnPortSettingsChangedRun(static_cast<int>(data2), + static_cast<OMX_INDEXTYPE>(data1)); break; default: LOG(ERROR) << "Warning - Unknown event received\n"; diff --git a/media/filters/omx_video_decode_engine.h b/media/filters/omx_video_decode_engine.h index 24ee407..7c1644f 100644 --- a/media/filters/omx_video_decode_engine.h +++ b/media/filters/omx_video_decode_engine.h @@ -105,7 +105,7 @@ class OmxVideoDecodeEngine : bool CreateComponent(); void DoneSetStateIdle(OMX_STATETYPE state); void DoneSetStateExecuting(OMX_STATETYPE state); - void OnPortSettingsChangedRun(OMX_INDEXTYPE index, int port); + void OnPortSettingsChangedRun(int port, OMX_INDEXTYPE index); void OnPortDisableEventRun(int port); void SetupOutputPort(); void OnPortEnableEventRun(int port); |