From: Charlotte Pabst cpabst@codeweavers.com
--- dlls/mfplat/tests/mfplat.c | 1 - dlls/winegstreamer/video_processor.c | 12 ++++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/dlls/mfplat/tests/mfplat.c b/dlls/mfplat/tests/mfplat.c index 92fd1f81b8f..7e018aec395 100644 --- a/dlls/mfplat/tests/mfplat.c +++ b/dlls/mfplat/tests/mfplat.c @@ -6947,7 +6947,6 @@ static void test_xvp_playback_mode(void) out_sample = create_dxgi_sample(device, 0, D3D11_BIND_RENDER_TARGET); got_out_sample = test_xvp_process_sample(xvp, in_sample, out_sample);
- todo_wine ok(got_out_sample == out_sample, "Video processor should use caller-provided sample.\n");
if (got_out_sample != out_sample) IMFSample_Release(got_out_sample); diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 3cb2c1a5bc6..347d2ca1d36 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -30,6 +30,8 @@ WINE_DECLARE_DEBUG_CHANNEL(winediag);
extern GUID MFVideoFormat_ABGR32;
+static const GUID MF_XVP_PLAYBACK_MODE = { 0x3c5d293f, 0xad67, 0x4e29, { 0xaf, 0x12, 0xcf, 0x3e, 0x23, 0x8a, 0xcc, 0xe9 } }; + static const GUID *const input_types[] = { &MFVideoFormat_IYUV, @@ -696,6 +698,7 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f MFT_OUTPUT_STREAM_INFO info; IMFSample *output_sample; HRESULT hr; + BOOL use_caller_samples;
TRACE("iface %p, flags %#lx, count %lu, samples %p, status %p.\n", iface, flags, count, samples, status);
@@ -709,7 +712,12 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f if (FAILED(hr = IMFTransform_GetOutputStreamInfo(iface, 0, &info))) return hr;
- if (impl->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) + if (FAILED(IMFAttributes_GetUINT32(impl->attributes, &MF_XVP_PLAYBACK_MODE, (UINT32 *) &use_caller_samples))) + use_caller_samples = FALSE; + + use_caller_samples = use_caller_samples || !(impl->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES); + + if (!use_caller_samples) { if (FAILED(hr = video_processor_init_allocator(impl))) return hr; @@ -727,7 +735,7 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f goto done; wg_sample_queue_flush(impl->wg_sample_queue, false);
- if (impl->output_info.dwFlags & MFT_OUTPUT_STREAM_PROVIDES_SAMPLES) + if (!use_caller_samples) { samples->pSample = output_sample; IMFSample_AddRef(output_sample);