Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #3707 from popcornmix/omx_cosmetic

[rbp/omxplayer] [Cosmetics] Remove unused code paths
  • Loading branch information...
commit 0c866920effa33d7ecb75fe957612e968aa25536 2 parents 427d0c7 + 386ab44
huceke huceke authored
22 xbmc/cores/omxplayer/OMXAudio.cpp
View
@@ -215,7 +215,7 @@ bool COMXAudio::PortSettingsChanged()
m_omx_tunnel_clock_analog.Initialize(m_omx_clock, m_omx_clock->GetInputPort(),
&m_omx_render_analog, m_omx_render_analog.GetInputPort()+1);
- omx_err = m_omx_tunnel_clock_analog.Establish(false);
+ omx_err = m_omx_tunnel_clock_analog.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_clock_analog.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -228,7 +228,7 @@ bool COMXAudio::PortSettingsChanged()
m_omx_tunnel_clock_hdmi.Initialize(m_omx_clock, m_omx_clock->GetInputPort() + (m_omx_render_analog.IsInitialized() ? 2 : 0),
&m_omx_render_hdmi, m_omx_render_hdmi.GetInputPort()+1);
- omx_err = m_omx_tunnel_clock_hdmi.Establish(false);
+ omx_err = m_omx_tunnel_clock_hdmi.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_clock_hdmi.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -292,7 +292,7 @@ bool COMXAudio::PortSettingsChanged()
if( m_omx_splitter.IsInitialized() )
{
m_omx_tunnel_splitter_analog.Initialize(&m_omx_splitter, m_omx_splitter.GetOutputPort(), &m_omx_render_analog, m_omx_render_analog.GetInputPort());
- omx_err = m_omx_tunnel_splitter_analog.Establish(false);
+ omx_err = m_omx_tunnel_splitter_analog.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_splitter_analog.Establish 0x%08x", omx_err);
@@ -300,7 +300,7 @@ bool COMXAudio::PortSettingsChanged()
}
m_omx_tunnel_splitter_hdmi.Initialize(&m_omx_splitter, m_omx_splitter.GetOutputPort() + 1, &m_omx_render_hdmi, m_omx_render_hdmi.GetInputPort());
- omx_err = m_omx_tunnel_splitter_hdmi.Establish(false);
+ omx_err = m_omx_tunnel_splitter_hdmi.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "COMXAudio::Initialize - Error m_omx_tunnel_splitter_hdmi.Establish 0x%08x", omx_err);
@@ -342,7 +342,7 @@ bool COMXAudio::PortSettingsChanged()
0, 0, 0, 0);
}
- omx_err = m_omx_tunnel_decoder.Establish(false);
+ omx_err = m_omx_tunnel_decoder.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_decoder.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -360,7 +360,7 @@ bool COMXAudio::PortSettingsChanged()
if( m_omx_mixer.IsInitialized() )
{
- omx_err = m_omx_tunnel_mixer.Establish(false);
+ omx_err = m_omx_tunnel_mixer.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_decoder.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -727,15 +727,15 @@ bool COMXAudio::Deinitialize()
m_omx_decoder.FlushInput();
- m_omx_decoder.Deinitialize(true);
+ m_omx_decoder.Deinitialize();
if ( m_omx_mixer.IsInitialized() )
- m_omx_mixer.Deinitialize(true);
+ m_omx_mixer.Deinitialize();
if ( m_omx_splitter.IsInitialized() )
- m_omx_splitter.Deinitialize(true);
+ m_omx_splitter.Deinitialize();
if ( m_omx_render_hdmi.IsInitialized() )
- m_omx_render_hdmi.Deinitialize(true);
+ m_omx_render_hdmi.Deinitialize();
if ( m_omx_render_analog.IsInitialized() )
- m_omx_render_analog.Deinitialize(true);
+ m_omx_render_analog.Deinitialize();
m_BytesPerSec = 0;
m_BufferLen = 0;
28 xbmc/cores/omxplayer/OMXImage.cpp
View
@@ -917,9 +917,9 @@ void COMXImageDec::Close()
if(m_omx_tunnel_decode.IsInitialized())
m_omx_tunnel_decode.Deestablish();
if(m_omx_decoder.IsInitialized())
- m_omx_decoder.Deinitialize(true);
+ m_omx_decoder.Deinitialize();
if(m_omx_resize.IsInitialized())
- m_omx_resize.Deinitialize(true);
+ m_omx_resize.Deinitialize();
}
bool COMXImageDec::HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height)
@@ -941,7 +941,7 @@ bool COMXImageDec::HandlePortSettingChange(unsigned int resize_width, unsigned i
m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort());
- omx_err = m_omx_tunnel_decode.Establish(false);
+ omx_err = m_omx_tunnel_decode.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish\n", CLASSNAME, __func__);
@@ -1189,7 +1189,7 @@ COMXImageEnc::~COMXImageEnc()
OMX_INIT_STRUCTURE(m_encoded_format);
m_encoded_buffer = NULL;
if(m_omx_encoder.IsInitialized())
- m_omx_encoder.Deinitialize(true);
+ m_omx_encoder.Deinitialize();
}
bool COMXImageEnc::Encode(unsigned char *buffer, int size, unsigned width, unsigned height, unsigned int pitch)
@@ -1435,11 +1435,11 @@ void COMXImageReEnc::Close()
if(m_omx_tunnel_resize.IsInitialized())
m_omx_tunnel_resize.Deestablish();
if(m_omx_decoder.IsInitialized())
- m_omx_decoder.Deinitialize(true);
+ m_omx_decoder.Deinitialize();
if(m_omx_resize.IsInitialized())
- m_omx_resize.Deinitialize(true);
+ m_omx_resize.Deinitialize();
if(m_omx_encoder.IsInitialized())
- m_omx_encoder.Deinitialize(true);
+ m_omx_encoder.Deinitialize();
}
@@ -1576,7 +1576,7 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned
m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort());
- omx_err = m_omx_tunnel_decode.Establish(false);
+ omx_err = m_omx_tunnel_decode.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish\n", CLASSNAME, __func__);
@@ -1585,7 +1585,7 @@ bool COMXImageReEnc::HandlePortSettingChange(unsigned int resize_width, unsigned
m_omx_tunnel_resize.Initialize(&m_omx_resize, m_omx_resize.GetOutputPort(), &m_omx_encoder, m_omx_encoder.GetInputPort());
- omx_err = m_omx_tunnel_resize.Establish(false);
+ omx_err = m_omx_tunnel_resize.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_resize.Establish\n", CLASSNAME, __func__);
@@ -1824,11 +1824,11 @@ void COMXTexture::Close()
m_omx_tunnel_egl.Deestablish();
// delete components
if (m_omx_decoder.IsInitialized())
- m_omx_decoder.Deinitialize(true);
+ m_omx_decoder.Deinitialize();
if (m_omx_resize.IsInitialized())
- m_omx_resize.Deinitialize(true);
+ m_omx_resize.Deinitialize();
if (m_omx_egl_render.IsInitialized())
- m_omx_egl_render.Deinitialize(true);
+ m_omx_egl_render.Deinitialize();
}
bool COMXTexture::HandlePortSettingChange(unsigned int resize_width, unsigned int resize_height, void *egl_image, void *egl_display, bool port_settings_changed)
@@ -1928,7 +1928,7 @@ bool COMXTexture::HandlePortSettingChange(unsigned int resize_width, unsigned in
m_omx_tunnel_decode.Initialize(&m_omx_decoder, m_omx_decoder.GetOutputPort(), &m_omx_resize, m_omx_resize.GetInputPort());
- omx_err = m_omx_tunnel_decode.Establish(false);
+ omx_err = m_omx_tunnel_decode.Establish();
if (omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_decode.Establish (%x)", CLASSNAME, __func__, omx_err);
@@ -1937,7 +1937,7 @@ bool COMXTexture::HandlePortSettingChange(unsigned int resize_width, unsigned in
m_omx_tunnel_egl.Initialize(&m_omx_resize, m_omx_resize.GetOutputPort(), &m_omx_egl_render, m_omx_egl_render.GetInputPort());
- omx_err = m_omx_tunnel_egl.Establish(false);
+ omx_err = m_omx_tunnel_egl.Establish();
if (omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s m_omx_tunnel_egl.Establish (%x)", CLASSNAME, __func__, omx_err);
16 xbmc/cores/omxplayer/OMXVideo.cpp
View
@@ -282,14 +282,14 @@ bool COMXVideo::PortSettingsChanged()
m_omx_tunnel_clock.Initialize(m_omx_clock, m_omx_clock->GetInputPort() + 1, &m_omx_sched, m_omx_sched.GetOutputPort() + 1);
- omx_err = m_omx_tunnel_clock.Establish(false);
+ omx_err = m_omx_tunnel_clock.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_clock.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
return false;
}
- omx_err = m_omx_tunnel_decoder.Establish(false);
+ omx_err = m_omx_tunnel_decoder.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_decoder.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -298,7 +298,7 @@ bool COMXVideo::PortSettingsChanged()
if(m_deinterlace)
{
- omx_err = m_omx_tunnel_image_fx.Establish(false);
+ omx_err = m_omx_tunnel_image_fx.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_image_fx.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -313,7 +313,7 @@ bool COMXVideo::PortSettingsChanged()
}
}
- omx_err = m_omx_tunnel_sched.Establish(false);
+ omx_err = m_omx_tunnel_sched.Establish();
if(omx_err != OMX_ErrorNone)
{
CLog::Log(LOGERROR, "%s::%s - m_omx_tunnel_sched.Establish omx_err(0x%08x)", CLASSNAME, __func__, omx_err);
@@ -686,11 +686,11 @@ void COMXVideo::Close()
m_omx_decoder.FlushInput();
- m_omx_sched.Deinitialize(true);
- m_omx_decoder.Deinitialize(true);
+ m_omx_sched.Deinitialize();
+ m_omx_decoder.Deinitialize();
if(m_deinterlace)
- m_omx_image_fx.Deinitialize(true);
- m_omx_render.Deinitialize(true);
+ m_omx_image_fx.Deinitialize();
+ m_omx_render.Deinitialize();
m_is_open = false;
4 xbmc/linux/OMXClock.cpp
View
@@ -131,8 +131,6 @@ bool OMXClock::OMXInitialize(CDVDClock *clock)
if(!m_omx_clock.Initialize((const std::string)componentName, OMX_IndexParamOtherInit))
return false;
- m_omx_clock.DisableAllPorts();
-
return true;
}
@@ -141,7 +139,7 @@ void OMXClock::OMXDeinitialize()
if(m_omx_clock.GetComponent() == NULL)
return;
- m_omx_clock.Deinitialize(true);
+ m_omx_clock.Deinitialize();
m_omx_speed = DVD_PLAYSPEED_NORMAL;
}
61 xbmc/linux/OMXCore.cpp
View
@@ -63,7 +63,6 @@ COMXCoreTunel::COMXCoreTunel()
m_dst_component = NULL;
m_src_port = 0;
m_dst_port = 0;
- m_portSettingsChanged = false;
m_tunnel_set = false;
m_DllOMX = g_RBP.GetDllOMX();
}
@@ -92,9 +91,6 @@ OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool noWait)
OMX_ERRORTYPE omx_err = OMX_ErrorNone;
- if(m_src_component->GetComponent() && m_portSettingsChanged && !noWait)
- omx_err = m_src_component->WaitForEvent(OMX_EventPortSettingsChanged);
-
if(m_src_component->GetComponent())
{
omx_err = m_src_component->DisablePort(m_src_port, false);
@@ -162,7 +158,7 @@ OMX_ERRORTYPE COMXCoreTunel::Deestablish(bool noWait)
return OMX_ErrorNone;
}
-OMX_ERRORTYPE COMXCoreTunel::Establish(bool portSettingsChanged, bool enable_ports /* = true */, bool disable_ports /* = false */)
+OMX_ERRORTYPE COMXCoreTunel::Establish(bool enable_ports /* = true */, bool disable_ports /* = false */)
{
OMX_ERRORTYPE omx_err = OMX_ErrorNone;
OMX_PARAM_U32TYPE param;
@@ -184,15 +180,6 @@ OMX_ERRORTYPE COMXCoreTunel::Establish(bool portSettingsChanged, bool enable_por
}
}
- if(portSettingsChanged)
- {
- omx_err = m_src_component->WaitForEvent(OMX_EventPortSettingsChanged);
- if(omx_err != OMX_ErrorNone)
- {
- return omx_err;
- }
- }
-
if(m_src_component->GetComponent() && disable_ports)
{
omx_err = m_src_component->DisablePort(m_src_port, false);
@@ -304,8 +291,6 @@ OMX_ERRORTYPE COMXCoreTunel::Establish(bool portSettingsChanged, bool enable_por
}
}
- m_portSettingsChanged = portSettingsChanged;
-
return OMX_ErrorNone;
}
@@ -351,7 +336,7 @@ COMXCoreComponent::COMXCoreComponent()
COMXCoreComponent::~COMXCoreComponent()
{
- Deinitialize(true);
+ Deinitialize();
pthread_mutex_destroy(&m_omx_input_mutex);
pthread_mutex_destroy(&m_omx_output_mutex);
@@ -1442,7 +1427,7 @@ bool COMXCoreComponent::Initialize( const std::string &component_name, OMX_INDEX
{
CLog::Log(LOGERROR, "COMXCoreComponent::Initialize - could not get component handle for %s omx_err(0x%08x)\n",
component_name.c_str(), (int)omx_err);
- Deinitialize(true);
+ Deinitialize();
return false;
}
}
@@ -1457,14 +1442,11 @@ bool COMXCoreComponent::Initialize( const std::string &component_name, OMX_INDEX
component_name.c_str(), (int)omx_err);
}
- if(m_componentName != "OMX.broadcom.clock")
+ omx_err = DisableAllPorts();
+ if (omx_err != OMX_ErrorNone)
{
- omx_err = DisableAllPorts();
- if (omx_err != OMX_ErrorNone)
- {
- CLog::Log(LOGERROR, "COMXCoreComponent::Initialize - error disable ports on component %s omx_err(0x%08x)\n",
- component_name.c_str(), (int)omx_err);
- }
+ CLog::Log(LOGERROR, "COMXCoreComponent::Initialize - error disable ports on component %s omx_err(0x%08x)\n",
+ component_name.c_str(), (int)omx_err);
}
m_input_port = port_param.nStartPortNumber;
@@ -1501,7 +1483,7 @@ void COMXCoreComponent::ResetEos()
pthread_mutex_unlock(&m_omx_eos_mutex);
}
-bool COMXCoreComponent::Deinitialize(bool free_component /* = false */)
+bool COMXCoreComponent::Deinitialize()
{
OMX_ERRORTYPE omx_err;
@@ -1519,23 +1501,20 @@ bool COMXCoreComponent::Deinitialize(bool free_component /* = false */)
TransitionToStateLoaded();
- if(free_component)
+ CLog::Log(LOGDEBUG, "COMXCoreComponent::Deinitialize : %s handle %p\n",
+ m_componentName.c_str(), m_handle);
+ omx_err = m_DllOMX->OMX_FreeHandle(m_handle);
+ if (omx_err != OMX_ErrorNone)
{
- CLog::Log(LOGDEBUG, "COMXCoreComponent::Deinitialize : %s handle %p\n",
- m_componentName.c_str(), m_handle);
- omx_err = m_DllOMX->OMX_FreeHandle(m_handle);
- if (omx_err != OMX_ErrorNone)
- {
- CLog::Log(LOGERROR, "COMXCoreComponent::Deinitialize - failed to free handle for component %s omx_err(0x%08x)",
- m_componentName.c_str(), omx_err);
- }
- m_handle = NULL;
-
- m_input_port = 0;
- m_output_port = 0;
- m_componentName = "";
- m_resource_error = false;
+ CLog::Log(LOGERROR, "COMXCoreComponent::Deinitialize - failed to free handle for component %s omx_err(0x%08x)",
+ m_componentName.c_str(), omx_err);
}
+ m_handle = NULL;
+
+ m_input_port = 0;
+ m_output_port = 0;
+ m_componentName = "";
+ m_resource_error = false;
}
return true;
5 xbmc/linux/OMXCore.h
View
@@ -72,9 +72,8 @@ class COMXCoreTunel
void Initialize(COMXCoreComponent *src_component, unsigned int src_port, COMXCoreComponent *dst_component, unsigned int dst_port);
bool IsInitialized();
OMX_ERRORTYPE Deestablish(bool noWait = false);
- OMX_ERRORTYPE Establish(bool portSettingsChanged, bool enable_ports = true, bool disable_ports = false);
+ OMX_ERRORTYPE Establish(bool enable_ports = true, bool disable_ports = false);
private:
- bool m_portSettingsChanged;
COMXCoreComponent *m_src_component;
COMXCoreComponent *m_dst_component;
unsigned int m_src_port;
@@ -112,7 +111,7 @@ class COMXCoreComponent
bool Initialize( const std::string &component_name, OMX_INDEXTYPE index);
bool IsInitialized();
- bool Deinitialize(bool free_component = false);
+ bool Deinitialize();
// OMXCore Decoder delegate callback routines.
static OMX_ERRORTYPE DecoderEventHandlerCallback(OMX_HANDLETYPE hComponent, OMX_PTR pAppData,
Please sign in to comment.
Something went wrong with that request. Please try again.