From a51c4c16b25416ca55ddca56a14c89be63782a90 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Wed, 24 Sep 2008 17:21:41 +0000 Subject: sys/dshowdecwrapper/: Prefer known-good filters, create directly by GUID if possible, fall back to creating highest-m... Original commit message from CVS: * sys/dshowdecwrapper/gstdshowaudiodec.cpp: * sys/dshowdecwrapper/gstdshowaudiodec.h: * sys/dshowdecwrapper/gstdshowfakesrc.cpp: * sys/dshowdecwrapper/gstdshowutil.cpp: * sys/dshowdecwrapper/gstdshowutil.h: * sys/dshowdecwrapper/gstdshowvideodec.cpp: * sys/dshowdecwrapper/gstdshowvideodec.h: Prefer known-good filters, create directly by GUID if possible, fall back to creating highest-merit filter otherwise. Fixes playback with random dshow filters installed in some cases. --- sys/dshowdecwrapper/gstdshowfakesrc.cpp | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'sys/dshowdecwrapper/gstdshowfakesrc.cpp') diff --git a/sys/dshowdecwrapper/gstdshowfakesrc.cpp b/sys/dshowdecwrapper/gstdshowfakesrc.cpp index 8095c36e..170e9ed8 100644 --- a/sys/dshowdecwrapper/gstdshowfakesrc.cpp +++ b/sys/dshowdecwrapper/gstdshowfakesrc.cpp @@ -46,14 +46,33 @@ HRESULT FakeOutputPin::GetMediaType(int iPosition, return VFW_S_NO_MORE_ITEMS; } +#if 0 +#define GUID_FORMAT "0x%.8x 0x%.4x 0x%.4x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x 0x%.2x" +#define GUID_ARGS(g) g.Data1, g.Data2, g.Data3, \ + g.Data4[0], g.Data4[1], g.Data4[2], g.Data4[3], \ + g.Data4[4], g.Data4[5], g.Data4[6], g.Data4[7] + +static void printMediaType (AM_MEDIA_TYPE *mt) +{ + GST_DEBUG (":: majortype: "GUID_FORMAT, GUID_ARGS(mt->majortype)); + GST_DEBUG (":: subtype: "GUID_FORMAT, GUID_ARGS(mt->subtype)); + + GST_DEBUG (":: bFixedSizeSamples: %d", mt->bFixedSizeSamples); + GST_DEBUG (":: bTemporalCompression: %d", mt->bTemporalCompression); + GST_DEBUG (":: cbFormat: %d", mt->cbFormat); + GST_DEBUG (":: formattype: %x", mt->formattype); + GST_DEBUG (":: lSampleSize: %lu", mt->lSampleSize); + GST_DEBUG (":: pbFormat: %p", mt->pbFormat); +} +#endif HRESULT FakeOutputPin::CheckMediaType(const CMediaType *pmt) { - if (m_MediaType == *pmt) { - return S_OK; - } + if (m_MediaType == *pmt) { + return S_OK; + } - return S_FALSE; + return S_FALSE; } HRESULT FakeOutputPin::DecideBufferSize (IMemAllocator *pAlloc, -- cgit v1.2.1