Re: [client v3 4/4] streaming: Create the pipeline at the same time as the GStreamer decoder

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

On Thu, Aug 11, 2016 at 12:22:24PM +0200, Francois Gouget wrote:
> This lets create_gstreamer_decoder() fail if it cannot create the
> pipeline it needs, allowing the caller to try fallbacks.
> This also means the pipeline has the same lifetime as the decoder which
> makes it possible to remove a check in queue_frame().

Great,

>
> Signed-off-by: Francois Gouget <fgouget@xxxxxxxxxxxxxxx>
> ---
>  src/channel-display-gst.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
> 
> diff --git a/src/channel-display-gst.c b/src/channel-display-gst.c
> index c752639..647afc1 100644
> --- a/src/channel-display-gst.c
> +++ b/src/channel-display-gst.c
> @@ -407,11 +407,6 @@ static void spice_gst_decoder_queue_frame(VideoDecoder *video_decoder,
>          return;
>      }
>  
> -    if (!decoder->pipeline && !create_pipeline(decoder)) {
> -        stream_dropped_frame_on_playback(decoder->base.stream);
> -        return;
> -    }
> -
>      /* ref() the frame_msg for the buffer */
>      spice_msg_in_ref(frame_msg);
>      GstBuffer *buffer = gst_buffer_new_wrapped_full(GST_MEMORY_FLAG_PHYSICALLY_CONTIGUOUS,
> @@ -463,6 +458,12 @@ VideoDecoder* create_gstreamer_decoder(int codec_type, display_stream *stream)
>          g_mutex_init(&decoder->queues_mutex);
>          decoder->decoding_queue = g_queue_new();
>          decoder->display_queue = g_queue_new();
> +
> +        if (!create_pipeline(decoder))
> +        {

Opening brace should be in the line above

> +            decoder->base.destroy((VideoDecoder*)decoder);
> +            decoder = NULL;
> +        }

I'll do the change and push the series. Many thanks!

Acked-by: Victor Toso <victortoso@xxxxxxxxxx>

>      }
>  
>      return (VideoDecoder*)decoder;
> @@ -475,7 +476,7 @@ gboolean gstvideo_has_codec(int codec_type)
>  
>      VideoDecoder *decoder = create_gstreamer_decoder(codec_type, NULL);
>      if (decoder) {
> -        has_codec = create_pipeline((SpiceGstDecoder*)decoder);
> +        has_codec = TRUE;
>          decoder->destroy(decoder);
>      }
>  
> -- 
> 2.8.1
> _______________________________________________
> Spice-devel mailing list
> Spice-devel@xxxxxxxxxxxxxxxxxxxxx
> https://lists.freedesktop.org/mailman/listinfo/spice-devel
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]