Signed-off-by: Derek Lesho dlesho@codeweavers.com --- dlls/mf/mf.rgs | 11 +++++++++++ dlls/mfplat/tests/mfplat.c | 36 ++++++++++------------------------- dlls/winegstreamer/mfplat.c | 9 ++++++++- dlls/winegstreamer/mfplat.idl | 7 +++++++ include/mfidl.idl | 1 + 5 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/dlls/mf/mf.rgs b/dlls/mf/mf.rgs index f127df7632..11fb106b4f 100644 --- a/dlls/mf/mf.rgs +++ b/dlls/mf/mf.rgs @@ -13,6 +13,17 @@ HKLM val '{477ec299-1421-4bdd-971f-7ccb933f21ad}' = s 'File Scheme Handler' } } + NoRemove 'ByteStreamHandlers' + { + '.mp4' + { + val '{271C3902-6095-4c45-A22F-20091816EE9E}' = s 'MPEG4 Byte Stream Handler' + } + 'video/mp4' + { + val '{271C3902-6095-4c45-A22F-20091816EE9E}' = s 'MPEG4 Byte Stream Handler' + } + } } } } diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index f056bbda2a..e08486bce1 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -432,7 +432,7 @@ static void test_source_resolver(void) WCHAR *filename; GUID guid; PROPVARIANT empty_var; - BOOL selected, do_uninit, skip_source_tests; + BOOL selected, do_uninit; ULONG refcount;
if (!pMFCreateSourceResolver) @@ -513,38 +513,23 @@ static void test_source_resolver(void) ok(hr == S_OK, "Failed to get type handler, hr %#x.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(handler, &guid); -todo_wine ok(hr == S_OK, "Failed to get stream major type, hr %#x.\n", hr); - if (hr == S_OK) - { - ok (IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected major type %s.\n", debugstr_guid(&guid)); - - hr = IMFMediaTypeHandler_GetCurrentMediaType(handler, &type); - ok (hr == S_OK, "Failed to get current media type, hr %#x.\n", hr); - - hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &guid); - ok(hr == S_OK, "Failed to get media sub type, hr %#x.\n", hr); - ok(IsEqualGUID(&guid, &MFVideoFormat_M4S2), "Unexpected sub type %s.\n", debugstr_guid(&guid)); + ok (IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected major type %s.\n", debugstr_guid(&guid));
- hr = IMFPresentationDescriptor_SelectStream(descriptor, 0); - ok(hr == S_OK, "Failed to select video stream, hr %#x.\n", hr); + hr = IMFMediaTypeHandler_GetCurrentMediaType(handler, &type); + ok (hr == S_OK, "Failed to get current media type, hr %#x.\n", hr);
- IMFMediaType_Release(type); + hr = IMFMediaType_GetGUID(type, &MF_MT_SUBTYPE, &guid); + ok(hr == S_OK, "Failed to get media sub type, hr %#x.\n", hr); + ok(IsEqualGUID(&guid, &MFVideoFormat_M4S2), "Unexpected sub type %s.\n", debugstr_guid(&guid));
- skip_source_tests = FALSE; - } - else - { - /* skip media source tests to avoid crashing, as the media source is fake */ - skip_source_tests = TRUE; - } + hr = IMFPresentationDescriptor_SelectStream(descriptor, 0); + ok(hr == S_OK, "Failed to select video stream, hr %#x.\n", hr);
+ IMFMediaType_Release(type); IMFMediaTypeHandler_Release(handler); IMFStreamDescriptor_Release(sd);
- if (skip_source_tests) - goto source_tests_end; - empty_var.vt = VT_EMPTY; hr = IMFMediaSource_Start(mediasource, descriptor, &GUID_NULL, &empty_var); ok(hr == S_OK, "Failed to start media source, hr %#x.\n", hr); @@ -631,7 +616,6 @@ todo_wine hr = IMFMediaSource_CreatePresentationDescriptor(mediasource, NULL); ok (hr == MF_E_SHUTDOWN, "Got 0x%08x\n", hr);
- source_tests_end: refcount = IMFMediaSource_Release(mediasource); ok(!refcount, "Unexpected refcount %u.\n", refcount); refcount = IMFByteStream_Release(stream); diff --git a/dlls/winegstreamer/mfplat.c b/dlls/winegstreamer/mfplat.c index 0a25cad48f..53aa0bc8f1 100644 --- a/dlls/winegstreamer/mfplat.c +++ b/dlls/winegstreamer/mfplat.c @@ -21,13 +21,14 @@
#include "gst_private.h"
+#include "gst_private.h" + #include <stdarg.h>
#define COBJMACROS #define NONAMELESSUNION
#include "mfapi.h" -#include "mfidl.h"
#include "wine/debug.h" #include "wine/heap.h" @@ -407,6 +408,11 @@ failed: return hr; }
+static HRESULT mp4_stream_handler_create(REFIID riid, void **ret) +{ + return container_stream_handler_construct(riid, ret, "qtdemux"); +} + static const struct class_object { const GUID *clsid; @@ -415,6 +421,7 @@ static const struct class_object class_objects[] = { { &CLSID_VideoProcessorMFT, &video_processor_create }, + { &CLSID_MPEG4ByteStreamHandler, &mp4_stream_handler_create }, };
HRESULT mfplat_get_class_object(REFCLSID rclsid, REFIID riid, void **obj) diff --git a/dlls/winegstreamer/mfplat.idl b/dlls/winegstreamer/mfplat.idl index 05a75bdb8e..947b47f435 100644 --- a/dlls/winegstreamer/mfplat.idl +++ b/dlls/winegstreamer/mfplat.idl @@ -24,3 +24,10 @@
] coclass VideoProcessorMFT { } + +[ + helpstring("MP4 Byte Stream Handler"), + threading(both), + uuid(271c3902-6095-4c45-a22f-20091816ee9e) +] +coclass MPEG4ByteStreamHandler { } \ No newline at end of file diff --git a/include/mfidl.idl b/include/mfidl.idl index da43399828..4c94c5d03e 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -910,3 +910,4 @@ cpp_quote("EXTERN_GUID(MF_SESSION_APPROX_EVENT_OCCURRENCE_TIME, 0x190e852f, 0x62 cpp_quote("EXTERN_GUID(MF_PMP_SERVER_CONTEXT, 0x2f00c910, 0xd2cf, 0x4278, 0x8b, 0x6a, 0xd0, 0x77, 0xfa, 0xc3, 0xa2, 0x5f);")
cpp_quote("EXTERN_GUID(CLSID_VideoProcessorMFT, 0x88753b26, 0x5b24, 0x49bd, 0xb2, 0xe7, 0xc, 0x44, 0x5c, 0x78, 0xc9, 0x82);") +cpp_quote("EXTERN_GUID(CLSID_MPEG4ByteStreamHandler, 0x271c3902, 0x6095, 0x4c45, 0xa2, 0x2f, 0x20, 0x09, 0x18, 0x16, 0xee, 0x9e);") \ No newline at end of file