[Spice-devel] [PATCH spice 1/3] Do not use gstreamer in default codecs if not available

Victor Toso victortoso at redhat.com
Tue Nov 15 17:36:59 UTC 2016


Hi,

On Tue, Nov 15, 2016 at 06:32:40PM +0100, Victor Toso wrote:
> Hi,
>
> On Tue, Nov 15, 2016 at 06:21:46PM +0100, Pavel Grunt wrote:
> > On Tue, 2016-11-15 at 12:10 -0500, Frediano Ziglio wrote:
> > > > 
> > > > Avoid the following warning when build with disabled gstreamer:
> > > > Spice-WARNING **: reds.c:3660:reds_set_video_codecs: spice:
> > > > unsupported video
> > > > encoder gstreamer
> > > > ---
> > > >  server/reds.c | 7 ++++++-
> > > >  1 file changed, 6 insertions(+), 1 deletion(-)
> > > > 
> > > > diff --git a/server/reds.c b/server/reds.c
> > > > index 5daf9bd..5456d22 100644
> > > > --- a/server/reds.c
> > > > +++ b/server/reds.c
> > > > @@ -3510,7 +3510,12 @@ err:
> > > >  }
> > > >  
> > > >  static const char default_renderer[] = "sw";
> > > > -static const char default_video_codecs[] =
> > > > "spice:mjpeg;gstreamer:mjpeg;gstreamer:h264;gstreamer:vp8";
> > > > +static const char default_video_codecs[] = "spice:mjpeg;"
> > > > +#if defined(HAVE_GSTREAMER_1_0) || defined(HAVE_GSTREAMER_0_10)
> > > > +
> > > > "gstreamer:mjpeg;gstreamer:h264;gstreamer:vp8";
> > > > +#else
> > > > +                                           "";
> > > > +#endif
> > > >  
> > > >  /* new interface */
> > > >  SPICE_GNUC_VISIBLE SpiceServer *spice_server_new(void)
> > > 
> > > I would use something like
> > > 
> > > 
> > > #if defined(HAVE_GSTREAMER_1_0) || defined(HAVE_GSTREAMER_0_10)
> > > #define GSTREAMER_CODECS
> > > "gstreamer:mjpeg;gstreamer:h264;gstreamer:vp8"
> > > #else
> > > #define GSTREAMER_CODECS ""
> > > #endif
> > > static const char default_video_codecs[] = "spice:mjpeg;"
> > > GSTREAMER_CODECS;
> > > 
> > > 
> > > But maybe it's just me.
> > 
> > It is more readable, i will go for it
> > 
> > > Doesn't the string ending with ';' cause problems with the parsing?
> > > 
> > It doesn't - the check for end is:
> >          while (*codecs != '\0' && *codecs != ';') {
> 
> Ii does as it will end the parser on ';' -- gstreamer bits will be lost

Or ";;" might crash the parsing code as it expects foo:bar or '/0' after
';'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20161115/924a2042/attachment-0001.sig>


More information about the Spice-devel mailing list