Commit b3edb269 authored by Ziqing Hui's avatar Ziqing Hui Committed by Alexandre Julliard

winegstreamer: Add MFMPEG4SinkClassFactory.

parent f98f3612
......@@ -6938,58 +6938,39 @@ static void test_mpeg4_media_sink(void)
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMPEG4MediaSink(NULL, NULL, NULL, NULL);
todo_wine
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
sink = (void *)0xdeadbeef;
hr = MFCreateMPEG4MediaSink(NULL, NULL, NULL, &sink);
todo_wine
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
ok(sink == (void *)0xdeadbeef, "Unexpected pointer %p.\n", sink);
sink = NULL;
hr = MFCreateMPEG4MediaSink(bytestream_empty, NULL, NULL, &sink_empty);
todo_wine
ok(hr == S_OK || broken(hr == E_INVALIDARG), "Unexpected hr %#lx.\n", hr);
hr = MFCreateMPEG4MediaSink(bytestream_audio, NULL, audio_type, &sink_audio);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMPEG4MediaSink(bytestream_video, video_type, NULL, &sink_video);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = MFCreateMPEG4MediaSink(bytestream, video_type, audio_type, &sink);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (!sink)
{
if (sink_video)
IMFMediaSink_Release(sink_video);
if (sink_audio)
IMFMediaSink_Release(sink_audio);
if (sink_empty)
IMFMediaSink_Release(sink_empty);
IMFByteStream_Release(bytestream);
IMFByteStream_Release(bytestream_empty);
IMFByteStream_Release(bytestream_video);
IMFByteStream_Release(bytestream_audio);
IMFMediaType_Release(video_type);
IMFMediaType_Release(audio_type);
return;
}
/* Test sink. */
flags = 0xdeadbeef;
hr = IMFMediaSink_GetCharacteristics(sink, &flags);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(flags == MEDIASINK_RATELESS || broken(flags == (MEDIASINK_RATELESS | MEDIASINK_FIXED_STREAMS)),
"Unexpected flags %#lx.\n", flags);
check_interface(sink, &IID_IMFMediaEventGenerator, TRUE);
check_interface(sink, &IID_IMFFinalizableMediaSink, TRUE);
check_interface(sink, &IID_IMFClockStateSink, TRUE);
todo_wine
check_interface(sink, &IID_IMFGetService, TRUE);
/* Test sink stream count. */
......@@ -7104,8 +7085,11 @@ static void test_mpeg4_media_sink(void)
hr = MFCreatePresentationClock(&clock);
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaSink_SetPresentationClock(sink, NULL);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
hr = IMFMediaSink_SetPresentationClock(sink, clock);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFPresentationClock_Release(clock);
......@@ -7124,13 +7108,18 @@ static void test_mpeg4_media_sink(void)
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(type_handler, NULL);
todo_wine
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(type_handler, &guid);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(IsEqualGUID(&guid, &MFMediaType_Audio), "Unexpected major type.\n");
hr = IMFMediaTypeHandler_GetMediaTypeCount(type_handler, &count);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(count == 1, "Unexpected count %lu.\n", count);
hr = IMFMediaTypeHandler_GetCurrentMediaType(type_handler, &media_type);
......@@ -7140,8 +7129,10 @@ static void test_mpeg4_media_sink(void)
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaTypeHandler_SetCurrentMediaType(type_handler, NULL);
todo_wine
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaTypeHandler_SetCurrentMediaType(type_handler, media_type);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFMediaType_Release(media_type);
......@@ -7160,19 +7151,25 @@ static void test_mpeg4_media_sink(void)
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(type_handler, NULL);
todo_wine
ok(hr == E_POINTER, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaTypeHandler_GetMajorType(type_handler, &guid);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
IMFStreamSink_Release(stream_sink);
hr = IMFMediaSink_AddStreamSink(sink, 0, audio_type, &stream_sink);
todo_wine
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaSink_GetStreamSinkByIndex(sink, 0, &stream_sink);
todo_wine
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaSink_GetStreamSinkById(sink, 0, &stream_sink);
todo_wine
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
hr = IMFMediaSink_GetCharacteristics(sink, &flags);
todo_wine
ok(hr == MF_E_SHUTDOWN, "Unexpected hr %#lx.\n", hr);
IMFMediaTypeHandler_Release(type_handler);
......
......@@ -1468,44 +1468,35 @@ static void test_sink_writer_mp4(void)
ok(!writer, "Unexpected pointer %p.\n", writer);
hr = MFCreateSinkWriterFromURL(NULL, stream, attr, &writer);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IMFSinkWriter_Release(writer);
hr = MFCreateSinkWriterFromURL(tmp_file, NULL, NULL, &writer);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IMFSinkWriter_Release(writer);
hr = MFCreateSinkWriterFromURL(tmp_file, NULL, attr, &writer);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IMFSinkWriter_Release(writer);
hr = MFCreateSinkWriterFromURL(tmp_file, stream, NULL, &writer);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr == S_OK)
IMFSinkWriter_Release(writer);
hr = MFCreateSinkWriterFromURL(tmp_file, stream, attr, &writer);
todo_wine
ok(hr == S_OK, "Unexpected hr %#lx.\n", hr);
if (hr != S_OK)
{
IMFByteStream_Release(stream);
IMFAttributes_Release(attr);
return;
}
/* Test GetServiceForStream. */
sink = (void *)0xdeadbeef;
hr = IMFSinkWriter_GetServiceForStream(writer, MF_SINK_WRITER_MEDIASINK,
&GUID_NULL, &IID_IMFMediaSink, (void **)&sink);
todo_wine
ok(hr == MF_E_UNSUPPORTED_SERVICE, "Unexpected hr %#lx.\n", hr);
todo_wine
ok(!sink, "Unexpected pointer %p.\n", sink);
DeleteFileW(tmp_file);
......
......@@ -649,6 +649,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID clsid, REFIID iid, void **out)
factory = &color_convert_cf;
else if (IsEqualGUID(clsid, &CLSID_MFMP3SinkClassFactory))
factory = &sink_class_factory_cf;
else if (IsEqualGUID(clsid, &CLSID_MFMPEG4SinkClassFactory))
factory = &sink_class_factory_cf;
else
{
FIXME("%s not implemented, returning CLASS_E_CLASSNOTAVAILABLE.\n", debugstr_guid(clsid));
......
......@@ -117,3 +117,10 @@ coclass CColorConvertDMO {}
uuid(11275a82-5e5a-47fd-a01c-3683c12fb196)
]
coclass MFMP3SinkClassFactory {}
[
helpstring("MF MPEG4 Sink Class Factory"),
threading(both),
uuid(a22c4fc7-6e91-4e1d-89e9-53b2667b72ba)
]
coclass MFMPEG4SinkClassFactory {}
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