[Spice-devel] [client v14 29/29] spice-gtk: Use decodebin as a fallback for the GStreamer video decoder

Pavel Grunt pgrunt at redhat.com
Tue May 17 07:24:24 UTC 2016


On Wed, 2016-05-04 at 11:45 +0200, Francois Gouget wrote:
> This means future video codecs may be supported automatically.
> One can also force usage of decodebin by setting $SPICE_GSTVIDEO_AUTO.
> 
> Signed-off-by: Francois Gouget <fgouget at codeweavers.com>
> ---
>  src/channel-display-gst.c | 16 ++++++++++++++--
>  1 file changed, 14 insertions(+), 2 deletions(-)
> 
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index 8934371..0253367 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -245,8 +245,20 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder)
>          gstdec_name = "h264parse ! avdec_h264";
>          break;
>      default:
> -        spice_warning("Unknown codec type %d", decoder->base.codec_type);
> -        return -1;
> +        SPICE_DEBUG("Unknown codec type %d. Trying decodebin.",
> +                    decoder->base.codec_type);
> +        src_caps = "";
> +        gstdec_name = NULL;
> +        break;
> +    }
> +
> +    /* decodebin will use vaapi if installed, which for a time could
> +     * intentionally crash the application. So only use decodebin as a
> +     * fallback or when SPICE_GSTVIDEO_AUTO is set.
> +     * See: https://bugs.freedesktop.org/show_bug.cgi?id=90884
> +     */
> +    if (!gstdec_name || getenv("SPICE_GSTVIDEO_AUTO")) {
I would use g_getenv() and explicit comparison to NULL.
I can change it before pushing.

Acked-by: Pavel Grunt <pgrunt at redhat.com>
> +        gstdec_name = "decodebin";
>      }
>  
>      /* - We schedule the frame display ourselves so set sync=false on appsink


More information about the Spice-devel mailing list