[Spice-devel] [PATCH spice-server] gstreamer: Include only needed fields in SpiceFormatForGStreamer structure

Christophe Fergeau cfergeau at redhat.com
Fri Jan 27 10:19:06 UTC 2017


On Thu, Jan 26, 2017 at 10:07:47PM +0000, Frediano Ziglio wrote:
> This structure is used to store format information for
> both Gstreamer 0.10 and 1.0 however the two format uses
> different fields from it.
> Use a macro to filter only needed fields.
> This currently also fixes a compile error using Gstreamer 0.10.

What is it?

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/gstreamer-encoder.c | 23 +++++++++++++++++------
>  1 file changed, 17 insertions(+), 6 deletions(-)
> 
> diff --git a/server/gstreamer-encoder.c b/server/gstreamer-encoder.c
> index 35573bd..cd9e627 100644
> --- a/server/gstreamer-encoder.c
> +++ b/server/gstreamer-encoder.c
> @@ -42,16 +42,27 @@
>  
>  typedef struct {
>      SpiceBitmapFmt spice_format;
> +    uint32_t bpp;
> +#ifndef HAVE_GSTREAMER_0_10
>      char format[8];
>      GstVideoFormat gst_format;
> -    uint32_t bpp;
> +#else
>      uint32_t depth;
>      uint32_t endianness;
>      uint32_t blue_mask;
>      uint32_t green_mask;
>      uint32_t red_mask;
> +#endif
>  } SpiceFormatForGStreamer;
>  
> +#ifndef HAVE_GSTREAMER_0_10
> +#define FMT_DESC(sf, b, f, gf, d, end, bm, gm, rm) \
> +    { sf, b, f, gf }
> +#else
> +#define FMT_DESC(sf, b, f, gf, d, end, bm, gm, rm) \
> +    { sf, b, d, end, bm, gm, rm }
> +#endif

FMT_DESC(spice_format, bpp, format, gst_format, depth, endianness, blue_mask, green_mask, red_mask) \

Apart from this, looks good to me

Reviewed-by: Christophe Fergeau <cfergeau at redhat.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 801 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20170127/772ef702/attachment.sig>


More information about the Spice-devel mailing list