diff options
author | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-12-21 02:55:04 +0400 |
---|---|---|
committer | Hendrik Leppkes <h.leppkes@gmail.com> | 2012-12-21 02:55:04 +0400 |
commit | 2b1ffcf54375ff36450096b6cfde80d1f958442d (patch) | |
tree | b5c675dac8aa4ccdcfad875ceead122903df540a | |
parent | 428cc53b97ae4253f16b5219794ef270fd7a2653 (diff) |
Show/Hide tray icon when entering/leaving the filter graph instead of loading the filter.
-rw-r--r-- | decoder/LAVAudio/LAVAudio.cpp | 14 | ||||
-rw-r--r-- | decoder/LAVAudio/LAVAudio.h | 2 | ||||
-rw-r--r-- | decoder/LAVVideo/LAVVideo.cpp | 14 | ||||
-rw-r--r-- | decoder/LAVVideo/LAVVideo.h | 2 | ||||
-rw-r--r-- | demuxer/LAVSplitter/LAVSplitter.cpp | 15 | ||||
-rw-r--r-- | demuxer/LAVSplitter/LAVSplitter.h | 2 |
6 files changed, 43 insertions, 6 deletions
diff --git a/decoder/LAVAudio/LAVAudio.cpp b/decoder/LAVAudio/LAVAudio.cpp index cdd74097..64599634 100644 --- a/decoder/LAVAudio/LAVAudio.cpp +++ b/decoder/LAVAudio/LAVAudio.cpp @@ -130,8 +130,6 @@ CLAVAudio::CLAVAudio(LPUNKNOWN pUnk, HRESULT* phr) InitBitstreaming(); - m_pTrayIcon = new CBaseTrayIcon(TEXT(LAV_AUDIO), IDI_ICON1); - #ifdef DEBUG DbgSetModuleLevel (LOG_ERROR, DWORD_MAX); DbgSetModuleLevel (LOG_TRACE, DWORD_MAX); @@ -162,6 +160,18 @@ CLAVAudio::~CLAVAudio() #endif } +STDMETHODIMP CLAVAudio::JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName) +{ + CAutoLock cObjectLock(m_pLock); + HRESULT hr = __super::JoinFilterGraph(pGraph, pName); + if (pGraph && !m_pTrayIcon) { + m_pTrayIcon = new CBaseTrayIcon(this, TEXT(LAV_SPLITTER), IDI_ICON1); + } else if (!pGraph && m_pTrayIcon) { + SAFE_DELETE(m_pTrayIcon); + } + return hr; +} + HRESULT CLAVAudio::LoadDefaults() { // Query OS version info diff --git a/decoder/LAVAudio/LAVAudio.h b/decoder/LAVAudio/LAVAudio.h index 4e12010e..3b1760ca 100644 --- a/decoder/LAVAudio/LAVAudio.h +++ b/decoder/LAVAudio/LAVAudio.h @@ -159,6 +159,8 @@ public: HRESULT Receive(IMediaSample *pIn); + STDMETHODIMP JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName); + // Optional Overrides HRESULT CheckConnect(PIN_DIRECTION dir, IPin *pPin); HRESULT SetMediaType(PIN_DIRECTION dir, const CMediaType *pmt); diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp index 8d9f5dd3..875c45f8 100644 --- a/decoder/LAVVideo/LAVVideo.cpp +++ b/decoder/LAVVideo/LAVVideo.cpp @@ -102,8 +102,6 @@ CLAVVideo::CLAVVideo(LPUNKNOWN pUnk, HRESULT* phr) m_ControlThread = new CLAVControlThread(this); - m_pTrayIcon = new CBaseTrayIcon(TEXT(LAV_VIDEO), IDI_ICON1); - #ifdef DEBUG DbgSetModuleLevel (LOG_TRACE, DWORD_MAX); DbgSetModuleLevel (LOG_ERROR, DWORD_MAX); @@ -135,6 +133,18 @@ CLAVVideo::~CLAVVideo() SAFE_DELETE(m_pSubtitleInput); } +STDMETHODIMP CLAVVideo::JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName) +{ + CAutoLock cObjectLock(m_pLock); + HRESULT hr = __super::JoinFilterGraph(pGraph, pName); + if (pGraph && !m_pTrayIcon) { + m_pTrayIcon = new CBaseTrayIcon(this, TEXT(LAV_SPLITTER), IDI_ICON1); + } else if (!pGraph && m_pTrayIcon) { + SAFE_DELETE(m_pTrayIcon); + } + return hr; +} + STDMETHODIMP_(BOOL) CLAVVideo::IsVistaOrNewer() { // Query OS version info diff --git a/decoder/LAVVideo/LAVVideo.h b/decoder/LAVVideo/LAVVideo.h index 01e4a4e1..a857021d 100644 --- a/decoder/LAVVideo/LAVVideo.h +++ b/decoder/LAVVideo/LAVVideo.h @@ -142,6 +142,8 @@ public: int GetPinCount(); CBasePin* GetPin(int n); + STDMETHODIMP JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName); + // ILAVVideoCallback STDMETHODIMP AllocateFrame(LAVFrame **ppFrame); STDMETHODIMP ReleaseFrame(LAVFrame **ppFrame); diff --git a/demuxer/LAVSplitter/LAVSplitter.cpp b/demuxer/LAVSplitter/LAVSplitter.cpp index 50058728..65685919 100644 --- a/demuxer/LAVSplitter/LAVSplitter.cpp +++ b/demuxer/LAVSplitter/LAVSplitter.cpp @@ -70,8 +70,6 @@ CLAVSplitter::CLAVSplitter(LPUNKNOWN pUnk, HRESULT* phr) m_pInput = new CLAVInputPin(NAME("LAV Input Pin"), this, this, phr); - m_pTrayIcon = new CBaseTrayIcon(TEXT(LAV_SPLITTER), IDI_ICON1); - #ifdef DEBUG DbgSetModuleLevel (LOG_TRACE, DWORD_MAX); DbgSetModuleLevel (LOG_ERROR, DWORD_MAX); @@ -118,6 +116,19 @@ STDMETHODIMP CLAVSplitter::Close() return S_OK; } +STDMETHODIMP CLAVSplitter::JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName) +{ + CAutoLock cObjectLock(m_pLock); + DbgLog((LOG_TRACE, 10, L"Joining Filter Graph with graph: %p", pGraph)); + HRESULT hr = __super::JoinFilterGraph(pGraph, pName); + if (pGraph && !m_pTrayIcon) { + m_pTrayIcon = new CBaseTrayIcon(this, TEXT(LAV_SPLITTER), IDI_ICON1); + } else if (!pGraph && m_pTrayIcon) { + SAFE_DELETE(m_pTrayIcon); + } + return hr; +} + // Default overrides for input formats static BOOL get_iformat_default(std::string name) { diff --git a/demuxer/LAVSplitter/LAVSplitter.h b/demuxer/LAVSplitter/LAVSplitter.h index d39c9b02..91a6b1d9 100644 --- a/demuxer/LAVSplitter/LAVSplitter.h +++ b/demuxer/LAVSplitter/LAVSplitter.h @@ -83,6 +83,8 @@ public: STDMETHODIMP Pause(); STDMETHODIMP Run(REFERENCE_TIME tStart); + STDMETHODIMP JoinFilterGraph(IFilterGraph * pGraph, LPCWSTR pName); + // IFileSourceFilter STDMETHODIMP Load(LPCOLESTR pszFileName, const AM_MEDIA_TYPE * pmt); STDMETHODIMP GetCurFile(LPOLESTR *ppszFileName, AM_MEDIA_TYPE *pmt); |