Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpc-hc/LAVFilters.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnderground78 <underground78@users.sourceforge.net>2013-09-28 19:30:14 +0400
committerUnderground78 <underground78@users.sourceforge.net>2016-05-06 11:51:08 +0300
commit66df9947ca99e6a93ee592491f22c607278ab02a (patch)
tree1ae8d0b85a1f804f698951b01906b7928ad9204c /decoder
parent44aab662f02ba8ab494b37a2e052c62cc1842ba0 (diff)
[MPC-HC] Tray icon: Add an optional custom callback for "show property page" events.
Diffstat (limited to 'decoder')
-rw-r--r--decoder/LAVAudio/LAVAudio.cpp11
-rw-r--r--decoder/LAVAudio/LAVAudio.h7
-rw-r--r--decoder/LAVAudio/LAVAudioSettings.h11
-rw-r--r--decoder/LAVVideo/LAVVideo.cpp12
-rw-r--r--decoder/LAVVideo/LAVVideo.h7
-rw-r--r--decoder/LAVVideo/LAVVideoSettings.h11
6 files changed, 57 insertions, 2 deletions
diff --git a/decoder/LAVAudio/LAVAudio.cpp b/decoder/LAVAudio/LAVAudio.cpp
index bf82a5fb..56cfdd76 100644
--- a/decoder/LAVAudio/LAVAudio.cpp
+++ b/decoder/LAVAudio/LAVAudio.cpp
@@ -132,6 +132,7 @@ STDMETHODIMP CLAVAudio::CreateTrayIcon()
if (CBaseTrayIcon::ProcessBlackList())
return S_FALSE;
m_pTrayIcon = new CBaseTrayIcon(this, TEXT(LAV_AUDIO), IDI_ICON1);
+ m_pTrayIcon->SetCustomOpenPropPage(m_fpPropPageCallback);
return S_OK;
}
@@ -425,6 +426,7 @@ STDMETHODIMP CLAVAudio::NonDelegatingQueryInterface(REFIID riid, void** ppv)
QI(ISpecifyPropertyPages)
QI(ISpecifyPropertyPages2)
QI2(ILAVAudioSettings)
+ QI2(ILAVAudioSettingsMPCHCCustom)
QI2(ILAVAudioStatus)
__super::NonDelegatingQueryInterface(riid, ppv);
}
@@ -803,6 +805,15 @@ STDMETHODIMP_(BOOL) CLAVAudio::GetOutput51LegacyLayout()
return m_settings.Output51Legacy;
}
+// ILAVAudioSettingsMPCHCCustom
+STDMETHODIMP CLAVAudio::SetPropertyPageCallback(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter))
+{
+ m_fpPropPageCallback = fpPropPageCallback;
+ if (m_pTrayIcon)
+ m_pTrayIcon->SetCustomOpenPropPage(fpPropPageCallback);
+ return S_OK;
+}
+
// ILAVAudioStatus
BOOL CLAVAudio::IsSampleFormatSupported(LAVAudioSampleFormat sfCheck)
{
diff --git a/decoder/LAVAudio/LAVAudio.h b/decoder/LAVAudio/LAVAudio.h
index 384562cf..ff6c6811 100644
--- a/decoder/LAVAudio/LAVAudio.h
+++ b/decoder/LAVAudio/LAVAudio.h
@@ -80,7 +80,8 @@ struct BufferDetails {
struct DTSDecoder;
[uuid("E8E73B6B-4CB3-44A4-BE99-4F7BCB96E491")]
-class CLAVAudio : public CTransformFilter, public ISpecifyPropertyPages2, public ILAVAudioSettings, public ILAVAudioStatus
+class CLAVAudio : public CTransformFilter, public ISpecifyPropertyPages2,
+ public ILAVAudioSettings, public ILAVAudioSettingsMPCHCCustom, public ILAVAudioStatus
{
public:
CLAVAudio(LPUNKNOWN pUnk, HRESULT* phr);
@@ -139,6 +140,9 @@ public:
STDMETHODIMP SetOutput51LegacyLayout(BOOL b51Legacy);
STDMETHODIMP_(BOOL) GetOutput51LegacyLayout();
+ // ILAVAudioSettingsMPCHCCustom
+ STDMETHODIMP SetPropertyPageCallback(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter));
+
// ILAVAudioStatus
STDMETHODIMP_(BOOL) IsSampleFormatSupported(LAVAudioSampleFormat sfCheck);
STDMETHODIMP GetDecodeDetails(const char **pCodec, const char **pDecodeFormat, int *pnChannels, int *pSampleRate, DWORD *pChannelMask);
@@ -354,4 +358,5 @@ private:
} m_raData;
CBaseTrayIcon *m_pTrayIcon = nullptr;
+ HRESULT (*m_fpPropPageCallback)(IBaseFilter* pFilter) = nullptr;
};
diff --git a/decoder/LAVAudio/LAVAudioSettings.h b/decoder/LAVAudio/LAVAudioSettings.h
index 15de658c..058c473f 100644
--- a/decoder/LAVAudio/LAVAudioSettings.h
+++ b/decoder/LAVAudio/LAVAudioSettings.h
@@ -23,6 +23,10 @@
DEFINE_GUID(IID_ILAVAudioSettings,
0x4158a22b, 0x6553, 0x45d0, 0x80, 0x69, 0x24, 0x71, 0x6f, 0x8f, 0xf1, 0x71);
+// {40A1D048-D41B-4D53-B737-FF9F99A245A0}
+DEFINE_GUID(IID_ILAVAudioSettingsMPCHCCustom,
+ 0x40a1d048, 0xd41b, 0x4d53, 0xb7, 0x37, 0xff, 0x9f, 0x99, 0xa2, 0x45, 0xa0);
+
// {A668B8F2-BA87-4F63-9D41-768F7DE9C50E}
DEFINE_GUID(IID_ILAVAudioStatus,
0xa668b8f2, 0xba87, 0x4f63, 0x9d, 0x41, 0x76, 0x8f, 0x7d, 0xe9, 0xc5, 0xe);
@@ -196,6 +200,13 @@ interface ILAVAudioSettings : public IUnknown
STDMETHOD(SetOutput51LegacyLayout)(BOOL b51Legacy) = 0;
};
+[uuid("40A1D048-D41B-4D53-B737-FF9F99A245A0")]
+interface ILAVAudioSettingsMPCHCCustom : public IUnknown
+{
+ // Set a custom callback function to handle the property page
+ STDMETHOD(SetPropertyPageCallback)(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter)) = 0;
+};
+
// LAV Audio Status Interface
// Get the current playback stats
[uuid("A668B8F2-BA87-4F63-9D41-768F7DE9C50E")]
diff --git a/decoder/LAVVideo/LAVVideo.cpp b/decoder/LAVVideo/LAVVideo.cpp
index 5311221d..9d368e15 100644
--- a/decoder/LAVVideo/LAVVideo.cpp
+++ b/decoder/LAVVideo/LAVVideo.cpp
@@ -54,6 +54,7 @@ void CALLBACK CLAVVideo::StaticInit(BOOL bLoading, const CLSID *clsid)
CLAVVideo::CLAVVideo(LPUNKNOWN pUnk, HRESULT* phr)
: CTransformFilter(NAME("LAV Video Decoder"), 0, __uuidof(CLAVVideo))
, m_Decoder(this)
+ , m_fpPropPageCallback(NULL)
{
*phr = S_OK;
m_pInput = new CVideoInputPin(TEXT("CVideoInputPin"), this, phr, L"Input");
@@ -112,6 +113,7 @@ HRESULT CLAVVideo::CreateTrayIcon()
if (CBaseTrayIcon::ProcessBlackList())
return S_FALSE;
m_pTrayIcon = new CBaseTrayIcon(this, TEXT(LAV_VIDEO), IDI_ICON1);
+ m_pTrayIcon->SetCustomOpenPropPage(m_fpPropPageCallback);
return S_OK;
}
@@ -388,6 +390,7 @@ STDMETHODIMP CLAVVideo::NonDelegatingQueryInterface(REFIID riid, void** ppv)
QI(ISpecifyPropertyPages2)
QI(IPropertyBag)
QI2(ILAVVideoSettings)
+ QI2(ILAVVideoSettingsMPCHCCustom)
QI2(ILAVVideoStatus)
__super::NonDelegatingQueryInterface(riid, ppv);
}
@@ -2348,3 +2351,12 @@ STDMETHODIMP CLAVVideo::GetHWAccelActiveDevice(BSTR *pstrDeviceName)
{
return m_Decoder.GetHWAccelActiveDevice(pstrDeviceName);
}
+
+// ILAVVideoSettingsMPCHCCustom
+STDMETHODIMP CLAVVideo::SetPropertyPageCallback(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter))
+{
+ m_fpPropPageCallback = fpPropPageCallback;
+ if (m_pTrayIcon)
+ m_pTrayIcon->SetCustomOpenPropPage(fpPropPageCallback);
+ return S_OK;
+}
diff --git a/decoder/LAVVideo/LAVVideo.h b/decoder/LAVVideo/LAVVideo.h
index 2caea20e..21329424 100644
--- a/decoder/LAVVideo/LAVVideo.h
+++ b/decoder/LAVVideo/LAVVideo.h
@@ -52,7 +52,8 @@ typedef struct {
} TimingCache;
[uuid("EE30215D-164F-4A92-A4EB-9D4C13390F9F")]
-class CLAVVideo : public CTransformFilter, public ISpecifyPropertyPages2, public ILAVVideoSettings, public ILAVVideoStatus, public ILAVVideoCallback, public IPropertyBag
+class CLAVVideo : public CTransformFilter, public ISpecifyPropertyPages2, public ILAVVideoSettings, public ILAVVideoStatus, public ILAVVideoCallback, public IPropertyBag,
+ public ILAVVideoSettingsMPCHCCustom
{
public:
CLAVVideo(LPUNKNOWN pUnk, HRESULT* phr);
@@ -135,6 +136,9 @@ public:
STDMETHODIMP SetH264MVCDecodingOverride(BOOL bEnabled);
+ // ILAVVideoSettingsMPCHCCustom
+ STDMETHODIMP SetPropertyPageCallback(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter));
+
// ILAVVideoStatus
STDMETHODIMP_(const WCHAR *) GetActiveDecoderName() { return m_Decoder.GetDecoderName(); }
STDMETHODIMP GetHWAccelActiveDevice(BSTR *pstrDeviceName);
@@ -298,6 +302,7 @@ private:
DWORD m_dwGPUDeviceIndex = DWORD_MAX;
CBaseTrayIcon *m_pTrayIcon = nullptr;
+ HRESULT (*m_fpPropPageCallback)(IBaseFilter* pFilter) = nullptr;
#ifdef DEBUG
FloatingAverage<double> m_pixFmtTimingAvg;
diff --git a/decoder/LAVVideo/LAVVideoSettings.h b/decoder/LAVVideo/LAVVideoSettings.h
index 2134a39b..ccdcbdf9 100644
--- a/decoder/LAVVideo/LAVVideoSettings.h
+++ b/decoder/LAVVideo/LAVVideoSettings.h
@@ -23,6 +23,10 @@
DEFINE_GUID(IID_ILAVVideoSettings,
0xfa40d6e9, 0x4d38, 0x4761, 0xad, 0xd2, 0x71, 0xa9, 0xec, 0x5f, 0xd3, 0x2f);
+// {F3BB90A3-B1CE-48C1-954C-3A506A33DE25}
+DEFINE_GUID(IID_ILAVVideoSettingsMPCHCCustom,
+0xf3bb90a3, 0xb1ce, 0x48c1, 0x95, 0x4c, 0x3a, 0x50, 0x6a, 0x33, 0xde, 0x25);
+
// {1CC2385F-36FA-41B1-9942-5024CE0235DC}
DEFINE_GUID(IID_ILAVVideoStatus,
0x1cc2385f, 0x36fa, 0x41b1, 0x99, 0x42, 0x50, 0x24, 0xce, 0x2, 0x35, 0xdc);
@@ -384,6 +388,13 @@ interface ILAVVideoSettings : public IUnknown
STDMETHOD(SetH264MVCDecodingOverride)(BOOL bEnabled) = 0;
};
+[uuid("F3BB90A3-B1CE-48C1-954C-3A506A33DE25")]
+interface ILAVVideoSettingsMPCHCCustom : public IUnknown
+{
+ // Set a custom callback function to handle the property page
+ STDMETHOD(SetPropertyPageCallback)(HRESULT (*fpPropPageCallback)(IBaseFilter* pFilter)) = 0;
+};
+
// LAV Video status interface
[uuid("1CC2385F-36FA-41B1-9942-5024CE0235DC")]
interface ILAVVideoStatus : public IUnknown