Playbin and changing video-sink

Sebastian Dröge sebastian at centricular.com
Sat Mar 12 11:04:35 UTC 2016


On Fr, 2016-03-11 at 20:05 +0000, Russel Winder wrote:
> I start a playbin. If I give it an MRL and set it to play, it plays.
> Because this is a trivial use of playbin from a trivial gtk code
> without any overlaying, the playbin starts a new window – which for
> this experiment is fine.
> 
> 	play_bin = ElementFactory.make("playbin");
> 	assert(play_bin !is null);
> 	play_bin.getBus().addWatch(delegate bool(Message m) { return onBusMessage(m); });
>> 	play_bin.setProperty("uri", Uri.isValid(path) ? path : Uri.filenameToUri(path));
> 	play_bin.setState(State.PLAYING);
> 
> OK, the potentially odd looking code syntax is because this is D code
> using the GtkD bindings to Gtk+-3 and GStreamer-1.0. The point is
> though it works entirely as expected. Until I click the close button on
> the playbin window, then I get:
> 
>     Error: Output window was closed: xvimagesink.c(555): gst_xv_image_sink_handle_xevents (): /GstPlayBin:playbin0/GstPlaySink:playsink/GstBin:vbin/GstXvImageSink:xvimagesink0
> 
>     (foscam_client:22397): Gtk-CRITICAL **: gtk_main_quit: assertion 'main_loops != NULL' failed
>     Error: GStreamer encountered a general stream error.: qtdemux.c(5319): gst_qtdemux_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
>     streaming stopped, reason error
> 
>     (foscam_client:22397): Gtk-CRITICAL **: gtk_main_quit: assertion 'main_loops != NULL' failed
> 
> Is this what should be expected? GtkD has no mention of anything qt-ish 
> for obvious reasons, so this must be happening inside GStreamer. Given
> the playbin window is being killed off, it sort of makes sense that the
> pipeline should be stopped.

qt here is quicktime, not the toolkit :)

The gtk_main_quit() assertions are something you should look into, it's
something wrong with either your GTK code or the D bindings.

The other thing is expected: when closing the window created by a video
sink, you'll get an error message. Also note that the automatically
created windows of video sinks are just there for debugging purposes,
you shouldn't use that in a real application but instead somehow create
windows/widgets yourself and embed the video in there.


>  However, if instead of terminating the
> playbin window I try to change the video-sink:
> 
> 	g_object_set(play_bin.getElementStruct(), Str.toStringz("video-sink"), video_sink.getElementStruct(), null);
> 
> and run the code, I get a "playbin" window with title "Gtk + GL
> renderer" and the message:
> 
>     Error: GStreamer encountered a general stream error.: qtdemux.c(5319): gst_qtdemux_loop (): /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecodeBin:decodebin0/GstQTDemux:qtdemux0:
>     streaming stopped, reason not-negotiated
> 
>     (foscam_client:22587): Gtk-CRITICAL **: gtk_main_quit: assertion 'main_loops != NULL' failed
> 
> very much the same message, so trying to replace the "video-sink"
> property appears to be causing the stream termination. Again is this as
> it should be?

That's surprising, changing the video sink during PLAYING should have
no effect at all until the next time you go back to READY. But in
general, changing video sinks in playbin is not supported in
PAUSED/PLAYING state. It should not fail like this though, can you
report a bug about that with a small C testcase application?
  https://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer

What is it that you're trying to do here? What's the goal of these
experiments? :)

-- 
Sebastian Dröge, Centricular Ltd · http://www.centricular.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160312/41c54f3a/attachment-0001.sig>


More information about the gstreamer-devel mailing list