[Spice-devel] [PATCH spice-server] Support VP9 encoder using GStreamer

Frediano Ziglio fziglio at redhat.com
Thu Jan 26 17:32:12 UTC 2017


ping

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  configure.ac               | 2 +-
>  server/gstreamer-encoder.c | 4 ++++
>  server/reds.c              | 4 +++-
>  3 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index a78b4ec..c155c35 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -142,7 +142,7 @@ AS_IF([test x"$have_smartcard" = "xyes"], [
>      AS_VAR_APPEND([SPICE_REQUIRES], [" libcacard >= 0.1.2"])
>  ])
>  
> -SPICE_PROTOCOL_MIN_VER=0.12.12
> +SPICE_PROTOCOL_MIN_VER=0.12.13
>  PKG_CHECK_MODULES([SPICE_PROTOCOL], [spice-protocol >=
>  $SPICE_PROTOCOL_MIN_VER])
>  AC_SUBST([SPICE_PROTOCOL_MIN_VER])
>  
> diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
> index 988d193..cb0af49 100644
> --- a/server/gstreamer-encoder.c
> +++ b/server/gstreamer-encoder.c
> @@ -878,6 +878,8 @@ static const gchar* get_gst_codec_name(SpiceGstEncoder
> *encoder)
>          return "vp8enc";
>      case SPICE_VIDEO_CODEC_TYPE_H264:
>          return "x264enc";
> +    case SPICE_VIDEO_CODEC_TYPE_VP9:
> +        return "vp9enc";
>      default:
>          /* gstreamer_encoder_new() should have rejected this codec type */
>          spice_warning("unsupported codec type %d",
>          encoder->base.codec_type);
> @@ -907,6 +909,7 @@ static gboolean create_pipeline(SpiceGstEncoder *encoder)
>          gstenc_opts = g_strdup("max-threads=1");
>  #endif
>          break;
> +    case SPICE_VIDEO_CODEC_TYPE_VP9:
>      case SPICE_VIDEO_CODEC_TYPE_VP8: {
>          /* See http://www.webmproject.org/docs/encoder-parameters/
>           * - Set mode/end-usage to get a constant bitrate to help with
> @@ -1694,6 +1697,7 @@ VideoEncoder *gstreamer_encoder_new(SpiceVideoCodecType
> codec_type,
>      SPICE_VERIFY(SPICE_GST_FRAME_STATISTICS_COUNT <=
>      SPICE_GST_HISTORY_SIZE);
>      spice_return_val_if_fail(codec_type == SPICE_VIDEO_CODEC_TYPE_MJPEG ||
>                               codec_type == SPICE_VIDEO_CODEC_TYPE_VP8 ||
> +                             codec_type == SPICE_VIDEO_CODEC_TYPE_VP9 ||
>                               codec_type == SPICE_VIDEO_CODEC_TYPE_H264,
>                               NULL);
>  
>      GError *err = NULL;
> diff --git a/server/reds.c b/server/reds.c
> index 3b30928..e831ab7 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -3405,7 +3405,7 @@ err:
>  
>  static const char default_renderer[] = "sw";
>  #if defined(HAVE_GSTREAMER_1_0) || defined(HAVE_GSTREAMER_0_10)
> -#define GSTREAMER_CODECS "gstreamer:mjpeg;gstreamer:h264;gstreamer:vp8;"
> +#define GSTREAMER_CODECS
> "gstreamer:mjpeg;gstreamer:h264;gstreamer:vp8;gstreamer:vp9;"
>  #else
>  #define GSTREAMER_CODECS ""
>  #endif
> @@ -3501,6 +3501,7 @@ static const EnumNames video_codec_names[] = {
>      {SPICE_VIDEO_CODEC_TYPE_MJPEG, "mjpeg"},
>      {SPICE_VIDEO_CODEC_TYPE_VP8, "vp8"},
>      {SPICE_VIDEO_CODEC_TYPE_H264, "h264"},
> +    {SPICE_VIDEO_CODEC_TYPE_VP9, "vp9"},
>      {0, NULL},
>  };
>  
> @@ -3508,6 +3509,7 @@ static const int video_codec_caps[] = {
>      SPICE_DISPLAY_CAP_CODEC_MJPEG,
>      SPICE_DISPLAY_CAP_CODEC_VP8,
>      SPICE_DISPLAY_CAP_CODEC_H264,
> +    SPICE_DISPLAY_CAP_CODEC_VP9,
>  };
>  


More information about the Spice-devel mailing list