From: Yuxuan Shui yshui@codeweavers.com
--- dlls/mf/tests/transform.c | 8 ++++++++ 1 file changed, 8 insertions(+)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index e6ff4a0836d..1ee5a8bc4ac 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -8355,6 +8355,14 @@ static void test_wmv_decoder_media_object(void) diff = check_dmo_output_data_buffer(&output_data_buffer, &output_buffer_desc_nv12, L"nv12frame.bmp", 0, 300000); ok(diff == 0, "Got %lu%% diff.\n", diff);
+ output_media_buffer->length = 0; + output_data_buffer.pBuffer = &output_media_buffer->IMediaBuffer_iface; + output_data_buffer.dwStatus = 0xdeadbeef; + output_data_buffer.rtTimestamp = 0xdeadbeef; + output_data_buffer.rtTimelength = 0xdeadbeef; + hr = IMediaObject_ProcessOutput(media_object, 0, 1, &output_data_buffer, &status); + todo_wine ok(hr == S_FALSE, "ProcessOutput returned %#lx.\n", hr); + hr = IMediaObject_AllocateStreamingResources(media_object); ok(hr == S_OK, "Got hr %#lx.\n", hr); hr = IMediaObject_FreeStreamingResources(media_object);
From: Yuxuan Shui yshui@codeweavers.com
--- dlls/mf/tests/transform.c | 3 +-- dlls/winegstreamer/wg_sample.c | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 1ee5a8bc4ac..e5c65ace228 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -8328,7 +8328,6 @@ static void test_wmv_decoder_media_object(void) output_data_buffer.rtTimestamp = 0xdeadbeef; output_data_buffer.rtTimelength = 0xdeadbeef; hr = IMediaObject_ProcessOutput(media_object, 0, 1, &output_data_buffer, &status); - todo_wine ok(hr == S_FALSE, "ProcessOutput returned %#lx.\n", hr); ok(output_media_buffer->length == 0, "Unexpected length %#lx.\n", output_media_buffer->length);
@@ -8361,7 +8360,7 @@ static void test_wmv_decoder_media_object(void) output_data_buffer.rtTimestamp = 0xdeadbeef; output_data_buffer.rtTimelength = 0xdeadbeef; hr = IMediaObject_ProcessOutput(media_object, 0, 1, &output_data_buffer, &status); - todo_wine ok(hr == S_FALSE, "ProcessOutput returned %#lx.\n", hr); + ok(hr == S_FALSE, "ProcessOutput returned %#lx.\n", hr);
hr = IMediaObject_AllocateStreamingResources(media_object); ok(hr == S_OK, "Got hr %#lx.\n", hr); diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index 2fc2679337f..c28d5bd6a5b 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -501,6 +501,8 @@ HRESULT wg_transform_read_dmo(wg_transform_t transform, DMO_OUTPUT_DATA_BUFFER * { if (hr == MF_E_TRANSFORM_STREAM_CHANGE) TRACE_(mfplat)("Stream format changed.\n"); + if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT) + hr = S_FALSE; wg_sample_release(wg_sample); return hr; }
Context: I was trying to make use of DMOs in `WMSyncReader`. I want to know if there is data available from a DMO decoder. Maybe there's a better way, but intuitively I call `ProcessOutput` and check if it returns `S_FALSE`.
Our DMOs return `MF_E_TRANSFORM_NEED_MORE_INPUT` which is not a documented return value for DMOs.
On Thu Nov 20 08:40:37 2025 +0000, Yuxuan Shui wrote:
Context: I was trying to make use of DMOs in `WMSyncReader`. I want to know if there is data available from a DMO decoder. Maybe there's a better way, but intuitively I call `ProcessOutput` and check if it returns `S_FALSE`. Our DMOs return `MF_E_TRANSFORM_NEED_MORE_INPUT` which is not a documented return value for DMOs.
Notes on the test case (on native):
- I also tried adding a test case calling `ProcessOutput` before any `ProcessInput` calls, and I got `E_POINTER`. Don't know what's going on there. - If I call `ProcessInput` before setting an output type, subsequent `ProcessOutput` might crash. Either c0000005, or c0000374 (heap corruption). Must messed up some internal states.
Rémi Bernon (@rbernon) commented about dlls/winegstreamer/wg_sample.c:
{ if (hr == MF_E_TRANSFORM_STREAM_CHANGE) TRACE_(mfplat)("Stream format changed.\n");
if (hr == MF_E_TRANSFORM_NEED_MORE_INPUT)hr = S_FALSE;
Several callers use SUCCEEDED(hr) after to check if a sample is returned, it will now succeed when no sample is available too and it needs to be changed.
On Thu Nov 20 09:42:00 2025 +0000, Rémi Bernon wrote:
Several callers use SUCCEEDED(hr) after to check if a sample is returned, it will now succeed when no sample is available too and it needs to be changed.
they need to be changed to `hr == S_OK` right?
On Thu Nov 20 09:44:14 2025 +0000, Yuxuan Shui wrote:
they need to be changed to `hr == S_OK` right?
That's one way, but as this function returns other MF specific return codes in other cases I think the translation from MF to DMO return code should perhaps be done in the callers.