Update to latest xbmc OMXCore.cpp
This commit is contained in:
parent
5419655bbe
commit
ec440e9275
5 changed files with 353 additions and 353 deletions
1
DllOMX.h
1
DllOMX.h
|
|
@ -86,6 +86,7 @@ public:
|
|||
return true;
|
||||
}
|
||||
virtual void Unload() {}
|
||||
static DllOMX *GetDllOMX() { static DllOMX static_dll_omx; return &static_dll_omx; }
|
||||
};
|
||||
#else
|
||||
class DllOMX : public DllDynamic, DllOMXInterface
|
||||
|
|
|
|||
49
OMXAudio.cpp
49
OMXAudio.cpp
|
|
@ -674,29 +674,41 @@ bool COMXAudio::Deinitialize()
|
|||
{
|
||||
CSingleLock lock (m_critSection);
|
||||
|
||||
Flush();
|
||||
|
||||
if ( m_omx_tunnel_clock_analog.IsInitialized() )
|
||||
m_omx_tunnel_clock_analog.Deestablish();
|
||||
if ( m_omx_tunnel_clock_hdmi.IsInitialized() )
|
||||
m_omx_tunnel_clock_hdmi.Deestablish();
|
||||
if ( m_omx_tunnel_splitter_analog.IsInitialized() )
|
||||
m_omx_tunnel_splitter_analog.Deestablish();
|
||||
if ( m_omx_tunnel_splitter_hdmi.IsInitialized() )
|
||||
m_omx_tunnel_splitter_hdmi.Deestablish();
|
||||
|
||||
// ignore expected errors on teardown
|
||||
if ( m_omx_mixer.IsInitialized() )
|
||||
m_omx_mixer.IgnoreNextError(OMX_ErrorPortUnpopulated);
|
||||
else
|
||||
{
|
||||
if ( m_omx_render_hdmi.IsInitialized() )
|
||||
m_omx_render_hdmi.IgnoreNextError(OMX_ErrorPortUnpopulated);
|
||||
if ( m_omx_render_analog.IsInitialized() )
|
||||
m_omx_render_analog.IgnoreNextError(OMX_ErrorPortUnpopulated);
|
||||
}
|
||||
|
||||
m_omx_tunnel_decoder.Deestablish();
|
||||
if ( m_omx_tunnel_mixer.IsInitialized() )
|
||||
m_omx_tunnel_mixer.Deestablish();
|
||||
m_omx_tunnel_decoder.Deestablish();
|
||||
if ( m_omx_tunnel_splitter_hdmi.IsInitialized() )
|
||||
m_omx_tunnel_splitter_hdmi.Deestablish();
|
||||
if ( m_omx_tunnel_splitter_analog.IsInitialized() )
|
||||
m_omx_tunnel_splitter_analog.Deestablish();
|
||||
|
||||
if ( m_omx_render_analog.IsInitialized() )
|
||||
m_omx_render_analog.Deinitialize(true);
|
||||
if ( m_omx_render_hdmi.IsInitialized() )
|
||||
m_omx_render_hdmi.Deinitialize(true);
|
||||
if ( m_omx_splitter.IsInitialized() )
|
||||
m_omx_splitter.Deinitialize(true);
|
||||
m_omx_decoder.FlushInput();
|
||||
|
||||
m_omx_decoder.Deinitialize(true);
|
||||
if ( m_omx_mixer.IsInitialized() )
|
||||
m_omx_mixer.Deinitialize(true);
|
||||
m_omx_decoder.Deinitialize(true);
|
||||
if ( m_omx_splitter.IsInitialized() )
|
||||
m_omx_splitter.Deinitialize(true);
|
||||
if ( m_omx_render_hdmi.IsInitialized() )
|
||||
m_omx_render_hdmi.Deinitialize(true);
|
||||
if ( m_omx_render_analog.IsInitialized() )
|
||||
m_omx_render_analog.Deinitialize(true);
|
||||
|
||||
m_BytesPerSec = 0;
|
||||
m_BufferLen = 0;
|
||||
|
|
@ -732,19 +744,10 @@ void COMXAudio::Flush()
|
|||
return;
|
||||
|
||||
m_omx_decoder.FlushAll();
|
||||
m_omx_tunnel_decoder.Flush();
|
||||
|
||||
if ( m_omx_mixer.IsInitialized() )
|
||||
m_omx_mixer.FlushAll();
|
||||
if( m_omx_tunnel_mixer.IsInitialized() )
|
||||
m_omx_tunnel_mixer.Flush();
|
||||
|
||||
if ( m_omx_splitter.IsInitialized() )
|
||||
m_omx_splitter.FlushAll();
|
||||
if ( m_omx_tunnel_splitter_analog.IsInitialized() )
|
||||
m_omx_tunnel_splitter_analog.Flush();
|
||||
if ( m_omx_tunnel_splitter_hdmi.IsInitialized() )
|
||||
m_omx_tunnel_splitter_hdmi.Flush();
|
||||
|
||||
if ( m_omx_render_analog.IsInitialized() )
|
||||
m_omx_render_analog.FlushAll();
|
||||
|
|
|
|||
607
OMXCore.cpp
607
OMXCore.cpp
File diff suppressed because it is too large
Load diff
29
OMXCore.h
29
OMXCore.h
|
|
@ -1,7 +1,7 @@
|
|||
#pragma once
|
||||
/*
|
||||
* Copyright (C) 2010-2013 Team XBMC
|
||||
* http://www.xbmc.org
|
||||
* http://xbmc.org
|
||||
*
|
||||
* This Program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -58,7 +58,6 @@ typedef struct omx_event {
|
|||
OMX_U32 nData2;
|
||||
} omx_event;
|
||||
|
||||
class DllLibOMXCore;
|
||||
class COMXCore;
|
||||
class COMXCoreComponent;
|
||||
class COMXCoreTunel;
|
||||
|
|
@ -72,20 +71,15 @@ public:
|
|||
|
||||
void Initialize(COMXCoreComponent *src_component, unsigned int src_port, COMXCoreComponent *dst_component, unsigned int dst_port);
|
||||
bool IsInitialized();
|
||||
OMX_ERRORTYPE Flush();
|
||||
OMX_ERRORTYPE Deestablish(bool noWait = false);
|
||||
OMX_ERRORTYPE Establish(bool portSettingsChanged, bool enable_ports = true);
|
||||
OMX_ERRORTYPE Establish(bool portSettingsChanged, bool enable_ports = true, bool disable_ports = false);
|
||||
private:
|
||||
pthread_mutex_t m_lock;
|
||||
bool m_portSettingsChanged;
|
||||
COMXCoreComponent *m_src_component;
|
||||
COMXCoreComponent *m_dst_component;
|
||||
unsigned int m_src_port;
|
||||
unsigned int m_dst_port;
|
||||
DllOMX *m_DllOMX;
|
||||
bool m_DllOMXOpen;
|
||||
void Lock();
|
||||
void UnLock();
|
||||
bool m_tunnel_set;
|
||||
};
|
||||
|
||||
|
|
@ -129,12 +123,12 @@ public:
|
|||
OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE* pBufferHeader);
|
||||
|
||||
// OMXCore decoder callback routines.
|
||||
OMX_ERRORTYPE DecoderEventHandler(OMX_HANDLETYPE hComponent, OMX_PTR pAppData,
|
||||
OMX_ERRORTYPE DecoderEventHandler(OMX_HANDLETYPE hComponent,
|
||||
OMX_EVENTTYPE eEvent, OMX_U32 nData1, OMX_U32 nData2, OMX_PTR pEventData);
|
||||
OMX_ERRORTYPE DecoderEmptyBufferDone(
|
||||
OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
OMX_ERRORTYPE DecoderFillBufferDone(
|
||||
OMX_HANDLETYPE hComponent, OMX_PTR pAppData, OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
OMX_HANDLETYPE hComponent, OMX_BUFFERHEADERTYPE* pBuffer);
|
||||
|
||||
void TransitionToStateLoaded();
|
||||
|
||||
|
|
@ -153,7 +147,7 @@ public:
|
|||
void FlushOutput();
|
||||
|
||||
OMX_BUFFERHEADERTYPE *GetInputBuffer(long timeout=200);
|
||||
OMX_BUFFERHEADERTYPE *GetOutputBuffer();
|
||||
OMX_BUFFERHEADERTYPE *GetOutputBuffer(long timeout=200);
|
||||
|
||||
OMX_ERRORTYPE AllocInputBuffers(bool use_buffers = false);
|
||||
OMX_ERRORTYPE AllocOutputBuffers(bool use_buffers = false);
|
||||
|
|
@ -161,9 +155,13 @@ public:
|
|||
OMX_ERRORTYPE FreeInputBuffers();
|
||||
OMX_ERRORTYPE FreeOutputBuffers();
|
||||
|
||||
OMX_ERRORTYPE WaitForInputDone(long timeout=200);
|
||||
OMX_ERRORTYPE WaitForOutputDone(long timeout=200);
|
||||
|
||||
bool IsEOS() { return m_eos; };
|
||||
bool BadState() { return m_resource_error; };
|
||||
void ResetEos();
|
||||
void IgnoreNextError(OMX_S32 error) { m_ignore_error = error; }
|
||||
|
||||
private:
|
||||
OMX_HANDLETYPE m_handle;
|
||||
|
|
@ -172,8 +170,8 @@ private:
|
|||
std::string m_componentName;
|
||||
pthread_mutex_t m_omx_event_mutex;
|
||||
pthread_mutex_t m_omx_eos_mutex;
|
||||
pthread_mutex_t m_lock;
|
||||
std::vector<omx_event> m_omx_events;
|
||||
OMX_S32 m_ignore_error;
|
||||
|
||||
OMX_CALLBACKTYPE m_callbacks;
|
||||
|
||||
|
|
@ -197,7 +195,6 @@ private:
|
|||
|
||||
bool m_exit;
|
||||
DllOMX *m_DllOMX;
|
||||
bool m_DllOMXOpen;
|
||||
pthread_cond_t m_input_buffer_cond;
|
||||
pthread_cond_t m_output_buffer_cond;
|
||||
pthread_cond_t m_omx_event_cond;
|
||||
|
|
@ -205,8 +202,6 @@ private:
|
|||
bool m_flush_input;
|
||||
bool m_flush_output;
|
||||
bool m_resource_error;
|
||||
void Lock();
|
||||
void UnLock();
|
||||
};
|
||||
|
||||
class COMXCore
|
||||
|
|
@ -218,10 +213,10 @@ public:
|
|||
// initialize OMXCore and get decoder component
|
||||
bool Initialize();
|
||||
void Deinitialize();
|
||||
DllOMX *GetDll() { return m_DllOMX; }
|
||||
|
||||
protected:
|
||||
bool m_is_open;
|
||||
bool m_Initialized;
|
||||
DllOMX *m_DllOMX;
|
||||
};
|
||||
|
||||
|
|
|
|||
20
OMXVideo.cpp
20
OMXVideo.cpp
|
|
@ -760,13 +760,6 @@ bool COMXVideo::Open(COMXStreamInfo &hints, OMXClock *clock, const CRect &DestRe
|
|||
|
||||
void COMXVideo::Close()
|
||||
{
|
||||
m_omx_tunnel_decoder.Flush();
|
||||
if(m_deinterlace)
|
||||
m_omx_tunnel_image_fx.Flush();
|
||||
m_omx_tunnel_clock.Flush();
|
||||
m_omx_tunnel_sched.Flush();
|
||||
m_omx_tunnel_text.Flush();
|
||||
|
||||
m_omx_tunnel_clock.Deestablish();
|
||||
m_omx_tunnel_decoder.Deestablish();
|
||||
if(m_deinterlace)
|
||||
|
|
@ -781,7 +774,7 @@ void COMXVideo::Close()
|
|||
if(m_deinterlace)
|
||||
m_omx_image_fx.Deinitialize(true);
|
||||
m_omx_render.Deinitialize(true);
|
||||
m_omx_text.Deinitialize();
|
||||
m_omx_tunnel_text.Deestablish(true);
|
||||
|
||||
m_is_open = false;
|
||||
|
||||
|
|
@ -906,13 +899,12 @@ void COMXVideo::Reset(void)
|
|||
if(!m_is_open)
|
||||
return;
|
||||
|
||||
//m_setStartTime = true;
|
||||
//m_setStartTimeText = true;
|
||||
|
||||
m_setStartTime = true;
|
||||
m_setStartTimeText = true;
|
||||
m_omx_text.FlushAll();
|
||||
m_omx_tunnel_text.Flush();
|
||||
m_omx_decoder.FlushInput();
|
||||
m_omx_tunnel_decoder.Flush();
|
||||
if(m_deinterlace)
|
||||
m_omx_image_fx.FlushInput();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -1018,7 +1010,7 @@ bool COMXVideo::IsEOS()
|
|||
|
||||
OMXPacket *COMXVideo::GetText()
|
||||
{
|
||||
OMX_BUFFERHEADERTYPE *omx_buffer = m_omx_text.GetOutputBuffer();
|
||||
OMX_BUFFERHEADERTYPE *omx_buffer = m_omx_text.GetOutputBuffer(0);
|
||||
OMXPacket *pkt = NULL;
|
||||
|
||||
if(omx_buffer)
|
||||
|
|
|
|||
Loading…
Reference in a new issue