Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 2a5efc99e8..038bfeacd1 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -1041,8 +1041,6 @@ todo_wine
IMFGetService_Release(gs);
- test_session_events(session); - IMFMediaSession_Release(session);
hr = MFCreateMediaSession(NULL, &session); @@ -1077,6 +1075,14 @@ todo_wine
IMFAttributes_Release(attributes);
+ /* Basic events behavior. */ + hr = MFCreateMediaSession(NULL, &session); + ok(hr == S_OK, "Failed to create media session, hr %#x.\n", hr); + + test_session_events(session); + + IMFMediaSession_Release(session); + hr = MFShutdown(); ok(hr == S_OK, "Shutdown failure, hr %#x.\n", hr); }
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++ dlls/mf/topology.c | 26 +++++++++++++++++++ 2 files changed, 91 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 038bfeacd1..7f9edfe241 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -656,6 +656,71 @@ static void test_topology(void) IMFTopologyNode_Release(node); IMFTopologyNode_Release(node2);
+ /* Cloning nodes of different types. */ + hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &node); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + + hr = MFCreateTopologyNode(MF_TOPOLOGY_OUTPUT_NODE, &node2); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + + hr = IMFTopologyNode_CloneFrom(node, node2); + ok(hr == MF_E_INVALIDREQUEST, "Unexpected hr %#x.\n", hr); + + IMFTopologyNode_Release(node2); + + /* Cloning preferred types. */ + hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &node2); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + + hr = MFCreateMediaType(&mediatype); + ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr); + + hr = IMFTopologyNode_SetOutputPrefType(node2, 0, mediatype); + ok(hr == S_OK, "Failed to set preferred type, hr %#x.\n", hr); + + /* Vista checks for additional attributes. */ + hr = IMFTopologyNode_CloneFrom(node, node2); + ok(hr == S_OK || broken(hr == MF_E_ATTRIBUTENOTFOUND) /* Vista */, "Failed to clone a node, hr %#x.\n", hr); + + hr = IMFTopologyNode_GetOutputPrefType(node, 0, &mediatype2); + ok(hr == S_OK, "Failed to get preferred type, hr %#x.\n", hr); + ok(mediatype == mediatype2, "Unexpected media type.\n"); + + IMFMediaType_Release(mediatype2); + IMFMediaType_Release(mediatype); + + IMFTopologyNode_Release(node2); + + /* Existing preferred types are not cleared. */ + hr = MFCreateTopologyNode(MF_TOPOLOGY_SOURCESTREAM_NODE, &node2); + ok(hr == S_OK, "Failed to create topology node, hr %#x.\n", hr); + + hr = IMFTopologyNode_GetOutputCount(node, &count); + ok(hr == S_OK, "Failed to get output count, hr %#x.\n", hr); + ok(count == 1, "Unexpected output count.\n"); + + hr = IMFTopologyNode_CloneFrom(node, node2); + ok(hr == S_OK || broken(hr == MF_E_ATTRIBUTENOTFOUND) /* Vista */, "Failed to clone a node, hr %#x.\n", hr); + + hr = IMFTopologyNode_GetOutputCount(node, &count); + ok(hr == S_OK, "Failed to get output count, hr %#x.\n", hr); + ok(count == 1, "Unexpected output count.\n"); + + hr = IMFTopologyNode_GetOutputPrefType(node, 0, &mediatype2); + ok(hr == S_OK, "Failed to get preferred type, hr %#x.\n", hr); + ok(!!mediatype2, "Unexpected media type.\n"); + IMFMediaType_Release(mediatype2); + + hr = IMFTopologyNode_CloneFrom(node2, node); + ok(hr == S_OK || broken(hr == MF_E_ATTRIBUTENOTFOUND) /* Vista */, "Failed to clone a node, hr %#x.\n", hr); + + hr = IMFTopologyNode_GetOutputCount(node2, &count); + ok(hr == S_OK, "Failed to get output count, hr %#x.\n", hr); + ok(count == 1, "Unexpected output count.\n"); + + IMFTopologyNode_Release(node2); + IMFTopologyNode_Release(node); + IMFTopology_Release(topology); }
diff --git a/dlls/mf/topology.c b/dlls/mf/topology.c index ad89739d4a..db82816328 100644 --- a/dlls/mf/topology.c +++ b/dlls/mf/topology.c @@ -1628,7 +1628,9 @@ static HRESULT WINAPI topology_node_CloneFrom(IMFTopologyNode *iface, IMFTopolog { struct topology_node *node = impl_from_IMFTopologyNode(iface); MF_TOPOLOGY_TYPE node_type; + IMFMediaType *mediatype; IUnknown *object; + DWORD count, i; TOPOID topoid; HRESULT hr;
@@ -1656,6 +1658,30 @@ static HRESULT WINAPI topology_node_CloneFrom(IMFTopologyNode *iface, IMFTopolog if (SUCCEEDED(hr)) node->id = topoid;
+ if (SUCCEEDED(IMFTopologyNode_GetInputCount(src_node, &count))) + { + for (i = 0; i < count; ++i) + { + if (SUCCEEDED(IMFTopologyNode_GetInputPrefType(src_node, i, &mediatype))) + { + IMFTopologyNode_SetInputPrefType(iface, i, mediatype); + IMFMediaType_Release(mediatype); + } + } + } + + if (SUCCEEDED(IMFTopologyNode_GetOutputCount(src_node, &count))) + { + for (i = 0; i < count; ++i) + { + if (SUCCEEDED(IMFTopologyNode_GetOutputPrefType(src_node, i, &mediatype))) + { + IMFTopologyNode_SetOutputPrefType(iface, i, mediatype); + IMFMediaType_Release(mediatype); + } + } + } + LeaveCriticalSection(&node->cs);
if (object)
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/samplegrabber.c | 2 ++ dlls/mf/tests/mf.c | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+)
diff --git a/dlls/mf/samplegrabber.c b/dlls/mf/samplegrabber.c index af9666c86c..c3dc2e1b7f 100644 --- a/dlls/mf/samplegrabber.c +++ b/dlls/mf/samplegrabber.c @@ -862,6 +862,8 @@ static HRESULT WINAPI sample_grabber_sink_GetCharacteristics(IMFMediaSink *iface return MF_E_SHUTDOWN;
*flags = MEDIASINK_FIXED_STREAMS; + if (grabber->ignore_clock) + *flags |= MEDIASINK_RATELESS;
return S_OK; } diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 7f9edfe241..830bb38259 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2166,6 +2166,32 @@ todo_wine refcount = IMFActivate_Release(activate); ok(!refcount, "Unexpected refcount %u.\n", refcount);
+ /* Rateless mode with MF_SAMPLEGRABBERSINK_IGNORE_CLOCK. */ + hr = MFCreateMediaType(&media_type); + ok(hr == S_OK, "Failed to create media type, hr %#x.\n", hr); + + hr = IMFMediaType_SetGUID(media_type, &MF_MT_MAJOR_TYPE, &MFMediaType_Audio); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + hr = IMFMediaType_SetGUID(media_type, &MF_MT_SUBTYPE, &MFAudioFormat_PCM); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + + hr = MFCreateSampleGrabberSinkActivate(media_type, &grabber_callback, &activate); + ok(hr == S_OK, "Failed to create grabber activate, hr %#x.\n", hr); + + hr = IMFActivate_SetUINT32(activate, &MF_SAMPLEGRABBERSINK_IGNORE_CLOCK, 1); + ok(hr == S_OK, "Failed to set attribute, hr %#x.\n", hr); + + hr = IMFActivate_ActivateObject(activate, &IID_IMFMediaSink, (void **)&sink); + ok(hr == S_OK, "Failed to activate object, hr %#x.\n", hr); + + hr = IMFMediaSink_GetCharacteristics(sink, &flags); + ok(hr == S_OK, "Failed to get sink flags, hr %#x.\n", hr); + ok(flags & MEDIASINK_RATELESS, "Unexpected flags %#x.\n", flags); + + IMFMediaSink_Release(sink); + IMFActivate_Release(activate); + IMFMediaType_Release(media_type); + hr = MFShutdown(); ok(hr == S_OK, "Failed to shut down, hr %#x.\n", hr); }
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=57642
Your paranoid android.
=== w8 (32 bit report) ===
mf: mf.c:1007: Test failed: Unexpected return value 0x102.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com --- dlls/mf/tests/mf.c | 33 +++++++++++++++++++++++++++++++++ include/mferror.h | 12 ++++++++++++ include/mfidl.idl | 2 ++ 3 files changed, 47 insertions(+)
diff --git a/dlls/mf/tests/mf.c b/dlls/mf/tests/mf.c index 830bb38259..0428c22ed3 100644 --- a/dlls/mf/tests/mf.c +++ b/dlls/mf/tests/mf.c @@ -2552,6 +2552,38 @@ static void test_quality_manager(void) IMFQualityManager_Release(manager); }
+static void test_sar(void) +{ + IMFPresentationTimeSource *time_source; + IMFMediaSink *sink; + HRESULT hr; + + hr = CoInitialize(NULL); + ok(hr == S_OK, "Failed to initialize, hr %#x.\n", hr); + + hr = MFCreateAudioRenderer(NULL, &sink); + if (hr == MF_E_NO_AUDIO_PLAYBACK_DEVICE) + { + skip("No audio playback device available.\n"); + CoUninitialize(); + return; + } + +todo_wine + ok(hr == S_OK, "Failed to create renderer, hr %#x.\n", hr); + +if (SUCCEEDED(hr)) +{ + hr = IMFMediaSink_QueryInterface(sink, &IID_IMFPresentationTimeSource, (void **)&time_source); + ok(hr == S_OK, "Failed to get time source interface, hr %#x.\n", hr); + IMFPresentationTimeSource_Release(time_source); + + IMFMediaSink_Release(sink); +} + + CoUninitialize(); +} + START_TEST(mf) { test_topology(); @@ -2564,4 +2596,5 @@ START_TEST(mf) test_sample_grabber(); test_video_processor(); test_quality_manager(); + test_sar(); } diff --git a/include/mferror.h b/include/mferror.h index ba4d365a79..6d7031ecc8 100644 --- a/include/mferror.h +++ b/include/mferror.h @@ -108,6 +108,18 @@ #define MF_E_SINK_NO_SAMPLES_PROCESSED _HRESULT_TYPEDEF_(0xc00d4a44) #define MF_E_SINK_HEADERS_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d4a45)
+#define MF_E_VIDEO_REN_NO_PROCAMP_HW _HRESULT_TYPEDEF_(0xc00d4e20) +#define MF_E_VIDEO_REN_NO_DEINTERLACE_HW _HRESULT_TYPEDEF_(0xc00d4e21) +#define MF_E_VIDEO_REN_COPYPROT_FAILED _HRESULT_TYPEDEF_(0xc00d4e22) +#define MF_E_VIDEO_REN_SURFACE_NOT_SHARED _HRESULT_TYPEDEF_(0xc00d4e23) +#define MF_E_VIDEO_DEVICE_LOCKED _HRESULT_TYPEDEF_(0xc00d4e24) +#define MF_E_NEW_VIDEO_DEVICE _HRESULT_TYPEDEF_(0xc00d4e25) +#define MF_E_NO_VIDEO_SAMPLE_AVAILABLE _HRESULT_TYPEDEF_(0xc00d4e26) +#define MF_E_NO_AUDIO_PLAYBACK_DEVICE _HRESULT_TYPEDEF_(0xc00d4e84) +#define MF_E_AUDIO_PLAYBACK_DEVICE_IN_USE _HRESULT_TYPEDEF_(0xc00d4e85) +#define MF_E_AUDIO_PLAYBACK_DEVICE_INVALIDATED _HRESULT_TYPEDEF_(0xc00d4e86) +#define MF_E_AUDIO_SERVICE_NOT_RUNNING _HRESULT_TYPEDEF_(0xc00d4e87) + #define MF_E_TOPO_INVALID_OPTIONAL_NODE _HRESULT_TYPEDEF_(0xc00d520e) #define MF_E_TOPO_CANNOT_FIND_DECRYPTOR _HRESULT_TYPEDEF_(0xc00d5211) #define MF_E_TOPO_CODEC_NOT_FOUND _HRESULT_TYPEDEF_(0xc00d5212) diff --git a/include/mfidl.idl b/include/mfidl.idl index df48cb3ab9..9c14c5604b 100644 --- a/include/mfidl.idl +++ b/include/mfidl.idl @@ -567,6 +567,8 @@ interface IMFSampleGrabberSinkCallback2 : IMFSampleGrabberSinkCallback }
cpp_quote("HRESULT WINAPI CreatePropertyStore(IPropertyStore **store);") +cpp_quote("HRESULT WINAPI MFCreateAudioRenderer(IMFAttributes *config, IMFMediaSink **sink);") +cpp_quote("HRESULT WINAPI MFCreateAudioRendererActivate(IMFActivate **activate);") cpp_quote("HRESULT WINAPI MFCreateMediaSession(IMFAttributes *config, IMFMediaSession **session);") cpp_quote("HRESULT WINAPI MFCreateMFByteStreamOnStream(IStream *stream, IMFByteStream **bytestream);" ) cpp_quote("HRESULT WINAPI MFCreateMFByteStreamOnStreamEx(IUnknown *stream, IMFByteStream **bytestream);")
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=57643
Your paranoid android.
=== debian10 (32 bit Chinese:China report) ===
mf: Unhandled exception: page fault on execute access to 0x00000000 in 32-bit code (0x00000000).
Report errors: mf:mf crashed (c0000005)