GNOME Bugzilla – Bug 592270
Cannot catch 'have-ns-view' on pipeline for playbin and playbin2
Last modified: 2010-05-11 09:15:59 UTC
// Was reproducedwith code like this : GstElement* m_pipeline = gst_element_factory_make("playbin2", "pipeline"); GstElement* videosink = gst_element_factory_make("osxvideosink", "vsink"); g_object_set(m_pipeline, "video-sink", videosink, NULL); GstBus* bus = gst_element_get_bus(m_pipeline); gst_bus_set_sync_handler(GST_BUS(bus), GstMessageDispatcher, static_cast<Pipeline*>(this)); g_object_unref(GST_OBJECT(bus)); I never get in my Sync handler message with "have-ns-view". The reason is when playbin is trying to use my videosink it calls gst_element_set_state(elem, GST_STATE_READY) before element has been added to playbin. ( see: for playbin : gstplaybin.c in func 'get_video_element' (line 868) for playbin2: gstplaysink.c in func 'try_element' (line 837) )
Reproduced on Mac OSX 10.5.6
Right, playbin(2) should probably add the video sink before changing it's state and remove it again if the state change fails. Or it should install some custom bus until it is added and cache events from there. I guess the first is easier but might give other problems, not sure...
Or maybe osxvideosink posts the message too early? (NULL->READY state change rather than during READY->PAUSED) Is the ns-view thing needed already when opening/initing the output on OSX? Not saying playbin2 shouldn't be fixed/changed, just wondering..
Alexey, Hi, I am convinced that this issue has to be fixed but could you try to use glimagesink (using it in the normal way described there: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gst-plugins-base-libs-gstxoverlay.html) If it does not work, could you send me your test app ? Note that glimagesink is really experimental on MacOSX (I did some updates in GIT one month ago). Julien
Thanks for help. Yes, state changing is too early in both playbin and playbin2. But I have fixed this issue... I just comment out state changing for video bin in from NULL to ready in get_video_element function. This is HACK but works for me. So I am Happy :)
I think we have logical error here. Why playbin is changing state from NULL to READY on a video bin if it is not connected to main bus (i.e. not added to playbin itself)?
This was fixed a while ago. The view is now created in READY_TO_PAUSED. commit b9ca852b510d0d0486db098fbaf23641f8a54015 Author: Michael Smith <msmith@songbirdnest.com> Date: Thu Feb 5 10:19:37 2009 -0800 osxvideosink: remove non-embedded mode and fix memory management. Remove non-embedded mode. Embed mode becomes default and only mode. embed property is retained for binary compatibility. Added autorelease pools around all objc functions that might be called from a non-main thread.