Rémi Bernon (@rbernon) commented about dlls/winegstreamer/wg_transform.c:
goto out;
} else {if (!transform_create_encoder_elements(transform, output_mime, &first, &last)) goto out;
if (!(element = create_element("videoconvert", "base"))
|| !append_element(transform->container, element, &first, &last))
GST_ERROR("Unsupported transform from %s to %s.", input_mime, output_mime); goto out;
/* Let GStreamer choose a default number of threads. */
gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0");
}
}
if (!link_src_to_element(transform->my_src, first))
What about just removing the raw checks and adding the encoder elements inline here?
```diff diff --git a/dlls/winegstreamer/wg_transform.c b/dlls/winegstreamer/wg_transform.c index 76dbd347064..3de478e893e 100644 --- a/dlls/winegstreamer/wg_transform.c +++ b/dlls/winegstreamer/wg_transform.c @@ -561,46 +561,37 @@ NTSTATUS wg_transform_create(void *args)
if (g_str_has_prefix(output_mime, "audio/")) { - if (strcmp(output_mime, "audio/x-raw")) - { - GST_FIXME("output caps %"GST_PTR_FORMAT" not implemented!", transform->output_caps); + /* The MF audio decoder transforms allow decoding to various formats + * as well as resampling the audio at the same time, whereas + * GStreamer decoder plugins usually only support decoding to a + * single format and at the original rate. + * + * The WMA decoder transform also has output samples interleaved on + * Windows, whereas GStreamer avdec_wmav2 output uses + * non-interleaved format. + */ + if (!(element = create_element("audioconvert", "base")) + || !append_element(transform->container, element, &first, &last)) + goto out; + if (!(element = create_element("audioresample", "base")) + || !append_element(transform->container, element, &first, &last)) goto out; - } - else - { - /* The MF audio decoder transforms allow decoding to various formats - * as well as resampling the audio at the same time, whereas - * GStreamer decoder plugins usually only support decoding to a - * single format and at the original rate. - * - * The WMA decoder transform also has output samples interleaved on - * Windows, whereas GStreamer avdec_wmav2 output uses - * non-interleaved format. - */ - if (!(element = create_element("audioconvert", "base")) - || !append_element(transform->container, element, &first, &last)) - goto out; - if (!(element = create_element("audioresample", "base")) - || !append_element(transform->container, element, &first, &last)) - goto out; - } }
if (g_str_has_prefix(output_mime, "video/")) { - if (strcmp(output_mime, "video/x-raw")) - { - GST_FIXME("output caps %"GST_PTR_FORMAT" not implemented!", transform->output_caps); + if (!(element = create_element("videoconvert", "base")) + || !append_element(transform->container, element, &first, &last)) + goto out; + /* Let GStreamer choose a default number of threads. */ + gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0"); + } + + if (strcmp(output_mime, "audio/x-raw") && strcmp(output_mime, "video/x-raw")) + { + if (!(element = find_element(GST_ELEMENT_FACTORY_TYPE_ENCODER, NULL, transform->output_caps)) + || !append_element(transform->container, element, &first, &last)) goto out; - } - else - { - if (!(element = create_element("videoconvert", "base")) - || !append_element(transform->container, element, &first, &last)) - goto out; - /* Let GStreamer choose a default number of threads. */ - gst_util_set_object_arg(G_OBJECT(element), "n-threads", "0"); - } }
if (!link_src_to_element(transform->my_src, first)) ```