[Spice-devel] [PATCH 1/2] channel-display-gst: Prefer playbin3 to playbin (v2)

Frediano Ziglio freddy77 at gmail.com
Fri Oct 6 08:06:10 UTC 2023


Il giorno lun 2 ott 2023 alle ore 06:41 Vivek Kasireddy
<vivek.kasireddy at intel.com> ha scritto:
>
> From: Jin Chung Teng <jin.chung.teng at intel.com>
>
> If playbin3 is available (checked in Gstreamer registry), it
> makes sense to prefer it given the major improvements and
> features it offers including the capability to handle higher
> bitrates.
>
> v2: (Frediano)
> - Cache the playbin3 is available check
> - Keep the playbin name for playbin3 element as well
>
> Cc: Frediano Ziglio <freddy77 at gmail.com>
> Cc: Dongwon Kim <dongwon.kim at intel.com>
> Cc: Hazwan Arif Mazlan <hazwan.arif.mazlan at intel.com>
> Signed-off-by: Jin Chung Teng <jin.chung.teng at intel.com>
> Signed-off-by: Vivek Kasireddy <vivek.kasireddy at intel.com>
> ---
>  src/channel-display-gst.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
>
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 36db3a3..5c9927b 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -495,11 +495,17 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder)
>      GstElement *playbin, *sink;
>      SpiceGstPlayFlags flags;
>      GstCaps *caps;
> +    static bool playbin3_supported = true;
>
> -    playbin = gst_element_factory_make("playbin", "playbin");
> +    playbin = playbin3_supported ?
> +              gst_element_factory_make("playbin3", "playbin") : NULL;
>      if (playbin == NULL) {
> -        spice_warning("error upon creation of 'playbin' element");
> -        return FALSE;
> +        playbin3_supported = false;
> +        playbin = gst_element_factory_make("playbin", "playbin");
> +        if (playbin == NULL) {
> +            spice_warning("error upon creation of 'playbin' element");
> +            return FALSE;
> +        }
>      }
>
>      /* Passing the pipeline to widget, try to get window handle and

Acked

Frediano


More information about the Spice-devel mailing list