From: Rémi Bernon rbernon@codeweavers.com
--- dlls/mf/tests/transform.c | 2 -- dlls/winegstreamer/color_convert.c | 4 ++++ dlls/winegstreamer/h264_decoder.c | 4 ++++ dlls/winegstreamer/resampler.c | 4 ++++ dlls/winegstreamer/video_processor.c | 4 ++++ dlls/winegstreamer/wma_decoder.c | 10 +++++++--- 6 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index d088bead46a..9756cd29070 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -278,7 +278,6 @@ static void check_mft_set_input_type_required_(int line, IMFTransform *transform hr = IMFTransform_SetInputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); ok_(__FILE__, line)(hr == S_OK, "SetInputType returned %#lx.\n", hr); ref = IMFMediaType_Release(media_type); - todo_wine_if(ref == 1) ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref); }
@@ -309,7 +308,6 @@ static void check_mft_set_output_type_required_(int line, IMFTransform *transfor hr = IMFTransform_SetOutputType(transform, 0, media_type, MFT_SET_TYPE_TEST_ONLY); ok_(__FILE__, line)(hr == S_OK, "SetOutputType returned %#lx.\n", hr); ref = IMFMediaType_Release(media_type); - todo_wine_if(ref == 1) ok_(__FILE__, line)(!ref, "Release returned %lu\n", ref); }
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index b47832b2c30..81067d052f7 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -401,6 +401,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM break; if (i == ARRAY_SIZE(input_types)) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type))) return hr; @@ -444,6 +446,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF break; if (i == ARRAY_SIZE(output_types)) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type))) return hr; diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 43b8f83a20c..c6098aee302 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -419,6 +419,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM break; if (i == ARRAY_SIZE(h264_decoder_input_types)) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (decoder->output_type) { @@ -469,6 +471,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF || (frame_size >> 32) != decoder->wg_format.u.video.width || (UINT32)frame_size != decoder->wg_format.u.video.height) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (decoder->output_type) IMFMediaType_Release(decoder->output_type); diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index 65a29d96794..1d35775af68 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -383,6 +383,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM
if (FAILED(hr = check_media_type(type))) return hr; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (!impl->input_type && FAILED(hr = MFCreateMediaType(&impl->input_type))) return hr; @@ -414,6 +416,8 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF
if (FAILED(hr = check_media_type(type))) return hr; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (!impl->output_type && FAILED(hr = MFCreateMediaType(&impl->output_type))) return hr; diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index a271ca9231f..4094ecd2bdd 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -376,6 +376,8 @@ static HRESULT WINAPI video_processor_SetInputType(IMFTransform *iface, DWORD id break; if (i == ARRAY_SIZE(input_types)) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (impl->input_type) IMFMediaType_Release(impl->input_type); @@ -413,6 +415,8 @@ static HRESULT WINAPI video_processor_SetOutputType(IMFTransform *iface, DWORD i break; if (i == ARRAY_SIZE(output_types)) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (impl->output_type) IMFMediaType_Release(impl->output_type); diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index e2a7a770826..31fb49df1f7 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -387,6 +387,8 @@ static HRESULT WINAPI transform_SetInputType(IMFTransform *iface, DWORD id, IMFM if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_NUM_CHANNELS, &item_type)) || item_type != MF_ATTRIBUTE_UINT32) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK;
if (!decoder->input_type && FAILED(hr = MFCreateMediaType(&decoder->input_type))) return hr; @@ -443,9 +445,6 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF return hr; }
- if (FAILED(IMFMediaType_SetUINT32(decoder->input_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, sample_size))) - return MF_E_INVALIDMEDIATYPE; - if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_AVG_BYTES_PER_SECOND, &item_type)) || item_type != MF_ATTRIBUTE_UINT32) return MF_E_INVALIDMEDIATYPE; @@ -461,6 +460,11 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF if (FAILED(IMFMediaType_GetItemType(type, &MF_MT_AUDIO_BLOCK_ALIGNMENT, &item_type)) || item_type != MF_ATTRIBUTE_UINT32) return MF_E_INVALIDMEDIATYPE; + if (flags & MFT_SET_TYPE_TEST_ONLY) + return S_OK; + + if (FAILED(IMFMediaType_SetUINT32(decoder->input_type, &MF_MT_AUDIO_BITS_PER_SAMPLE, sample_size))) + return MF_E_INVALIDMEDIATYPE;
if (!decoder->output_type && FAILED(hr = MFCreateMediaType(&decoder->output_type))) return hr;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/video_processor.c | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 4094ecd2bdd..b513b1e52b5 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -667,6 +667,10 @@ HRESULT video_processor_create(REFIID riid, void **ret) return S_OK;
failed: + if (impl->output_attributes) + IMFAttributes_Release(impl->output_attributes); + if (impl->attributes) + IMFAttributes_Release(impl->attributes); free(impl); return hr; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/mf/tests/transform.c | 1 - dlls/winegstreamer/h264_decoder.c | 53 +++++++++++++++++++++++++------ 2 files changed, 43 insertions(+), 11 deletions(-)
diff --git a/dlls/mf/tests/transform.c b/dlls/mf/tests/transform.c index 9756cd29070..c5dbea290bc 100644 --- a/dlls/mf/tests/transform.c +++ b/dlls/mf/tests/transform.c @@ -2326,7 +2326,6 @@ static void test_h264_decoder(void) hr = IMFAttributes_SetUINT32(attributes, &MF_LOW_LATENCY, 1); ok(hr == S_OK, "SetUINT32 returned %#lx\n", hr); ret = IMFAttributes_Release(attributes); - todo_wine ok(ret == 1, "Release returned %ld\n", ret);
/* no output type is available before an input type is set */ diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index c6098aee302..3e29a7bafd9 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -47,6 +47,9 @@ struct h264_decoder { IMFTransform IMFTransform_iface; LONG refcount; + + IMFAttributes *attributes; + IMFAttributes *output_attributes; IMFMediaType *input_type; IMFMediaType *output_type;
@@ -238,6 +241,10 @@ static ULONG WINAPI transform_Release(IMFTransform *iface) IMFMediaType_Release(decoder->input_type); if (decoder->output_type) IMFMediaType_Release(decoder->output_type); + if (decoder->output_attributes) + IMFAttributes_Release(decoder->output_attributes); + if (decoder->attributes) + IMFAttributes_Release(decoder->attributes);
wg_sample_queue_destroy(decoder->wg_sample_queue); free(decoder); @@ -305,8 +312,15 @@ static HRESULT WINAPI transform_GetOutputStreamInfo(IMFTransform *iface, DWORD i
static HRESULT WINAPI transform_GetAttributes(IMFTransform *iface, IMFAttributes **attributes) { - FIXME("iface %p, attributes %p stub!\n", iface, attributes); - return MFCreateAttributes(attributes, 0); + struct h264_decoder *decoder = impl_from_IMFTransform(iface); + + FIXME("iface %p, attributes %p semi-stub!\n", iface, attributes); + + if (!attributes) + return E_POINTER; + + IMFAttributes_AddRef((*attributes = decoder->attributes)); + return S_OK; }
static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) @@ -315,11 +329,19 @@ static HRESULT WINAPI transform_GetInputStreamAttributes(IMFTransform *iface, DW return E_NOTIMPL; }
-static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, - IMFAttributes **attributes) +static HRESULT WINAPI transform_GetOutputStreamAttributes(IMFTransform *iface, DWORD id, IMFAttributes **attributes) { - FIXME("iface %p, id %#lx, attributes %p stub!\n", iface, id, attributes); - return E_NOTIMPL; + struct h264_decoder *decoder = impl_from_IMFTransform(iface); + + FIXME("iface %p, id %#lx, attributes %p semi-stub!\n", iface, id, attributes); + + if (!attributes) + return E_POINTER; + if (id) + return MF_E_INVALIDSTREAMNUMBER; + + IMFAttributes_AddRef((*attributes = decoder->output_attributes)); + return S_OK; }
static HRESULT WINAPI transform_DeleteInputStream(IMFTransform *iface, DWORD id) @@ -708,13 +730,24 @@ HRESULT h264_decoder_create(REFIID riid, void **ret) decoder->wg_format.u.video.fps_n = 30000; decoder->wg_format.u.video.fps_d = 1001;
+ if (FAILED(hr = MFCreateAttributes(&decoder->attributes, 16))) + goto failed; + if (FAILED(hr = IMFAttributes_SetUINT32(decoder->attributes, &MF_LOW_LATENCY, 0))) + goto failed; + if (FAILED(hr = MFCreateAttributes(&decoder->output_attributes, 0))) + goto failed; if (FAILED(hr = wg_sample_queue_create(&decoder->wg_sample_queue))) - { - free(decoder); - return hr; - } + goto failed;
*ret = &decoder->IMFTransform_iface; TRACE("Created decoder %p\n", *ret); return S_OK; + +failed: + if (decoder->output_attributes) + IMFAttributes_Release(decoder->output_attributes); + if (decoder->attributes) + IMFAttributes_Release(decoder->attributes); + free(decoder); + return hr; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/color_convert.c | 4 +++- dlls/winegstreamer/gst_private.h | 2 +- dlls/winegstreamer/h264_decoder.c | 4 +++- dlls/winegstreamer/resampler.c | 7 ++----- dlls/winegstreamer/video_processor.c | 4 +++- dlls/winegstreamer/wg_sample.c | 7 +++++-- dlls/winegstreamer/wma_decoder.c | 7 ++----- 7 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index 81067d052f7..2b8d06b991c 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -595,8 +595,10 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, return MF_E_BUFFERTOOSMALL; }
- if (SUCCEEDED(hr = wg_transform_read_mf(impl->wg_transform, wg_sample, NULL))) + if (SUCCEEDED(hr = wg_transform_read_mf(impl->wg_transform, wg_sample, NULL, + &samples[0].dwStatus))) wg_sample_queue_flush(impl->wg_sample_queue, false); + wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index 324d677ebe8..a7a1397873d 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -135,7 +135,7 @@ HRESULT wg_transform_push_mf(struct wg_transform *transform, struct wg_sample *s HRESULT wg_transform_push_quartz(struct wg_transform *transform, struct wg_sample *sample, struct wg_sample_queue *queue); HRESULT wg_transform_read_mf(struct wg_transform *transform, struct wg_sample *sample, - struct wg_format *format); + struct wg_format *format, DWORD *flags); HRESULT wg_transform_read_quartz(struct wg_transform *transform, struct wg_sample *sample);
HRESULT winegstreamer_stream_handler_create(REFIID riid, void **obj); diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 3e29a7bafd9..90ae4793392 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -641,8 +641,10 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, return MF_E_BUFFERTOOSMALL; }
- if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, wg_sample, &wg_format))) + if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, wg_sample, &wg_format, + &samples[0].dwStatus))) wg_sample_queue_flush(decoder->wg_sample_queue, false); + wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index 1d35775af68..122802d5413 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -565,12 +565,9 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, return MF_E_BUFFERTOOSMALL; }
- if (SUCCEEDED(hr = wg_transform_read_mf(impl->wg_transform, wg_sample, NULL))) - { - if (wg_sample->flags & WG_SAMPLE_FLAG_INCOMPLETE) - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_INCOMPLETE; + if (SUCCEEDED(hr = wg_transform_read_mf(impl->wg_transform, wg_sample, NULL, + &samples[0].dwStatus))) wg_sample_queue_flush(impl->wg_sample_queue, false); - }
wg_sample_release(wg_sample);
diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index b513b1e52b5..86aa2d269cf 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -571,8 +571,10 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f return MF_E_BUFFERTOOSMALL; }
- if (SUCCEEDED(hr = wg_transform_read_mf(impl->wg_transform, wg_sample, NULL))) + if (SUCCEEDED(hr = wg_transform_read_mf(impl->wg_transform, wg_sample, NULL, + &samples[0].dwStatus))) wg_sample_queue_flush(impl->wg_sample_queue, false); + wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index ae8a2d4d0c7..d8fe8662f65 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -20,6 +20,7 @@
#include "wmcodecdsp.h" #include "mfapi.h" +#include "mferror.h"
#include "wine/debug.h" #include "wine/list.h" @@ -282,12 +283,12 @@ HRESULT wg_transform_push_mf(struct wg_transform *transform, struct wg_sample *w }
HRESULT wg_transform_read_mf(struct wg_transform *transform, struct wg_sample *wg_sample, - struct wg_format *format) + struct wg_format *format, DWORD *flags) { struct sample *sample = unsafe_mf_from_wg_sample(wg_sample); HRESULT hr;
- TRACE_(mfplat)("transform %p, wg_sample %p, format %p.\n", transform, wg_sample, format); + TRACE_(mfplat)("transform %p, wg_sample %p, format %p, flags %p.\n", transform, wg_sample, format, flags);
if (FAILED(hr = wg_transform_read_data(transform, wg_sample, format))) return hr; @@ -295,6 +296,8 @@ HRESULT wg_transform_read_mf(struct wg_transform *transform, struct wg_sample *w if (FAILED(hr = IMFMediaBuffer_SetCurrentLength(sample->u.mf.buffer, wg_sample->size))) return hr;
+ if (wg_sample->flags & WG_SAMPLE_FLAG_INCOMPLETE) + *flags |= MFT_OUTPUT_DATA_BUFFER_INCOMPLETE; if (wg_sample->flags & WG_SAMPLE_FLAG_HAS_PTS) IMFSample_SetSampleTime(sample->u.mf.sample, wg_sample->pts); if (wg_sample->flags & WG_SAMPLE_FLAG_HAS_DURATION) diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 31fb49df1f7..ceb5c523506 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -591,12 +591,9 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, return MF_E_BUFFERTOOSMALL; }
- if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, wg_sample, NULL))) - { - if (wg_sample->flags & WG_SAMPLE_FLAG_INCOMPLETE) - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_INCOMPLETE; + if (SUCCEEDED(hr = wg_transform_read_mf(decoder->wg_transform, wg_sample, NULL, + &samples[0].dwStatus))) wg_sample_queue_flush(decoder->wg_sample_queue, false); - }
wg_sample_release(wg_sample);
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/color_convert.c | 4 ---- dlls/winegstreamer/resampler.c | 4 ---- dlls/winegstreamer/video_processor.c | 3 --- dlls/winegstreamer/wma_decoder.c | 4 ---- 4 files changed, 15 deletions(-)
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index 2b8d06b991c..7f3c558d21c 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -602,11 +602,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - { FIXME("Unexpected stream format change!\n"); - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - *status |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - }
return hr; } diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index 122802d5413..0ca2d714dc3 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -572,11 +572,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - { FIXME("Unexpected stream format change!\n"); - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - *status |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - }
return hr; } diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 86aa2d269cf..8a0e141a365 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -578,10 +578,7 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - { FIXME("Unexpected stream format change!\n"); - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - }
return hr; } diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index ceb5c523506..22b328479e3 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -598,11 +598,7 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, wg_sample_release(wg_sample);
if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - { FIXME("Unexpected stream format change!\n"); - samples[0].dwStatus |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - *status |= MFT_OUTPUT_DATA_BUFFER_FORMAT_CHANGE; - }
return hr; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/color_convert.c | 3 --- dlls/winegstreamer/quartz_transform.c | 2 -- dlls/winegstreamer/resampler.c | 3 --- dlls/winegstreamer/video_processor.c | 3 --- dlls/winegstreamer/wg_sample.c | 8 ++++++++ dlls/winegstreamer/wma_decoder.c | 3 --- 6 files changed, 8 insertions(+), 14 deletions(-)
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index 7f3c558d21c..763b7f241f4 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -601,9 +601,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
wg_sample_release(wg_sample);
- if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - FIXME("Unexpected stream format change!\n"); - return hr; }
diff --git a/dlls/winegstreamer/quartz_transform.c b/dlls/winegstreamer/quartz_transform.c index 30cfb7b855b..b4640b497ec 100644 --- a/dlls/winegstreamer/quartz_transform.c +++ b/dlls/winegstreamer/quartz_transform.c @@ -342,8 +342,6 @@ static HRESULT WINAPI transform_sink_receive(struct strmbase_sink *pin, IMediaSa } if (FAILED(hr)) { - if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - FIXME("Unexpected stream format change!\n"); IMediaSample_Release(output_sample); return hr; } diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index 0ca2d714dc3..f2c414e5661 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -571,9 +571,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
wg_sample_release(wg_sample);
- if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - FIXME("Unexpected stream format change!\n"); - return hr; }
diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index 8a0e141a365..ba207a8bcde 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -577,9 +577,6 @@ static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD f
wg_sample_release(wg_sample);
- if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - FIXME("Unexpected stream format change!\n"); - return hr; }
diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index d8fe8662f65..53a543fc625 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -291,7 +291,11 @@ HRESULT wg_transform_read_mf(struct wg_transform *transform, struct wg_sample *w TRACE_(mfplat)("transform %p, wg_sample %p, format %p, flags %p.\n", transform, wg_sample, format, flags);
if (FAILED(hr = wg_transform_read_data(transform, wg_sample, format))) + { + if (hr == MF_E_TRANSFORM_STREAM_CHANGE && !format) + FIXME("Unexpected stream format change!\n"); return hr; + }
if (FAILED(hr = IMFMediaBuffer_SetCurrentLength(sample->u.mf.buffer, wg_sample->size))) return hr; @@ -349,7 +353,11 @@ HRESULT wg_transform_read_quartz(struct wg_transform *transform, struct wg_sampl TRACE_(mfplat)("transform %p, wg_sample %p.\n", transform, wg_sample);
if (FAILED(hr = wg_transform_read_data(transform, wg_sample, NULL))) + { + if (hr == MF_E_TRANSFORM_STREAM_CHANGE) + FIXME("Unexpected stream format change!\n"); return hr; + }
if (FAILED(hr = IMediaSample_SetActualDataLength(sample->u.quartz.sample, wg_sample->size))) return hr; diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 22b328479e3..2951d7cac4d 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -597,9 +597,6 @@ static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags,
wg_sample_release(wg_sample);
- if (hr == MF_E_TRANSFORM_STREAM_CHANGE) - FIXME("Unexpected stream format change!\n"); - return hr; }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/wma_decoder.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 2951d7cac4d..4374f5bdcdf 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -531,6 +531,7 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS struct wma_decoder *decoder = impl_from_IMFTransform(iface); struct wg_sample *wg_sample; MFT_INPUT_STREAM_INFO info; + DWORD total_length; HRESULT hr;
TRACE("iface %p, id %lu, sample %p, flags %#lx.\n", iface, id, sample, flags); @@ -538,18 +539,16 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS if (!decoder->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (FAILED(hr = IMFTransform_GetInputStreamInfo(iface, 0, &info))) - return hr; - - if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) + if (FAILED(hr = IMFTransform_GetInputStreamInfo(iface, 0, &info)) + || FAILED(hr = IMFSample_GetTotalLength(sample, &total_length))) return hr;
/* WMA transform uses fixed size input samples and ignores samples with invalid sizes */ - if (wg_sample->size % info.cbSize) - { - wg_sample_release(wg_sample); + if (total_length % info.cbSize) return S_OK; - } + + if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) + return hr;
return wg_transform_push_mf(decoder->wg_transform, wg_sample, decoder->wg_sample_queue); }
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/color_convert.c | 4 ---- dlls/winegstreamer/h264_decoder.c | 4 ---- dlls/winegstreamer/video_processor.c | 4 ---- 3 files changed, 12 deletions(-)
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index 763b7f241f4..de8eb5bcd9a 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -545,14 +545,10 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS { struct color_convert *impl = impl_from_IMFTransform(iface); struct wg_sample *wg_sample; - MFT_INPUT_STREAM_INFO info; HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
- if (FAILED(hr = IMFTransform_GetInputStreamInfo(iface, 0, &info))) - return hr; - if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 90ae4793392..3a7576135da 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -586,14 +586,10 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS { struct h264_decoder *decoder = impl_from_IMFTransform(iface); struct wg_sample *wg_sample; - MFT_INPUT_STREAM_INFO info; HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
- if (FAILED(hr = IMFTransform_GetInputStreamInfo(iface, 0, &info))) - return hr; - if (!decoder->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index ba207a8bcde..de762aa0dbf 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -522,14 +522,10 @@ static HRESULT WINAPI video_processor_ProcessInput(IMFTransform *iface, DWORD id { struct video_processor *impl = impl_from_IMFTransform(iface); struct wg_sample *wg_sample; - MFT_INPUT_STREAM_INFO info; HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
- if (FAILED(hr = IMFTransform_GetInputStreamInfo(iface, 0, &info))) - return hr; - if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/color_convert.c | 8 +------- dlls/winegstreamer/gst_private.h | 2 +- dlls/winegstreamer/h264_decoder.c | 7 +------ dlls/winegstreamer/resampler.c | 8 +------- dlls/winegstreamer/video_processor.c | 8 +------- dlls/winegstreamer/wg_sample.c | 25 ++++++++++++++----------- dlls/winegstreamer/wma_decoder.c | 6 +----- 7 files changed, 20 insertions(+), 44 deletions(-)
diff --git a/dlls/winegstreamer/color_convert.c b/dlls/winegstreamer/color_convert.c index de8eb5bcd9a..e4fb78752b0 100644 --- a/dlls/winegstreamer/color_convert.c +++ b/dlls/winegstreamer/color_convert.c @@ -544,19 +544,13 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { struct color_convert *impl = impl_from_IMFTransform(iface); - struct wg_sample *wg_sample; - HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) - return hr; - - return wg_transform_push_mf(impl->wg_transform, wg_sample, - impl->wg_sample_queue); + return wg_transform_push_mf(impl->wg_transform, sample, impl->wg_sample_queue); }
static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, diff --git a/dlls/winegstreamer/gst_private.h b/dlls/winegstreamer/gst_private.h index a7a1397873d..8e761758da4 100644 --- a/dlls/winegstreamer/gst_private.h +++ b/dlls/winegstreamer/gst_private.h @@ -130,7 +130,7 @@ HRESULT wg_sample_create_mf(IMFSample *sample, struct wg_sample **out); HRESULT wg_sample_create_quartz(IMediaSample *sample, struct wg_sample **out); void wg_sample_release(struct wg_sample *wg_sample);
-HRESULT wg_transform_push_mf(struct wg_transform *transform, struct wg_sample *sample, +HRESULT wg_transform_push_mf(struct wg_transform *transform, IMFSample *sample, struct wg_sample_queue *queue); HRESULT wg_transform_push_quartz(struct wg_transform *transform, struct wg_sample *sample, struct wg_sample_queue *queue); diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index 3a7576135da..44c6d992b55 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -585,18 +585,13 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { struct h264_decoder *decoder = impl_from_IMFTransform(iface); - struct wg_sample *wg_sample; - HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
if (!decoder->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) - return hr; - - return wg_transform_push_mf(decoder->wg_transform, wg_sample, decoder->wg_sample_queue); + return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); }
static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, diff --git a/dlls/winegstreamer/resampler.c b/dlls/winegstreamer/resampler.c index f2c414e5661..a9c9ae32e8a 100644 --- a/dlls/winegstreamer/resampler.c +++ b/dlls/winegstreamer/resampler.c @@ -513,19 +513,13 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { struct resampler *impl = impl_from_IMFTransform(iface); - struct wg_sample *wg_sample; - HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) - return hr; - - return wg_transform_push_mf(impl->wg_transform, wg_sample, - impl->wg_sample_queue); + return wg_transform_push_mf(impl->wg_transform, sample, impl->wg_sample_queue); }
static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, diff --git a/dlls/winegstreamer/video_processor.c b/dlls/winegstreamer/video_processor.c index de762aa0dbf..fcbccb3c3ef 100644 --- a/dlls/winegstreamer/video_processor.c +++ b/dlls/winegstreamer/video_processor.c @@ -521,19 +521,13 @@ static HRESULT WINAPI video_processor_ProcessMessage(IMFTransform *iface, MFT_ME static HRESULT WINAPI video_processor_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { struct video_processor *impl = impl_from_IMFTransform(iface); - struct wg_sample *wg_sample; - HRESULT hr;
TRACE("iface %p, id %#lx, sample %p, flags %#lx.\n", iface, id, sample, flags);
if (!impl->wg_transform) return MF_E_TRANSFORM_TYPE_NOT_SET;
- if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) - return hr; - - return wg_transform_push_mf(impl->wg_transform, wg_sample, - impl->wg_sample_queue); + return wg_transform_push_mf(impl->wg_transform, sample, impl->wg_sample_queue); }
static HRESULT WINAPI video_processor_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count, diff --git a/dlls/winegstreamer/wg_sample.c b/dlls/winegstreamer/wg_sample.c index 53a543fc625..4dcac74348e 100644 --- a/dlls/winegstreamer/wg_sample.c +++ b/dlls/winegstreamer/wg_sample.c @@ -252,28 +252,31 @@ HRESULT wg_transform_push_data(struct wg_transform *transform, struct wg_sample HRESULT wg_transform_read_data(struct wg_transform *transform, struct wg_sample *sample, struct wg_format *format);
-HRESULT wg_transform_push_mf(struct wg_transform *transform, struct wg_sample *wg_sample, +HRESULT wg_transform_push_mf(struct wg_transform *transform, IMFSample *sample, struct wg_sample_queue *queue) { - struct sample *sample = unsafe_mf_from_wg_sample(wg_sample); + struct wg_sample *wg_sample; LONGLONG time, duration; UINT32 value; HRESULT hr;
- TRACE_(mfplat)("transform %p, wg_sample %p, queue %p.\n", transform, wg_sample, queue); + TRACE_(mfplat)("transform %p, sample %p, queue %p.\n", transform, sample, queue); + + if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) + return hr;
- if (SUCCEEDED(IMFSample_GetSampleTime(sample->u.mf.sample, &time))) + if (SUCCEEDED(IMFSample_GetSampleTime(sample, &time))) { - sample->wg_sample.flags |= WG_SAMPLE_FLAG_HAS_PTS; - sample->wg_sample.pts = time; + wg_sample->flags |= WG_SAMPLE_FLAG_HAS_PTS; + wg_sample->pts = time; } - if (SUCCEEDED(IMFSample_GetSampleDuration(sample->u.mf.sample, &duration))) + if (SUCCEEDED(IMFSample_GetSampleDuration(sample, &duration))) { - sample->wg_sample.flags |= WG_SAMPLE_FLAG_HAS_DURATION; - sample->wg_sample.duration = duration; + wg_sample->flags |= WG_SAMPLE_FLAG_HAS_DURATION; + wg_sample->duration = duration; } - if (SUCCEEDED(IMFSample_GetUINT32(sample->u.mf.sample, &MFSampleExtension_CleanPoint, &value)) && value) - sample->wg_sample.flags |= WG_SAMPLE_FLAG_SYNC_POINT; + if (SUCCEEDED(IMFSample_GetUINT32(sample, &MFSampleExtension_CleanPoint, &value)) && value) + wg_sample->flags |= WG_SAMPLE_FLAG_SYNC_POINT;
wg_sample_queue_begin_append(queue, wg_sample); hr = wg_transform_push_data(transform, wg_sample); diff --git a/dlls/winegstreamer/wma_decoder.c b/dlls/winegstreamer/wma_decoder.c index 4374f5bdcdf..6d8917c9c07 100644 --- a/dlls/winegstreamer/wma_decoder.c +++ b/dlls/winegstreamer/wma_decoder.c @@ -529,7 +529,6 @@ static HRESULT WINAPI transform_ProcessMessage(IMFTransform *iface, MFT_MESSAGE_ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFSample *sample, DWORD flags) { struct wma_decoder *decoder = impl_from_IMFTransform(iface); - struct wg_sample *wg_sample; MFT_INPUT_STREAM_INFO info; DWORD total_length; HRESULT hr; @@ -547,10 +546,7 @@ static HRESULT WINAPI transform_ProcessInput(IMFTransform *iface, DWORD id, IMFS if (total_length % info.cbSize) return S_OK;
- if (FAILED(hr = wg_sample_create_mf(sample, &wg_sample))) - return hr; - - return wg_transform_push_mf(decoder->wg_transform, wg_sample, decoder->wg_sample_queue); + return wg_transform_push_mf(decoder->wg_transform, sample, decoder->wg_sample_queue); }
static HRESULT WINAPI transform_ProcessOutput(IMFTransform *iface, DWORD flags, DWORD count,