summaryrefslogtreecommitdiff
path: root/sys/dshowsrcwrapper/gstdshowfakesink.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dshowsrcwrapper/gstdshowfakesink.cpp')
-rw-r--r--sys/dshowsrcwrapper/gstdshowfakesink.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/sys/dshowsrcwrapper/gstdshowfakesink.cpp b/sys/dshowsrcwrapper/gstdshowfakesink.cpp
index c524c7c08..3c5fca82c 100644
--- a/sys/dshowsrcwrapper/gstdshowfakesink.cpp
+++ b/sys/dshowsrcwrapper/gstdshowfakesink.cpp
@@ -46,12 +46,19 @@ STDMETHODIMP
HRESULT CDshowFakeSink::CheckMediaType (const CMediaType * pmt)
{
- if (pmt != NULL) {
- if (*pmt == m_MediaType)
- return S_OK;
- }
+ if (!IsEqualGUID(pmt->majortype, m_MediaType.majortype) ||
+ !IsEqualGUID(pmt->subtype, m_MediaType.subtype) ||
+ !IsEqualGUID(pmt->formattype, m_MediaType.formattype) ||
+ (pmt->cbFormat != m_MediaType.cbFormat))
+ return S_FALSE;
+
+ VIDEOINFOHEADER *info1 = (VIDEOINFOHEADER*)pmt->pbFormat;
+ VIDEOINFOHEADER *info2 = (VIDEOINFOHEADER*)m_MediaType.pbFormat;
- return S_FALSE;
+ if (memcmp(&info1->bmiHeader, &info2->bmiHeader, sizeof(BITMAPINFOHEADER)))
+ return S_FALSE;
+
+ return S_OK;
}
HRESULT CDshowFakeSink::DoRenderSample (IMediaSample * pMediaSample)