Commit 3d8d05db authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

mf/evr: Add GetMajorType() for the stream sink.

parent 3625f762
...@@ -385,9 +385,18 @@ static HRESULT WINAPI video_stream_typehandler_GetCurrentMediaType(IMFMediaTypeH ...@@ -385,9 +385,18 @@ static HRESULT WINAPI video_stream_typehandler_GetCurrentMediaType(IMFMediaTypeH
static HRESULT WINAPI video_stream_typehandler_GetMajorType(IMFMediaTypeHandler *iface, GUID *type) static HRESULT WINAPI video_stream_typehandler_GetMajorType(IMFMediaTypeHandler *iface, GUID *type)
{ {
FIXME("%p, %p.\n", iface, type); struct video_stream *stream = impl_from_IMFMediaTypeHandler(iface);
return E_NOTIMPL; TRACE("%p, %p.\n", iface, type);
if (!stream->parent)
return MF_E_STREAMSINK_REMOVED;
if (!type)
return E_POINTER;
memcpy(type, &MFMediaType_Video, sizeof(*type));
return S_OK;
} }
static const IMFMediaTypeHandlerVtbl video_stream_type_handler_vtbl = static const IMFMediaTypeHandlerVtbl video_stream_type_handler_vtbl =
......
...@@ -3236,16 +3236,19 @@ todo_wine ...@@ -3236,16 +3236,19 @@ todo_wine
static void test_evr(void) static void test_evr(void)
{ {
IMFMediaEventGenerator *ev_generator; IMFMediaEventGenerator *ev_generator;
IMFMediaTypeHandler *type_handler;
IMFVideoRenderer *video_renderer; IMFVideoRenderer *video_renderer;
IMFClockStateSink *clock_sink; IMFClockStateSink *clock_sink;
IMFMediaSinkPreroll *preroll; IMFMediaSinkPreroll *preroll;
IMFMediaSink *sink, *sink2; IMFMediaSink *sink, *sink2;
IMFStreamSink *stream_sink;
IMFActivate *activate; IMFActivate *activate;
DWORD flags, count; DWORD flags, count;
IMFGetService *gs; IMFGetService *gs;
IUnknown *unk; IUnknown *unk;
UINT64 value; UINT64 value;
HRESULT hr; HRESULT hr;
GUID guid;
hr = CoInitialize(NULL); hr = CoInitialize(NULL);
ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr); ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr);
...@@ -3267,6 +3270,23 @@ static void test_evr(void) ...@@ -3267,6 +3270,23 @@ static void test_evr(void)
hr = IMFActivate_ActivateObject(activate, &IID_IMFMediaSink, (void **)&sink); hr = IMFActivate_ActivateObject(activate, &IID_IMFMediaSink, (void **)&sink);
ok(hr == S_OK, "Failed to activate, hr %#x.\n", hr); ok(hr == S_OK, "Failed to activate, hr %#x.\n", hr);
/* Primary stream type handler. */
hr = IMFMediaSink_GetStreamSinkById(sink, 0, &stream_sink);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFStreamSink_GetMediaTypeHandler(stream_sink, &type_handler);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(type_handler, NULL);
ok(hr == E_POINTER, "Unexpected hr %#x.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(type_handler, &guid);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(IsEqualGUID(&guid, &MFMediaType_Video), "Unexpected type %s.\n", wine_dbgstr_guid(&guid));
IMFStreamSink_Release(stream_sink);
IMFMediaTypeHandler_Release(type_handler);
hr = IMFMediaSink_GetCharacteristics(sink, &flags); hr = IMFMediaSink_GetCharacteristics(sink, &flags);
ok(hr == S_OK, "Unexpected hr %#x.\n", hr); ok(hr == S_OK, "Unexpected hr %#x.\n", hr);
ok(flags == (MEDIASINK_CAN_PREROLL | MEDIASINK_CLOCK_REQUIRED), "Unexpected flags %#x.\n", flags); ok(flags == (MEDIASINK_CAN_PREROLL | MEDIASINK_CLOCK_REQUIRED), "Unexpected flags %#x.\n", flags);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment