Playbin and changing video-sink
Russel Winder
russel at winder.org.uk
Fri Mar 11 20:05:00 UTC 2016
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. 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?
(I am more or less assuming I am doing something wrong in controlling
the GStreamer subsystem, the GtkD binding is auto generated via the GIR
stuff.
--
Russel.
=============================================================================
Dr Russel Winder t: +44 20 7585 2200 voip: sip:russel.winder at ekiga.net
41 Buckmaster Road m: +44 7770 465 077 xmpp: russel at winder.org.uk
London SW11 1EN, UK w: www.russel.org.uk skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20160311/c3e51cb6/attachment.sig>
More information about the gstreamer-devel
mailing list