mf: Adjust sample grabber sink flags in rateless mode.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Nikolay Sivov 2019-10-08 15:58:56 +03:00 committed by Alexandre Julliard
parent c1c77f22bc
commit d5b79e6a79
2 changed files with 28 additions and 0 deletions

View File

@ -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;
}

View File

@ -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);
}