Permalink
Browse files

[rbp] fixed omx fillbuffer, deinit of components, some wrong event wa…

…its, port enabled/disabled detection

Changed the way we wait for fillbuffer. A semaphore is more relaiable.
Fixed some wrong event waits. Should speedup some omx operations.
Deinit of components was wrong. Special free the buffers.
Changed port enableed/disabled detection to use omx functions and no internal statetracking.
Some cosmetics and removed some duplicate code.
  • Loading branch information...
1 parent 0b50307 commit b88ebf34f481de76a19a7efeff30a0504ebec9ec @huceke huceke committed Aug 18, 2012
Showing with 158 additions and 176 deletions.
  1. +6 −18 xbmc/cores/omxplayer/OMXImage.cpp
  2. +9 −6 xbmc/linux/OMXClock.cpp
  3. +137 −148 xbmc/linux/OMXCore.cpp
  4. +6 −4 xbmc/linux/OMXCore.h
@@ -633,7 +633,6 @@ bool COMXImage::Decode(unsigned width, unsigned height)
return false;
}
-
port_def.format.image.eCompressionFormat = OMX_IMAGE_CodingUnused;
port_def.format.image.eColorFormat = OMX_COLOR_Format32bitABGR8888;
if((((width + 15)&~15) > width) || (((height + 15)&~15) > height))
@@ -705,9 +704,8 @@ bool COMXImage::Decode(unsigned width, unsigned height)
{
m_firstFrame = false;
- m_omx_decoder.DisablePort(m_omx_decoder.GetOutputPort(), NULL);
- m_omx_resize.DisablePort(m_omx_resize.GetInputPort(), NULL);
- //m_omx_resize.DisablePort(m_omx_resize.GetOutputPort(), NULL);
+ m_omx_decoder.DisablePort(m_omx_decoder.GetOutputPort(), false);
+ m_omx_resize.DisablePort(m_omx_resize.GetInputPort(), false);
OMX_PARAM_PORTDEFINITIONTYPE port_image;
OMX_INIT_STRUCTURE(port_image);
@@ -718,16 +716,15 @@ bool COMXImage::Decode(unsigned width, unsigned height)
port_image.nPortIndex = m_omx_resize.GetInputPort();
m_omx_resize.SetParameter(OMX_IndexParamPortDefinition, &port_image);
- m_omx_decoder.EnablePort(m_omx_decoder.GetOutputPort(), NULL);
- //m_omx_decoder.EnablePort(m_omx_decoder.GetInputPort(), NULL);
+ m_omx_decoder.EnablePort(m_omx_decoder.GetOutputPort(), false);
omx_err = m_omx_decoder.WaitForEvent(OMX_EventPortSettingsChanged);
if(omx_err == OMX_ErrorStreamCorrupt)
{
CLog::Log(LOGERROR, "%s::%s image not unsupported\n", CLASSNAME, __func__);
return false;
}
- m_omx_resize.EnablePort(m_omx_resize.GetInputPort(), NULL);
+ m_omx_resize.EnablePort(m_omx_resize.GetInputPort(), false);
omx_err = m_omx_resize.WaitForEvent(OMX_EventPortSettingsChanged);
if(omx_err == OMX_ErrorStreamCorrupt)
{
@@ -737,23 +734,14 @@ bool COMXImage::Decode(unsigned width, unsigned height)
}
}
- /*
- omx_err = m_omx_resize.EnablePort(m_omx_resize.GetOutputPort(), NULL);
- if(omx_err != OMX_ErrorNone)
- {
- CLog::Log(LOGERROR, "%s::%s m_omx_resize.EnablePort result(0x%x)\n", CLASSNAME, __func__, omx_err);
- return false;
- }
- */
-
omx_err = m_omx_decoder.WaitForEvent(OMX_EventBufferFlag, 1000);
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s m_omx_decoder.WaitForEvent result(0x%x)\n", CLASSNAME, __func__, omx_err);
return false;
}
- m_decoded_buffer = m_omx_resize.GetOutputBuffer(2000);
+ m_decoded_buffer = m_omx_resize.GetOutputBuffer();
if(!m_decoded_buffer)
{
@@ -935,7 +923,7 @@ bool COMXImage::Encode(unsigned char *buffer, int size, unsigned width, unsigned
if(internalBuffer) free(internalBuffer);
- m_encoded_buffer = m_omx_encoder.GetOutputBuffer(2000);
+ m_encoded_buffer = m_omx_encoder.GetOutputBuffer();
if(!m_encoded_buffer)
{
View
@@ -629,13 +629,16 @@ bool OMXClock::OMXReset(bool lock /* = true */)
OMXSetClockPorts(&clock);
- omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeClockState, &clock);
- if(omx_err != OMX_ErrorNone)
+ if(clock.nWaitMask)
{
- CLog::Log(LOGERROR, "OMXClock::OMXReset error setting OMX_IndexConfigTimeClockState\n");
- if(lock)
- UnLock();
- return false;
+ omx_err = m_omx_clock.SetConfig(OMX_IndexConfigTimeClockState, &clock);
+ if(omx_err != OMX_ErrorNone)
+ {
+ CLog::Log(LOGERROR, "OMXClock::OMXReset error setting OMX_IndexConfigTimeClockState\n");
+ if(lock)
+ UnLock();
+ return false;
+ }
}
if(lock)
Oops, something went wrong.

0 comments on commit b88ebf3

Please sign in to comment.