Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mfreadwrite/main.c | 35 ++++++++++++++++++++++++++++++++--- include/mfreadwrite.idl | 2 ++ 2 files changed, 34 insertions(+), 3 deletions(-)
diff --git a/dlls/mfreadwrite/main.c b/dlls/mfreadwrite/main.c index 6b6c5167ff..f3fd3b293d 100644 --- a/dlls/mfreadwrite/main.c +++ b/dlls/mfreadwrite/main.c @@ -21,6 +21,7 @@ #include <stdarg.h>
#define COBJMACROS +#define NONAMELESSUNION
#include "windef.h" #include "winbase.h" @@ -211,10 +212,38 @@ static HRESULT WINAPI src_reader_GetServiceForStream(IMFSourceReader *iface, DWO }
static HRESULT WINAPI src_reader_GetPresentationAttribute(IMFSourceReader *iface, DWORD index, - REFGUID guid, PROPVARIANT *attr) + REFGUID guid, PROPVARIANT *value) { - srcreader *This = impl_from_IMFSourceReader(iface); - FIXME("%p, 0x%08x, %s, %p\n", This, index, debugstr_guid(guid), attr); + struct source_reader *reader = impl_from_IMFSourceReader(iface); + HRESULT hr; + + TRACE("%p, %#x, %s, %p.\n", iface, index, debugstr_guid(guid), value); + + switch (index) + { + case MF_SOURCE_READER_MEDIASOURCE: + if (IsEqualGUID(guid, &MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS)) + { + DWORD flags; + + if (FAILED(hr = IMFMediaSource_GetCharacteristics(reader->source, &flags))) + return hr; + + value->vt = VT_UI4; + value->u.ulVal = flags; + return S_OK; + } + else + { + FIXME("Unsupported source attribute %s.\n", debugstr_guid(guid)); + return E_NOTIMPL; + } + break; + default: + FIXME("Unsupported index %#x.\n", index); + return E_NOTIMPL; + } + return E_NOTIMPL; }
diff --git a/include/mfreadwrite.idl b/include/mfreadwrite.idl index 264712778f..9097b5a548 100644 --- a/include/mfreadwrite.idl +++ b/include/mfreadwrite.idl @@ -78,6 +78,8 @@ cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_CLASS_AUDIO, 0x430847da, 0x08 cpp_quote("EXTERN_GUID(MF_READWRITE_MMCSS_PRIORITY_AUDIO, 0x273db885, 0x2de2, 0x4db2, 0xa6, 0xa7, 0xfd, 0xb6, 0x6f, 0xb4, 0x0b, 0x61);") cpp_quote("EXTERN_GUID(MF_READWRITE_D3D_OPTIONAL, 0x216479d9, 0x3071, 0x42ca, 0xbb, 0x6c, 0x4c, 0x22, 0x10, 0x2e, 0x1d, 0x18);")
+cpp_quote("EXTERN_GUID(MF_SOURCE_READER_MEDIASOURCE_CHARACTERISTICS, 0x6d23f5c8, 0xc5d7, 0x4a9b, 0x99, 0x71, 0x5d, 0x11, 0xf8, 0xbc, 0xa8, 0x80);") + interface IMFMediaSource;
[