GNOME Bugzilla – Bug 604280
fpsdisplaysink: allow access to internal video sink used
Last modified: 2009-12-16 21:43:34 UTC
The fpsdisplaysink uses an internal video sink, hardcoded, xvimagesink. It would be nice to be able to change this both from pipeline description and from a program like: GstElement* sink = gst_element_factory_make("mysink", "sink"); g_object_set(G_OBJECT(fps_sink), "video-sink", sink, NULL); or with gst-launch videotestsrc ! fpsdisplaysink video-sink-name=foo Proposal is to add 2 properties in the sink, video-sink and video-sink-name to allow above 2 use-cases.
Created attachment 149519 [details] [review] fpsdisplaysink: expose video sink using properties
The "video-sink-name" property should not be needed, and we don't have this in playbin/elsewhere either.. gst-launch-0.10 blabla ! fpsdisplaysink video-sink="xvimagesink optionalpropertyfoo=bar" should work automagically with recent core versions.
Created attachment 149527 [details] [review] fpsdisplaysink: expose video sink using a property
Created attachment 149535 [details] [review] fpsdisplaysink: expose video sink using a property Previous patch was producing warnings because I was setting the sync property on the video-sink bin. I now iterate on the sinks of the bin.
Created attachment 149559 [details] [review] updated patch Fixed the build and changed the default sink to autovideosink instead of xvimagesink. Would that be considered a behavior break?
Using autovideosink sounds good to me :)
FIxed. Module: gst-plugins-bad Branch: master Commit: 4111d6321f140eb7790620ab42e5cf1d9413b56a URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=4111d6321f140eb7790620ab42e5cf1d9413b56a Author: Philippe Normand <phil@base-art.net> Date: Thu Dec 10 22:49:13 2009 -0300 fpsdisplaysink: expose video sink using a property Exposes the internally used sink as video-sink property and makes the default one to be autovideosink instead of the hardcoded xvimagesink Fixes #604280
Review of attachment 149559 [details] [review]: commited
I get this warning: GLib-GObject-WARNING **: IA__g_object_set_valist: object class `GstAutoVideoSink' has no property named `sync' and indeed autovideosink has no sync property. Should we reopen this bug or open a bug for autovideosink?
I guess we should reopen and add the property to autovideosink
Another thing here is that, as the user can set any sink he wants with the property, setting the sync property on them might raise the warning. Is there a way to check if a property exists?
Created attachment 149755 [details] [review] fpsdisplaysink: check the sync property exists on embedded sink(s) Follow-up on 4111d6321f140eb7790620ab42e5cf1d9413b56a, the video sink(s) used by fpsdisplaysink might not have the sync property. So we check its existence to avoid warning from g_object_set() at runtime.
Pushed your patch + another one to make sync work with autovideosink. Hopefully closing this forever now. Module: gst-plugins-bad Branch: master Commit: 9c03149e7b8375388ab779f2f51a3dbbab57f7bb URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=9c03149e7b8375388ab779f2f51a3dbbab57f7bb Author: Philippe Normand <phil@base-art.net> Date: Tue Dec 15 13:08:08 2009 +0100 fpsdisplaysink: check the sync property exists on embedded sink(s) Follow-up on 4111d6321f140eb7790620ab42e5cf1d9413b56a, the video sink(s) used by fpsdisplaysink might not have the sync property. So we check its existence to avoid warning from g_object_set() at runtime. Fixes #604280 Module: gst-plugins-bad Branch: master Commit: d2dce72c602465654ba45145f695cc427c052c50 URL: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/commit/?id=d2dce72c602465654ba45145f695cc427c052c50 Author: Thiago Santos <thiago.sousa.santos@collabora.co.uk> Date: Wed Dec 16 18:32:42 2009 -0300 fpsdisplaysink: fix setting sync on child bin Use GST_IS_BIN instead of G_OBJECT_TYPE to check if the internal sink is a bin. Using the later won't work when the sink is not a bin directly (but inherits from one, like autovideosink). Fixes #604280
Comment on attachment 149755 [details] [review] fpsdisplaysink: check the sync property exists on embedded sink(s) Committed with micro changes