[Spice-devel] [spice-gtk v1 1/4] channel-display-gst: style changes in create_pipeline

Victor Toso lists at victortoso.com
Wed Oct 19 12:16:19 UTC 2016


Hi,

On Wed, Oct 19, 2016 at 06:26:17AM -0400, Frediano Ziglio wrote:
> > 
> > From: Victor Toso <me at victortoso.com>
> > 
> > Move declaration of variable to top and break big g_strdup_printf
> > line.
> > 
> > Signed-off-by: Victor Toso <victortoso at redhat.com>
> > ---
> >  src/channel-display-gst.c | 13 ++++++++++---
> >  1 file changed, 10 insertions(+), 3 deletions(-)
> > 
> > diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> > index 430bb95..de774f2 100644
> > --- a/src/channel-display-gst.c
> > +++ b/src/channel-display-gst.c
> > @@ -250,6 +250,10 @@ static void free_pipeline(SpiceGstDecoder *decoder)
> >  static gboolean create_pipeline(SpiceGstDecoder *decoder)
> >  {
> >      const gchar *src_caps, *gstdec_name;
> > +    gchar *desc;
> > +    GstAppSinkCallbacks appsink_cbs = { 0 };
> > +    GError *err = NULL;
> > +
> >      switch (decoder->base.codec_type) {
> >      case SPICE_VIDEO_CODEC_TYPE_MJPEG:
> >          src_caps = "caps=image/jpeg";
> > @@ -293,10 +297,12 @@ static gboolean create_pipeline(SpiceGstDecoder
> > *decoder)
> >       * - Set max-bytes=0 on appsrc so it does not drop frames that may be
> >       *   needed by those that follow.
> >       */
> > -    gchar *desc = g_strdup_printf("appsrc name=src is-live=true format=time
> > max-bytes=0 block=true %s ! %s ! videoconvert ! appsink name=sink
> > caps=video/x-raw,format=BGRx sync=false drop=false", src_caps, gstdec_name);
> > +    desc = g_strdup_printf("appsrc name=src is-live=true format=time
> > max-bytes=0 block=true "
> > +                           "%s ! %s ! videoconvert ! appsink name=sink "
> > +                           "caps=video/x-raw,format=BGRx sync=false
> > drop=false",
> > +                           src_caps, gstdec_name);
> >      SPICE_DEBUG("GStreamer pipeline: %s", desc);
> >  
> > -    GError *err = NULL;
> >      decoder->pipeline = gst_parse_launch_full(desc, NULL,
> >      GST_PARSE_FLAG_FATAL_ERRORS, &err);
> >      g_free(desc);
> >      if (!decoder->pipeline) {
> > @@ -307,7 +313,8 @@ static gboolean create_pipeline(SpiceGstDecoder *decoder)
> >  
> >      decoder->appsrc =
> >      GST_APP_SRC(gst_bin_get_by_name(GST_BIN(decoder->pipeline), "src"));
> >      decoder->appsink =
> >      GST_APP_SINK(gst_bin_get_by_name(GST_BIN(decoder->pipeline), "sink"));
> > -    GstAppSinkCallbacks appsink_cbs = {NULL, NULL, &new_sample, {NULL}};
> > +
> > +    appsink_cbs.new_sample = &new_sample;
> 
> I would remove the & before new_sample, all other code does not use
> this syntax.

Fixed!

>
> >      gst_app_sink_set_callbacks(decoder->appsink, &appsink_cbs, decoder,
> >      NULL);
> >  
> >      decoder->clock =
> >      gst_pipeline_get_clock(GST_PIPELINE(decoder->pipeline));
> 
> Frediano
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
-------------- 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/20161019/5cf81ebb/attachment.sig>


More information about the Spice-devel mailing list