[PATCH v4 4/5] winegstreamer: Append audioconvert and audioresample elements.

Rémi Bernon rbernon at codeweavers.com
Tue Feb 22 12:07:47 CST 2022


On 2/22/22 18:43, Zebediah Figura wrote:
>   
> +    switch (output_format.major_type)
> +    {
> +        case WG_MAJOR_TYPE_AUDIO:
> +            /* 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"))
> +                    || !transform_append_element(transform, element, &first, &last))
> +                goto out_stop_container;
> +            if (!(element = create_element("audioresample", "base"))
> +                    || !transform_append_element(transform, element, &first, &last))
> +                goto out_stop_container;
> +            break;
> +
> +        case WG_MAJOR_TYPE_VIDEO:
> +        case WG_MAJOR_TYPE_WMA:
> +        case WG_MAJOR_TYPE_UNKNOWN:
> +            GST_FIXME("Format %u not implemented!", output_format.major_type);
> +            goto out_stop_container;
> +    }
> +
>       gst_caps_unref(sink_caps);
>       gst_caps_unref(src_caps);
>   

I'm not sure which one is right, but starting the bin before appending 
the elements, and in a later patch getting the elements pads, linking 
them with ours and activating them, causes the pipeline to fail to run.

Starting the bin only after everything is setup, like it was done in the 
previous version worked.

Also, in a later patch and for H264 we will want to modify sink_caps to 
remove frame size information, I was doing it in this switch but that 
won't work if it's below my_sink creation.

-- 
Rémi Bernon <rbernon at codeweavers.com>



More information about the wine-devel mailing list