After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 592270 - Cannot catch 'have-ns-view' on pipeline for playbin and playbin2
Cannot catch 'have-ns-view' on pipeline for playbin and playbin2
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-good
git master
Other Mac OS
: Normal major
: 0.10.23
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-08-18 22:38 UTC by alexey sidorov
Modified: 2010-05-11 09:15 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description alexey sidorov 2009-08-18 22:38:17 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)
)
Comment 1 alexey sidorov 2009-08-18 22:38:58 UTC
Reproduced on Mac OSX 10.5.6
Comment 2 Sebastian Dröge (slomo) 2009-08-19 13:30:38 UTC
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...
Comment 3 Tim-Philipp Müller 2009-08-19 15:37:21 UTC
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..
Comment 4 Julien Isorce 2009-08-20 20:34:16 UTC
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
Comment 5 alexey sidorov 2009-08-21 21:12:43 UTC
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 :)
Comment 6 alexey sidorov 2009-08-21 21:19:00 UTC
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)?
Comment 7 Alessandro Decina 2010-05-11 08:59:48 UTC
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.