Nikolay Sivov : mf/evr: Implement GetMediaTypeCount().
Alexandre Julliard
julliard at winehq.org
Fri Oct 9 16:00:44 CDT 2020
Module: wine
Branch: master
Commit: 6408aa3ab74d4740f276c0b8cc444dd6a9e6842e
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6408aa3ab74d4740f276c0b8cc444dd6a9e6842e
Author: Nikolay Sivov <nsivov at codeweavers.com>
Date: Fri Oct 9 13:54:36 2020 +0300
mf/evr: Implement GetMediaTypeCount().
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/mf/evr.c | 9 +++++++--
dlls/mf/tests/mf.c | 9 +++++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/evr.c b/dlls/mf/evr.c
index ac3f17fa58..7567b1a709 100644
--- a/dlls/mf/evr.c
+++ b/dlls/mf/evr.c
@@ -372,9 +372,14 @@ static HRESULT WINAPI video_stream_typehandler_IsMediaTypeSupported(IMFMediaType
static HRESULT WINAPI video_stream_typehandler_GetMediaTypeCount(IMFMediaTypeHandler *iface, DWORD *count)
{
- FIXME("%p, %p.\n", iface, count);
+ TRACE("%p, %p.\n", iface, count);
- return E_NOTIMPL;
+ if (!count)
+ return E_POINTER;
+
+ *count = 0;
+
+ return S_OK;
}
static HRESULT WINAPI video_stream_typehandler_GetMediaTypeByIndex(IMFMediaTypeHandler *iface, DWORD index,
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c
index a63c353a4b..db442453d6 100644
--- a/dlls/mf/tests/mf.c
+++ b/dlls/mf/tests/mf.c
@@ -3296,6 +3296,15 @@ static void test_evr(void)
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected type %s.\n", wine_dbgstr_guid(&guid));
+ /* Supported types are not advertised. */
+ hr = IMFMediaTypeHandler_GetMediaTypeCount(type_handler, NULL);
+ ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
+
+ count = 1;
+ hr = IMFMediaTypeHandler_GetMediaTypeCount(type_handler, &count);
+ ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
+ ok(!count, "Unexpected count %u.\n", count);
+
IMFMediaTypeHandler_Release(type_handler);
/* Stream uses an allocator. */
More information about the wine-cvs
mailing list