From: Rémi Bernon rbernon@codeweavers.com
--- dlls/winegstreamer/h264_decoder.c | 13 +------------ dlls/winegstreamer/unixlib.h | 1 + dlls/winegstreamer/wg_transform.c | 4 ++++ 3 files changed, 6 insertions(+), 12 deletions(-)
diff --git a/dlls/winegstreamer/h264_decoder.c b/dlls/winegstreamer/h264_decoder.c index ec1dd593b18..bf691a2e25c 100644 --- a/dlls/winegstreamer/h264_decoder.c +++ b/dlls/winegstreamer/h264_decoder.c @@ -89,6 +89,7 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder) { .output_plane_align = 15, .input_queue_length = 15, + .allow_size_change = TRUE, }; struct wg_format input_format; struct wg_format output_format; @@ -106,12 +107,6 @@ static HRESULT try_create_wg_transform(struct h264_decoder *decoder) if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN) return MF_E_INVALIDMEDIATYPE;
- /* Don't force any specific size, H264 streams already have the metadata for it - * and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later. - */ - output_format.u.video.width = 0; - output_format.u.video.height = 0; - if (SUCCEEDED(IMFAttributes_GetUINT32(decoder->attributes, &MF_LOW_LATENCY, &low_latency))) attrs.low_latency = !!low_latency;
@@ -545,12 +540,6 @@ static HRESULT WINAPI transform_SetOutputType(IMFTransform *iface, DWORD id, IMF struct wg_format output_format; mf_media_type_to_wg_format(decoder->output_type, &output_format);
- /* Don't force any specific size, H264 streams already have the metadata for it - * and will generate a MF_E_TRANSFORM_STREAM_CHANGE result later. - */ - output_format.u.video.width = 0; - output_format.u.video.height = 0; - if (output_format.major_type == WG_MAJOR_TYPE_UNKNOWN || !wg_transform_set_output_format(decoder->wg_transform, &output_format)) { diff --git a/dlls/winegstreamer/unixlib.h b/dlls/winegstreamer/unixlib.h index 516fc19b4e3..4ec9fce515e 100644 --- a/dlls/winegstreamer/unixlib.h +++ b/dlls/winegstreamer/unixlib.h @@ -336,6 +336,7 @@ struct wg_transform_attrs { UINT32 output_plane_align; UINT32 input_queue_length; + BOOL allow_size_change; BOOL low_latency; };
diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 320ee76438e..516b28e82e2 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -193,7 +193,11 @@ static GstCaps *transform_format_to_caps(struct wg_transform *transform, const s struct wg_format copy = *format;
if (format->major_type == WG_MAJOR_TYPE_VIDEO) + { + if (transform->attrs.allow_size_change) + copy.u.video.width = copy.u.video.height = 0; copy.u.video.fps_n = copy.u.video.fps_d = 0; + }
return wg_format_to_caps(©); }