[Spice-devel] [spice v13 10/29] server: Handle and recover from GStreamer encoding errors

Francois Gouget fgouget at codeweavers.com
Wed May 11 10:55:06 UTC 2016


On Wed, 4 May 2016, Christophe Fergeau wrote:

> On Wed, May 04, 2016 at 12:03:57PM +0200, Christophe Fergeau wrote:
> > Ugh that's bad :( Using gst_message_new_request_state() might avoid
> > this, but while the GstAppSink element is blocked waiting for data, I
> > don't know if state changes are going to be handled (ie I'm not sure
> > about GStreamer threading model and which thread the state change is
> > going to come from). I can try asking on #gstreamer if needed.
> 
> Looking at the code, GST_MESSAGE_REQUEST_STATE_CHANGE does not seem to
> be used within GStreamer. GstBin looks at EOS message though from the
> thread GstBus runs in (I think), and GstAppSink also handles this
> message, so maybe we could use EOS to recover from errors?

I tried sending an EOS from handle_pipeline_message() but it does 
not work.

Sending the EOS seems to work but then I get the following messages and 
pull_buffer/pull_sample() never returns:

(Xorg:19764): Spice-WARNING **: gstreamer-encoder.c:809:handle_pipeline_message: GStreamer error from element encoder: Can not initialize x264 encoder.
gstreamer-encoder.c:809:handle_pipeline_message: GStreamer error from element encoder: Can not initialize x264 encoder.
gstreamer-encoder.c:811:handle_pipeline_message: debug details: gstx264enc.c(1269): gst_x264_enc_init_encoder (): /GstPipeline:pipeline3/GstX264Enc:encoder
[...]
(Xorg:19764): Spice-WARNING **: gstreamer-encoder.c:809:handle_pipeline_message: GStreamer error from element src: Internal data flow error.
gstreamer-encoder.c:809:handle_pipeline_message: GStreamer error from element src: Internal data flow error.
gstreamer-encoder.c:811:handle_pipeline_message: debug details: gstbasesrc.c(2625): gst_base_src_loop (): /GstPipeline:pipeline3/GstAppSrc:src:
streaming task paused, reason not-negotiated (-4)
[...]
0:00:00.736257174 19764 0x7f64807fd540 DEBUG               basesink gstbasesink.c:2277:gst_base_sink_wait_preroll:<sink> waiting in preroll for flush or PLAYING

(full log at http://fgouget.free.fr/tmp/Xspice-eos.log.xz)


My understanding is that x264enc did not like the first frame, so the 
pipeline remained in preroll, a state in which an EOS cannot be sent.

I also tried variants like sending a gst_event_new_flush_stop() event 
but the send operation failed altogether (and had no effect obviously).

See the attachment for reference.


-- 
Francois Gouget <fgouget at codeweavers.com>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: eos.diff
Type: text/x-diff
Size: 3599 bytes
Desc: eos.diff
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160511/07bc756c/attachment.diff>


More information about the Spice-devel mailing list