From 5c3f7b51ce31fdcc31a2d8ef0d3154a40c1e927d Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Tue, 21 Feb 2012 16:43:59 +0100 Subject: [PATCH 01/50] tag: xmp: Fix a build warning when compiling with asserts disabled Return a value even if the code will never be reached, to make compilers happy. https://bugzilla.gnome.org/show_bug.cgi?id=670548 --- gst-libs/gst/tag/gstxmptag.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/tag/gstxmptag.c b/gst-libs/gst/tag/gstxmptag.c index 1fb7f3945b..5a51f62cd3 100644 --- a/gst-libs/gst/tag/gstxmptag.c +++ b/gst-libs/gst/tag/gstxmptag.c @@ -173,8 +173,11 @@ xmp_tag_type_get_name (GstXmpTagType tagtype) case GstXmpTagTypeBag: return "rdf:Bag"; default: - g_assert_not_reached (); + break; } + + /* Make compiler happy */ + g_return_val_if_reached (""); } struct _PendingXmpTag From 1ac6c436e73cde5289c90f21eb79ba9845e60d75 Mon Sep 17 00:00:00 2001 From: David Schleef Date: Tue, 21 Feb 2012 16:51:35 -0800 Subject: [PATCH 02/50] autogen: workaround for gettext/automake with git Fixes: #669207. --- autogen.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autogen.sh b/autogen.sh index 4a4a8f40c4..9b384635d5 100755 --- a/autogen.sh +++ b/autogen.sh @@ -35,6 +35,9 @@ then ln -s ../../common/hooks/pre-commit.hook .git/hooks/pre-commit fi +# GNU gettext automake support doesn't get along with git. +# https://bugzilla.gnome.org/show_bug.cgi?id=661128 +touch -t 200001010000 po/gst-plugins-base-0.10.pot CONFIGURE_DEF_OPT='--enable-maintainer-mode --enable-gtk-doc' From 018bb2ca6ffe5a6fa63d8291f8955e382cd7ca30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 09:50:39 +0100 Subject: [PATCH 03/50] playsink: Implement GstStreamVolume interface --- gst/playback/gstplaysink.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index d02ec60235..50176205d9 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -32,6 +32,7 @@ #include #include #include +#include #include "gstplaysink.h" #include "gststreamsynchronizer.h" @@ -325,7 +326,18 @@ gst_play_marshal_BUFFER__BOXED (GClosure * closure, /* static guint gst_play_sink_signals[LAST_SIGNAL] = { 0 }; */ -G_DEFINE_TYPE (GstPlaySink, gst_play_sink, GST_TYPE_BIN); +static void +_do_init (GType type) +{ + static const GInterfaceInfo svol_info = { + NULL, NULL, NULL + }; + + g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info); +} + +G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN, + _do_init (g_define_type_id)); static void gst_play_sink_class_init (GstPlaySinkClass * klass) @@ -479,14 +491,11 @@ gst_play_sink_class_init (GstPlaySinkClass * klass) gst_element_class_add_static_pad_template (gstelement_klass, &audiorawtemplate); - gst_element_class_add_static_pad_template (gstelement_klass, - &audiotemplate); + gst_element_class_add_static_pad_template (gstelement_klass, &audiotemplate); gst_element_class_add_static_pad_template (gstelement_klass, &videorawtemplate); - gst_element_class_add_static_pad_template (gstelement_klass, - &videotemplate); - gst_element_class_add_static_pad_template (gstelement_klass, - &texttemplate); + gst_element_class_add_static_pad_template (gstelement_klass, &videotemplate); + gst_element_class_add_static_pad_template (gstelement_klass, &texttemplate); gst_element_class_set_details_simple (gstelement_klass, "Player Sink", "Generic/Bin/Sink", "Convenience sink for multiple streams", @@ -3042,14 +3051,14 @@ caps_notify_cb (GstPad * pad, GParamSpec * unused, GstPlaySink * playsink) if (pad == playsink->audio_pad) { raw = is_raw_pad (pad); - reconfigure = (!!playsink->audio_pad_raw != !!raw) + reconfigure = (! !playsink->audio_pad_raw != ! !raw) && playsink->audiochain; GST_DEBUG_OBJECT (pad, "Audio caps changed: raw %d reconfigure %d caps %" GST_PTR_FORMAT, raw, reconfigure, caps); } else if (pad == playsink->video_pad) { raw = is_raw_pad (pad); - reconfigure = (!!playsink->video_pad_raw != !!raw) + reconfigure = (! !playsink->video_pad_raw != ! !raw) && playsink->videochain; GST_DEBUG_OBJECT (pad, "Video caps changed: raw %d reconfigure %d caps %" GST_PTR_FORMAT, raw, From 17b8299df1baf91542c7b6f4c8441d732e3e3d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 10:09:15 +0100 Subject: [PATCH 04/50] navigation: Fix copy&paste error in documentation --- gst-libs/gst/interfaces/navigation.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst-libs/gst/interfaces/navigation.h b/gst-libs/gst/interfaces/navigation.h index b4eaca5f5d..4b21441ce3 100644 --- a/gst-libs/gst/interfaces/navigation.h +++ b/gst-libs/gst/interfaces/navigation.h @@ -44,7 +44,7 @@ typedef struct _GstNavigationInterface GstNavigationInterface; * @g_iface: the parent interface * @send_event: sending a navigation event * - * Color-balance interface. + * Navigation interface. */ struct _GstNavigationInterface { GTypeInterface g_iface; From 16c39464409fa8d23abbce7e184f2c863a85707e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 10:15:15 +0100 Subject: [PATCH 05/50] colorbalance: Add ::get_balance_type() vfunc and deprecated value inside the interface struct Values in class/interface structs are not supported by most bindings. --- gst-libs/gst/interfaces/colorbalance.c | 11 ++++++++++- gst-libs/gst/interfaces/colorbalance.h | 5 +++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/interfaces/colorbalance.c b/gst-libs/gst/interfaces/colorbalance.c index 0bf52a915d..464d737b81 100644 --- a/gst-libs/gst/interfaces/colorbalance.c +++ b/gst-libs/gst/interfaces/colorbalance.c @@ -102,13 +102,15 @@ gst_color_balance_class_init (GstColorBalanceClass * klass) initialized = TRUE; } - +#ifndef GST_REMOVE_DEPRECATED klass->balance_type = GST_COLOR_BALANCE_SOFTWARE; +#endif /* default virtual functions */ klass->list_channels = NULL; klass->set_value = NULL; klass->get_value = NULL; + klass->get_balance_type = NULL; } /** @@ -212,7 +214,14 @@ gst_color_balance_get_balance_type (GstColorBalance * balance) klass = GST_COLOR_BALANCE_GET_CLASS (balance); + if (klass->get_balance_type) + return klass->get_balance_type (balance); + +#ifndef GST_REMOVE_DEPRECATED return klass->balance_type; +#else + g_return_val_if_reached (GST_COLOR_BALANCE_SOFTWARE); +#endif } /** diff --git a/gst-libs/gst/interfaces/colorbalance.h b/gst-libs/gst/interfaces/colorbalance.h index 62771b5027..fd8ceaa51c 100644 --- a/gst-libs/gst/interfaces/colorbalance.h +++ b/gst-libs/gst/interfaces/colorbalance.h @@ -80,7 +80,10 @@ typedef enum struct _GstColorBalanceClass { GTypeInterface klass; +/* FIXME 0.11: Remove this */ +#ifndef GST_REMOVE_DEPRECATED GstColorBalanceType balance_type; +#endif /* virtual functions */ const GList * (* list_channels) (GstColorBalance *balance); @@ -96,6 +99,8 @@ struct _GstColorBalanceClass { GstColorBalanceChannel *channel, gint value); + GstColorBalanceType (*get_balance_type) (GstColorBalance *balance); + /*< private >*/ gpointer _gst_reserved[GST_PADDING]; }; From dd2aca875355c7832c5a233334e8d7f3cd3167df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 10:19:13 +0100 Subject: [PATCH 06/50] mixer: Add ::get_mixer_type() vfunc and deprecate interface struct value --- gst-libs/gst/interfaces/mixer.c | 9 +++++++++ gst-libs/gst/interfaces/mixer.h | 7 ++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/gst-libs/gst/interfaces/mixer.c b/gst-libs/gst/interfaces/mixer.c index 0c6abf0960..5b8aeedd44 100644 --- a/gst-libs/gst/interfaces/mixer.c +++ b/gst-libs/gst/interfaces/mixer.c @@ -134,7 +134,9 @@ gst_mixer_class_init (GstMixerClass * klass) } #endif +#ifndef GST_REMOVE_DEPRECATED klass->mixer_type = GST_MIXER_SOFTWARE; +#endif /* default virtual functions */ klass->list_tracks = NULL; @@ -355,7 +357,14 @@ gst_mixer_get_mixer_type (GstMixer * mixer) { GstMixerClass *klass = GST_MIXER_GET_CLASS (mixer); + if (klass->get_mixer_type) + return klass->get_mixer_type (mixer); + +#ifndef GST_REMOVE_DEPRECATED return klass->mixer_type; +#else + g_return_if_reached (GST_MIXER_TYPE_SOFTWARE); +#endif } /** diff --git a/gst-libs/gst/interfaces/mixer.h b/gst-libs/gst/interfaces/mixer.h index 71c8f7542f..b2a199c2b1 100644 --- a/gst-libs/gst/interfaces/mixer.h +++ b/gst-libs/gst/interfaces/mixer.h @@ -117,7 +117,10 @@ typedef enum struct _GstMixerClass { GTypeInterface klass; +/* FIXME 0.11: Remove this */ +#ifndef GST_REMOVE_DEPRECATED GstMixerType mixer_type; +#endif /* virtual functions */ const GList * (* list_tracks) (GstMixer *mixer); @@ -166,8 +169,10 @@ struct _GstMixerClass { GstMixerFlags (* get_mixer_flags) (GstMixer *mixer); + GstMixerType (* get_mixer_type) (GstMixer *mixer); + /*< private >*/ - gpointer _gst_reserved[GST_PADDING-1]; + gpointer _gst_reserved[GST_PADDING]; }; GType gst_mixer_get_type (void); From dfa508ffa1ec5031f62735372acf4e21c8c9cf86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 11:56:59 +0100 Subject: [PATCH 07/50] playsink: Add a software color-balance element before the sink if the sink doesn't support changing the color-balance --- gst/playback/gstplay-enum.c | 2 + gst/playback/gstplay-enum.h | 3 +- gst/playback/gstplaybin2.c | 2 +- gst/playback/gstplaysink.c | 37 ++++++- gst/playback/gstplaysinkaudioconvert.c | 1 - gst/playback/gstplaysinkvideoconvert.c | 147 +++++++++++++++++++++++-- gst/playback/gstplaysinkvideoconvert.h | 4 + 7 files changed, 180 insertions(+), 16 deletions(-) diff --git a/gst/playback/gstplay-enum.c b/gst/playback/gstplay-enum.c index e337fdf9a7..4fe137db38 100644 --- a/gst/playback/gstplay-enum.c +++ b/gst/playback/gstplay-enum.c @@ -65,6 +65,8 @@ gst_play_flags_get_type (void) "buffering"}, {C_FLAGS (GST_PLAY_FLAG_DEINTERLACE), "Deinterlace video if necessary", "deinterlace"}, + {C_FLAGS (GST_PLAY_FLAG_SOFT_COLORBALANCE), "Use software color balance", + "soft-colorbalance"}, {0, NULL, NULL} }; static volatile GType id = 0; diff --git a/gst/playback/gstplay-enum.h b/gst/playback/gstplay-enum.h index 77a34cfeaf..457d90c1e6 100644 --- a/gst/playback/gstplay-enum.h +++ b/gst/playback/gstplay-enum.h @@ -70,7 +70,8 @@ typedef enum { GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6), GST_PLAY_FLAG_DOWNLOAD = (1 << 7), GST_PLAY_FLAG_BUFFERING = (1 << 8), - GST_PLAY_FLAG_DEINTERLACE = (1 << 9) + GST_PLAY_FLAG_DEINTERLACE = (1 << 9), + GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10) } GstPlayFlags; #define GST_TYPE_PLAY_FLAGS (gst_play_flags_get_type()) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index ce429f11a2..dde0cb8c87 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -458,7 +458,7 @@ struct _GstPlayBinClass #define DEFAULT_SUBURI NULL #define DEFAULT_SOURCE NULL #define DEFAULT_FLAGS GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_TEXT | \ - GST_PLAY_FLAG_SOFT_VOLUME + GST_PLAY_FLAG_SOFT_VOLUME | GST_PLAY_FLAG_SOFT_COLORBALANCE #define DEFAULT_N_VIDEO 0 #define DEFAULT_CURRENT_VIDEO -1 #define DEFAULT_N_AUDIO 0 diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 50176205d9..d8f2c3b197 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -33,6 +33,7 @@ #include #include #include +#include #include "gstplaysink.h" #include "gststreamsynchronizer.h" @@ -45,7 +46,7 @@ GST_DEBUG_CATEGORY_STATIC (gst_play_sink_debug); #define VOLUME_MAX_DOUBLE 10.0 #define DEFAULT_FLAGS GST_PLAY_FLAG_AUDIO | GST_PLAY_FLAG_VIDEO | GST_PLAY_FLAG_TEXT | \ - GST_PLAY_FLAG_SOFT_VOLUME + GST_PLAY_FLAG_SOFT_VOLUME | GST_PLAY_FLAG_SOFT_COLORBALANCE #define GST_PLAY_CHAIN(c) ((GstPlayChain *)(c)) @@ -1249,6 +1250,22 @@ link_failed: } } +static gboolean +has_color_balance_element (GstElement * element) +{ + GstElement *cb = NULL; + + if (GST_IS_COLOR_BALANCE (element)) + return TRUE; + else if (!GST_IS_BIN (element)) + return FALSE; + + cb = gst_bin_get_by_interface (GST_BIN (element), GST_TYPE_COLOR_BALANCE); + gst_object_unref (cb); + + return (cb != NULL); +} + /* make the element (bin) that contains the elements needed to perform * video display. * @@ -1347,10 +1364,17 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) head = prev = chain->queue; } - if (!(playsink->flags & GST_PLAY_FLAG_NATIVE_VIDEO)) { + if (!(playsink->flags & GST_PLAY_FLAG_NATIVE_VIDEO) + || (!has_color_balance_element (chain->sink) + && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE))) { + gboolean use_converters = !(playsink->flags & GST_PLAY_FLAG_NATIVE_VIDEO); + gboolean use_balance = !has_color_balance_element (chain->sink) + && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE); + GST_DEBUG_OBJECT (playsink, "creating videoconverter"); chain->conv = - g_object_new (GST_TYPE_PLAY_SINK_VIDEO_CONVERT, "name", "vconv", NULL); + g_object_new (GST_TYPE_PLAY_SINK_VIDEO_CONVERT, "name", "vconv", + "use-converters", use_converters, "use-balance", use_balance, NULL); gst_bin_add (bin, chain->conv); if (prev) { if (!gst_element_link_pads_full (prev, "src", chain->conv, "sink", @@ -1461,6 +1485,12 @@ setup_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) GST_DEBUG_OBJECT (playsink, "no async property on the sink"); chain->async = TRUE; } + + if (chain->conv) + g_object_set (chain->conv, "use-balance", + !has_color_balance_element (chain->sink) + && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE), NULL); + return TRUE; } @@ -3753,7 +3783,6 @@ gst_play_sink_get_property (GObject * object, guint prop_id, } } - gboolean gst_play_sink_plugin_init (GstPlugin * plugin) { diff --git a/gst/playback/gstplaysinkaudioconvert.c b/gst/playback/gstplaysinkaudioconvert.c index a0756bc476..77504da13f 100644 --- a/gst/playback/gstplaysinkaudioconvert.c +++ b/gst/playback/gstplaysinkaudioconvert.c @@ -64,7 +64,6 @@ gst_play_sink_audio_convert_add_conversion_elements (GstPlaySinkAudioConvert * el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, "audioresample", "resample"); if (el) { - if (prev) { if (!gst_element_link_pads_full (prev, "src", el, "sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) diff --git a/gst/playback/gstplaysinkvideoconvert.c b/gst/playback/gstplaysinkvideoconvert.c index 72a9aff7fc..85a5d2b859 100644 --- a/gst/playback/gstplaysinkvideoconvert.c +++ b/gst/playback/gstplaysinkvideoconvert.c @@ -34,6 +34,13 @@ GST_DEBUG_CATEGORY_STATIC (gst_play_sink_video_convert_debug); G_DEFINE_TYPE (GstPlaySinkVideoConvert, gst_play_sink_video_convert, GST_TYPE_PLAY_SINK_CONVERT_BIN); +enum +{ + PROP_0, + PROP_USE_CONVERTERS, + PROP_USE_BALANCE, +}; + static gboolean gst_play_sink_video_convert_add_conversion_elements (GstPlaySinkVideoConvert * self) @@ -41,22 +48,51 @@ gst_play_sink_video_convert_add_conversion_elements (GstPlaySinkVideoConvert * GstPlaySinkConvertBin *cbin = GST_PLAY_SINK_CONVERT_BIN (self); GstElement *el, *prev = NULL; - el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, - COLORSPACE, "conv"); - if (el) - prev = el; + g_assert (cbin->conversion_elements == NULL); - el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, - "videoscale", "scale"); - if (el) { - /* Add black borders if necessary to keep the DAR */ - g_object_set (el, "add-borders", TRUE, NULL); + GST_DEBUG_OBJECT (self, + "Building video conversion with use-converters %d, use-balance %d", + self->use_converters, self->use_balance); + + if (self->use_converters) { + el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, + COLORSPACE, "conv"); + if (el) + prev = el; + + el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, + "videoscale", "scale"); + if (el) { + /* Add black borders if necessary to keep the DAR */ + g_object_set (el, "add-borders", TRUE, NULL); + if (prev) { + if (!gst_element_link_pads_full (prev, "src", el, "sink", + GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) + goto link_failed; + } + prev = el; + } + } + + if (self->use_balance && self->balance) { + el = self->balance; + gst_play_sink_convert_bin_add_conversion_element (cbin, el); if (prev) { if (!gst_element_link_pads_full (prev, "src", el, "sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) goto link_failed; } prev = el; + + el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, + COLORSPACE, "conv"); + if (prev) { + if (!gst_element_link_pads_full (prev, "src", el, "sink", + GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) + goto link_failed; + } + if (el) + prev = el; } return TRUE; @@ -65,16 +101,101 @@ link_failed: return FALSE; } +static void +gst_play_sink_video_convert_finalize (GObject * object) +{ + GstPlaySinkVideoConvert *self = GST_PLAY_SINK_VIDEO_CONVERT_CAST (object); + + if (self->balance) + gst_object_unref (self->balance); + + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +gst_play_sink_video_convert_set_property (GObject * object, guint prop_id, + const GValue * value, GParamSpec * pspec) +{ + GstPlaySinkVideoConvert *self = GST_PLAY_SINK_VIDEO_CONVERT_CAST (object); + gboolean v, changed = FALSE; + + GST_PLAY_SINK_CONVERT_BIN_LOCK (self); + switch (prop_id) { + case PROP_USE_CONVERTERS: + v = g_value_get_boolean (value); + if (v != self->use_converters) { + self->use_converters = v; + changed = TRUE; + } + break; + case PROP_USE_BALANCE: + v = g_value_get_boolean (value); + if (v != self->use_balance) { + self->use_balance = v; + changed = TRUE; + } + break; + default: + break; + } + + if (changed) { + GstPlaySinkConvertBin *cbin = GST_PLAY_SINK_CONVERT_BIN (self); + GST_DEBUG_OBJECT (self, "Rebuilding converter bin"); + gst_play_sink_convert_bin_remove_elements (cbin); + gst_play_sink_video_convert_add_conversion_elements (self); + gst_play_sink_convert_bin_add_identity (cbin); + gst_play_sink_convert_bin_cache_converter_caps (cbin); + } + GST_PLAY_SINK_CONVERT_BIN_UNLOCK (self); +} + +static void +gst_play_sink_video_convert_get_property (GObject * object, guint prop_id, + GValue * value, GParamSpec * pspec) +{ + GstPlaySinkVideoConvert *self = GST_PLAY_SINK_VIDEO_CONVERT_CAST (object); + + GST_PLAY_SINK_CONVERT_BIN_LOCK (self); + switch (prop_id) { + case PROP_USE_CONVERTERS: + g_value_set_boolean (value, self->use_converters); + break; + case PROP_USE_BALANCE: + g_value_set_boolean (value, self->use_balance); + break; + default: + break; + } + GST_PLAY_SINK_CONVERT_BIN_UNLOCK (self); +} + static void gst_play_sink_video_convert_class_init (GstPlaySinkVideoConvertClass * klass) { + GObjectClass *gobject_class; GstElementClass *gstelement_class; GST_DEBUG_CATEGORY_INIT (gst_play_sink_video_convert_debug, "playsinkvideoconvert", 0, "play bin"); + gobject_class = (GObjectClass *) klass; gstelement_class = (GstElementClass *) klass; + gobject_class->finalize = gst_play_sink_video_convert_finalize; + gobject_class->set_property = gst_play_sink_video_convert_set_property; + gobject_class->get_property = gst_play_sink_video_convert_get_property; + + g_object_class_install_property (gobject_class, PROP_USE_CONVERTERS, + g_param_spec_boolean ("use-converters", "Use converters", + "Whether to use conversion elements", FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + + g_object_class_install_property (gobject_class, PROP_USE_BALANCE, + g_param_spec_boolean ("use-balance", "Use balance", + "Whether to use a videobalance element", FALSE, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gst_element_class_set_details_simple (gstelement_class, "Player Sink Video Converter", "Video/Bin/Converter", "Convenience bin for video conversion", @@ -87,6 +208,14 @@ gst_play_sink_video_convert_init (GstPlaySinkVideoConvert * self) GstPlaySinkConvertBin *cbin = GST_PLAY_SINK_CONVERT_BIN (self); cbin->audio = FALSE; + /* FIXME: Only create this on demand but for now we need + * it to always exist because of playsink's color balance + * proxying logic. + */ + self->balance = gst_element_factory_make ("videobalance", "videobalance"); + if (self->balance) + gst_object_ref_sink (self->balance); + gst_play_sink_video_convert_add_conversion_elements (self); gst_play_sink_convert_bin_cache_converter_caps (cbin); } diff --git a/gst/playback/gstplaysinkvideoconvert.h b/gst/playback/gstplaysinkvideoconvert.h index df56d97ab8..5c504629a4 100644 --- a/gst/playback/gstplaysinkvideoconvert.h +++ b/gst/playback/gstplaysinkvideoconvert.h @@ -43,6 +43,10 @@ struct _GstPlaySinkVideoConvert { GstPlaySinkConvertBin parent; + /* < pseudo public > */ + GstElement *balance; + gboolean use_converters; + gboolean use_balance; }; struct _GstPlaySinkVideoConvertClass From 68220a1893ff9e29ed2d76c65181ec31144e6aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 12:07:13 +0100 Subject: [PATCH 08/50] playsink: Only really use software volume if requested --- gst/playback/gstplaysink.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index d8f2c3b197..0ad326f7e1 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1849,10 +1849,10 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw) } if (!(playsink->flags & GST_PLAY_FLAG_NATIVE_AUDIO) || (!have_volume - && playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME)) { + && (playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME))) { gboolean use_converters = !(playsink->flags & GST_PLAY_FLAG_NATIVE_AUDIO); gboolean use_volume = - !have_volume && playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME; + !have_volume && (playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME); GST_DEBUG_OBJECT (playsink, "creating audioconvert with use-converters %d, use-volume %d", use_converters, use_volume); @@ -1869,7 +1869,7 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw) } prev = chain->conv; - if (!have_volume && playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME) { + if (!have_volume && (playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME)) { GstPlaySinkAudioConvert *conv = GST_PLAY_SINK_AUDIO_CONVERT_CAST (chain->conv); @@ -2022,13 +2022,14 @@ setup_audio_chain (GstPlaySink * playsink, gboolean raw) GST_PLAY_SINK_AUDIO_CONVERT_CAST (chain->conv); /* no volume, we need to add a volume element when we can */ - g_object_set (chain->conv, "use-volume", TRUE, NULL); + g_object_set (chain->conv, "use-volume", + ! !(playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME), NULL); GST_DEBUG_OBJECT (playsink, "the sink has no volume property"); /* Disconnect signals */ disconnect_chain (chain, playsink); - if (conv->volume) { + if (conv->volume && (playsink->flags & GST_PLAY_FLAG_SOFT_VOLUME)) { chain->volume = conv->volume; chain->mute = chain->volume; From 56737a2ab14be68269cc4dc2caa45f16849a3006 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 12:17:47 +0100 Subject: [PATCH 09/50] playbin2: Give a fixed name "playsink" to the internal playsink element --- gst/playback/gstplaybin2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index dde0cb8c87..1874d9556a 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -1259,7 +1259,8 @@ gst_play_bin_init (GstPlayBin * playbin) playbin->elements_lock = g_mutex_new (); /* add sink */ - playbin->playsink = g_object_new (GST_TYPE_PLAY_SINK, NULL); + playbin->playsink = + g_object_new (GST_TYPE_PLAY_SINK, "name", "playsink", NULL); gst_bin_add (GST_BIN_CAST (playbin), GST_ELEMENT_CAST (playbin->playsink)); gst_play_sink_set_flags (playbin->playsink, DEFAULT_FLAGS); /* Connect to notify::volume and notify::mute signals for proxying */ From 8bcf96198eb3e63aaed103a0ac1d202e009d4901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 14:12:16 +0100 Subject: [PATCH 10/50] playsinkvideoconvert: Fix element name --- gst/playback/gstplaysinkvideoconvert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/playback/gstplaysinkvideoconvert.c b/gst/playback/gstplaysinkvideoconvert.c index 85a5d2b859..38c8878e64 100644 --- a/gst/playback/gstplaysinkvideoconvert.c +++ b/gst/playback/gstplaysinkvideoconvert.c @@ -85,7 +85,7 @@ gst_play_sink_video_convert_add_conversion_elements (GstPlaySinkVideoConvert * prev = el; el = gst_play_sink_convert_bin_add_conversion_element_factory (cbin, - COLORSPACE, "conv"); + COLORSPACE, "conv2"); if (prev) { if (!gst_element_link_pads_full (prev, "src", el, "sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) From 2c565f72df86fb95118d5471bed3abcc31cb1a30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 14:53:39 +0100 Subject: [PATCH 11/50] playsink: Only use the sink's colorbalance interface if it supports at least brightness/contrast/hue/saturation --- gst/playback/gstplaysink.c | 53 ++++++++++++++++++++++++++++++++++---- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 0ad326f7e1..e48eefac36 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1250,20 +1250,63 @@ link_failed: } } +static gboolean +is_valid_color_balance_element (GstElement * element) +{ + GstColorBalance *bal = GST_COLOR_BALANCE (element); + gboolean have_brightness = FALSE; + gboolean have_contrast = FALSE; + gboolean have_hue = FALSE; + gboolean have_saturation = FALSE; + const GList *channels, *l; + + channels = gst_color_balance_list_channels (bal); + for (l = channels; l; l = l->next) { + GstColorBalanceChannel *ch = l->data; + + if (g_strrstr (ch->label, "BRIGHTNESS")) + have_brightness = TRUE; + else if (g_strrstr (ch->label, "CONTRAST")) + have_contrast = TRUE; + else if (g_strrstr (ch->label, "HUE")) + have_hue = TRUE; + else if (g_strrstr (ch->label, "SATURATION")) + have_saturation = TRUE; + } + + return have_brightness && have_contrast && have_hue && have_saturation; +} + +static void +iterate_color_balance_elements (gpointer data, gpointer user_data) +{ + gboolean valid = is_valid_color_balance_element (data); + gboolean *valid_out = user_data; + + *valid_out = *valid_out && valid; + + gst_object_unref (data); +} + static gboolean has_color_balance_element (GstElement * element) { - GstElement *cb = NULL; + GstIterator *it; + gboolean valid = FALSE; if (GST_IS_COLOR_BALANCE (element)) - return TRUE; + return is_valid_color_balance_element (element); else if (!GST_IS_BIN (element)) return FALSE; - cb = gst_bin_get_by_interface (GST_BIN (element), GST_TYPE_COLOR_BALANCE); - gst_object_unref (cb); + it = gst_bin_iterate_all_by_interface (GST_BIN (element), + GST_TYPE_COLOR_BALANCE); + while (gst_iterator_foreach (it, iterate_color_balance_elements, + &valid) == GST_ITERATOR_RESYNC) + gst_iterator_resync (it); + gst_iterator_free (it); - return (cb != NULL); + return valid; } /* make the element (bin) that contains the elements needed to perform From d85a8a6e7ea525cd7e5973dd64b9c331940ae416 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 14:58:38 +0100 Subject: [PATCH 12/50] seek: Add UI for setting the colorbalance interface properties on playbin2 --- tests/examples/seek/seek.c | 217 +++++++++++++++++++++++++++++++++++-- 1 file changed, 205 insertions(+), 12 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index c90691517d..4ad9682203 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -46,6 +46,7 @@ #include #include +#include GST_DEBUG_CATEGORY_STATIC (seek_debug); #define GST_CAT_DEFAULT (seek_debug) @@ -125,6 +126,12 @@ static GtkWidget *shuttle_checkbox, *step_button; static GtkWidget *shuttle_hscale; static GtkAdjustment *shuttle_adjustment; +static GtkWidget *contrast_scale, *brightness_scale, *hue_scale, + *saturation_scale; + +static GstElement *navigation_element = NULL; +static GstElement *colorbalance_element = NULL; + static struct { GstNavigationCommand cmd; @@ -145,7 +152,7 @@ static GArray *vis_entries; static void clear_streams (GstElement * pipeline); static void volume_notify_cb (GstElement * pipeline, GParamSpec * arg, gpointer user_dat); -static void find_navigation_element (void); +static void find_interface_elements (void); /* pipeline construction */ @@ -1458,7 +1465,7 @@ start_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) if (changed_id == 0 && flush_seek && scrub) { changed_id = - g_signal_connect (hscale, "value_changed", G_CALLBACK (seek_cb), + g_signal_connect (hscale, "value-changed", G_CALLBACK (seek_cb), pipeline); } @@ -2296,6 +2303,48 @@ shuttle_value_changed (GtkRange * range, GstElement * element) } } +static void +colorbalance_value_changed (GtkRange * range, gpointer user_data) +{ + const gchar *label = user_data; + gdouble val; + gint ival; + GstColorBalanceChannel *channel = NULL; + const GList *channels, *l; + + val = gtk_range_get_value (range); + + g_print ("colorbalance %s value changed %lf\n", label, val / 100.); + + if (!colorbalance_element) { + find_interface_elements (); + if (!colorbalance_element) + return; + } + + channels = + gst_color_balance_list_channels (GST_COLOR_BALANCE + (colorbalance_element)); + for (l = channels; l; l = l->next) { + GstColorBalanceChannel *tmp = l->data; + + if (g_strrstr (tmp->label, label)) { + channel = tmp; + break; + } + } + + if (!channel) + return; + + ival = + (gint) (0.5 + channel->min_value + + (val / 100.0) * ((gdouble) channel->max_value - + (gdouble) channel->min_value)); + gst_color_balance_set_value (GST_COLOR_BALANCE (colorbalance_element), + channel, ival); +} + static void msg_async_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) { @@ -2307,7 +2356,7 @@ msg_async_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) /* update the available streams */ update_streams (pipeline); - find_navigation_element (); + find_interface_elements (); } static void @@ -2473,12 +2522,40 @@ msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data) } } -static GstElement *navigation_element = NULL; +static gboolean +is_valid_color_balance_element (GstElement * element) +{ + GstColorBalance *bal = GST_COLOR_BALANCE (element); + gboolean have_brightness = FALSE; + gboolean have_contrast = FALSE; + gboolean have_hue = FALSE; + gboolean have_saturation = FALSE; + const GList *channels, *l; + + channels = gst_color_balance_list_channels (bal); + for (l = channels; l; l = l->next) { + GstColorBalanceChannel *ch = l->data; + + if (g_strrstr (ch->label, "BRIGHTNESS")) + have_brightness = TRUE; + else if (g_strrstr (ch->label, "CONTRAST")) + have_contrast = TRUE; + else if (g_strrstr (ch->label, "HUE")) + have_hue = TRUE; + else if (g_strrstr (ch->label, "SATURATION")) + have_saturation = TRUE; + } + + return have_brightness && have_contrast && have_hue && have_saturation; +} static void -find_navigation_element (void) +find_interface_elements (void) { - GstElement *video_sink; + GstElement *video_sink, *playsink; + GstIterator *it; + gpointer item; + gboolean done = FALSE, hardware = FALSE; g_object_get (pipeline, "video-sink", &video_sink, NULL); if (!video_sink) @@ -2487,6 +2564,10 @@ find_navigation_element (void) if (navigation_element) gst_object_unref (navigation_element); + if (colorbalance_element) + gst_object_unref (colorbalance_element); + colorbalance_element = NULL; + if (GST_IS_NAVIGATION (video_sink)) { navigation_element = gst_object_ref (video_sink); } else if (GST_IS_BIN (video_sink)) { @@ -2497,6 +2578,62 @@ find_navigation_element (void) } gst_object_unref (video_sink); + + playsink = gst_bin_get_by_name (GST_BIN (pipeline), "playsink"); + g_assert (playsink != NULL); + + it = gst_bin_iterate_all_by_interface (GST_BIN (playsink), + GST_TYPE_COLOR_BALANCE); + while (!done) { + switch (gst_iterator_next (it, &item)) { + case GST_ITERATOR_OK:{ + GstElement *element = GST_ELEMENT (item); + + if (is_valid_color_balance_element (element)) { + if (!colorbalance_element) { + colorbalance_element = GST_ELEMENT_CAST (gst_object_ref (element)); + hardware = + (gst_color_balance_get_balance_type (GST_COLOR_BALANCE + (element)) == GST_COLOR_BALANCE_HARDWARE); + } else if (!hardware) { + gboolean tmp = + (gst_color_balance_get_balance_type (GST_COLOR_BALANCE + (element)) == GST_COLOR_BALANCE_HARDWARE); + + if (tmp) { + if (colorbalance_element) + gst_object_unref (colorbalance_element); + colorbalance_element = + GST_ELEMENT_CAST (gst_object_ref (element)); + hardware = TRUE; + } + } + } + + gst_object_unref (element); + + if (hardware && colorbalance_element) + done = TRUE; + break; + } + case GST_ITERATOR_RESYNC: + gst_iterator_resync (it); + done = FALSE; + hardware = FALSE; + if (colorbalance_element) + gst_object_unref (colorbalance_element); + colorbalance_element = NULL; + break; + case GST_ITERATOR_DONE: + case GST_ITERATOR_ERROR: + default: + done = TRUE; + } + } + + gst_iterator_free (it); + + gst_object_unref (playsink); } /* called when Navigation command button is pressed */ @@ -2506,7 +2643,7 @@ navigation_cmd_cb (GtkButton * button, gpointer data) GstNavigationCommand cmd = GPOINTER_TO_INT (data); if (!navigation_element) { - find_navigation_element (); + find_interface_elements (); if (!navigation_element) return; } @@ -2553,7 +2690,7 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) gst_x_overlay_set_window_handle (GST_X_OVERLAY (element), embed_xid); gst_x_overlay_handle_events (GST_X_OVERLAY (element), FALSE); - find_navigation_element (); + find_interface_elements (); } return GST_BUS_PASS; } @@ -2843,7 +2980,7 @@ int main (int argc, char **argv) { GtkWidget *window, *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, - *flagtable, *boxes2, *step, *navigation; + *flagtable, *boxes2, *step, *navigation, *colorbalance; GtkWidget *play_button, *pause_button, *stop_button, *shot_button; GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox; @@ -3028,7 +3165,7 @@ main (int argc, char **argv) shuttle_hscale = gtk_hscale_new (shuttle_adjustment); gtk_scale_set_digits (GTK_SCALE (shuttle_hscale), 2); gtk_scale_set_value_pos (GTK_SCALE (shuttle_hscale), GTK_POS_TOP); - g_signal_connect (shuttle_hscale, "value_changed", + g_signal_connect (shuttle_hscale, "value-changed", G_CALLBACK (shuttle_value_changed), pipeline); g_signal_connect (shuttle_hscale, "format_value", G_CALLBACK (shuttle_format_value), pipeline); @@ -3187,6 +3324,60 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (navigation), grid); } + /* colorbalance expander */ + { + GtkWidget *vbox, *frame; + + colorbalance = gtk_expander_new ("color balance options"); + vbox = gtk_vbox_new (FALSE, 0); + + /* contrast scale */ + frame = gtk_frame_new ("Contrast"); + adjustment = + GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + contrast_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (contrast_scale), FALSE); + g_signal_connect (contrast_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), (gpointer) "CONTRAST"); + gtk_container_add (GTK_CONTAINER (frame), contrast_scale); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); + + /* brightness scale */ + frame = gtk_frame_new ("Brightness"); + adjustment = + GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + brightness_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (brightness_scale), FALSE); + g_signal_connect (brightness_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), (gpointer) "BRIGHTNESS"); + gtk_container_add (GTK_CONTAINER (frame), brightness_scale); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); + + /* hue scale */ + frame = gtk_frame_new ("Hue"); + adjustment = + GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + hue_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (hue_scale), FALSE); + g_signal_connect (hue_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), (gpointer) "HUE"); + gtk_container_add (GTK_CONTAINER (frame), hue_scale); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); + + /* saturation scale */ + frame = gtk_frame_new ("Saturation"); + adjustment = + GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + saturation_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (saturation_scale), FALSE); + g_signal_connect (saturation_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), (gpointer) "SATURATION"); + gtk_container_add (GTK_CONTAINER (frame), saturation_scale); + gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); + + gtk_container_add (GTK_CONTAINER (colorbalance), vbox); + } + /* seek bar */ adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, N_GRAD, 0.1, 1.0, 1.0)); @@ -3263,7 +3454,7 @@ main (int argc, char **argv) G_CALLBACK (download_toggle_cb), pipeline); g_signal_connect (G_OBJECT (buffer_checkbox), "toggled", G_CALLBACK (buffer_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (volume_spinbutton), "value_changed", + g_signal_connect (G_OBJECT (volume_spinbutton), "value-changed", G_CALLBACK (volume_spinbutton_changed_cb), pipeline); /* playbin2 panel for snapshot */ boxes2 = gtk_hbox_new (FALSE, 0); @@ -3320,6 +3511,8 @@ main (int argc, char **argv) } gtk_box_pack_start (GTK_BOX (vbox), step, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), navigation, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 2); @@ -3344,7 +3537,7 @@ main (int argc, char **argv) G_CALLBACK (play_scrub_toggle_cb), pipeline); g_signal_connect (G_OBJECT (skip_checkbox), "toggled", G_CALLBACK (skip_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (rate_spinbutton), "value_changed", + g_signal_connect (G_OBJECT (rate_spinbutton), "value-changed", G_CALLBACK (rate_spinbutton_changed_cb), pipeline); g_signal_connect (G_OBJECT (window), "delete-event", delete_event_cb, NULL); From 8e36830dab3ab47e5df2fe2bc63987a99b3f41a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 15:01:15 +0100 Subject: [PATCH 13/50] seek: Only show colorbalance expander for playbin2 pipelines --- tests/examples/seek/seek.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 4ad9682203..b826561ac9 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2980,7 +2980,7 @@ int main (int argc, char **argv) { GtkWidget *window, *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, - *flagtable, *boxes2, *step, *navigation, *colorbalance; + *flagtable, *boxes2, *step, *navigation, *colorbalance = NULL; GtkWidget *play_button, *pause_button, *stop_button, *shot_button; GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox; @@ -3324,8 +3324,8 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (navigation), grid); } - /* colorbalance expander */ - { + /* colorbalance expander, only for playbin2 */ + if (pipeline_type == 16) { GtkWidget *vbox, *frame; colorbalance = gtk_expander_new ("color balance options"); @@ -3511,7 +3511,8 @@ main (int argc, char **argv) } gtk_box_pack_start (GTK_BOX (vbox), step, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), navigation, FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); + if (colorbalance) + gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 2); From 6aa08ec7167dd26d9cfd5d12475f365ed34d5178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 15:43:25 +0100 Subject: [PATCH 14/50] seek: Add checkboxes for the remaining playbin2 flags and refactor code a bit --- tests/examples/seek/seek.c | 177 +++++++++++++++++++++++++++++-------- 1 file changed, 141 insertions(+), 36 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index b826561ac9..d861fc5e31 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -51,6 +51,23 @@ GST_DEBUG_CATEGORY_STATIC (seek_debug); #define GST_CAT_DEFAULT (seek_debug) +/* Copied from gst-plugins-base/gst/playback/gstplay-enum.h */ +typedef enum +{ + GST_PLAY_FLAG_VIDEO = (1 << 0), + GST_PLAY_FLAG_AUDIO = (1 << 1), + GST_PLAY_FLAG_TEXT = (1 << 2), + GST_PLAY_FLAG_VIS = (1 << 3), + GST_PLAY_FLAG_SOFT_VOLUME = (1 << 4), + GST_PLAY_FLAG_NATIVE_AUDIO = (1 << 5), + GST_PLAY_FLAG_NATIVE_VIDEO = (1 << 6), + GST_PLAY_FLAG_DOWNLOAD = (1 << 7), + GST_PLAY_FLAG_BUFFERING = (1 << 8), + GST_PLAY_FLAG_DEINTERLACE = (1 << 9), + GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10) +} GstPlayFlags; + + /* configuration */ #define SOURCE "filesrc" @@ -116,8 +133,11 @@ static gboolean need_streams = TRUE; static GtkWidget *video_combo, *audio_combo, *text_combo, *vis_combo; static GtkWidget *vis_checkbox, *video_checkbox, *audio_checkbox; static GtkWidget *text_checkbox, *mute_checkbox, *volume_spinbutton; +static GtkWidget *soft_volume_checkbox, *native_audio_checkbox; +static GtkWidget *native_video_checkbox, *deinterlace_checkbox; +static GtkWidget *soft_colorbalance_checkbox; static GtkWidget *skip_checkbox, *video_window, *download_checkbox; -static GtkWidget *buffer_checkbox, *rate_spinbutton; +static GtkWidget *buffering_checkbox, *rate_spinbutton; static GStaticMutex state_mutex = G_STATIC_MUTEX_INIT; @@ -1727,15 +1747,17 @@ rate_spinbutton_changed_cb (GtkSpinButton * button, GstPipeline * pipeline) } static void -update_flag (GstPipeline * pipeline, gint num, gboolean state) +update_flag (GstPipeline * pipeline, GstPlayFlags flag, gboolean state) { gint flags; + g_print ("%ssetting flag 0x%08x\n", (state ? "" : "un"), flag); + g_object_get (pipeline, "flags", &flags, NULL); if (state) - flags |= (1 << num); + flags |= flag; else - flags &= ~(1 << num); + flags &= ~(flag); g_object_set (pipeline, "flags", flags, NULL); } @@ -1745,7 +1767,7 @@ vis_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, 3, state); + update_flag (pipeline, GST_PLAY_FLAG_VIS, state); gtk_widget_set_sensitive (vis_combo, state); } @@ -1755,7 +1777,7 @@ audio_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, 1, state); + update_flag (pipeline, GST_PLAY_FLAG_AUDIO, state); gtk_widget_set_sensitive (audio_combo, state); } @@ -1765,7 +1787,7 @@ video_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, 0, state); + update_flag (pipeline, GST_PLAY_FLAG_VIDEO, state); gtk_widget_set_sensitive (video_combo, state); } @@ -1775,7 +1797,7 @@ text_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, 2, state); + update_flag (pipeline, GST_PLAY_FLAG_TEXT, state); gtk_widget_set_sensitive (text_combo, state); } @@ -1794,16 +1816,61 @@ download_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, 7, state); + update_flag (pipeline, GST_PLAY_FLAG_DOWNLOAD, state); } static void -buffer_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +buffering_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, 8, state); + update_flag (pipeline, GST_PLAY_FLAG_BUFFERING, state); +} + +static void +soft_volume_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +{ + gboolean state; + + state = gtk_toggle_button_get_active (button); + update_flag (pipeline, GST_PLAY_FLAG_SOFT_VOLUME, state); +} + +static void +native_audio_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +{ + gboolean state; + + state = gtk_toggle_button_get_active (button); + update_flag (pipeline, GST_PLAY_FLAG_NATIVE_AUDIO, state); +} + +static void +native_video_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +{ + gboolean state; + + state = gtk_toggle_button_get_active (button); + update_flag (pipeline, GST_PLAY_FLAG_NATIVE_VIDEO, state); +} + +static void +deinterlace_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +{ + gboolean state; + + state = gtk_toggle_button_get_active (button); + update_flag (pipeline, GST_PLAY_FLAG_DEINTERLACE, state); +} + +static void +soft_colorbalance_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +{ + gboolean state; + + state = gtk_toggle_button_get_active (button); + update_flag (pipeline, GST_PLAY_FLAG_SOFT_COLORBALANCE, state); } static void @@ -3413,47 +3480,85 @@ main (int argc, char **argv) g_signal_connect (G_OBJECT (text_combo), "changed", G_CALLBACK (text_combo_cb), pipeline); /* playbin2 panel for flag checkboxes and volume/mute */ - boxes = gtk_hbox_new (FALSE, 0); - vis_checkbox = gtk_check_button_new_with_label ("Vis"); + boxes = gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (boxes), 2); + gtk_grid_set_row_homogeneous (GTK_GRID (boxes), TRUE); + gtk_grid_set_column_spacing (GTK_GRID (boxes), 2); + gtk_grid_set_column_homogeneous (GTK_GRID (boxes), TRUE); + video_checkbox = gtk_check_button_new_with_label ("Video"); audio_checkbox = gtk_check_button_new_with_label ("Audio"); text_checkbox = gtk_check_button_new_with_label ("Text"); - mute_checkbox = gtk_check_button_new_with_label ("Mute"); + vis_checkbox = gtk_check_button_new_with_label ("Vis"); + soft_volume_checkbox = gtk_check_button_new_with_label ("Soft Volume"); + native_audio_checkbox = gtk_check_button_new_with_label ("Native Audio"); + native_video_checkbox = gtk_check_button_new_with_label ("Native Video"); download_checkbox = gtk_check_button_new_with_label ("Download"); - buffer_checkbox = gtk_check_button_new_with_label ("Buffer"); + buffering_checkbox = gtk_check_button_new_with_label ("Buffering"); + deinterlace_checkbox = gtk_check_button_new_with_label ("Deinterlace"); + soft_colorbalance_checkbox = + gtk_check_button_new_with_label ("Soft Colorbalance"); + mute_checkbox = gtk_check_button_new_with_label ("Mute"); volume_label = gtk_label_new ("Volume"); volume_spinbutton = gtk_spin_button_new_with_range (0, 10.0, 0.1); gtk_spin_button_set_value (GTK_SPIN_BUTTON (volume_spinbutton), 1.0); - gtk_box_pack_start (GTK_BOX (boxes), video_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), audio_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), text_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), vis_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), mute_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), download_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), buffer_checkbox, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), volume_label, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes), volume_spinbutton, TRUE, TRUE, 2); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (vis_checkbox), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (audio_checkbox), TRUE); + gtk_grid_attach (GTK_GRID (boxes), video_checkbox, 0, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), audio_checkbox, 1, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), text_checkbox, 2, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), vis_checkbox, 3, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), soft_volume_checkbox, 4, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), native_audio_checkbox, 5, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), native_video_checkbox, 0, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), download_checkbox, 1, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), buffering_checkbox, 2, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), deinterlace_checkbox, 3, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), soft_colorbalance_checkbox, 4, 1, 1, 1); + + gtk_grid_attach (GTK_GRID (boxes), mute_checkbox, 7, 0, 2, 1); + gtk_grid_attach (GTK_GRID (boxes), volume_label, 6, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), volume_spinbutton, 7, 1, 1, 1); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (video_checkbox), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (audio_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (text_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mute_checkbox), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (vis_checkbox), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (soft_volume_checkbox), + TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (native_audio_checkbox), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (native_video_checkbox), + FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (download_checkbox), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (buffer_checkbox), FALSE); - g_signal_connect (G_OBJECT (vis_checkbox), "toggled", - G_CALLBACK (vis_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (audio_checkbox), "toggled", - G_CALLBACK (audio_toggle_cb), pipeline); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (buffering_checkbox), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (deinterlace_checkbox), + FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (soft_colorbalance_checkbox), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mute_checkbox), FALSE); g_signal_connect (G_OBJECT (video_checkbox), "toggled", G_CALLBACK (video_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (audio_checkbox), "toggled", + G_CALLBACK (audio_toggle_cb), pipeline); g_signal_connect (G_OBJECT (text_checkbox), "toggled", G_CALLBACK (text_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (mute_checkbox), "toggled", - G_CALLBACK (mute_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (vis_checkbox), "toggled", + G_CALLBACK (vis_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (soft_volume_checkbox), "toggled", + G_CALLBACK (soft_volume_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (native_audio_checkbox), "toggled", + G_CALLBACK (native_audio_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (native_video_checkbox), "toggled", + G_CALLBACK (native_video_toggle_cb), pipeline); g_signal_connect (G_OBJECT (download_checkbox), "toggled", G_CALLBACK (download_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (buffer_checkbox), "toggled", - G_CALLBACK (buffer_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (buffering_checkbox), "toggled", + G_CALLBACK (buffering_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (deinterlace_checkbox), "toggled", + G_CALLBACK (deinterlace_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (soft_colorbalance_checkbox), "toggled", + G_CALLBACK (soft_colorbalance_toggle_cb), pipeline); + g_signal_connect (G_OBJECT (mute_checkbox), "toggled", + G_CALLBACK (mute_toggle_cb), pipeline); g_signal_connect (G_OBJECT (volume_spinbutton), "value-changed", G_CALLBACK (volume_spinbutton_changed_cb), pipeline); /* playbin2 panel for snapshot */ From 55aaec31022846e795961c0d7f3eb19a13a1e9c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Wed, 22 Feb 2012 15:52:04 +0100 Subject: [PATCH 15/50] seek: Make navigation/colorbalance settings work with non-playbin2 pipelines too --- tests/examples/seek/seek.c | 32 +++++++------------------------- 1 file changed, 7 insertions(+), 25 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index d861fc5e31..4ec50d8978 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2619,37 +2619,22 @@ is_valid_color_balance_element (GstElement * element) static void find_interface_elements (void) { - GstElement *video_sink, *playsink; GstIterator *it; gpointer item; gboolean done = FALSE, hardware = FALSE; - g_object_get (pipeline, "video-sink", &video_sink, NULL); - if (!video_sink) - return; - if (navigation_element) gst_object_unref (navigation_element); + navigation_element = NULL; if (colorbalance_element) gst_object_unref (colorbalance_element); colorbalance_element = NULL; - if (GST_IS_NAVIGATION (video_sink)) { - navigation_element = gst_object_ref (video_sink); - } else if (GST_IS_BIN (video_sink)) { - navigation_element = - gst_bin_get_by_interface (GST_BIN (video_sink), GST_TYPE_NAVIGATION); - } else { - navigation_element = NULL; - } + navigation_element = + gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION); - gst_object_unref (video_sink); - - playsink = gst_bin_get_by_name (GST_BIN (pipeline), "playsink"); - g_assert (playsink != NULL); - - it = gst_bin_iterate_all_by_interface (GST_BIN (playsink), + it = gst_bin_iterate_all_by_interface (GST_BIN (pipeline), GST_TYPE_COLOR_BALANCE); while (!done) { switch (gst_iterator_next (it, &item)) { @@ -2699,8 +2684,6 @@ find_interface_elements (void) } gst_iterator_free (it); - - gst_object_unref (playsink); } /* called when Navigation command button is pressed */ @@ -3391,8 +3374,8 @@ main (int argc, char **argv) gtk_container_add (GTK_CONTAINER (navigation), grid); } - /* colorbalance expander, only for playbin2 */ - if (pipeline_type == 16) { + /* colorbalance expander */ + { GtkWidget *vbox, *frame; colorbalance = gtk_expander_new ("color balance options"); @@ -3616,8 +3599,7 @@ main (int argc, char **argv) } gtk_box_pack_start (GTK_BOX (vbox), step, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), navigation, FALSE, FALSE, 2); - if (colorbalance) - gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 2); From b8343b4a14ee33b561378d0f3a6e88b5c5acacdc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:05:11 +0100 Subject: [PATCH 16/50] playsink: Force the aspect ratio if the sink has such a property --- gst/playback/gstplaysink.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index e48eefac36..7e5bb575a1 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1376,6 +1376,13 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) chain->async = TRUE; } + /* Make sure the aspect ratio is kept */ + elem = + gst_play_sink_find_property_sinks (playsink, chain->sink, + "force-aspect-ratio", G_TYPE_BOOLEAN); + if (elem) + g_object_set (elem, "force-aspect-ratio", TRUE, NULL); + /* find ts-offset element */ gst_object_replace ((GstObject **) & chain->ts_offset, (GstObject *) gst_play_sink_find_property_sinks (playsink, chain->sink, "ts-offset", @@ -1529,6 +1536,13 @@ setup_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) chain->async = TRUE; } + /* Make sure the aspect ratio is kept */ + elem = + gst_play_sink_find_property_sinks (playsink, chain->sink, + "force-aspect-ratio", G_TYPE_BOOLEAN); + if (elem) + g_object_set (elem, "force-aspect-ratio", TRUE, NULL); + if (chain->conv) g_object_set (chain->conv, "use-balance", !has_color_balance_element (chain->sink) From 993c6e006a13534fe3fa602d1926163385059e1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:33:27 +0100 Subject: [PATCH 17/50] playsink: Proxy the XOverlay interface --- gst/playback/gstplaysink.c | 267 ++++++++++++++++++++++++++++++++++--- 1 file changed, 251 insertions(+), 16 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 7e5bb575a1..ae6f1fc7d0 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "gstplaysink.h" #include "gststreamsynchronizer.h" @@ -205,6 +206,15 @@ struct _GstPlaySink gboolean volume_changed; /* volume/mute changed while no audiochain */ gboolean mute_changed; /* ... has been created yet */ gint64 av_offset; + + /* xoverlay proxy interface */ + GstXOverlay *xoverlay_element; /* protected with LOCK */ + gboolean xoverlay_handle_set; + guintptr xoverlay_handle; + gboolean xoverlay_render_rectangle_set; + gint xoverlay_x, xoverlay_y, xoverlay_width, xoverlay_height; + gboolean xoverlay_handle_events_set; + gboolean xoverlay_handle_events; }; struct _GstPlaySinkClass @@ -327,14 +337,28 @@ gst_play_marshal_BUFFER__BOXED (GClosure * closure, /* static guint gst_play_sink_signals[LAST_SIGNAL] = { 0 }; */ +static void gst_play_sink_implements_interface_init (gpointer g_iface, + gpointer g_iface_data); +static void gst_play_sink_xoverlay_init (gpointer g_iface, + gpointer g_iface_data); static void _do_init (GType type) { + static const GInterfaceInfo impl_info = { + gst_play_sink_implements_interface_init, + NULL, NULL + }; static const GInterfaceInfo svol_info = { NULL, NULL, NULL }; + static const GInterfaceInfo xov_info = { + gst_play_sink_xoverlay_init, + NULL, NULL + }; + g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE, &impl_info); g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info); + g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &xov_info); } G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN, @@ -450,6 +474,7 @@ gst_play_sink_class_init (GstPlaySinkClass * klass) g_param_spec_object ("audio-sink", "Audio Sink", "the audio output element to use (NULL = default sink)", GST_TYPE_ELEMENT, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** * GstPlaySink:text-sink: * @@ -1395,6 +1420,34 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) gst_object_ref_sink (bin); gst_bin_add (bin, chain->sink); + /* Get the XOverlay element */ + { + GstXOverlay *xoverlay = NULL; + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + gst_object_unref (playsink->xoverlay_element); + playsink->xoverlay_element = + GST_X_OVERLAY (gst_bin_get_by_interface (GST_BIN (chain->chain.bin), + GST_TYPE_X_OVERLAY)); + if (playsink->xoverlay_element) + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + GST_OBJECT_UNLOCK (playsink); + + if (xoverlay) { + if (playsink->xoverlay_handle_set) + gst_x_overlay_set_window_handle (xoverlay, playsink->xoverlay_handle); + if (playsink->xoverlay_handle_events_set) + gst_x_overlay_handle_events (xoverlay, + playsink->xoverlay_handle_events); + if (playsink->xoverlay_render_rectangle_set) + gst_x_overlay_set_render_rectangle (xoverlay, + playsink->xoverlay_x, playsink->xoverlay_y, + playsink->xoverlay_width, playsink->xoverlay_height); + gst_object_unref (xoverlay); + } + } + /* decouple decoder from sink, this improves playback quite a lot since the * decoder can continue while the sink blocks for synchronisation. We don't * need a lot of buffers as this consumes a lot of memory and we don't want @@ -1482,6 +1535,7 @@ no_sinks: free_chain ((GstPlayChain *) chain); return NULL; } + link_failed: { GST_ELEMENT_ERROR (playsink, CORE, PAD, @@ -1515,8 +1569,35 @@ setup_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) if (ret == GST_STATE_CHANGE_FAILURE) return FALSE; - /* find ts-offset element */ + /* Get the XOverlay element */ + { + GstXOverlay *xoverlay = NULL; + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + gst_object_unref (playsink->xoverlay_element); + playsink->xoverlay_element = + GST_X_OVERLAY (gst_bin_get_by_interface (GST_BIN (chain->chain.bin), + GST_TYPE_X_OVERLAY)); + if (playsink->xoverlay_element) + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + GST_OBJECT_UNLOCK (playsink); + + if (xoverlay) { + if (playsink->xoverlay_handle_set) + gst_x_overlay_set_window_handle (xoverlay, playsink->xoverlay_handle); + if (playsink->xoverlay_handle_events_set) + gst_x_overlay_handle_events (xoverlay, + playsink->xoverlay_handle_events); + if (playsink->xoverlay_render_rectangle_set) + gst_x_overlay_set_render_rectangle (xoverlay, + playsink->xoverlay_x, playsink->xoverlay_y, + playsink->xoverlay_width, playsink->xoverlay_height); + gst_object_unref (xoverlay); + } + } + + /* find ts-offset element */ gst_object_replace ((GstObject **) & chain->ts_offset, (GstObject *) gst_play_sink_find_property_sinks (playsink, chain->sink, "ts-offset", G_TYPE_INT64)); @@ -2270,6 +2351,12 @@ gst_play_sink_reconfigure (GstPlaySink * playsink) need_text = TRUE; } + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + gst_object_unref (playsink->xoverlay_element); + playsink->xoverlay_element = NULL; + GST_OBJECT_UNLOCK (playsink); + if (((flags & GST_PLAY_FLAG_VIDEO) || (flags & GST_PLAY_FLAG_NATIVE_VIDEO)) && playsink->video_pad) { /* we have video and we are requested to show it */ @@ -3428,6 +3515,43 @@ gst_play_sink_handle_message (GstBin * bin, GstMessage * message) GST_BIN_CLASS (gst_play_sink_parent_class)->handle_message (bin, message); break; } + case GST_MESSAGE_ELEMENT:{ + if (gst_structure_has_name (message->structure, "prepare-xwindow-id")) { + GstXOverlay *xoverlay; + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element + && GST_OBJECT_CAST (playsink->xoverlay_element) != + GST_MESSAGE_SRC (message)) { + gst_object_unref (playsink->xoverlay_element); + playsink->xoverlay_element = NULL; + } + + if (!playsink->xoverlay_element) + playsink->xoverlay_element = + GST_X_OVERLAY (gst_object_ref (GST_MESSAGE_SRC (message))); + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + GST_OBJECT_UNLOCK (playsink); + + GST_DEBUG_OBJECT (playsink, "Got prepare-xwindow-id message"); + + if (playsink->xoverlay_handle_set) + gst_x_overlay_set_window_handle (playsink->xoverlay_element, + playsink->xoverlay_handle); + if (playsink->xoverlay_handle_events_set) + gst_x_overlay_handle_events (playsink->xoverlay_element, + playsink->xoverlay_handle_events); + if (playsink->xoverlay_render_rectangle_set) + gst_x_overlay_set_render_rectangle (playsink->xoverlay_element, + playsink->xoverlay_x, playsink->xoverlay_y, + playsink->xoverlay_width, playsink->xoverlay_height); + + gst_object_unref (xoverlay); + gst_message_unref (message); + gst_x_overlay_prepare_xwindow_id (GST_X_OVERLAY (playsink)); + } + break; + } default: GST_BIN_CLASS (gst_play_sink_parent_class)->handle_message (bin, message); break; @@ -3443,7 +3567,6 @@ static gboolean gst_play_sink_send_event_to_sink (GstPlaySink * playsink, GstEvent * event) { gboolean res = TRUE; - if (playsink->textchain && playsink->textchain->sink) { gst_event_ref (event); if ((res = gst_element_send_event (playsink->textchain->chain.bin, event))) { @@ -3484,9 +3607,7 @@ gst_play_sink_send_event (GstElement * element, GstEvent * event) gboolean res = FALSE; GstEventType event_type = GST_EVENT_TYPE (event); GstPlaySink *playsink; - playsink = GST_PLAY_SINK_CAST (element); - switch (event_type) { case GST_EVENT_SEEK: GST_DEBUG_OBJECT (element, "Sending event to a sink"); @@ -3498,10 +3619,8 @@ gst_play_sink_send_event (GstElement * element, GstEvent * event) guint64 amount; gdouble rate; gboolean flush, intermediate; - gst_event_parse_step (event, &format, &amount, &rate, &flush, &intermediate); - if (format == GST_FORMAT_BUFFERS) { /* for buffers, we will try to step video frames, for other formats we * send the step to all sinks */ @@ -3527,11 +3646,8 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) { GstStateChangeReturn ret; GstStateChangeReturn bret; - GstPlaySink *playsink; - playsink = GST_PLAY_SINK (element); - switch (transition) { case GST_STATE_CHANGE_READY_TO_PAUSED: playsink->need_async_start = TRUE; @@ -3559,7 +3675,6 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) GstPad *opad = GST_PAD_CAST (gst_proxy_pad_get_internal (GST_PROXY_PAD (playsink->audio_pad))); - if (gst_pad_is_blocked (opad)) { gst_pad_set_blocked_async_full (opad, FALSE, sinkpad_blocked_cb, gst_object_ref (playsink), (GDestroyNotify) gst_object_unref); @@ -3599,6 +3714,13 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) gst_object_unref (playsink->videochain->ts_offset); playsink->videochain->ts_offset = NULL; } + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + gst_object_unref (playsink->xoverlay_element); + playsink->xoverlay_element = NULL; + GST_OBJECT_UNLOCK (playsink); + ret = GST_STATE_CHANGE_SUCCESS; break; default: @@ -3708,7 +3830,6 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) if (playsink->textchain && playsink->textchain->sink) gst_bin_remove (GST_BIN_CAST (playsink->textchain->chain.bin), playsink->textchain->sink); - if (playsink->audio_sink != NULL) gst_element_set_state (playsink->audio_sink, GST_STATE_NULL); if (playsink->video_sink != NULL) @@ -3717,7 +3838,6 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) gst_element_set_state (playsink->visualisation, GST_STATE_NULL); if (playsink->text_sink != NULL) gst_element_set_state (playsink->text_sink, GST_STATE_NULL); - free_chain ((GstPlayChain *) playsink->videodeinterlacechain); playsink->videodeinterlacechain = NULL; free_chain ((GstPlayChain *) playsink->videochain); @@ -3734,7 +3854,6 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) break; } return ret; - /* ERRORS */ activate_failed: { @@ -3749,7 +3868,6 @@ gst_play_sink_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * spec) { GstPlaySink *playsink = GST_PLAY_SINK (object); - switch (prop_id) { case PROP_FLAGS: gst_play_sink_set_flags (playsink, g_value_get_flags (value)); @@ -3796,7 +3914,6 @@ gst_play_sink_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * spec) { GstPlaySink *playsink = GST_PLAY_SINK (object); - switch (prop_id) { case PROP_FLAGS: g_value_set_flags (value, gst_play_sink_get_flags (playsink)); @@ -3841,11 +3958,129 @@ gst_play_sink_get_property (GObject * object, guint prop_id, } } +static void +gst_play_sink_xoverlay_expose (GstXOverlay * overlay) +{ + GstPlaySink *playsink = GST_PLAY_SINK (overlay); + GstXOverlay *xoverlay; + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + else + xoverlay = NULL; + GST_OBJECT_UNLOCK (playsink); + + if (xoverlay) { + gst_x_overlay_expose (xoverlay); + gst_object_unref (xoverlay); + } +} + +static void +gst_play_sink_xoverlay_handle_events (GstXOverlay * overlay, + gboolean handle_events) +{ + GstPlaySink *playsink = GST_PLAY_SINK (overlay); + GstXOverlay *xoverlay; + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + else + xoverlay = NULL; + GST_OBJECT_UNLOCK (playsink); + + playsink->xoverlay_handle_events_set = TRUE; + playsink->xoverlay_handle_events = handle_events; + + if (xoverlay) { + gst_x_overlay_handle_events (xoverlay, handle_events); + gst_object_unref (xoverlay); + } +} + +static void +gst_play_sink_xoverlay_set_render_rectangle (GstXOverlay * overlay, gint x, + gint y, gint width, gint height) +{ + GstPlaySink *playsink = GST_PLAY_SINK (overlay); + GstXOverlay *xoverlay; + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + else + xoverlay = NULL; + GST_OBJECT_UNLOCK (playsink); + + playsink->xoverlay_render_rectangle_set = TRUE; + playsink->xoverlay_x = x; + playsink->xoverlay_y = y; + playsink->xoverlay_width = width; + playsink->xoverlay_height = height; + + if (xoverlay) { + gst_x_overlay_set_render_rectangle (xoverlay, x, y, width, height); + gst_object_unref (xoverlay); + } +} + +static void +gst_play_sink_xoverlay_set_window_handle (GstXOverlay * overlay, + guintptr handle) +{ + GstPlaySink *playsink = GST_PLAY_SINK (overlay); + GstXOverlay *xoverlay; + + GST_OBJECT_LOCK (playsink); + if (playsink->xoverlay_element) + xoverlay = GST_X_OVERLAY (gst_object_ref (playsink->xoverlay_element)); + else + xoverlay = NULL; + GST_OBJECT_UNLOCK (playsink); + + playsink->xoverlay_handle_set = TRUE; + playsink->xoverlay_handle = handle; + + if (xoverlay) { + gst_x_overlay_set_window_handle (xoverlay, handle); + gst_object_unref (xoverlay); + } +} + +static void +gst_play_sink_xoverlay_init (gpointer g_iface, gpointer g_iface_data) +{ + GstXOverlayClass *iface = (GstXOverlayClass *) g_iface; + iface->expose = gst_play_sink_xoverlay_expose; + iface->handle_events = gst_play_sink_xoverlay_handle_events; + iface->set_render_rectangle = gst_play_sink_xoverlay_set_render_rectangle; + iface->set_window_handle = gst_play_sink_xoverlay_set_window_handle; +} + +static gboolean +gst_play_sink_implements_interface_supported (GstImplementsInterface * iface, + GType type) +{ + if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME) + return TRUE; + else + return FALSE; +} + +static void +gst_play_sink_implements_interface_init (gpointer g_iface, + gpointer g_iface_data) +{ + GstImplementsInterfaceClass *iface = (GstImplementsInterfaceClass *) g_iface; + iface->supported = gst_play_sink_implements_interface_supported; +} + gboolean gst_play_sink_plugin_init (GstPlugin * plugin) { GST_DEBUG_CATEGORY_INIT (gst_play_sink_debug, "playsink", 0, "play bin"); - return gst_element_register (plugin, "playsink", GST_RANK_NONE, GST_TYPE_PLAY_SINK); } From 9dab4a847730234ba403b2a020e4115a8df9712c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:42:55 +0100 Subject: [PATCH 18/50] playbin2: Proxy the XOverlay interface --- gst/playback/gstplaybin2.c | 81 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 1874d9556a..031ddd009c 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -232,6 +232,7 @@ #include #include #include +#include #include "gstplay-enum.h" #include "gstplay-marshal.h" @@ -580,6 +581,11 @@ if (id) { \ id = 0; \ } +static void gst_play_bin_implements_interface_init (gpointer g_iface, + gpointer g_iface_data); +static void gst_play_bin_xoverlay_init (gpointer g_iface, + gpointer g_iface_data); + static GType gst_play_bin_get_type (void) { @@ -598,15 +604,27 @@ gst_play_bin_get_type (void) (GInstanceInitFunc) gst_play_bin_init, NULL }; + static const GInterfaceInfo impl_info = { + gst_play_bin_implements_interface_init, + NULL, NULL + }; static const GInterfaceInfo svol_info = { NULL, NULL, NULL }; + static const GInterfaceInfo xov_info = { + gst_play_bin_xoverlay_init, + NULL, NULL + }; gst_play_bin_type = g_type_register_static (GST_TYPE_PIPELINE, "GstPlayBin2", &gst_play_bin_info, 0); + g_type_add_interface_static (gst_play_bin_type, + GST_TYPE_IMPLEMENTS_INTERFACE, &impl_info); g_type_add_interface_static (gst_play_bin_type, GST_TYPE_STREAM_VOLUME, &svol_info); + g_type_add_interface_static (gst_play_bin_type, GST_TYPE_X_OVERLAY, + &xov_info); } return gst_play_bin_type; @@ -4020,6 +4038,69 @@ failure: } } +static void +gst_play_bin_xoverlay_expose (GstXOverlay * overlay) +{ + GstPlayBin *playbin = GST_PLAY_BIN (overlay); + + gst_x_overlay_expose (GST_X_OVERLAY (playbin->playsink)); +} + +static void +gst_play_bin_xoverlay_handle_events (GstXOverlay * overlay, + gboolean handle_events) +{ + GstPlayBin *playbin = GST_PLAY_BIN (overlay); + + gst_x_overlay_handle_events (GST_X_OVERLAY (playbin->playsink), + handle_events); +} + +static void +gst_play_bin_xoverlay_set_render_rectangle (GstXOverlay * overlay, gint x, + gint y, gint width, gint height) +{ + GstPlayBin *playbin = GST_PLAY_BIN (overlay); + + gst_x_overlay_set_render_rectangle (GST_X_OVERLAY (playbin->playsink), x, y, + width, height); +} + +static void +gst_play_bin_xoverlay_set_window_handle (GstXOverlay * overlay, guintptr handle) +{ + GstPlayBin *playbin = GST_PLAY_BIN (overlay); + + gst_x_overlay_set_window_handle (GST_X_OVERLAY (playbin->playsink), handle); +} + +static void +gst_play_bin_xoverlay_init (gpointer g_iface, gpointer g_iface_data) +{ + GstXOverlayClass *iface = (GstXOverlayClass *) g_iface; + iface->expose = gst_play_bin_xoverlay_expose; + iface->handle_events = gst_play_bin_xoverlay_handle_events; + iface->set_render_rectangle = gst_play_bin_xoverlay_set_render_rectangle; + iface->set_window_handle = gst_play_bin_xoverlay_set_window_handle; +} + +static gboolean +gst_play_bin_implements_interface_supported (GstImplementsInterface * iface, + GType type) +{ + if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME) + return TRUE; + else + return FALSE; +} + +static void +gst_play_bin_implements_interface_init (gpointer g_iface, gpointer g_iface_data) +{ + GstImplementsInterfaceClass *iface = (GstImplementsInterfaceClass *) g_iface; + iface->supported = gst_play_bin_implements_interface_supported; +} + gboolean gst_play_bin2_plugin_init (GstPlugin * plugin) { From 99d7aa655620a8cc4962123df5823905043d2375 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:43:09 +0100 Subject: [PATCH 19/50] seek: Directly use the XOverlay interface on playbin2 --- tests/examples/seek/seek.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 4ec50d8978..e1c861eeed 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2762,6 +2762,8 @@ draw_cb (GtkWidget * widget, cairo_t * cr, gpointer data) if (xoverlay_element) gst_x_overlay_expose (GST_X_OVERLAY (xoverlay_element)); + else if (pipeline_type == 16) + gst_x_overlay_expose (GST_X_OVERLAY (pipeline)); return FALSE; } @@ -2929,9 +2931,11 @@ connect_bus_signals (GstElement * pipeline) GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) - /* handle prepare-xwindow-id element message synchronously */ - gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, - pipeline); + if (pipeline_type != 16) { + /* handle prepare-xwindow-id element message synchronously, but only for non-playbin2 */ + gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, + pipeline); + } #endif gst_bus_add_signal_watch_full (bus, G_PRIORITY_HIGH); @@ -3641,6 +3645,11 @@ main (int argc, char **argv) #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) /* we should have the XID now */ g_assert (embed_xid != 0); + + if (pipeline_type == 16) { + gst_x_overlay_set_window_handle (GST_X_OVERLAY (pipeline), embed_xid); + gst_x_overlay_handle_events (GST_X_OVERLAY (pipeline), FALSE); + } #endif if (verbose) { From d5779c96c4254e220f4b7c74d8e7b237782c107b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:54:27 +0100 Subject: [PATCH 20/50] playsink: Proxy navigation interface --- gst/playback/gstplaysink.c | 47 +++++++++++++++++++++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index ae6f1fc7d0..3322ea49a5 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -35,6 +35,7 @@ #include #include #include +#include #include "gstplaysink.h" #include "gststreamsynchronizer.h" @@ -341,6 +342,8 @@ static void gst_play_sink_implements_interface_init (gpointer g_iface, gpointer g_iface_data); static void gst_play_sink_xoverlay_init (gpointer g_iface, gpointer g_iface_data); +static void gst_play_sink_navigation_init (gpointer g_iface, + gpointer g_iface_data); static void _do_init (GType type) { @@ -355,10 +358,15 @@ _do_init (GType type) gst_play_sink_xoverlay_init, NULL, NULL }; + static const GInterfaceInfo nav_info = { + gst_play_sink_navigation_init, + NULL, NULL + }; g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE, &impl_info); g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info); g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &xov_info); + g_type_add_interface_static (type, GST_TYPE_NAVIGATION, &nav_info); } G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN, @@ -4063,7 +4071,8 @@ static gboolean gst_play_sink_implements_interface_supported (GstImplementsInterface * iface, GType type) { - if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME) + if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME || + type == GST_TYPE_NAVIGATION) return TRUE; else return FALSE; @@ -4077,6 +4086,42 @@ gst_play_sink_implements_interface_init (gpointer g_iface, iface->supported = gst_play_sink_implements_interface_supported; } +static void +gst_play_sink_navigation_send_event (GstNavigation * navigation, + GstStructure * structure) +{ + GstPlaySink *playsink = GST_PLAY_SINK (navigation); + GstBin *bin = NULL; + + GST_PLAY_SINK_LOCK (playsink); + if (playsink->videochain && playsink->videochain->chain.bin) + bin = GST_BIN (gst_object_ref (playsink->videochain->chain.bin)); + GST_PLAY_SINK_UNLOCK (playsink); + + if (bin) { + GstElement *nav = gst_bin_get_by_interface (bin, GST_TYPE_NAVIGATION); + + if (nav) { + gst_navigation_send_event (GST_NAVIGATION (nav), structure); + structure = NULL; + gst_object_unref (nav); + } + + gst_object_unref (bin); + } + + if (structure) + gst_structure_free (structure); +} + +static void +gst_play_sink_navigation_init (gpointer g_iface, gpointer g_iface_data) +{ + GstNavigationInterface *iface = (GstNavigationInterface *) g_iface; + + iface->send_event = gst_play_sink_navigation_send_event; +} + gboolean gst_play_sink_plugin_init (GstPlugin * plugin) { From 46a3ea011d7e075a509cb5d34159085f6f951787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:56:37 +0100 Subject: [PATCH 21/50] playbin2: Proxy navigation interface --- gst/playback/gstplaybin2.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 031ddd009c..c495838f7a 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -233,6 +233,7 @@ #include #include #include +#include #include "gstplay-enum.h" #include "gstplay-marshal.h" @@ -585,6 +586,8 @@ static void gst_play_bin_implements_interface_init (gpointer g_iface, gpointer g_iface_data); static void gst_play_bin_xoverlay_init (gpointer g_iface, gpointer g_iface_data); +static void gst_play_bin_navigation_init (gpointer g_iface, + gpointer g_iface_data); static GType gst_play_bin_get_type (void) @@ -615,6 +618,10 @@ gst_play_bin_get_type (void) gst_play_bin_xoverlay_init, NULL, NULL }; + static const GInterfaceInfo nav_info = { + gst_play_bin_navigation_init, + NULL, NULL + }; gst_play_bin_type = g_type_register_static (GST_TYPE_PIPELINE, "GstPlayBin2", &gst_play_bin_info, 0); @@ -625,6 +632,8 @@ gst_play_bin_get_type (void) &svol_info); g_type_add_interface_static (gst_play_bin_type, GST_TYPE_X_OVERLAY, &xov_info); + g_type_add_interface_static (gst_play_bin_type, GST_TYPE_NAVIGATION, + &nav_info); } return gst_play_bin_type; @@ -4088,7 +4097,8 @@ static gboolean gst_play_bin_implements_interface_supported (GstImplementsInterface * iface, GType type) { - if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME) + if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME || + type == GST_TYPE_NAVIGATION) return TRUE; else return FALSE; @@ -4101,6 +4111,23 @@ gst_play_bin_implements_interface_init (gpointer g_iface, gpointer g_iface_data) iface->supported = gst_play_bin_implements_interface_supported; } +static void +gst_play_bin_navigation_send_event (GstNavigation * navigation, + GstStructure * structure) +{ + GstPlayBin *playbin = GST_PLAY_BIN (navigation); + + gst_navigation_send_event (GST_NAVIGATION (playbin->playsink), structure); +} + +static void +gst_play_bin_navigation_init (gpointer g_iface, gpointer g_iface_data) +{ + GstNavigationInterface *iface = (GstNavigationInterface *) g_iface; + + iface->send_event = gst_play_bin_navigation_send_event; +} + gboolean gst_play_bin2_plugin_init (GstPlugin * plugin) { From 3ab387cd91ac0c4eb84be145811f3217d8db8613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 11:59:17 +0100 Subject: [PATCH 22/50] seek: Directly use navigation interface on playbin2 --- tests/examples/seek/seek.c | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index e1c861eeed..c7e7e6cfc5 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2631,8 +2631,9 @@ find_interface_elements (void) gst_object_unref (colorbalance_element); colorbalance_element = NULL; - navigation_element = - gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION); + if (pipeline_type != 16) + navigation_element = + gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION); it = gst_bin_iterate_all_by_interface (GST_BIN (pipeline), GST_TYPE_COLOR_BALANCE); @@ -2692,13 +2693,17 @@ navigation_cmd_cb (GtkButton * button, gpointer data) { GstNavigationCommand cmd = GPOINTER_TO_INT (data); - if (!navigation_element) { - find_interface_elements (); - if (!navigation_element) - return; - } + if (pipeline_type == 16) { + gst_navigation_send_command (GST_NAVIGATION (pipeline), cmd); + } else { + if (!navigation_element) { + find_interface_elements (); + if (!navigation_element) + return; + } - gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd); + gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd); + } } #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) @@ -2799,6 +2804,9 @@ button_press_cb (GtkWidget * widget, GdkEventButton * event, gpointer user_data) if (navigation_element) gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), "mouse-button-press", event->button, event->x, event->y); + else if (pipeline_type == 16) + gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline), + "mouse-button-press", event->button, event->x, event->y); return FALSE; } @@ -2810,6 +2818,9 @@ button_release_cb (GtkWidget * widget, GdkEventButton * event, if (navigation_element) gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), "mouse-button-release", event->button, event->x, event->y); + else if (pipeline_type == 16) + gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline), + "mouse-button-release", event->button, event->x, event->y); return FALSE; } @@ -2820,6 +2831,9 @@ key_press_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) if (navigation_element) gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), "key-press", gdk_keyval_name (event->keyval)); + else if (pipeline_type == 16) + gst_navigation_send_key_event (GST_NAVIGATION (pipeline), + "key-press", gdk_keyval_name (event->keyval)); return FALSE; } @@ -2830,6 +2844,9 @@ key_release_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) if (navigation_element) gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), "key-release", gdk_keyval_name (event->keyval)); + else if (pipeline_type == 16) + gst_navigation_send_key_event (GST_NAVIGATION (pipeline), + "key-release", gdk_keyval_name (event->keyval)); return FALSE; } @@ -2841,6 +2858,9 @@ motion_notify_cb (GtkWidget * widget, GdkEventMotion * event, if (navigation_element) gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), "mouse-move", 0, event->x, event->y); + else if (pipeline_type == 16) + gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline), + "mouse-move", 0, event->x, event->y); return FALSE; } From 4991992029d4ca82c259fbc34c4d96250823f035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 23 Feb 2012 11:04:00 +0000 Subject: [PATCH 23/50] Bump version after release --- configure.ac | 4 +- docs/plugins/gst-plugins-base-plugins.args | 217 +++++++++++++++--- .../gst-plugins-base-plugins.hierarchy | 15 +- .../gst-plugins-base-plugins.interfaces | 3 + docs/plugins/inspect/plugin-adder.xml | 4 +- docs/plugins/inspect/plugin-alsa.xml | 4 +- docs/plugins/inspect/plugin-app.xml | 4 +- docs/plugins/inspect/plugin-audioconvert.xml | 4 +- docs/plugins/inspect/plugin-audiorate.xml | 4 +- docs/plugins/inspect/plugin-audioresample.xml | 4 +- docs/plugins/inspect/plugin-audiotestsrc.xml | 4 +- docs/plugins/inspect/plugin-cdparanoia.xml | 4 +- docs/plugins/inspect/plugin-decodebin.xml | 4 +- docs/plugins/inspect/plugin-encoding.xml | 4 +- .../inspect/plugin-ffmpegcolorspace.xml | 4 +- docs/plugins/inspect/plugin-gdp.xml | 4 +- docs/plugins/inspect/plugin-gio.xml | 4 +- docs/plugins/inspect/plugin-gnomevfs.xml | 4 +- docs/plugins/inspect/plugin-libvisual.xml | 4 +- docs/plugins/inspect/plugin-ogg.xml | 8 +- docs/plugins/inspect/plugin-pango.xml | 16 +- docs/plugins/inspect/plugin-playback.xml | 4 +- docs/plugins/inspect/plugin-subparse.xml | 4 +- docs/plugins/inspect/plugin-tcp.xml | 4 +- docs/plugins/inspect/plugin-theora.xml | 4 +- .../inspect/plugin-typefindfunctions.xml | 4 +- docs/plugins/inspect/plugin-uridecodebin.xml | 4 +- docs/plugins/inspect/plugin-videorate.xml | 4 +- docs/plugins/inspect/plugin-videoscale.xml | 8 +- docs/plugins/inspect/plugin-videotestsrc.xml | 4 +- docs/plugins/inspect/plugin-volume.xml | 4 +- docs/plugins/inspect/plugin-vorbis.xml | 6 +- docs/plugins/inspect/plugin-ximagesink.xml | 4 +- docs/plugins/inspect/plugin-xvimagesink.xml | 4 +- win32/common/_stdint.h | 4 +- win32/common/audio-enumtypes.c | 4 + win32/common/config.h | 32 ++- win32/common/gstrtsp-enumtypes.c | 2 + 38 files changed, 301 insertions(+), 122 deletions(-) diff --git a/configure.ac b/configure.ac index 859bb05cf8..344ec29768 100644 --- a/configure.ac +++ b/configure.ac @@ -5,7 +5,7 @@ dnl please read gstreamer/docs/random/autotools before changing this file dnl initialize autoconf dnl releases only do -Wall, git and prerelease does -Werror too dnl use a three digit version number for releases, and four for git/prerelease -AC_INIT(GStreamer Base Plug-ins, 0.10.35.1, +AC_INIT(GStreamer Base Plug-ins, 0.10.36.1, http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer, gst-plugins-base) @@ -60,7 +60,7 @@ AC_LIBTOOL_WIN32_DLL AM_PROG_LIBTOOL dnl *** required versions of GStreamer stuff *** -GST_REQ=0.10.35.1 +GST_REQ=0.10.36 dnl *** autotools stuff **** diff --git a/docs/plugins/gst-plugins-base-plugins.args b/docs/plugins/gst-plugins-base-plugins.args index ffb6e3fa81..574ededc06 100644 --- a/docs/plugins/gst-plugins-base-plugins.args +++ b/docs/plugins/gst-plugins-base-plugins.args @@ -64,7 +64,7 @@ rw Synchronous -When enabled, runs the X display in synchronous mode. (used only for debugging). +When enabled, runs the X display in synchronous mode. (unrelated to A/V sync, used only for debugging). FALSE @@ -204,7 +204,7 @@ rw Synchronous -When enabled, runs the X display in synchronous mode. (used only for debugging). +When enabled, runs the X display in synchronous mode. (unrelated to A/V sync, used only for debugging). FALSE @@ -711,7 +711,7 @@ GstMultiFdSink::buffers-max gint ->= -1 +>= G_MAXULONG rw Buffers max max number of buffers to queue for a client (-1 = no limit). @@ -731,7 +731,7 @@ GstMultiFdSink::buffers-soft-max gint ->= -1 +>= G_MAXULONG rw Buffers soft max Recover client when going over this limit (-1 = no limit). @@ -821,7 +821,7 @@ GstMultiFdSink::buffers-min gint ->= -1 +>= G_MAXULONG rw Buffers min min number of buffers to queue (-1 = as few as possible). @@ -851,7 +851,7 @@ GstMultiFdSink::bytes-min gint ->= -1 +>= G_MAXULONG rw Bytes min min number of bytes to queue (-1 = as little as possible). @@ -861,7 +861,7 @@ GstMultiFdSink::time-min gint64 ->= -1 +>= G_MAXULONG rw Time min min number of time to queue (-1 = as little as possible). @@ -881,7 +881,7 @@ GstMultiFdSink::units-max gint64 ->= -1 +>= G_MAXULONG rw Units max max number of units to queue (-1 = no limit). @@ -891,7 +891,7 @@ GstMultiFdSink::units-soft-max gint64 ->= -1 +>= G_MAXULONG rw Units soft max Recover client when going over this limit (-1 = no limit). @@ -901,7 +901,7 @@ GstMultiFdSink::qos-dscp gint -[-1,63] +[G_MAXULONG,63] rw QoS diff srv code point Quality of Service, differentiated services code point (-1 default). @@ -1081,7 +1081,7 @@ GstVorbisEnc::bitrate gint -[-1,250001] +[G_MAXULONG,250001] rw Target Bitrate Attempt to encode at a bitrate averaging this (in bps). This uses the bitrate management engine, and is not recommended for most users. Quality is a better alternative. (-1 == disabled). @@ -1111,7 +1111,7 @@ GstVorbisEnc::max-bitrate gint -[-1,250001] +[G_MAXULONG,250001] rw Maximum Bitrate Specify a maximum bitrate (in bps). Useful for streaming applications. (-1 == disabled). @@ -1121,7 +1121,7 @@ GstVorbisEnc::min-bitrate gint -[-1,250001] +[G_MAXULONG,250001] rw Minimum Bitrate Specify a minimum bitrate (in bps). Useful for encoding for a fixed-size channel. (-1 == disabled). @@ -1283,7 +1283,7 @@ gboolean rw -VP3 Compatible +Cap Overflow Enable capping of bit reservoir overflows. TRUE @@ -1293,7 +1293,7 @@ gboolean rw -VP3 Compatible +Cap Underflow Enable capping of bit reservoir underflows. FALSE @@ -1303,7 +1303,7 @@ gboolean rw -VP3 Compatible +Drop Frames Allow or disallow frame dropping. TRUE @@ -1348,6 +1348,16 @@ Single pass + +GstTheoraEnc::dup-on-gap +gboolean + +rw +Create DUP frame on GAP flag +Allow codec to handle frames with GAP flag as duplicates of previous frame. This is good to work with variable frame rate stabilized by videorate element. It will add variable latency with maximal size of keyframe distance, this way it is a bad idea to use with live streams. +FALSE + + GstGnomeVFSSrc::handle GnomeVFSHandle* @@ -1448,6 +1458,26 @@ 500000000 + +GstOggMux::max-tolerance +guint64 + +rw +Max time tolerance +Maximum timestamp difference for maintaining perfect granules. +40000000 + + + +GstOggMux::skeleton +gboolean + +rw +Skeleton +Whether to include a Skeleton track. +FALSE + + GstAlsaSrc::device gchar* @@ -1608,6 +1638,46 @@ FALSE + +GstVideoScale::dither +gboolean + +rwx +Dither +Add dither (only used for Lanczos method). +FALSE + + + +GstVideoScale::envelope +gdouble +[0,5] +rwx +Envelope +Size of filter envelope. +2 + + + +GstVideoScale::sharpen +gdouble +[0,1] +rwx +Sharpen +Sharpening. +0 + + + +GstVideoScale::sharpness +gdouble +[0,2] +rwx +Sharpness +Sharpness of filter. +1 + + GstVideoRate::drop guint64 @@ -1681,7 +1751,7 @@ GstVideoRate::average-period guint64 -<= G_MAXINT64 +<= G_MAXLONG rw Period over which to average Period over which to average the framerate (in ns) (0 = disabled). @@ -1698,6 +1768,26 @@ FALSE + +GstVideoRate::force-fps +GstFraction + +rwx +Force output framerate +Force output framerate (negative means negotiate via caps). + + + + +GstVideoRate::max-rate +gint +>= 1 +rwx +maximum framerate +Maximum framerate allowed to pass through (in frames per second, implies drop-only). +2147483647 + + GstAudioRate::add guint64 @@ -2028,6 +2118,26 @@ 0.5 + +GstTextOverlay::outline-color +guint + +rw +Text Outline Color +Color to use for outline the text (big-endian ARGB). +4278190080 + + + +GstTextOverlay::shadow +gboolean + +rw +create shadow of text +Whether to create a shadow of the letters under the text. +TRUE + + CDParanoia::abort-on-skip gboolean @@ -2221,7 +2331,7 @@ GstCdParanoiaSrc::read-speed gint ->= -1 +>= G_MAXULONG rw Read speed Read from device at specified speed. @@ -2231,7 +2341,7 @@ GstCdParanoiaSrc::search-overlap gint -[-1,75] +[G_MAXULONG,75] rw Search overlap Force minimum overlap search during verification to n sectors. @@ -2241,7 +2351,7 @@ GstCdParanoiaSrc::cache-size gint ->= -1 +>= G_MAXULONG rw Cache size Set CD cache size to n sectors (-1 = auto). @@ -2471,7 +2581,7 @@ GstURIDecodeBin::buffer-duration gint64 ->= -1 +>= G_MAXULONG rw Buffer duration (ns) Buffer duration when buffering streams (-1 default value). @@ -2481,7 +2591,7 @@ GstURIDecodeBin::buffer-size gint ->= -1 +>= G_MAXULONG rw Buffer size (bytes) Buffer size when buffering streams (-1 default value). @@ -2521,7 +2631,7 @@ GstURIDecodeBin::ring-buffer-max-size guint64 -<= G_MAXULONG +<= G_MAXUINT rw Max. ring buffer size (bytes) Max. amount of data in the ring buffer (bytes, 0 = ring buffer disabled). @@ -2691,7 +2801,7 @@ GstPlayBin2::current-audio gint ->= -1 +>= G_MAXULONG rw Current audio Currently playing audio stream (-1 = auto). @@ -2701,7 +2811,7 @@ GstPlayBin2::current-text gint ->= -1 +>= G_MAXULONG rw Current Text Currently playing text stream (-1 = auto). @@ -2711,7 +2821,7 @@ GstPlayBin2::current-video gint ->= -1 +>= G_MAXULONG rw Current Video Currently playing video stream (-1 = auto). @@ -2725,7 +2835,7 @@ rw Flags Flags to control behaviour. -Render the video stream|Render the audio stream|Render subtitles|Use software volume +Render the video stream|Render the audio stream|Render subtitles|Use software volume|Use software color balance @@ -2861,7 +2971,7 @@ GstPlayBin2::buffer-duration gint64 ->= -1 +>= G_MAXULONG rw Buffer duration (ns) Buffer duration when buffering network streams. @@ -2871,7 +2981,7 @@ GstPlayBin2::buffer-size gint ->= -1 +>= G_MAXULONG rw Buffer size (bytes) Buffer size when buffering network streams. @@ -2911,7 +3021,7 @@ GstPlayBin2::ring-buffer-max-size guint64 -<= G_MAXULONG +<= G_MAXUINT rw Max. ring buffer size (bytes) Max. amount of data in the ring buffer (bytes, 0 = ring buffer disabled). @@ -3251,7 +3361,7 @@ GstAppSrc::max-latency gint64 ->= -1 +>= G_MAXULONG rw Max Latency The maximum latency (-1 = unlimited). @@ -3261,7 +3371,7 @@ GstAppSrc::min-latency gint64 ->= -1 +>= G_MAXULONG rw Min Latency The minimum latency (-1 = default). @@ -3271,7 +3381,7 @@ GstAppSrc::size gint64 ->= -1 +>= G_MAXULONG rw Size The size of the data stream in bytes (-1 if unknown). @@ -3345,7 +3455,7 @@ rw Flags Flags to control behaviour. -Render the video stream|Render the audio stream|Render subtitles|Use software volume +Render the video stream|Render the audio stream|Render subtitles|Use software volume|Use software color balance @@ -3418,6 +3528,36 @@ + +GstPlaySink::audio-sink +GstElement* + +rw +Audio Sink +the audio output element to use (NULL = default sink). + + + + +GstPlaySink::text-sink +GstElement* + +rw +Text sink +the text output element to use (NULL = default textoverlay). + + + + +GstPlaySink::video-sink +GstElement* + +rw +Video Sink +the video output element to use (NULL = default sink). + + + GstSubtitleOverlay::font-desc gchar* @@ -3508,3 +3648,12 @@ 1000000000 + +GstEncodeBin::flags +GstEncFlags + +rw +Flags +Flags to control behaviour. + + diff --git a/docs/plugins/gst-plugins-base-plugins.hierarchy b/docs/plugins/gst-plugins-base-plugins.hierarchy index 89307df889..b55999f3aa 100644 --- a/docs/plugins/gst-plugins-base-plugins.hierarchy +++ b/docs/plugins/gst-plugins-base-plugins.hierarchy @@ -11,6 +11,10 @@ GObject GstElement GstAdder GstAlsaMixerElement + GstAudioDecoder + GstVorbisDec + GstAudioEncoder + GstVorbisEnc GstAudioRate GstBaseSink GstAppSink @@ -42,8 +46,6 @@ GObject GstCdParanoiaSrc GstTCPClientSrc GstTCPServerSrc - GstV4lElement - GstV4lSrc GstVideoTestSrc GstBaseTransform GstAudioConvert @@ -53,6 +55,7 @@ GObject GstVideoFilter GstFFMpegCsp GstVideoScale + GstVideoRate GstBin GstDecodeBin GstDecodeBin2 @@ -84,18 +87,15 @@ GObject GstTheoraDec GstTheoraEnc GstTheoraParse - GstVideoRate GstVisual GstVisualbumpscope GstVisualcorona - GstVisualgforce GstVisualinfinite GstVisualjakdaw GstVisualjess + GstVisuallv_analyzer GstVisuallv_scope GstVisualoinksie - GstVorbisDec - GstVorbisEnc GstVorbisParse GstVorbisTag GstPad @@ -113,8 +113,6 @@ GObject GstTaskPool GstSignalObject GstStreamInfo - GstTunerChannel - GstTunerNorm PangoContext PangoFontMap PangoFcFontMap @@ -131,7 +129,6 @@ GInterface GstPropertyProbe GstStreamVolume GstTagSetter - GstTuner GstURIHandler GstXOverlay PangoCairoFontMap diff --git a/docs/plugins/gst-plugins-base-plugins.interfaces b/docs/plugins/gst-plugins-base-plugins.interfaces index 8f393f45c1..3d81d8f26d 100644 --- a/docs/plugins/gst-plugins-base-plugins.interfaces +++ b/docs/plugins/gst-plugins-base-plugins.interfaces @@ -3,6 +3,7 @@ GstAlsaSink GstPropertyProbe GstAlsaSrc GstImplementsInterface GstMixer GstPropertyProbe GstAppSink GstURIHandler GstAppSrc GstURIHandler +GstAudioEncoder GstPreset GstBin GstChildProxy GstCdParanoiaSrc GstURIHandler GstCddaBaseSrc GstURIHandler @@ -19,12 +20,14 @@ GstPlayBaseBin GstChildProxy GstPlayBin GstChildProxy GstPlayBin2 GstChildProxy GstStreamVolume GstPlaySink GstChildProxy +GstPlaySink GstChildProxy GstStreamVolume GstSubtitleOverlay GstChildProxy GstTheoraEnc GstPreset GstURIDecodeBin GstChildProxy GstV4lElement GstImplementsInterface GstTuner GstXOverlay GstColorBalance GstPropertyProbe GstV4lSrc GstImplementsInterface GstTuner GstXOverlay GstColorBalance GstPropertyProbe GstVolume GstImplementsInterface GstMixer GstStreamVolume +GstVorbisEnc GstPreset GstTagSetter GstVorbisEnc GstTagSetter GstPreset GstVorbisTag GstTagSetter GstXImageSink GstImplementsInterface GstNavigation GstXOverlay diff --git a/docs/plugins/inspect/plugin-adder.xml b/docs/plugins/inspect/plugin-adder.xml index 526d9c0c49..6d7ce4960b 100644 --- a/docs/plugins/inspect/plugin-adder.xml +++ b/docs/plugins/inspect/plugin-adder.xml @@ -3,7 +3,7 @@ Adds multiple streams ../../gst/adder/.libs/libgstadder.so libgstadder.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-alsa.xml b/docs/plugins/inspect/plugin-alsa.xml index d1623e863a..7098c5c9bf 100644 --- a/docs/plugins/inspect/plugin-alsa.xml +++ b/docs/plugins/inspect/plugin-alsa.xml @@ -3,7 +3,7 @@ ALSA plugin library ../../ext/alsa/.libs/libgstalsa.so libgstalsa.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -49,4 +49,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-app.xml b/docs/plugins/inspect/plugin-app.xml index 2648f4aa46..7aafd66021 100644 --- a/docs/plugins/inspect/plugin-app.xml +++ b/docs/plugins/inspect/plugin-app.xml @@ -3,7 +3,7 @@ Elements used to communicate with applications ../../gst/app/.libs/libgstapp.so libgstapp.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -40,4 +40,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-audioconvert.xml b/docs/plugins/inspect/plugin-audioconvert.xml index 1bdd23354d..6dcb775c48 100644 --- a/docs/plugins/inspect/plugin-audioconvert.xml +++ b/docs/plugins/inspect/plugin-audioconvert.xml @@ -3,7 +3,7 @@ Convert audio to different formats ../../gst/audioconvert/.libs/libgstaudioconvert.so libgstaudioconvert.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-audiorate.xml b/docs/plugins/inspect/plugin-audiorate.xml index 4c32e10add..f6ecc7532e 100644 --- a/docs/plugins/inspect/plugin-audiorate.xml +++ b/docs/plugins/inspect/plugin-audiorate.xml @@ -3,7 +3,7 @@ Adjusts audio frames ../../gst/audiorate/.libs/libgstaudiorate.so libgstaudiorate.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-audioresample.xml b/docs/plugins/inspect/plugin-audioresample.xml index 062caf3c71..e58baf9204 100644 --- a/docs/plugins/inspect/plugin-audioresample.xml +++ b/docs/plugins/inspect/plugin-audioresample.xml @@ -3,7 +3,7 @@ Resamples audio ../../gst/audioresample/.libs/libgstaudioresample.so libgstaudioresample.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-audiotestsrc.xml b/docs/plugins/inspect/plugin-audiotestsrc.xml index 5190389895..e12cf3124e 100644 --- a/docs/plugins/inspect/plugin-audiotestsrc.xml +++ b/docs/plugins/inspect/plugin-audiotestsrc.xml @@ -3,7 +3,7 @@ Creates audio test signals of given frequency and volume ../../gst/audiotestsrc/.libs/libgstaudiotestsrc.so libgstaudiotestsrc.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-cdparanoia.xml b/docs/plugins/inspect/plugin-cdparanoia.xml index 2dae88da55..2ba49b70ac 100644 --- a/docs/plugins/inspect/plugin-cdparanoia.xml +++ b/docs/plugins/inspect/plugin-cdparanoia.xml @@ -3,7 +3,7 @@ Read audio from CD in paranoid mode ../../ext/cdparanoia/.libs/libgstcdparanoia.so libgstcdparanoia.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-decodebin.xml b/docs/plugins/inspect/plugin-decodebin.xml index e8f7814935..31a18a948f 100644 --- a/docs/plugins/inspect/plugin-decodebin.xml +++ b/docs/plugins/inspect/plugin-decodebin.xml @@ -3,7 +3,7 @@ decoder bin ../../gst/playback/.libs/libgstdecodebin.so libgstdecodebin.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-encoding.xml b/docs/plugins/inspect/plugin-encoding.xml index 0a97277766..589e3ee35b 100644 --- a/docs/plugins/inspect/plugin-encoding.xml +++ b/docs/plugins/inspect/plugin-encoding.xml @@ -3,7 +3,7 @@ various encoding-related elements ../../gst/encoding/.libs/libgstencodebin.so libgstencodebin.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -43,4 +43,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-ffmpegcolorspace.xml b/docs/plugins/inspect/plugin-ffmpegcolorspace.xml index fbbbb761a9..c0ddeebcda 100644 --- a/docs/plugins/inspect/plugin-ffmpegcolorspace.xml +++ b/docs/plugins/inspect/plugin-ffmpegcolorspace.xml @@ -3,7 +3,7 @@ colorspace conversion copied from FFMpeg 0.4.9-pre1 ../../gst/ffmpegcolorspace/.libs/libgstffmpegcolorspace.so libgstffmpegcolorspace.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base FFMpeg @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-gdp.xml b/docs/plugins/inspect/plugin-gdp.xml index 72b08b8f32..970505e416 100644 --- a/docs/plugins/inspect/plugin-gdp.xml +++ b/docs/plugins/inspect/plugin-gdp.xml @@ -3,7 +3,7 @@ Payload/depayload GDP packets ../../gst/gdp/.libs/libgstgdp.so libgstgdp.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -52,4 +52,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-gio.xml b/docs/plugins/inspect/plugin-gio.xml index d531e9f4ef..aecd4bd95b 100644 --- a/docs/plugins/inspect/plugin-gio.xml +++ b/docs/plugins/inspect/plugin-gio.xml @@ -3,7 +3,7 @@ GIO elements ../../ext/gio/.libs/libgstgio.so libgstgio.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -70,4 +70,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-gnomevfs.xml b/docs/plugins/inspect/plugin-gnomevfs.xml index e31d8b5477..781e2c1fc8 100644 --- a/docs/plugins/inspect/plugin-gnomevfs.xml +++ b/docs/plugins/inspect/plugin-gnomevfs.xml @@ -3,7 +3,7 @@ elements to read from and write to Gnome-VFS uri's ../../ext/gnomevfs/.libs/libgstgnomevfs.so libgstgnomevfs.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -40,4 +40,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-libvisual.xml b/docs/plugins/inspect/plugin-libvisual.xml index 0c477f0d26..4d82ace37b 100644 --- a/docs/plugins/inspect/plugin-libvisual.xml +++ b/docs/plugins/inspect/plugin-libvisual.xml @@ -3,7 +3,7 @@ libvisual visualization plugins ../../ext/libvisual/.libs/libgstlibvisual.so libgstlibvisual.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -178,4 +178,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-ogg.xml b/docs/plugins/inspect/plugin-ogg.xml index 80ac5d2ac2..1811f0d43f 100644 --- a/docs/plugins/inspect/plugin-ogg.xml +++ b/docs/plugins/inspect/plugin-ogg.xml @@ -3,7 +3,7 @@ ogg stream manipulation (info about ogg: http://xiph.org) ../../ext/ogg/.libs/libgstogg.so libgstogg.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -62,7 +62,7 @@ sink_%d sink request -
video/x-theora; audio/x-vorbis; audio/x-flac; audio/x-speex; audio/x-celt; application/x-ogm-video; application/x-ogm-audio; video/x-dirac; video/x-smoke; video/x-vp8; text/x-cmml, encoded=(boolean)true; subtitle/x-kate; application/x-kate
+
video/x-theora; audio/x-vorbis; audio/x-flac; audio/x-speex; audio/x-celt; application/x-ogm-video; application/x-ogm-audio; video/x-dirac; video/x-smoke; video/x-vp8; text/x-cmml, encoded=(boolean)true; subtitle/x-kate; application/x-kate; audio/x-opus
src @@ -152,9 +152,9 @@ src source sometimes -
video/x-3ivx, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-asus, asusversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-asus, asusversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-cirrus-logic-accupak, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-camstudio, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-compressed-yuv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-rgb, bpp=(int){ 8, 24, 32 }, depth=(int){ 8, 24 }, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-truemotion, trueversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dv, systemstream=(boolean)false, dvversion=(int)25, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dv, systemstream=(boolean)false, dvversion=(int)50, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)5, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, mpegversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-flash-video, flvversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp6-flash, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)itu, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)lucent, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)itu, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-huffyuv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-intel-h263, variant=(string)intel, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)5, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)lead, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)lead, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)microsoft, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, mpegversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; image/jpeg, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)42, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)43, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, systemstream=(boolean)false, mpegversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, systemstream=(boolean)false, mpegversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)41, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-mszh, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; image/png, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-rle, layout=(string)microsoft, depth=(int)[ 1, 64 ], framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/sp5x, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-truemotion, trueversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-camtasia, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ultimotion, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ati-vcr, vcrversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ati-vcr, vcrversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)vdolive, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)vivo, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vmnc, version=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)videosoft, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-wmv, wmvversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-wmv, wmvversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-wmv, wmvversion=(int)3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-xvid, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-xan, wcversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)YVU9, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-zlib, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-cinepak, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)itu, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msvideocodec, msvideoversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)xirlink, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dirac, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ffv, ffvversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-kmvc, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp5, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp6, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp6-flash, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp7, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp8, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-mimic, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-apple-video, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-theora, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-fraps, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-aasc, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)YV12, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-loco, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-zmbv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]
+
video/x-3ivx, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-asus, asusversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-asus, asusversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-cirrus-logic-accupak, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-camstudio, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-compressed-yuv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-rgb, bpp=(int){ 8, 24, 32 }, depth=(int){ 8, 24 }, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-truemotion, trueversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dv, systemstream=(boolean)false, dvversion=(int)25, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dv, systemstream=(boolean)false, dvversion=(int)50, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-divx, divxversion=(int)5, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, mpegversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-flash-video, flvversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp6-flash, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)itu, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)lucent, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)itu, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-huffyuv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-intel-h263, variant=(string)intel, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)I420, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)5, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)lead, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)lead, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)microsoft, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, mpegversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; image/jpeg, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)42, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)43, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, systemstream=(boolean)false, mpegversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/mpeg, systemstream=(boolean)false, mpegversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msmpeg, msmpegversion=(int)41, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-mszh, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; image/png, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-rle, layout=(string)microsoft, depth=(int)[ 1, 64 ], framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-indeo, indeoversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/sp5x, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-truemotion, trueversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-camtasia, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ultimotion, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)UYVY, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ati-vcr, vcrversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ati-vcr, vcrversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)vdolive, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)vivo, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vmnc, version=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)videosoft, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-wmv, wmvversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-wmv, wmvversion=(int)2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-wmv, wmvversion=(int)3, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-xvid, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-xan, wcversion=(int)4, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)YUY2, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)YVU9, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-zlib, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-cinepak, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h264, variant=(string)itu, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-msvideocodec, msvideoversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-h263, variant=(string)xirlink, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-dirac, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-ffv, ffvversion=(int)1, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-kmvc, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp5, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp6, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp6-flash, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp7, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-vp8, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-mimic, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-apple-video, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-theora, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-fraps, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-aasc, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)YV12, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-loco, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-zmbv, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-yuv, format=(fourcc)v210, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]; video/x-raw-rgb, endianness=(int)4321, depth=(int)30, bpp=(int)32, red_mask=(int)1072693248, green_mask=(int)1047552, blue_mask=(int)1023, framerate=(fraction)[ 0/1, 2147483647/1 ], width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ]
- + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-pango.xml b/docs/plugins/inspect/plugin-pango.xml index 16834c7a08..95d7d96e9e 100644 --- a/docs/plugins/inspect/plugin-pango.xml +++ b/docs/plugins/inspect/plugin-pango.xml @@ -3,7 +3,7 @@ Pango-based text rendering and overlay ../../ext/pango/.libs/libgstpango.so libgstpango.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -20,13 +20,13 @@ video_sink sink always -
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc){ AYUV, I420, UYVY, NV12, NV21 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-surface; video/x-raw-yuv, format=(fourcc){ I420, YV12, AYUV, YUY2, UYVY, v308, v210, v216, Y41B, Y42B, Y444, Y800, Y16 , NV12, NV21, UYVP, A420, YUV9, IYU1 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
src source always -
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc){ AYUV, I420, UYVY, NV12, NV21 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-surface; video/x-raw-yuv, format=(fourcc){ I420, YV12, AYUV, YUY2, UYVY, v308, v210, v216, Y41B, Y42B, Y444, Y800, Y16 , NV12, NV21, UYVP, A420, YUV9, IYU1 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
@@ -47,13 +47,13 @@ video_sink sink always -
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc){ AYUV, I420, UYVY, NV12, NV21 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-surface; video/x-raw-yuv, format=(fourcc){ I420, YV12, AYUV, YUY2, UYVY, v308, v210, v216, Y41B, Y42B, Y444, Y800, Y16 , NV12, NV21, UYVP, A420, YUV9, IYU1 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
src source always -
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc){ AYUV, I420, UYVY, NV12, NV21 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-surface; video/x-raw-yuv, format=(fourcc){ I420, YV12, AYUV, YUY2, UYVY, v308, v210, v216, Y41B, Y42B, Y444, Y800, Y16 , NV12, NV21, UYVP, A420, YUV9, IYU1 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
@@ -89,15 +89,15 @@ video_sink sink always -
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc){ AYUV, I420, UYVY, NV12, NV21 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-surface; video/x-raw-yuv, format=(fourcc){ I420, YV12, AYUV, YUY2, UYVY, v308, v210, v216, Y41B, Y42B, Y444, Y800, Y16 , NV12, NV21, UYVP, A420, YUV9, IYU1 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
src source always -
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc){ AYUV, I420, UYVY, NV12, NV21 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-surface; video/x-raw-yuv, format=(fourcc){ I420, YV12, AYUV, YUY2, UYVY, v308, v210, v216, Y41B, Y42B, Y444, Y800, Y16 , NV12, NV21, UYVP, A420, YUV9, IYU1 }, width=(int)[ 1, 2147483647 ], height=(int)[ 1, 2147483647 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
- + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-playback.xml b/docs/plugins/inspect/plugin-playback.xml index cbd683c076..6b6b53537d 100644 --- a/docs/plugins/inspect/plugin-playback.xml +++ b/docs/plugins/inspect/plugin-playback.xml @@ -3,7 +3,7 @@ various playback elements ../../gst/playback/.libs/libgstplaybin.so libgstplaybin.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -94,4 +94,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-subparse.xml b/docs/plugins/inspect/plugin-subparse.xml index f2199274ea..eda6f057cf 100644 --- a/docs/plugins/inspect/plugin-subparse.xml +++ b/docs/plugins/inspect/plugin-subparse.xml @@ -3,7 +3,7 @@ Subtitle parsing ../../gst/subparse/.libs/libgstsubparse.so libgstsubparse.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -52,4 +52,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-tcp.xml b/docs/plugins/inspect/plugin-tcp.xml index 8cb63caf38..33f77d8042 100644 --- a/docs/plugins/inspect/plugin-tcp.xml +++ b/docs/plugins/inspect/plugin-tcp.xml @@ -3,7 +3,7 @@ transfer data over the network via TCP ../../gst/tcp/.libs/libgsttcp.so libgsttcp.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -85,4 +85,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-theora.xml b/docs/plugins/inspect/plugin-theora.xml index 4563c60dd9..a01c70e169 100644 --- a/docs/plugins/inspect/plugin-theora.xml +++ b/docs/plugins/inspect/plugin-theora.xml @@ -3,7 +3,7 @@ Theora plugin library ../../ext/theora/.libs/libgsttheora.so libgsttheora.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -73,4 +73,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-typefindfunctions.xml b/docs/plugins/inspect/plugin-typefindfunctions.xml index f2d430d7b2..f55aa1e01d 100644 --- a/docs/plugins/inspect/plugin-typefindfunctions.xml +++ b/docs/plugins/inspect/plugin-typefindfunctions.xml @@ -3,11 +3,11 @@ default typefind functions ../../gst/typefind/.libs/libgsttypefindfunctions.so libgsttypefindfunctions.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git Unknown package origin - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-uridecodebin.xml b/docs/plugins/inspect/plugin-uridecodebin.xml index 87ec73d8ae..38057b7f68 100644 --- a/docs/plugins/inspect/plugin-uridecodebin.xml +++ b/docs/plugins/inspect/plugin-uridecodebin.xml @@ -3,7 +3,7 @@ URI Decoder bin ../../gst/playback/.libs/libgstdecodebin2.so libgstdecodebin2.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -46,4 +46,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-videorate.xml b/docs/plugins/inspect/plugin-videorate.xml index df79cae7a4..676b8424d7 100644 --- a/docs/plugins/inspect/plugin-videorate.xml +++ b/docs/plugins/inspect/plugin-videorate.xml @@ -3,7 +3,7 @@ Adjusts video frames ../../gst/videorate/.libs/libgstvideorate.so libgstvideorate.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-videoscale.xml b/docs/plugins/inspect/plugin-videoscale.xml index af87c24f78..bb96a68473 100644 --- a/docs/plugins/inspect/plugin-videoscale.xml +++ b/docs/plugins/inspect/plugin-videoscale.xml @@ -3,7 +3,7 @@ Resizes video ../../gst/videoscale/.libs/libgstvideoscale.so libgstvideoscale.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -20,15 +20,15 @@ sink sink always -
video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AYUV, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y444, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)v308, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y42B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YVYU, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y41B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)16, endianness=(int)1234, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)15, endianness=(int)1234, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)16, depth=(int)16, endianness=(int)1234, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y16 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)8, depth=(int)8, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y800, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y8 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)GREY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AY64, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)64, depth=(int)64, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AYUV, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y444, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)v308, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y42B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YVYU, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y41B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)16, endianness=(int)1234, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)15, endianness=(int)1234, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)16, depth=(int)16, endianness=(int)1234, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y16 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)8, depth=(int)8, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y800, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y8 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)GREY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AY64, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)64, depth=(int)64, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)NV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
src source always -
video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AYUV, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y444, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)v308, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y42B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YVYU, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y41B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)16, endianness=(int)1234, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)15, endianness=(int)1234, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)16, depth=(int)16, endianness=(int)1234, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y16 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)8, depth=(int)8, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y800, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y8 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)GREY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AY64, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)64, depth=(int)64, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
+
video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, alpha_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)32, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AYUV, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)-16777216, green_mask=(int)16711680, blue_mask=(int)65280, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)65280, green_mask=(int)16711680, blue_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)32, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y444, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)v308, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)24, depth=(int)24, endianness=(int)4321, red_mask=(int)255, green_mask=(int)65280, blue_mask=(int)16711680, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y42B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YUY2, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YVYU, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)UYVY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)I420, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)YV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y41B, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)16, endianness=(int)1234, red_mask=(int)63488, green_mask=(int)2016, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)16, depth=(int)15, endianness=(int)1234, red_mask=(int)31744, green_mask=(int)992, blue_mask=(int)31, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)16, depth=(int)16, endianness=(int)1234, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y16 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-gray, bpp=(int)8, depth=(int)8, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y800, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)Y8 , width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)GREY, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)AY64, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-rgb, bpp=(int)64, depth=(int)64, endianness=(int)4321, red_mask=(int)16711680, green_mask=(int)65280, blue_mask=(int)255, alpha_mask=(int)-16777216, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]; video/x-raw-yuv, format=(fourcc)NV12, width=(int)[ 1, 32767 ], height=(int)[ 1, 32767 ], framerate=(fraction)[ 0/1, 2147483647/1 ]
- + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-videotestsrc.xml b/docs/plugins/inspect/plugin-videotestsrc.xml index 73a26d0a53..03a6803f1b 100644 --- a/docs/plugins/inspect/plugin-videotestsrc.xml +++ b/docs/plugins/inspect/plugin-videotestsrc.xml @@ -3,7 +3,7 @@ Creates a test video stream ../../gst/videotestsrc/.libs/libgstvideotestsrc.so libgstvideotestsrc.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-volume.xml b/docs/plugins/inspect/plugin-volume.xml index 02d15ee1c5..23f3bd27cd 100644 --- a/docs/plugins/inspect/plugin-volume.xml +++ b/docs/plugins/inspect/plugin-volume.xml @@ -3,7 +3,7 @@ plugin for controlling audio volume ../../gst/volume/.libs/libgstvolume.so libgstvolume.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -31,4 +31,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-vorbis.xml b/docs/plugins/inspect/plugin-vorbis.xml index 3f4f3e4883..323df3045e 100644 --- a/docs/plugins/inspect/plugin-vorbis.xml +++ b/docs/plugins/inspect/plugin-vorbis.xml @@ -3,7 +3,7 @@ Vorbis plugin library ../../ext/vorbis/.libs/libgstvorbis.so libgstvorbis.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -41,7 +41,7 @@ sink sink always -
audio/x-raw-float, rate=(int)[ 1, 200000 ], channels=(int)[ 1, 256 ], endianness=(int)1234, width=(int)32
+
audio/x-raw-float, rate=(int)[ 1, 200000 ], channels=(int)[ 1, 255 ], endianness=(int)1234, width=(int)32
src @@ -94,4 +94,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-ximagesink.xml b/docs/plugins/inspect/plugin-ximagesink.xml index 58dbc00d6c..d9bc6c0d29 100644 --- a/docs/plugins/inspect/plugin-ximagesink.xml +++ b/docs/plugins/inspect/plugin-ximagesink.xml @@ -3,7 +3,7 @@ X11 video output element based on standard Xlib calls ../../sys/ximage/.libs/libgstximagesink.so libgstximagesink.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/docs/plugins/inspect/plugin-xvimagesink.xml b/docs/plugins/inspect/plugin-xvimagesink.xml index a72b6a93bf..d18497b6ab 100644 --- a/docs/plugins/inspect/plugin-xvimagesink.xml +++ b/docs/plugins/inspect/plugin-xvimagesink.xml @@ -3,7 +3,7 @@ XFree86 video output plugin using Xv extension ../../sys/xvimage/.libs/libgstxvimagesink.so libgstxvimagesink.so - 0.10.35.1 + 0.10.36.1 LGPL gst-plugins-base GStreamer Base Plug-ins git @@ -25,4 +25,4 @@ - + \ No newline at end of file diff --git a/win32/common/_stdint.h b/win32/common/_stdint.h index f5905f1f9f..2b2bc6152f 100644 --- a/win32/common/_stdint.h +++ b/win32/common/_stdint.h @@ -1,8 +1,8 @@ #ifndef _GST_PLUGINS_BASE__STDINT_H #define _GST_PLUGINS_BASE__STDINT_H 1 #ifndef _GENERATED_STDINT_H -#define _GENERATED_STDINT_H "gst-plugins-base 0.10.35.1" -/* generated using gnu compiler gcc (Debian 4.6.0-13) 4.6.1 20110611 (prerelease) */ +#define _GENERATED_STDINT_H "gst-plugins-base 0.10.36.1" +/* generated using gnu compiler gcc (Debian 4.6.2-12) 4.6.2 */ #define _STDINT_HAVE_STDINT_H 1 #include #endif diff --git a/win32/common/audio-enumtypes.c b/win32/common/audio-enumtypes.c index 61af357eef..6dfd85dfa9 100644 --- a/win32/common/audio-enumtypes.c +++ b/win32/common/audio-enumtypes.c @@ -109,6 +109,8 @@ gst_buffer_format_type_get_type (void) {GST_BUFTYPE_AC3, "GST_BUFTYPE_AC3", "ac3"}, {GST_BUFTYPE_EAC3, "GST_BUFTYPE_EAC3", "eac3"}, {GST_BUFTYPE_DTS, "GST_BUFTYPE_DTS", "dts"}, + {GST_BUFTYPE_MPEG2_AAC, "GST_BUFTYPE_MPEG2_AAC", "mpeg2-aac"}, + {GST_BUFTYPE_MPEG4_AAC, "GST_BUFTYPE_MPEG4_AAC", "mpeg4-aac"}, {0, NULL, NULL} }; GType g_define_type_id = @@ -164,6 +166,8 @@ gst_buffer_format_get_type (void) {GST_AC3, "GST_AC3", "ac3"}, {GST_EAC3, "GST_EAC3", "eac3"}, {GST_DTS, "GST_DTS", "dts"}, + {GST_MPEG2_AAC, "GST_MPEG2_AAC", "mpeg2-aac"}, + {GST_MPEG4_AAC, "GST_MPEG4_AAC", "mpeg4-aac"}, {0, NULL, NULL} }; GType g_define_type_id = g_enum_register_static ("GstBufferFormat", values); diff --git a/win32/common/config.h b/win32/common/config.h index 9386b20a87..421b571408 100644 --- a/win32/common/config.h +++ b/win32/common/config.h @@ -56,12 +56,18 @@ /* system wide data directory */ #define GST_DATADIR PREFIX "\\share" +/* Extra platform specific plugin suffix */ +#undef GST_EXTRA_MODULE_SUFFIX + /* macro to use to show function name */ #undef GST_FUNCTION /* Defined if gcov is enabled to force a rebuild due to config.h changing */ #undef GST_GCOV_ENABLED +/* Defined when registry scanning through fork is unsafe */ +#undef GST_HAVE_UNSAFE_FORK + /* plugin install helper script */ #define GST_INSTALL_PLUGINS_HELPER PREFIX "\\libexec\\gst-install-plugins-helper.exe" @@ -81,7 +87,7 @@ #define GST_PACKAGE_ORIGIN "Unknown package origin" /* GStreamer package release date/time for plugins as YYYY-MM-DD */ -#define GST_PACKAGE_RELEASE_DATETIME "2011-05-18T13:30Z" +#define GST_PACKAGE_RELEASE_DATETIME "2012-02-23T10:41Z" /* I know the API is subject to change. */ #undef G_UDEV_API_IS_SUBJECT_TO_CHANGE @@ -149,6 +155,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* Define to 1 if you have the header file. */ +#undef HAVE_EMMINTRIN_H + /* Define to enable building of experimental plug-ins. */ #undef HAVE_EXPERIMENTAL @@ -239,6 +248,9 @@ /* Use Orc */ #undef HAVE_ORC +/* Defined if compiling for OSX */ +#undef HAVE_OSX + /* Define to enable Pango font rendering (used by pango). */ #undef HAVE_PANGO @@ -290,18 +302,27 @@ /* defined if vorbis_synthesis_restart is present */ #undef HAVE_VORBIS_SYNTHESIS_RESTART +/* Defined if compiling for Windows */ +#define HAVE_WIN32 1 + /* Define to 1 if you have the header file. */ #define HAVE_WINSOCK2_H 1 /* Define to enable X libraries and plugins (used by ximagesink). */ #undef HAVE_X +/* Define to 1 if you have the header file. */ +#undef HAVE_XMMINTRIN_H + /* Define to enable X Shared Memory extension. */ #undef HAVE_XSHM /* Define to enable X11 XVideo extensions (used by xvimagesink). */ #undef HAVE_XVIDEO +/* Define to enable zlib support for ID3 parsing in libgsttag. */ +#undef HAVE_ZLIB + /* the host CPU */ #define HOST_CPU "i686" @@ -337,7 +358,7 @@ #define PACKAGE_NAME "GStreamer Base Plug-ins" /* Define to the full name and version of this package. */ -#define PACKAGE_STRING "GStreamer Base Plug-ins 0.10.35.1" +#define PACKAGE_STRING "GStreamer Base Plug-ins 0.10.36.1" /* Define to the one symbol short name of this package. */ #define PACKAGE_TARNAME "gst-plugins-base" @@ -346,7 +367,7 @@ #undef PACKAGE_URL /* Define to the version of this package. */ -#define PACKAGE_VERSION "0.10.35.1" +#define PACKAGE_VERSION "0.10.36.1" /* directory where plugins are located */ #ifdef _DEBUG @@ -377,7 +398,7 @@ #undef USE_TREMOLO /* Version number of package */ -#define VERSION "0.10.35.1" +#define VERSION "0.10.36.1" /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most significant byte first (like Motorola and SPARC, unlike Intel). */ @@ -402,3 +423,6 @@ /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES + +/* We need at least WinXP SP2 for __stat64 */ +#undef __MSVCRT_VERSION__ diff --git a/win32/common/gstrtsp-enumtypes.c b/win32/common/gstrtsp-enumtypes.c index 15a0c4b76d..ea8ea4af48 100644 --- a/win32/common/gstrtsp-enumtypes.c +++ b/win32/common/gstrtsp-enumtypes.c @@ -279,6 +279,8 @@ gst_rtsp_header_field_get_type (void) "x-server-ip-address"}, {GST_RTSP_HDR_X_SESSIONCOOKIE, "GST_RTSP_HDR_X_SESSIONCOOKIE", "x-sessioncookie"}, + {GST_RTSP_HDR_RTCP_INTERVAL, "GST_RTSP_HDR_RTCP_INTERVAL", + "rtcp-interval"}, {GST_RTSP_HDR_LAST, "GST_RTSP_HDR_LAST", "last"}, {0, NULL, NULL} }; From 377bd8255c5ea1c7d363631d62820fe8a9bd1e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Thu, 23 Feb 2012 12:06:15 +0000 Subject: [PATCH 24/50] Update NEWS and RELEASE as well --- NEWS | 320 ++++++++++++++++++++++++++++++++++++++++++++++- RELEASE | 377 +++++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 690 insertions(+), 7 deletions(-) diff --git a/NEWS b/NEWS index 6ee1d4f9ea..94583e8279 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,322 @@ -This is GStreamer Base Plug-ins 0.10.35, "Short Notice" +This is GStreamer Base Plug-ins 0.10.36, "Better" + +Changes since 0.10.35: + + * audio: new IEC 61937 payloading library + * audio: new GstAudioFormat, GstAudioFormatInfo and GstAudioInfo API + * audio: new GstAudioDecoder and GstAudioEncoder base classes + * audio: baseaudiosink: allow subclasses to provide payloaders + * audio: baseaudiosink: fix latency calculation for live elements + * audio: baseaudiosink: make discont-wait configurable + * audio: baseaudiosink: split "drift-tolerance" into "alignment-threshold" + * codec-utils: Add method to convert H.264 text level in a level_idc + * discoverer: add support for subtitles; try harder to extract language and duration + * encoding-profile: add function to create a profile from a discoverer info + * ringbuffer: add support for AAC, DTS, E-AC3 and MPEG audio buffers + * rtcpbuffer: Add feedback message types from RFC 510 + * rtcpbuffer: prevent overflow of 16bit header length + * rtspconnection: make hostname lookup thread-safe; OSX portability fixes + * rtspconnection: only send new data immediately if there are no queued messages + * tags: add new GstTagMux base class + * tags: add convenience API to handle creative commons licenses + * tags: add API to parse ID3v2 tags + * tags: various exif and xmp tag writing fixes + * tags: xmp: add Iptc4xmpExt schema support + * tags: gstvorbistag: map ENCODER Vorbis comment to application-name + * video: add video overlay composition API for subtitles + * video: fix a RGB ordering mixup in colorspace conversion code + * alsasink: fix high sample rates being rejected, and negotiation to "nearest" rate + * audioresample: don't emit DISCONT buffers if no discontinuity happened + * audioresample: fix quality setting being ignored; use SSE/SSE2 when possible + * audiotestsrc: add red (brownian) and blue/violet noise generator + * cdparanoiasrc: fix build issue on OSX (caused by broken cdparanoia port and broken system headers) + * decodebin2: improve handling of multi-stream chains (e.g. mpeg-ts) + * decodebin2: Cache the upstream seekability for demuxer decode chains and use it for the non-preroll multiqueue limits + * decodebin2: add support for autoplugging parsers and parser-converters, and negotiate stream-format conversions properly as needed + * decodebin2: link elements before testing if they can reach the READY state, so allow hw-accelerated elements can query the video context + * decodebin2: use a TIME limit for pre-rolling in live streams and not in non-live streams + * decodebin2: fix preroll for HLS streams at low bitrates + * decodebin2: add source pads to stream-topology element messages + * decodebin, decodebin2: don't plug the same parser multiple times in a row, so we can make parsers accept parsed input as well (and use them to convert to different stream formats) + * encodebin: add flags to disable conversion elements + * encodebin: autoplug formatters; re-enable parsers + * gnomevfssrc: add support for cancelling read operations + * oggdemux, oggmux: add support for new Opus audio codec + * oggdemux: implement push mode seeking (e.g. for http) + * oggdemux: assume input is live stream if byte size cannot be determined + * oggdemux: fix hang on small truncated files + * oggmux: add skeleton write support + * oggmux: sync input streams and select input buffers based on running time + * oggmux: headers should always have granpos 0 + * oggmux: refactor how EOS is determined + * oggmux: support sparse streams as input (e.g. kate subtitle streams) + * playbin2: fix decoder-sink compatibility check for raw audio/video formats + * playbin2: make sure that the decoders we plug are compatible with the fixed sink + * playsink: Add audio and video converter convenience bins + * playbin2: improve stream switching + * playbin2/playsink: Decide if A/V caps are raw only inside playsink + * playbin2/playsink: better support for raw + compressed streams (audio passthrough) + * playbin2/playsink: improve handling of "non-raw" formats (for hw-accelerated video decoding) + * playsinkconvertbin: Reconfigure if we switch from raw to incompatible raw caps + * subparse: subtitle format typefinding improvements + * subtitleoverlay: handle non raw video streams (add suport for hardware accelerated videos) + * textoverlay: support more video formats + * textoverlay: add "outline-color" and "shadow" properties + * textoverlay: attach GstVideoOverlayComposition to buffers if input is not raw video + * theoraenc: do not automatically override quality when using target bitrate + * theoraenc: proxy downstream caps restrictions upstream + * typefinding: extract SOF marker in jpeg typefinder (to distinguish lossless JPEG) + * typefinding: add typefinder for WAP WBMP bitmaps (mostly to avoid false positives) + * typefinding: typefind UTF-16 and UTF-32 with BOMs (to avoid false positives) + * typefinding: recognize Asylum modules + * videorate: add a "max-rate" property; optionally ensure maximum average output frame rate + * videorate: add "force-fps" property to force an output framerate or change it on the fly + * videorate: optionally only drop frames to ensure maximum frame rate + * videoscale: add modified Lanczos scaling method + * volume: Fix handling of volume>=4.0 for 8 and 16 bit integer formats + * vorbisenc: relax overly tight jitter tolerances (make it work better with non-perfect input streams) + * xvimagesink, ximagesink: fall back to non-XShm mode if allocating the XShm image failed + +Bugs fixed since 0.10.35: + + * 643202 : [encodebin] streamcombiner not completely implemented + * 654270 : oggmux unit test fails after latest changes + * 658984 : Fix typos in gst-plugins-base + * 555437 : [tag] add GstTagMux base class + * 556648 : [typefind] detect lossless jpeg + * 563251 : oggmux should have option to create Ogg Skeleton stream + * 584811 : playbin2's get-text-tags sometimes fails in text stream 0 + * 607619 : [typefind] utf-16 text file mistakenly identified as layer 1 mpeg audio + * 607742 : API: add gst_event_new_{upstream,downstream}_force_key_unit() etc. + * 609918 : [OS X] configure: cdda_interface.h: present but cannot be compiled (if VERSION is defined) + * 610443 : baseaudiosink: clock can jump on setcaps + * 612443 : oggdemux: only use information from skeleton if we have nothing better + * 615131 : playing an ogg over http does not report duration correctly + * 615342 : [gstalsamixer] leaks + * 621897 : [oggdemux] reports wrong duration, and push mode seeking support + * 628337 : [gnomevfssrc] Add support for cancelling read operations + * 628764 : [videorate] add new option for max frame rate + * 629212 : [oggdemux] Improve support for push mode (seeking, duration) + * 630322 : make seek example work with windows + * 630442 : xvimagesink, ximagesink: fallback to X*CreateImage() if X*ShmCreateImage() fails + * 630497 : [seek] sprinkle GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS to dump pipeline to dot file + * 632788 : [playbin2] Doesn't support files with a streams that are supported compressed by a sink and streams that need decoding + * 635556 : [oggdemux] bad duration estimate in streaming mode with vertical-overview.ogg + * 637812 : vorbisenc: choppy sound due to input timestamp jitter + * 638897 : [textrender] allow setting the canvas size using peer caps + bugfixes + * 639055 : discoverer: add support for subtitle streams + * 640041 : textoverlay: Added parameters to control text outline color and whether shadowing is enabled + * 640564 : Remuxing a Theora stream generates a stream that oggz-validate complains about + * 640859 : basesink incorrectly categorizes timestamp jitter as drift + * 642690 : [baseaudio] GstBaseAudioEncoder and GstBaseAudioDecoder class + * 642878 : encoding-profile: add a function to create a profile from a discoverer info + * 643578 : [encodebin] - broken remuxing + * 644284 : Suspicious max_latency computation in gstbaseaudiosink.c + * 647648 : videorate: support for caps modifications in a running pipeline + * 647769 : [decodebin2] Fix preroll for streams at low bitrate + * 649319 : Add boiler plate code to xvimagesink + * 649642 : [volume] Overflows with volume > =4.0 and 8/16 bit integer formats + * 649969 : [audiotestsrc] Add more noise variants + * 650406 : vorbisdec does not handle headers in caps + * 651089 : [xvimagesink/ximagesink] Remove g_assert from Interface query + * 651294 : WBMP images are not supported by typefind + * 651496 : encodebin seems to fail to pick up container variant + * 651615 : [vorbisenc] Too small jitter tolerance + * 651788 : [theoraenc] separate encode and push block in theora_enc_chain + * 651855 : elements/volume unit test fails + * 652342 : encoding-target: set name on audio and video profiles when reading from keyfile + * 652642 : typefind: NULL check in degas_type_find + * 652838 : gst_discoverer_discover_uri Allow NULL GError* argument + * 653461 : [theoraenc] element causes encoder to drop frames? + * 654295 : [typefind] audio/x-sap detection doesn't work + * 654434 : [basertppayload] RTP timestamps not longer reproducible + * 654959 : textoverlay would flicker if it receives not timestampes text on input + * 655244 : encodebin has to provide the downstream possible caps to h264parse + * 655268 : decodebin2: deadlock after multi-stream chains change + * 655279 : [playbin2] Don't reset sinks when not needed + * 655347 : theoradec: segfault on 0-byte ogg_packet in _chain_reverse + * 655503 : pbutils: Add MPEG-4 SP levels 4a, 5 and 6 + * 655574 : ogg: crash determining duration of empty vorbis packet + * 656022 : volume: fix sample depth typo + * 656034 : gstvorbistag: map ENCODER Vorbis comment to application-name + * 656392 : audioresample: add FFT based checks + * 656715 : playbin2, playsink: reference count ts_offset to avoid crashes + * 656775 : oggmux: various cleanups + * 656781 : resample.c has warnings treated as errors that prevent compilation + * 657049 : textoverlay: buffer leaks + * 657062 : oggdemux: do not skip sparse streams when determining start times + * 657151 : ogg: another cleanup round + * 657257 : discoverer: retrieve audio track language from tags too + * 657261 : resindvd: regression in git: no more button highlights in menus + * 657319 : videorate should use basetransform + * 657333 : theoraenc: fix caps leak + * 657504 : gtk-doc distcheck failure: files left in build directory after distclean: + * 657872 : [subparse] Doesn't detect some SRT subtitle files + * 658294 : gst-inspect videorate hangs + * 658416 : decodebin2: refcounting bugs causing criticals + * 658443 : theoraenc: do not automatically override quality when using target bitrate + * 658514 : typefinding: recognize .amf (Asylum Music File) files for modplug + * 658609 : Handle subtitles with non raw caps video streams in subtitle overlay + * 658846 : Playbin2 pipeline stuck while prerolling if decoder is missing + * 658901 : textoverlay: crash when the video sink pad has no parent + * 659562 : videorate: gst_mini_object_unref: assertion `GST_IS_MINI_OBJECT (mini_object)' failed + * 660150 : baseaudio: compiler warnings if debugging system is disabled + * 660170 : alsasrc: broken timestamps lead to alsasrc ! audiorate endless loop + * 660301 : playbin2: Fix mingw compiler warnings + * 660304 : videotestsrc: Fix mingw compiler warning + * 660598 : playbin2: Make sure that elements that are plugged are compatible with the fixed sink + * 660604 : textoverlay: add YV12 support + * 660816 : dvd menus got broken + * 661105 : audiotestsrc: add missing break + * 661106 : tests: actually test what we said we would + * 661122 : videotestsrc does not build on Solaris + * 661202 : decodebin2: fire drained signal where appropriate + * 661738 : Deadlock between threads in gstaudiosink and gstringbuffer + * 661897 : oggdemux: do not retry seeking indefinitely + * 661983 : Regression: Reverse playback does not work for vorbis + * 662049 : oggdemux/oggmux in push mode cause preroll to wedge + * 662108 : Assertion in base audio decoder when decoding vorbis + * 662330 : [decodebin2] Should link and add elements to the bin before checking if they can reach READY state + * 662475 : oggdemux: Improvements on the push mode seeking algorithm. + * 662829 : [textoverlay] - silent property looks not well implemented + * 663174 : oggmux: set collectpads2 not to wait on sparse streams + * 663312 : decodebin2: Post all source pads in stream-topology messages as " element-srcpad " values + * 663390 : theoraenc: fix speed level failure test + * 663391 : theoraenc: misc small tweaks + * 663465 : baseaudiosink: fix late buffers leaking + * 663766 : [0.11] oggmux: split request pad templates into audio/video/subtitle + * 663892 : [playbin2] visualisation leads to not-negotiated error + * 663893 : playbin2: g_object_set_valist: construct property " use-volume " for object `GstPlaySinkAudioConvert' can't be set after construction + * 664818 : Autoplugger sink bin receives strange caps while it gets the correct ones in 0.10.35 and earlier + * 665004 : audioresample emits spurious disconts + * 665074 : [gstfft] headers are not bracketed + * 665080 : API: subtitle overlays for raw and non-raw video buffers + * 665120 : playbin2: decoder not selected for audio-sink=autoaudiosink + * 666395 : playbin2: set uri to a non-existed file in " about-to-finish " causes a CRITICAL warning + * 667210 : videotestsrc/generate_sine_table needs to link against glib + * 667306 : discoverer: don't use unportable vararg macro + * 667311 : fix various unlikely, but still potential memoryleaks + * 667312 : appsrc: implement get_caps + * 667313 : rtcpbuffer: prevent overflow of 16bit header length. + * 667315 : videotestsrc: keep the calculation fixed-point + * 667316 : pango: Changes includes from brackets to quotes for local files + * 667917 : alsasink: Rate doesn't match (requested 88200Hz, get 0Hz) + * 668097 : [subtitleoverlay] fix state change stall on PAUSED- > READY- > PAUSED (patch) + * 669039 : gstrtspconnection: new data may get sent even-though there is a queued message in the GstRTSPWatch + * 669164 : oggdemux generates invalid granpos which causes asserts in theoraparse + * 669167 : vorbisparse drops certain data buffers on the floor mistakenly thinking they're headers + * 669203 : playbin2: totem segfaults in gst_stream_get_other_pad_from_pad() + * 646868 : tag: Provide Creative Commons helper functions + * 654388 : [tags] API: move id3 parsing from id3demux to tag lib + * 311486 : [oggmux] theora bos must come before any audio bos pages + +API additions since 0.10.35: + + * gst_audio_decoder_finish_frame() + * gst_audio_decoder_get_audio_info() + * gst_audio_decoder_get_byte_time() + * gst_audio_decoder_get_delay() + * gst_audio_decoder_get_drainable() + * gst_audio_decoder_get_latency() + * gst_audio_decoder_get_max_errors() + * gst_audio_decoder_get_min_latency() + * gst_audio_decoder_get_needs_format() + * gst_audio_decoder_get_parse_state() + * gst_audio_decoder_get_plc() + * gst_audio_decoder_get_plc_aware() + * gst_audio_decoder_get_tolerance() + * gst_audio_decoder_get_type() + * gst_audio_decoder_set_byte_time() + * gst_audio_decoder_set_drainable() + * gst_audio_decoder_set_latency() + * gst_audio_decoder_set_max_errors() + * gst_audio_decoder_set_min_latency() + * gst_audio_decoder_set_needs_format() + * gst_audio_decoder_set_plc() + * gst_audio_decoder_set_plc_aware() + * gst_audio_decoder_set_tolerance() + * gst_audio_encoder_finish_frame() + * gst_audio_encoder_get_audio_info() + * gst_audio_encoder_get_drainable() + * gst_audio_encoder_get_frame_max() + * gst_audio_encoder_get_frame_samples_max() + * gst_audio_encoder_get_frame_samples_min() + * gst_audio_encoder_get_hard_min() + * gst_audio_encoder_get_hard_resync() + * gst_audio_encoder_get_latency() + * gst_audio_encoder_get_lookahead() + * gst_audio_encoder_get_mark_granule() + * gst_audio_encoder_get_perfect_timestamp() + * gst_audio_encoder_get_tolerance() + * gst_audio_encoder_get_type() + * gst_audio_encoder_merge_tags() + * gst_audio_encoder_proxy_getcaps() + * gst_audio_encoder_set_drainable() + * gst_audio_encoder_set_frame_max() + * gst_audio_encoder_set_frame_samples_max() + * gst_audio_encoder_set_frame_samples_min() + * gst_audio_encoder_set_hard_min() + * gst_audio_encoder_set_hard_resync() + * gst_audio_encoder_set_latency() + * gst_audio_encoder_set_lookahead() + * gst_audio_encoder_set_mark_granule() + * gst_audio_encoder_set_perfect_timestamp() + * gst_audio_encoder_set_tolerance() + * gst_audio_iec61937_frame_size() + * gst_audio_iec61937_payload() + * gst_audio_info_clear() + * gst_audio_info_convert() + * gst_audio_info_copy() + * gst_audio_info_free() + * gst_audio_info_from_caps() + * gst_audio_info_init() + * gst_audio_info_to_caps() + * gst_base_audio_sink_get_alignment_threshold() + * gst_base_audio_sink_get_discont_wait() + * gst_base_audio_sink_set_alignment_threshold() + * gst_base_audio_sink_set_discont_wait() + * gst_codec_utils_h264_get_level_idc() + * gst_discoverer_audio_info_get_language() + * gst_discoverer_info_get_subtitle_streams() + * gst_discoverer_subtitle_info_get_language() + * gst_discoverer_subtitle_info_get_type() + * gst_encoding_profile_from_discoverer() + * gst_tag_get_license_description() + * gst_tag_get_license_flags() + * gst_tag_get_license_jurisdiction() + * gst_tag_get_license_nick() + * gst_tag_get_license_title() + * gst_tag_get_license_version() + * gst_tag_get_licenses() + * gst_tag_license_flags_get_type() + * gst_tag_get_id3v2_tag_size() + * gst_tag_list_from_id3v2_tag() + * gst_tag_mux_get_type() + * gst_video_buffer_get_overlay_composition() + * gst_video_buffer_set_overlay_composition() + * gst_video_event_is_force_key_unit() + * gst_video_event_new_downstream_force_key_unit() + * gst_video_event_new_upstream_force_key_unit() + * gst_video_event_parse_downstream_force_key_unit() + * gst_video_event_parse_upstream_force_key_unit() + * gst_video_get_size_from_caps() + * gst_video_overlay_composition_add_rectangle() + * gst_video_overlay_composition_blend() + * gst_video_overlay_composition_copy() + * gst_video_overlay_composition_get_rectangle() + * gst_video_overlay_composition_get_seqnum() + * gst_video_overlay_composition_get_type() + * gst_video_overlay_composition_make_writable() + * gst_video_overlay_composition_n_rectangles() + * gst_video_overlay_composition_new() + * gst_video_overlay_rectangle_copy() + * gst_video_overlay_rectangle_get_pixels_argb() + * gst_video_overlay_rectangle_get_pixels_unscaled_argb() + * gst_video_overlay_rectangle_get_render_rectangle() + * gst_video_overlay_rectangle_get_seqnum() + * gst_video_overlay_rectangle_get_type() + * gst_video_overlay_rectangle_new_argb() + * gst_video_overlay_rectangle_set_render_rectangle() Changes since 0.10.34: diff --git a/RELEASE b/RELEASE index 7c4682f216..8d94c90f9b 100644 --- a/RELEASE +++ b/RELEASE @@ -1,5 +1,5 @@ -Release notes for GStreamer Base Plug-ins 0.10.35 "Short Notice" +Release notes for GStreamer Base Plug-ins 0.10.36 "Better" @@ -55,13 +55,323 @@ contains a set of less supported plug-ins that haven't passed the Features of this release - * work around GLib atomic ops API change - * don't use G_CONST_RETURN in public headers - * subparse: typefinding fixes for subtitles in non-UTF8 charsets + * audio: new IEC 61937 payloading library + * audio: new GstAudioFormat, GstAudioFormatInfo and GstAudioInfo API + * audio: new GstAudioDecoder and GstAudioEncoder base classes + * audio: baseaudiosink: allow subclasses to provide payloaders + * audio: baseaudiosink: fix latency calculation for live elements + * audio: baseaudiosink: make discont-wait configurable + * audio: baseaudiosink: split "drift-tolerance" into "alignment-threshold" + * codec-utils: Add method to convert H.264 text level in a level_idc + * discoverer: add support for subtitles; try harder to extract language and duration + * encoding-profile: add function to create a profile from a discoverer info + * ringbuffer: add support for AAC, DTS, E-AC3 and MPEG audio buffers + * rtcpbuffer: Add feedback message types from RFC 510 + * rtcpbuffer: prevent overflow of 16bit header length + * rtspconnection: make hostname lookup thread-safe; OSX portability fixes + * rtspconnection: only send new data immediately if there are no queued messages + * tags: add new GstTagMux base class + * tags: add convenience API to handle creative commons licenses + * tags: add API to parse ID3v2 tags + * tags: various exif and xmp tag writing fixes + * tags: xmp: add Iptc4xmpExt schema support + * tags: gstvorbistag: map ENCODER Vorbis comment to application-name + * video: add video overlay composition API for subtitles + * video: fix a RGB ordering mixup in colorspace conversion code + * alsasink: fix high sample rates being rejected, and negotiation to "nearest" rate + * audioresample: don't emit DISCONT buffers if no discontinuity happened + * audioresample: fix quality setting being ignored; use SSE/SSE2 when possible + * audiotestsrc: add red (brownian) and blue/violet noise generator + * cdparanoiasrc: fix build issue on OSX (caused by broken cdparanoia port and broken system headers) + * decodebin2: improve handling of multi-stream chains (e.g. mpeg-ts) + * decodebin2: Cache the upstream seekability for demuxer decode chains and use it for the non-preroll multiqueue limits + * decodebin2: add support for autoplugging parsers and parser-converters, and negotiate stream-format conversions properly as needed + * decodebin2: link elements before testing if they can reach the READY state, so allow hw-accelerated elements can query the video context + * decodebin2: use a TIME limit for pre-rolling in live streams and not in non-live streams + * decodebin2: fix preroll for HLS streams at low bitrates + * decodebin2: add source pads to stream-topology element messages + * decodebin, decodebin2: don't plug the same parser multiple times in a row, so we can make parsers accept parsed input as well (and use them to convert to different stream formats) + * encodebin: add flags to disable conversion elements + * encodebin: autoplug formatters; re-enable parsers + * gnomevfssrc: add support for cancelling read operations + * oggdemux, oggmux: add support for new Opus audio codec + * oggdemux: implement push mode seeking (e.g. for http) + * oggdemux: assume input is live stream if byte size cannot be determined + * oggdemux: fix hang on small truncated files + * oggmux: add skeleton write support + * oggmux: sync input streams and select input buffers based on running time + * oggmux: headers should always have granpos 0 + * oggmux: refactor how EOS is determined + * oggmux: support sparse streams as input (e.g. kate subtitle streams) + * playbin2: fix decoder-sink compatibility check for raw audio/video formats + * playbin2: make sure that the decoders we plug are compatible with the fixed sink + * playsink: Add audio and video converter convenience bins + * playbin2: improve stream switching + * playbin2/playsink: Decide if A/V caps are raw only inside playsink + * playbin2/playsink: better support for raw + compressed streams (audio passthrough) + * playbin2/playsink: improve handling of "non-raw" formats (for hw-accelerated video decoding) + * playsinkconvertbin: Reconfigure if we switch from raw to incompatible raw caps + * subparse: subtitle format typefinding improvements + * subtitleoverlay: handle non raw video streams (add suport for hardware accelerated videos) + * textoverlay: support more video formats + * textoverlay: add "outline-color" and "shadow" properties + * textoverlay: attach GstVideoOverlayComposition to buffers if input is not raw video + * theoraenc: do not automatically override quality when using target bitrate + * theoraenc: proxy downstream caps restrictions upstream + * typefinding: extract SOF marker in jpeg typefinder (to distinguish lossless JPEG) + * typefinding: add typefinder for WAP WBMP bitmaps (mostly to avoid false positives) + * typefinding: typefind UTF-16 and UTF-32 with BOMs (to avoid false positives) + * typefinding: recognize Asylum modules + * videorate: add a "max-rate" property; optionally ensure maximum average output frame rate + * videorate: add "force-fps" property to force an output framerate or change it on the fly + * videorate: optionally only drop frames to ensure maximum frame rate + * videoscale: add modified Lanczos scaling method + * volume: Fix handling of volume>=4.0 for 8 and 16 bit integer formats + * vorbisenc: relax overly tight jitter tolerances (make it work better with non-perfect input streams) + * xvimagesink, ximagesink: fall back to non-XShm mode if allocating the XShm image failed Bugs fixed in this release - * 600043 : subparse: fails to recognise Cyrillic subtitles in windows-1251 encoding + * 643202 : [encodebin] streamcombiner not completely implemented + * 654270 : oggmux unit test fails after latest changes + * 658984 : Fix typos in gst-plugins-base + * 555437 : [tag] add GstTagMux base class + * 556648 : [typefind] detect lossless jpeg + * 563251 : oggmux should have option to create Ogg Skeleton stream + * 584811 : playbin2's get-text-tags sometimes fails in text stream 0 + * 607619 : [typefind] utf-16 text file mistakenly identified as layer 1 mpeg audio + * 607742 : API: add gst_event_new_{upstream,downstream}_force_key_unit() etc. + * 609918 : [OS X] configure: cdda_interface.h: present but cannot be compiled (if VERSION is defined) + * 610443 : baseaudiosink: clock can jump on setcaps + * 612443 : oggdemux: only use information from skeleton if we have nothing better + * 615131 : playing an ogg over http does not report duration correctly + * 615342 : [gstalsamixer] leaks + * 621897 : [oggdemux] reports wrong duration, and push mode seeking support + * 628337 : [gnomevfssrc] Add support for cancelling read operations + * 628764 : [videorate] add new option for max frame rate + * 629212 : [oggdemux] Improve support for push mode (seeking, duration) + * 630322 : make seek example work with windows + * 630442 : xvimagesink, ximagesink: fallback to X*CreateImage() if X*ShmCreateImage() fails + * 630497 : [seek] sprinkle GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS to dump pipeline to dot file + * 632788 : [playbin2] Doesn't support files with a streams that are supported compressed by a sink and streams that need decoding + * 635556 : [oggdemux] bad duration estimate in streaming mode with vertical-overview.ogg + * 637812 : vorbisenc: choppy sound due to input timestamp jitter + * 638897 : [textrender] allow setting the canvas size using peer caps + bugfixes + * 639055 : discoverer: add support for subtitle streams + * 640041 : textoverlay: Added parameters to control text outline color and whether shadowing is enabled + * 640564 : Remuxing a Theora stream generates a stream that oggz-validate complains about + * 640859 : basesink incorrectly categorizes timestamp jitter as drift + * 642690 : [baseaudio] GstBaseAudioEncoder and GstBaseAudioDecoder class + * 642878 : encoding-profile: add a function to create a profile from a discoverer info + * 643578 : [encodebin] - broken remuxing + * 644284 : Suspicious max_latency computation in gstbaseaudiosink.c + * 647648 : videorate: support for caps modifications in a running pipeline + * 647769 : [decodebin2] Fix preroll for streams at low bitrate + * 649319 : Add boiler plate code to xvimagesink + * 649642 : [volume] Overflows with volume > =4.0 and 8/16 bit integer formats + * 649969 : [audiotestsrc] Add more noise variants + * 650406 : vorbisdec does not handle headers in caps + * 651089 : [xvimagesink/ximagesink] Remove g_assert from Interface query + * 651294 : WBMP images are not supported by typefind + * 651496 : encodebin seems to fail to pick up container variant + * 651615 : [vorbisenc] Too small jitter tolerance + * 651788 : [theoraenc] separate encode and push block in theora_enc_chain + * 651855 : elements/volume unit test fails + * 652342 : encoding-target: set name on audio and video profiles when reading from keyfile + * 652642 : typefind: NULL check in degas_type_find + * 652838 : gst_discoverer_discover_uri Allow NULL GError* argument + * 653461 : [theoraenc] element causes encoder to drop frames? + * 654295 : [typefind] audio/x-sap detection doesn't work + * 654434 : [basertppayload] RTP timestamps not longer reproducible + * 654959 : textoverlay would flicker if it receives not timestampes text on input + * 655244 : encodebin has to provide the downstream possible caps to h264parse + * 655268 : decodebin2: deadlock after multi-stream chains change + * 655279 : [playbin2] Don't reset sinks when not needed + * 655347 : theoradec: segfault on 0-byte ogg_packet in _chain_reverse + * 655503 : pbutils: Add MPEG-4 SP levels 4a, 5 and 6 + * 655574 : ogg: crash determining duration of empty vorbis packet + * 656022 : volume: fix sample depth typo + * 656034 : gstvorbistag: map ENCODER Vorbis comment to application-name + * 656392 : audioresample: add FFT based checks + * 656715 : playbin2, playsink: reference count ts_offset to avoid crashes + * 656775 : oggmux: various cleanups + * 656781 : resample.c has warnings treated as errors that prevent compilation + * 657049 : textoverlay: buffer leaks + * 657062 : oggdemux: do not skip sparse streams when determining start times + * 657151 : ogg: another cleanup round + * 657257 : discoverer: retrieve audio track language from tags too + * 657261 : resindvd: regression in git: no more button highlights in menus + * 657319 : videorate should use basetransform + * 657333 : theoraenc: fix caps leak + * 657504 : gtk-doc distcheck failure: files left in build directory after distclean: + * 657872 : [subparse] Doesn't detect some SRT subtitle files + * 658294 : gst-inspect videorate hangs + * 658416 : decodebin2: refcounting bugs causing criticals + * 658443 : theoraenc: do not automatically override quality when using target bitrate + * 658514 : typefinding: recognize .amf (Asylum Music File) files for modplug + * 658609 : Handle subtitles with non raw caps video streams in subtitle overlay + * 658846 : Playbin2 pipeline stuck while prerolling if decoder is missing + * 658901 : textoverlay: crash when the video sink pad has no parent + * 659562 : videorate: gst_mini_object_unref: assertion `GST_IS_MINI_OBJECT (mini_object)' failed + * 660150 : baseaudio: compiler warnings if debugging system is disabled + * 660170 : alsasrc: broken timestamps lead to alsasrc ! audiorate endless loop + * 660301 : playbin2: Fix mingw compiler warnings + * 660304 : videotestsrc: Fix mingw compiler warning + * 660598 : playbin2: Make sure that elements that are plugged are compatible with the fixed sink + * 660604 : textoverlay: add YV12 support + * 660816 : dvd menus got broken + * 661105 : audiotestsrc: add missing break + * 661106 : tests: actually test what we said we would + * 661122 : videotestsrc does not build on Solaris + * 661202 : decodebin2: fire drained signal where appropriate + * 661738 : Deadlock between threads in gstaudiosink and gstringbuffer + * 661897 : oggdemux: do not retry seeking indefinitely + * 661983 : Regression: Reverse playback does not work for vorbis + * 662049 : oggdemux/oggmux in push mode cause preroll to wedge + * 662108 : Assertion in base audio decoder when decoding vorbis + * 662330 : [decodebin2] Should link and add elements to the bin before checking if they can reach READY state + * 662475 : oggdemux: Improvements on the push mode seeking algorithm. + * 662829 : [textoverlay] - silent property looks not well implemented + * 663174 : oggmux: set collectpads2 not to wait on sparse streams + * 663312 : decodebin2: Post all source pads in stream-topology messages as " element-srcpad " values + * 663390 : theoraenc: fix speed level failure test + * 663391 : theoraenc: misc small tweaks + * 663465 : baseaudiosink: fix late buffers leaking + * 663766 : [0.11] oggmux: split request pad templates into audio/video/subtitle + * 663892 : [playbin2] visualisation leads to not-negotiated error + * 663893 : playbin2: g_object_set_valist: construct property " use-volume " for object `GstPlaySinkAudioConvert' can't be set after construction + * 664818 : Autoplugger sink bin receives strange caps while it gets the correct ones in 0.10.35 and earlier + * 665004 : audioresample emits spurious disconts + * 665074 : [gstfft] headers are not bracketed + * 665080 : API: subtitle overlays for raw and non-raw video buffers + * 665120 : playbin2: decoder not selected for audio-sink=autoaudiosink + * 666395 : playbin2: set uri to a non-existed file in " about-to-finish " causes a CRITICAL warning + * 667210 : videotestsrc/generate_sine_table needs to link against glib + * 667306 : discoverer: don't use unportable vararg macro + * 667311 : fix various unlikely, but still potential memoryleaks + * 667312 : appsrc: implement get_caps + * 667313 : rtcpbuffer: prevent overflow of 16bit header length. + * 667315 : videotestsrc: keep the calculation fixed-point + * 667316 : pango: Changes includes from brackets to quotes for local files + * 667917 : alsasink: Rate doesn't match (requested 88200Hz, get 0Hz) + * 668097 : [subtitleoverlay] fix state change stall on PAUSED- > READY- > PAUSED (patch) + * 669039 : gstrtspconnection: new data may get sent even-though there is a queued message in the GstRTSPWatch + * 669164 : oggdemux generates invalid granpos which causes asserts in theoraparse + * 669167 : vorbisparse drops certain data buffers on the floor mistakenly thinking they're headers + * 669203 : playbin2: totem segfaults in gst_stream_get_other_pad_from_pad() + * 646868 : tag: Provide Creative Commons helper functions + * 654388 : [tags] API: move id3 parsing from id3demux to tag lib + * 311486 : [oggmux] theora bos must come before any audio bos pages + +API changed in this release + +- API additions: + + * gst_audio_decoder_finish_frame() + * gst_audio_decoder_get_audio_info() + * gst_audio_decoder_get_byte_time() + * gst_audio_decoder_get_delay() + * gst_audio_decoder_get_drainable() + * gst_audio_decoder_get_latency() + * gst_audio_decoder_get_max_errors() + * gst_audio_decoder_get_min_latency() + * gst_audio_decoder_get_needs_format() + * gst_audio_decoder_get_parse_state() + * gst_audio_decoder_get_plc() + * gst_audio_decoder_get_plc_aware() + * gst_audio_decoder_get_tolerance() + * gst_audio_decoder_get_type() + * gst_audio_decoder_set_byte_time() + * gst_audio_decoder_set_drainable() + * gst_audio_decoder_set_latency() + * gst_audio_decoder_set_max_errors() + * gst_audio_decoder_set_min_latency() + * gst_audio_decoder_set_needs_format() + * gst_audio_decoder_set_plc() + * gst_audio_decoder_set_plc_aware() + * gst_audio_decoder_set_tolerance() + * gst_audio_encoder_finish_frame() + * gst_audio_encoder_get_audio_info() + * gst_audio_encoder_get_drainable() + * gst_audio_encoder_get_frame_max() + * gst_audio_encoder_get_frame_samples_max() + * gst_audio_encoder_get_frame_samples_min() + * gst_audio_encoder_get_hard_min() + * gst_audio_encoder_get_hard_resync() + * gst_audio_encoder_get_latency() + * gst_audio_encoder_get_lookahead() + * gst_audio_encoder_get_mark_granule() + * gst_audio_encoder_get_perfect_timestamp() + * gst_audio_encoder_get_tolerance() + * gst_audio_encoder_get_type() + * gst_audio_encoder_merge_tags() + * gst_audio_encoder_proxy_getcaps() + * gst_audio_encoder_set_drainable() + * gst_audio_encoder_set_frame_max() + * gst_audio_encoder_set_frame_samples_max() + * gst_audio_encoder_set_frame_samples_min() + * gst_audio_encoder_set_hard_min() + * gst_audio_encoder_set_hard_resync() + * gst_audio_encoder_set_latency() + * gst_audio_encoder_set_lookahead() + * gst_audio_encoder_set_mark_granule() + * gst_audio_encoder_set_perfect_timestamp() + * gst_audio_encoder_set_tolerance() + * gst_audio_iec61937_frame_size() + * gst_audio_iec61937_payload() + * gst_audio_info_clear() + * gst_audio_info_convert() + * gst_audio_info_copy() + * gst_audio_info_free() + * gst_audio_info_from_caps() + * gst_audio_info_init() + * gst_audio_info_to_caps() + * gst_base_audio_sink_get_alignment_threshold() + * gst_base_audio_sink_get_discont_wait() + * gst_base_audio_sink_set_alignment_threshold() + * gst_base_audio_sink_set_discont_wait() + * gst_codec_utils_h264_get_level_idc() + * gst_discoverer_audio_info_get_language() + * gst_discoverer_info_get_subtitle_streams() + * gst_discoverer_subtitle_info_get_language() + * gst_discoverer_subtitle_info_get_type() + * gst_encoding_profile_from_discoverer() + * gst_tag_get_license_description() + * gst_tag_get_license_flags() + * gst_tag_get_license_jurisdiction() + * gst_tag_get_license_nick() + * gst_tag_get_license_title() + * gst_tag_get_license_version() + * gst_tag_get_licenses() + * gst_tag_license_flags_get_type() + * gst_tag_get_id3v2_tag_size() + * gst_tag_list_from_id3v2_tag() + * gst_tag_mux_get_type() + * gst_video_buffer_get_overlay_composition() + * gst_video_buffer_set_overlay_composition() + * gst_video_event_is_force_key_unit() + * gst_video_event_new_downstream_force_key_unit() + * gst_video_event_new_upstream_force_key_unit() + * gst_video_event_parse_downstream_force_key_unit() + * gst_video_event_parse_upstream_force_key_unit() + * gst_video_get_size_from_caps() + * gst_video_overlay_composition_add_rectangle() + * gst_video_overlay_composition_blend() + * gst_video_overlay_composition_copy() + * gst_video_overlay_composition_get_rectangle() + * gst_video_overlay_composition_get_seqnum() + * gst_video_overlay_composition_get_type() + * gst_video_overlay_composition_make_writable() + * gst_video_overlay_composition_n_rectangles() + * gst_video_overlay_composition_new() + * gst_video_overlay_rectangle_copy() + * gst_video_overlay_rectangle_get_pixels_argb() + * gst_video_overlay_rectangle_get_pixels_unscaled_argb() + * gst_video_overlay_rectangle_get_render_rectangle() + * gst_video_overlay_rectangle_get_seqnum() + * gst_video_overlay_rectangle_get_type() + * gst_video_overlay_rectangle_new_argb() + * gst_video_overlay_rectangle_set_render_rectangle() Download @@ -90,10 +400,65 @@ Applications Contributors to this release + * Age Bosma + * Alessandro Decina + * Alex Lancaster + * Alexey Fisher + * Andoni Morales Alastruey + * Anssi Hannula + * Benjamin Otte + * Brian Cameron + * Christian Fredrik Kalager Schaller + * Christophe Fergeau + * Colin Walters * David Schleef - * Debarshi Ray + * Edward Hervey + * Erich Schubert + * Felipe Contreras + * Havard Graff + * Iago Toral + * Idar Tollefsen + * James "Doc" Livingston + * James Doc Livingston + * Jan Schmidt + * Jason Kivlighn + * Jens Georg + * Jonathan Liu + * Jonathan Matthew + * Josep Torra + * Julien Moutte + * Kipp Cannon + * LoneStar + * Luis de Bethencourt * Mark Nauwelaerts + * Mart Raudsepp + * Mersad Jelacic + * Michael Smith + * Monty Montgomery + * Nicolas Dufresne + * Ognyan Tonchev + * Olivier Crête + * Pascal Buhler + * Philip Jägenstedt + * Philippe Normand + * Piotr Fusik + * Raimo Järvi + * René Stadler + * Reynaldo H. Verdejo Pinochet + * Robert Swain * Sebastian Dröge + * Sergey Scobich + * Sergey Scobich) + * Sjoerd Simons * Stefan Kost + * Stefan Sauer + * Sébastien Moutte + * Thiago Santos + * Thibault Saunier + * Thomas Vander Stichele * Tim-Philipp Müller + * Tommi Myöhänen + * Vincent Penquerc'h + * Wim Taymans + * Youness Alaoui   \ No newline at end of file From 4289c0c899ef3af7fb1d5a6c5ce18eb1e466d0fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 13:19:55 +0100 Subject: [PATCH 25/50] playsink: Proxy colorbalance interface --- gst/playback/gstplaysink.c | 351 +++++++++++++++++++++++++++++++++++-- 1 file changed, 335 insertions(+), 16 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 3322ea49a5..b59ae8ae91 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -216,6 +216,11 @@ struct _GstPlaySink gint xoverlay_x, xoverlay_y, xoverlay_width, xoverlay_height; gboolean xoverlay_handle_events_set; gboolean xoverlay_handle_events; + + /* colorbalance proxy interface */ + GstColorBalance *colorbalance_element; + GList *colorbalance_channels; /* CONTRAST, BRIGHTNESS, HUE, SATURATION */ + gint colorbalance_values[4]; }; struct _GstPlaySinkClass @@ -344,6 +349,9 @@ static void gst_play_sink_xoverlay_init (gpointer g_iface, gpointer g_iface_data); static void gst_play_sink_navigation_init (gpointer g_iface, gpointer g_iface_data); +static void gst_play_sink_colorbalance_init (gpointer g_iface, + gpointer g_iface_data); + static void _do_init (GType type) { @@ -362,11 +370,16 @@ _do_init (GType type) gst_play_sink_navigation_init, NULL, NULL }; + static const GInterfaceInfo col_info = { + gst_play_sink_colorbalance_init, + NULL, NULL + }; g_type_add_interface_static (type, GST_TYPE_IMPLEMENTS_INTERFACE, &impl_info); g_type_add_interface_static (type, GST_TYPE_STREAM_VOLUME, &svol_info); g_type_add_interface_static (type, GST_TYPE_X_OVERLAY, &xov_info); g_type_add_interface_static (type, GST_TYPE_NAVIGATION, &nav_info); + g_type_add_interface_static (type, GST_TYPE_COLOR_BALANCE, &col_info); } G_DEFINE_TYPE_WITH_CODE (GstPlaySink, gst_play_sink, GST_TYPE_BIN, @@ -553,6 +566,8 @@ gst_play_sink_class_init (GstPlaySinkClass * klass) static void gst_play_sink_init (GstPlaySink * playsink) { + GstColorBalanceChannel *channel; + /* init groups */ playsink->video_sink = NULL; playsink->audio_sink = NULL; @@ -570,6 +585,46 @@ gst_play_sink_init (GstPlaySink * playsink) g_static_rec_mutex_init (&playsink->lock); GST_OBJECT_FLAG_SET (playsink, GST_ELEMENT_IS_SINK); + + channel = + GST_COLOR_BALANCE_CHANNEL (g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, + NULL)); + channel->label = g_strdup ("CONTRAST"); + channel->min_value = -1000; + channel->max_value = 1000; + playsink->colorbalance_channels = + g_list_append (playsink->colorbalance_channels, channel); + playsink->colorbalance_values[0] = 0; + + channel = + GST_COLOR_BALANCE_CHANNEL (g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, + NULL)); + channel->label = g_strdup ("BRIGHTNESS"); + channel->min_value = -1000; + channel->max_value = 1000; + playsink->colorbalance_channels = + g_list_append (playsink->colorbalance_channels, channel); + playsink->colorbalance_values[1] = 0; + + channel = + GST_COLOR_BALANCE_CHANNEL (g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, + NULL)); + channel->label = g_strdup ("HUE"); + channel->min_value = -1000; + channel->max_value = 1000; + playsink->colorbalance_channels = + g_list_append (playsink->colorbalance_channels, channel); + playsink->colorbalance_values[2] = 0; + + channel = + GST_COLOR_BALANCE_CHANNEL (g_object_new (GST_TYPE_COLOR_BALANCE_CHANNEL, + NULL)); + channel->label = g_strdup ("SATURATION"); + channel->min_value = -1000; + channel->max_value = 1000; + playsink->colorbalance_channels = + g_list_append (playsink->colorbalance_channels, channel); + playsink->colorbalance_values[3] = 0; } static void @@ -661,6 +716,11 @@ gst_play_sink_dispose (GObject * object) playsink->stream_synchronizer = NULL; + g_list_foreach (playsink->colorbalance_channels, (GFunc) gst_object_unref, + NULL); + g_list_free (playsink->colorbalance_channels); + playsink->colorbalance_channels = NULL; + G_OBJECT_CLASS (gst_play_sink_parent_class)->dispose (object); } @@ -1314,32 +1374,117 @@ static void iterate_color_balance_elements (gpointer data, gpointer user_data) { gboolean valid = is_valid_color_balance_element (data); - gboolean *valid_out = user_data; + GstColorBalance **cb_out = user_data; - *valid_out = *valid_out && valid; + if (valid) { + if (*cb_out + && gst_color_balance_get_balance_type (*cb_out) == + GST_COLOR_BALANCE_SOFTWARE) { + gst_object_unref (*cb_out); + *cb_out = GST_COLOR_BALANCE (gst_object_ref (data)); + } else if (!*cb_out) { + *cb_out = GST_COLOR_BALANCE (gst_object_ref (data)); + } + } gst_object_unref (data); } -static gboolean -has_color_balance_element (GstElement * element) +static GstColorBalance * +find_color_balance_element (GstElement * element) { GstIterator *it; - gboolean valid = FALSE; + GstColorBalance *cb = NULL; - if (GST_IS_COLOR_BALANCE (element)) - return is_valid_color_balance_element (element); + if (GST_IS_COLOR_BALANCE (element) + && is_valid_color_balance_element (element)) + return GST_COLOR_BALANCE (gst_object_ref (element)); else if (!GST_IS_BIN (element)) return FALSE; it = gst_bin_iterate_all_by_interface (GST_BIN (element), GST_TYPE_COLOR_BALANCE); while (gst_iterator_foreach (it, iterate_color_balance_elements, - &valid) == GST_ITERATOR_RESYNC) + &cb) == GST_ITERATOR_RESYNC) gst_iterator_resync (it); gst_iterator_free (it); - return valid; + return cb; +} + +static void +colorbalance_value_changed_cb (GstColorBalance * balance, + GstColorBalanceChannel * channel, gint value, GstPlaySink * playsink) +{ + GList *l; + gint i; + + for (i = 0, l = playsink->colorbalance_channels; l; l = l->next, i++) { + GstColorBalanceChannel *proxy = l->data; + + if (g_strrstr (channel->label, proxy->label)) { + gdouble new_val; + + /* Convert to [0, 1] range */ + new_val = + ((gdouble) value - + (gdouble) channel->min_value) / ((gdouble) channel->max_value - + (gdouble) channel->min_value); + /* Convert to proxy range */ + new_val = + proxy->min_value + new_val * ((gdouble) proxy->max_value - + (gdouble) proxy->min_value); + playsink->colorbalance_values[i] = (gint) (0.5 + new_val); + + gst_color_balance_value_changed (GST_COLOR_BALANCE (playsink), proxy, + playsink->colorbalance_values[i]); + break; + } + } +} + +static void +update_colorbalance (GstPlaySink * playsink) +{ + GstColorBalance *balance = NULL; + GList *l; + gint i; + + GST_OBJECT_LOCK (playsink); + if (playsink->colorbalance_element) { + balance = + GST_COLOR_BALANCE (gst_object_ref (playsink->colorbalance_element)); + } + GST_OBJECT_UNLOCK (playsink); + if (!balance) + return; + + g_signal_handlers_disconnect_by_func (balance, + G_CALLBACK (colorbalance_value_changed_cb), playsink); + + for (i = 0, l = playsink->colorbalance_channels; l; l = l->next, i++) { + GstColorBalanceChannel *proxy = l->data; + GstColorBalanceChannel *channel = NULL; + const GList *channels, *k; + + channels = gst_color_balance_list_channels (balance); + for (k = channels; k; k = k->next) { + GstColorBalanceChannel *tmp = k->data; + + if (g_strrstr (tmp->label, proxy->label)) { + channel = tmp; + break; + } + } + + g_assert (channel); + + gst_color_balance_set_value (balance, channel, + playsink->colorbalance_values[i]); + } + + g_signal_connect (balance, "value-changed", + G_CALLBACK (colorbalance_value_changed_cb), playsink); } /* make the element (bin) that contains the elements needed to perform @@ -1475,17 +1620,34 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) head = prev = chain->queue; } + GST_OBJECT_LOCK (playsink); + if (playsink->colorbalance_element) { + g_signal_handlers_disconnect_by_func (playsink->colorbalance_element, + G_CALLBACK (colorbalance_value_changed_cb), playsink); + gst_object_unref (playsink->colorbalance_element); + } + playsink->colorbalance_element = find_color_balance_element (chain->sink); + GST_OBJECT_UNLOCK (playsink); + if (!(playsink->flags & GST_PLAY_FLAG_NATIVE_VIDEO) - || (!has_color_balance_element (chain->sink) + || (!playsink->colorbalance_element && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE))) { gboolean use_converters = !(playsink->flags & GST_PLAY_FLAG_NATIVE_VIDEO); - gboolean use_balance = !has_color_balance_element (chain->sink) + gboolean use_balance = !playsink->colorbalance_element && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE); GST_DEBUG_OBJECT (playsink, "creating videoconverter"); chain->conv = g_object_new (GST_TYPE_PLAY_SINK_VIDEO_CONVERT, "name", "vconv", "use-converters", use_converters, "use-balance", use_balance, NULL); + + GST_OBJECT_LOCK (playsink); + if (use_balance && GST_PLAY_SINK_VIDEO_CONVERT (chain->conv)->balance) + playsink->colorbalance_element = + GST_COLOR_BALANCE (gst_object_ref (GST_PLAY_SINK_VIDEO_CONVERT + (chain->conv)->balance)); + GST_OBJECT_UNLOCK (playsink); + gst_bin_add (bin, chain->conv); if (prev) { if (!gst_element_link_pads_full (prev, "src", chain->conv, "sink", @@ -1497,6 +1659,8 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) prev = chain->conv; } + update_colorbalance (playsink); + if (prev) { GST_DEBUG_OBJECT (playsink, "linking to sink"); if (!gst_element_link_pads_full (prev, "src", chain->sink, NULL, @@ -1632,10 +1796,30 @@ setup_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) if (elem) g_object_set (elem, "force-aspect-ratio", TRUE, NULL); - if (chain->conv) - g_object_set (chain->conv, "use-balance", - !has_color_balance_element (chain->sink) - && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE), NULL); + GST_OBJECT_LOCK (playsink); + if (playsink->colorbalance_element) { + g_signal_handlers_disconnect_by_func (playsink->colorbalance_element, + G_CALLBACK (colorbalance_value_changed_cb), playsink); + gst_object_unref (playsink->colorbalance_element); + } + playsink->colorbalance_element = find_color_balance_element (chain->sink); + GST_OBJECT_UNLOCK (playsink); + + if (chain->conv) { + gboolean use_balance = !playsink->colorbalance_element + && (playsink->flags & GST_PLAY_FLAG_SOFT_COLORBALANCE); + + g_object_set (chain->conv, "use-balance", use_balance, NULL); + + GST_OBJECT_LOCK (playsink); + if (use_balance && GST_PLAY_SINK_VIDEO_CONVERT (chain->conv)->balance) + playsink->colorbalance_element = + GST_COLOR_BALANCE (gst_object_ref (GST_PLAY_SINK_VIDEO_CONVERT + (chain->conv)->balance)); + GST_OBJECT_UNLOCK (playsink); + } + + update_colorbalance (playsink); return TRUE; } @@ -2363,6 +2547,13 @@ gst_play_sink_reconfigure (GstPlaySink * playsink) if (playsink->xoverlay_element) gst_object_unref (playsink->xoverlay_element); playsink->xoverlay_element = NULL; + + if (playsink->colorbalance_element) { + g_signal_handlers_disconnect_by_func (playsink->colorbalance_element, + G_CALLBACK (colorbalance_value_changed_cb), playsink); + gst_object_unref (playsink->colorbalance_element); + } + playsink->colorbalance_element = NULL; GST_OBJECT_UNLOCK (playsink); if (((flags & GST_PLAY_FLAG_VIDEO) @@ -3727,6 +3918,13 @@ gst_play_sink_change_state (GstElement * element, GstStateChange transition) if (playsink->xoverlay_element) gst_object_unref (playsink->xoverlay_element); playsink->xoverlay_element = NULL; + + if (playsink->colorbalance_element) { + g_signal_handlers_disconnect_by_func (playsink->colorbalance_element, + G_CALLBACK (colorbalance_value_changed_cb), playsink); + gst_object_unref (playsink->colorbalance_element); + } + playsink->colorbalance_element = NULL; GST_OBJECT_UNLOCK (playsink); ret = GST_STATE_CHANGE_SUCCESS; @@ -4072,7 +4270,7 @@ gst_play_sink_implements_interface_supported (GstImplementsInterface * iface, GType type) { if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME || - type == GST_TYPE_NAVIGATION) + type == GST_TYPE_NAVIGATION || type == GST_TYPE_COLOR_BALANCE) return TRUE; else return FALSE; @@ -4122,6 +4320,127 @@ gst_play_sink_navigation_init (gpointer g_iface, gpointer g_iface_data) iface->send_event = gst_play_sink_navigation_send_event; } +static const GList * +gst_play_sink_colorbalance_list_channels (GstColorBalance * balance) +{ + GstPlaySink *playsink = GST_PLAY_SINK (balance); + + return playsink->colorbalance_channels; +} + +static void +gst_play_sink_colorbalance_set_value (GstColorBalance * balance, + GstColorBalanceChannel * proxy, gint value) +{ + GstPlaySink *playsink = GST_PLAY_SINK (balance); + GList *l; + gint i; + GstColorBalance *balance_element = NULL; + + GST_OBJECT_LOCK (playsink); + if (playsink->colorbalance_element) + balance_element = + GST_COLOR_BALANCE (gst_object_ref (playsink->colorbalance_element)); + GST_OBJECT_UNLOCK (playsink); + + for (i = 0, l = playsink->colorbalance_channels; l; l = l->next, i++) { + GstColorBalanceChannel *proxy_tmp = l->data; + gdouble new_val; + + if (proxy_tmp != proxy) + continue; + + playsink->colorbalance_values[i] = value; + + if (balance_element) { + GstColorBalanceChannel *channel = NULL; + const GList *channels, *k; + + channels = gst_color_balance_list_channels (balance_element); + for (k = channels; k; k = k->next) { + GstColorBalanceChannel *tmp = l->data; + + if (g_strrstr (tmp->label, proxy->label)) { + channel = tmp; + break; + } + } + + g_assert (channel); + + /* Convert to [0, 1] range */ + new_val = + ((gdouble) value - + (gdouble) proxy->min_value) / ((gdouble) proxy->max_value - + (gdouble) proxy->min_value); + /* Convert to channel range */ + new_val = + channel->min_value + new_val * ((gdouble) channel->max_value - + (gdouble) channel->min_value); + + gst_color_balance_set_value (balance_element, channel, + (gint) (new_val + 0.5)); + + gst_object_unref (balance_element); + } + + gst_color_balance_value_changed (balance, proxy, value); + break; + } +} + +static gint +gst_play_sink_colorbalance_get_value (GstColorBalance * balance, + GstColorBalanceChannel * proxy) +{ + GstPlaySink *playsink = GST_PLAY_SINK (balance); + GList *l; + gint i; + + for (i = 0, l = playsink->colorbalance_channels; l; l = l->next, i++) { + GstColorBalanceChannel *proxy_tmp = l->data; + + if (proxy_tmp != proxy) + continue; + + return playsink->colorbalance_values[i]; + } + + g_return_val_if_reached (0); +} + +static GstColorBalanceType +gst_play_sink_colorbalance_get_balance_type (GstColorBalance * balance) +{ + GstPlaySink *playsink = GST_PLAY_SINK (balance); + GstColorBalance *balance_element = NULL; + GstColorBalanceType t = GST_COLOR_BALANCE_SOFTWARE; + + GST_OBJECT_LOCK (playsink); + if (playsink->colorbalance_element) + balance_element = + GST_COLOR_BALANCE (gst_object_ref (playsink->colorbalance_element)); + GST_OBJECT_UNLOCK (playsink); + + if (balance_element) { + t = gst_color_balance_get_balance_type (balance_element); + gst_object_unref (balance_element); + } + + return t; +} + +static void +gst_play_sink_colorbalance_init (gpointer g_iface, gpointer g_iface_data) +{ + GstColorBalanceClass *iface = (GstColorBalanceClass *) g_iface; + + iface->list_channels = gst_play_sink_colorbalance_list_channels; + iface->set_value = gst_play_sink_colorbalance_set_value; + iface->get_value = gst_play_sink_colorbalance_get_value; + iface->get_balance_type = gst_play_sink_colorbalance_get_balance_type; +} + gboolean gst_play_sink_plugin_init (GstPlugin * plugin) { From 0ef49c5275e56be308bd804177a52499f78aca2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 13:27:28 +0100 Subject: [PATCH 26/50] playbin2: Proxy colorbalance interface --- gst/playback/gstplaybin2.c | 70 +++++++++++++++++++++++++++++++++++++- 1 file changed, 69 insertions(+), 1 deletion(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index c495838f7a..0ed8b3ac87 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -234,6 +234,7 @@ #include #include #include +#include #include "gstplay-enum.h" #include "gstplay-marshal.h" @@ -588,6 +589,8 @@ static void gst_play_bin_xoverlay_init (gpointer g_iface, gpointer g_iface_data); static void gst_play_bin_navigation_init (gpointer g_iface, gpointer g_iface_data); +static void gst_play_bin_colorbalance_init (gpointer g_iface, + gpointer g_iface_data); static GType gst_play_bin_get_type (void) @@ -622,6 +625,10 @@ gst_play_bin_get_type (void) gst_play_bin_navigation_init, NULL, NULL }; + static const GInterfaceInfo col_info = { + gst_play_bin_colorbalance_init, + NULL, NULL + }; gst_play_bin_type = g_type_register_static (GST_TYPE_PIPELINE, "GstPlayBin2", &gst_play_bin_info, 0); @@ -634,6 +641,8 @@ gst_play_bin_get_type (void) &xov_info); g_type_add_interface_static (gst_play_bin_type, GST_TYPE_NAVIGATION, &nav_info); + g_type_add_interface_static (gst_play_bin_type, GST_TYPE_COLOR_BALANCE, + &col_info); } return gst_play_bin_type; @@ -1243,6 +1252,13 @@ notify_mute_cb (GObject * selector, GParamSpec * pspec, GstPlayBin * playbin) g_object_notify (G_OBJECT (playbin), "mute"); } +static void +colorbalance_value_changed_cb (GstColorBalance * balance, + GstColorBalanceChannel * channel, gint value, GstPlayBin * playbin) +{ + gst_color_balance_value_changed (GST_COLOR_BALANCE (playbin), channel, value); +} + /* Must be called with elements lock! */ static void gst_play_bin_update_elements_list (GstPlayBin * playbin) @@ -1295,6 +1311,8 @@ gst_play_bin_init (GstPlayBin * playbin) G_CALLBACK (notify_volume_cb), playbin); g_signal_connect (playbin->playsink, "notify::mute", G_CALLBACK (notify_mute_cb), playbin); + g_signal_connect (playbin->playsink, "value-changed", + G_CALLBACK (colorbalance_value_changed_cb), playbin); playbin->current_video = DEFAULT_CURRENT_VIDEO; playbin->current_audio = DEFAULT_CURRENT_AUDIO; @@ -4098,7 +4116,7 @@ gst_play_bin_implements_interface_supported (GstImplementsInterface * iface, GType type) { if (type == GST_TYPE_X_OVERLAY || type == GST_TYPE_STREAM_VOLUME || - type == GST_TYPE_NAVIGATION) + type == GST_TYPE_NAVIGATION || type == GST_TYPE_COLOR_BALANCE) return TRUE; else return FALSE; @@ -4128,6 +4146,56 @@ gst_play_bin_navigation_init (gpointer g_iface, gpointer g_iface_data) iface->send_event = gst_play_bin_navigation_send_event; } +static const GList * +gst_play_bin_colorbalance_list_channels (GstColorBalance * balance) +{ + GstPlayBin *playbin = GST_PLAY_BIN (balance); + + return + gst_color_balance_list_channels (GST_COLOR_BALANCE (playbin->playsink)); +} + +static void +gst_play_bin_colorbalance_set_value (GstColorBalance * balance, + GstColorBalanceChannel * channel, gint value) +{ + GstPlayBin *playbin = GST_PLAY_BIN (balance); + + gst_color_balance_set_value (GST_COLOR_BALANCE (playbin->playsink), channel, + value); +} + +static gint +gst_play_bin_colorbalance_get_value (GstColorBalance * balance, + GstColorBalanceChannel * channel) +{ + GstPlayBin *playbin = GST_PLAY_BIN (balance); + + return gst_color_balance_get_value (GST_COLOR_BALANCE (playbin->playsink), + channel); +} + +static GstColorBalanceType +gst_play_bin_colorbalance_get_balance_type (GstColorBalance * balance) +{ + GstPlayBin *playbin = GST_PLAY_BIN (balance); + + return + gst_color_balance_get_balance_type (GST_COLOR_BALANCE + (playbin->playsink)); +} + +static void +gst_play_bin_colorbalance_init (gpointer g_iface, gpointer g_iface_data) +{ + GstColorBalanceClass *iface = (GstColorBalanceClass *) g_iface; + + iface->list_channels = gst_play_bin_colorbalance_list_channels; + iface->set_value = gst_play_bin_colorbalance_set_value; + iface->get_value = gst_play_bin_colorbalance_get_value; + iface->get_balance_type = gst_play_bin_colorbalance_get_balance_type; +} + gboolean gst_play_bin2_plugin_init (GstPlugin * plugin) { From 03eab90fe8d38200c60641decf2fd638da826f9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 13:31:37 +0100 Subject: [PATCH 27/50] seek: Use colorbalance of playbin2 directly --- tests/examples/seek/seek.c | 43 +++++++++++++------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index c7e7e6cfc5..6fc97a92fe 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1002,6 +1002,10 @@ make_playerbin2_pipeline (const gchar * location) /* FIXME: this is not triggered, playbin2 is not forwarding it from the sink */ g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb), NULL); + + navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); + colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); + return pipeline; } @@ -2623,6 +2627,9 @@ find_interface_elements (void) gpointer item; gboolean done = FALSE, hardware = FALSE; + if (pipeline_type == 16) + return; + if (navigation_element) gst_object_unref (navigation_element); navigation_element = NULL; @@ -2631,9 +2638,8 @@ find_interface_elements (void) gst_object_unref (colorbalance_element); colorbalance_element = NULL; - if (pipeline_type != 16) - navigation_element = - gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION); + navigation_element = + gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION); it = gst_bin_iterate_all_by_interface (GST_BIN (pipeline), GST_TYPE_COLOR_BALANCE); @@ -2693,17 +2699,13 @@ navigation_cmd_cb (GtkButton * button, gpointer data) { GstNavigationCommand cmd = GPOINTER_TO_INT (data); - if (pipeline_type == 16) { - gst_navigation_send_command (GST_NAVIGATION (pipeline), cmd); - } else { - if (!navigation_element) { - find_interface_elements (); - if (!navigation_element) - return; - } - - gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd); + if (!navigation_element) { + find_interface_elements (); + if (!navigation_element) + return; } + + gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd); } #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) @@ -2804,9 +2806,6 @@ button_press_cb (GtkWidget * widget, GdkEventButton * event, gpointer user_data) if (navigation_element) gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), "mouse-button-press", event->button, event->x, event->y); - else if (pipeline_type == 16) - gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline), - "mouse-button-press", event->button, event->x, event->y); return FALSE; } @@ -2818,9 +2817,6 @@ button_release_cb (GtkWidget * widget, GdkEventButton * event, if (navigation_element) gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), "mouse-button-release", event->button, event->x, event->y); - else if (pipeline_type == 16) - gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline), - "mouse-button-release", event->button, event->x, event->y); return FALSE; } @@ -2831,9 +2827,6 @@ key_press_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) if (navigation_element) gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), "key-press", gdk_keyval_name (event->keyval)); - else if (pipeline_type == 16) - gst_navigation_send_key_event (GST_NAVIGATION (pipeline), - "key-press", gdk_keyval_name (event->keyval)); return FALSE; } @@ -2844,9 +2837,6 @@ key_release_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) if (navigation_element) gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), "key-release", gdk_keyval_name (event->keyval)); - else if (pipeline_type == 16) - gst_navigation_send_key_event (GST_NAVIGATION (pipeline), - "key-release", gdk_keyval_name (event->keyval)); return FALSE; } @@ -2858,9 +2848,6 @@ motion_notify_cb (GtkWidget * widget, GdkEventMotion * event, if (navigation_element) gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), "mouse-move", 0, event->x, event->y); - else if (pipeline_type == 16) - gst_navigation_send_mouse_event (GST_NAVIGATION (pipeline), - "mouse-move", 0, event->x, event->y); return FALSE; } From db66b501fe5df208bdb559a80701ed3a8efb4113 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 13:39:33 +0100 Subject: [PATCH 28/50] seek: The volume property signals are proxied in playbin2 since some time already --- tests/examples/seek/seek.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 6fc97a92fe..699ba36219 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -999,10 +999,6 @@ make_playerbin2_pipeline (const gchar * location) { GstElement *pipeline = construct_playerbin ("playbin2", location); - /* FIXME: this is not triggered, playbin2 is not forwarding it from the sink */ - g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb), - NULL); - navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); @@ -1302,11 +1298,6 @@ update_scale (gpointer data) set_scale (position * N_GRAD / duration); } - /* FIXME: see make_playerbin2_pipeline() and volume_notify_cb() */ - if (pipeline_type == 16) { - g_object_notify (G_OBJECT (pipeline), "volume"); - } - return TRUE; } From 361e1e2e980004bca0acfc73ee3b84bf6d4ceb95 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 13:41:25 +0100 Subject: [PATCH 29/50] playsink: Use g_signal_handlers_block_by_func()/unblock_by_func() instead of disconnecting and reconnecting --- gst/playback/gstplaysink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index b59ae8ae91..61bdceee5f 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1459,7 +1459,7 @@ update_colorbalance (GstPlaySink * playsink) if (!balance) return; - g_signal_handlers_disconnect_by_func (balance, + g_signal_handlers_block_by_func (balance, G_CALLBACK (colorbalance_value_changed_cb), playsink); for (i = 0, l = playsink->colorbalance_channels; l; l = l->next, i++) { @@ -1483,7 +1483,7 @@ update_colorbalance (GstPlaySink * playsink) playsink->colorbalance_values[i]); } - g_signal_connect (balance, "value-changed", + g_signal_handlers_unblock_by_func (balance, G_CALLBACK (colorbalance_value_changed_cb), playsink); } From e3a1535930a83806a8df67f79596d9f326f7f46b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 23 Feb 2012 14:46:07 +0100 Subject: [PATCH 30/50] seek: Fix mistake in last commit --- tests/examples/seek/seek.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index 699ba36219..ffc114f0bd 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -999,6 +999,9 @@ make_playerbin2_pipeline (const gchar * location) { GstElement *pipeline = construct_playerbin ("playbin2", location); + g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb), + NULL); + navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); From ed25febef9796303ea9a3776c25497b2bb44079e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 Feb 2012 11:44:53 +0100 Subject: [PATCH 31/50] seek: Refactor and cleanup seek example application --- tests/examples/seek/seek.c | 2913 +++++++++++++----------------------- 1 file changed, 1014 insertions(+), 1899 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index ffc114f0bd..a5f8460bc5 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -4,6 +4,8 @@ * * Copyright (C) 2005 Wim Taymans * 2006 Stefan Kost + * 2012 Collabora Ltd. + * Author: Sebastian Dröge * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public @@ -27,6 +29,7 @@ /* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex * with newer GTK versions (>= 3.3.0) */ #define GDK_DISABLE_DEPRECATION_WARNINGS +#define GLIB_DISABLE_DEPRECATION_WARNINGS #include #include @@ -67,14 +70,8 @@ typedef enum GST_PLAY_FLAG_SOFT_COLORBALANCE = (1 << 10) } GstPlayFlags; - /* configuration */ -#define SOURCE "filesrc" - -static gchar *opt_audiosink_str; /* NULL */ -static gchar *opt_videosink_str; /* NULL */ - #define FILL_INTERVAL 100 //#define UPDATE_INTERVAL 500 //#define UPDATE_INTERVAL 100 @@ -93,73 +90,6 @@ static gchar *opt_videosink_str; /* NULL */ #define N_GRAD 1000.0 -static GList *seekable_pads = NULL; -static GList *rate_pads = NULL; -static GList *seekable_elements = NULL; - -static gboolean accurate_seek = FALSE; -static gboolean keyframe_seek = FALSE; -static gboolean loop_seek = FALSE; -static gboolean flush_seek = TRUE; -static gboolean scrub = TRUE; -static gboolean play_scrub = FALSE; -static gboolean skip_seek = FALSE; -static gdouble rate = 1.0; - -static GstElement *pipeline; -static gint pipeline_type; -static const gchar *pipeline_spec; -static gint64 position = -1; -static gint64 duration = -1; -static GtkAdjustment *adjustment; -static GtkWidget *hscale, *statusbar; -static guint status_id = 0; -static gboolean stats = FALSE; -static gboolean elem_seek = FALSE; -static gboolean verbose = FALSE; - -static gboolean is_live = FALSE; -static gboolean buffering = FALSE; -static GstBufferingMode mode; -static gint64 buffering_left; -static GstState state = GST_STATE_NULL; -static guint update_id = 0; -static guint seek_timeout_id = 0; -static gulong changed_id; -static guint fill_id = 0; - -static gint n_video = 0, n_audio = 0, n_text = 0; -static gboolean need_streams = TRUE; -static GtkWidget *video_combo, *audio_combo, *text_combo, *vis_combo; -static GtkWidget *vis_checkbox, *video_checkbox, *audio_checkbox; -static GtkWidget *text_checkbox, *mute_checkbox, *volume_spinbutton; -static GtkWidget *soft_volume_checkbox, *native_audio_checkbox; -static GtkWidget *native_video_checkbox, *deinterlace_checkbox; -static GtkWidget *soft_colorbalance_checkbox; -static GtkWidget *skip_checkbox, *video_window, *download_checkbox; -static GtkWidget *buffering_checkbox, *rate_spinbutton; - -static GStaticMutex state_mutex = G_STATIC_MUTEX_INIT; - -static GtkWidget *format_combo, *step_amount_spinbutton, *step_rate_spinbutton; -static GtkWidget *shuttle_checkbox, *step_button; -static GtkWidget *shuttle_hscale; -static GtkAdjustment *shuttle_adjustment; - -static GtkWidget *contrast_scale, *brightness_scale, *hue_scale, - *saturation_scale; - -static GstElement *navigation_element = NULL; -static GstElement *colorbalance_element = NULL; - -static struct -{ - GstNavigationCommand cmd; - GtkWidget *button; -} navigation_buttons[14]; - -static GList *paths = NULL, *l = NULL; - /* we keep an array of the visualisation entries so that we can easily switch * with the combo box index. */ typedef struct @@ -167,23 +97,90 @@ typedef struct GstElementFactory *factory; } VisEntry; -static GArray *vis_entries; +typedef struct +{ + /* GTK widgets */ + GtkWidget *window; + GtkWidget *video_combo, *audio_combo, *text_combo, *vis_combo; + GtkWidget *vis_checkbox, *video_checkbox, *audio_checkbox; + GtkWidget *text_checkbox, *mute_checkbox, *volume_spinbutton; + GtkWidget *video_window; -static void clear_streams (GstElement * pipeline); + GtkWidget *seek_scale, *statusbar; + guint status_id; + + GtkWidget *format_combo, *step_amount_spinbutton, *step_rate_spinbutton; + GtkWidget *shuttle_scale; + + GtkWidget *contrast_scale, *brightness_scale, *hue_scale, *saturation_scale; + + struct + { + GstNavigationCommand cmd; + GtkWidget *button; + } navigation_buttons[14]; + + guintptr embed_xid; + + /* GStreamer pipeline */ + GstElement *pipeline; + + GstElement *navigation_element; + GstElement *colorbalance_element; + GstElement *xoverlay_element; + + /* Settings */ + gboolean accurate_seek; + gboolean keyframe_seek; + gboolean loop_seek; + gboolean flush_seek; + gboolean scrub; + gboolean play_scrub; + gboolean skip_seek; + gdouble rate; + + /* From commandline parameters */ + gboolean stats; + gboolean verbose; + const gchar *pipeline_spec; + gint pipeline_type; + GList *paths, *current_path; + + gchar *audiosink_str, *videosink_str; + + /* Internal state */ + gint64 position, duration; + + gboolean is_live; + gboolean buffering; + GstBufferingMode mode; + gint64 buffering_left; + GstState state; + guint update_id; + guint seek_timeout_id; + gulong changed_id; + guint fill_id; + + gboolean need_streams; + gint n_video, n_audio, n_text; + + GStaticMutex state_mutex; + + GArray *vis_entries; /* Array of VisEntry structs */ + + gboolean shuttling; + gdouble shuttle_rate; + gdouble play_rate; +} SeekApp; + +static void clear_streams (SeekApp * app); static void volume_notify_cb (GstElement * pipeline, GParamSpec * arg, - gpointer user_dat); -static void find_interface_elements (void); + SeekApp * app); +static void find_interface_elements (SeekApp * app); /* pipeline construction */ -typedef struct -{ - const gchar *padname; - GstPad *target; - GstElement *bin; -} -dyn_link; - +#if 0 static GstElement * gst_element_factory_make_or_warn (const gchar * type, const gchar * name) { @@ -205,747 +202,10 @@ gst_element_factory_make_or_warn (const gchar * type, const gchar * name) return element; } +#endif static void -dynamic_link (GstPadTemplate * templ, GstPad * newpad, gpointer data) -{ - gchar *padname; - dyn_link *connect = (dyn_link *) data; - - padname = gst_pad_get_name (newpad); - - if (connect->padname == NULL || !strcmp (padname, connect->padname)) { - if (connect->bin) - gst_bin_add (GST_BIN (pipeline), connect->bin); - gst_pad_link (newpad, connect->target); - - //seekable_pads = g_list_prepend (seekable_pads, newpad); - rate_pads = g_list_prepend (rate_pads, newpad); - } - g_free (padname); -} - -static void -setup_dynamic_link (GstElement * element, const gchar * padname, - GstPad * target, GstElement * bin) -{ - dyn_link *connect; - - connect = g_new0 (dyn_link, 1); - connect->padname = g_strdup (padname); - connect->target = target; - connect->bin = bin; - - g_signal_connect (G_OBJECT (element), "pad-added", G_CALLBACK (dynamic_link), - connect); -} - -static GstElement * -make_mod_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *decoder, *audiosink; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - decoder = gst_element_factory_make_or_warn ("modplug", "decoder"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink"); - //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), decoder); - gst_bin_add (GST_BIN (pipeline), audiosink); - - gst_element_link (src, decoder); - gst_element_link (decoder, audiosink); - - seekable = gst_element_get_static_pad (decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink")); - - return pipeline; -} - -static GstElement * -make_dv_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *demux, *decoder, *audiosink, *videosink; - GstElement *a_queue, *v_queue; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - demux = gst_element_factory_make_or_warn ("dvdemux", "demuxer"); - v_queue = gst_element_factory_make_or_warn ("queue", "v_queue"); - decoder = gst_element_factory_make_or_warn ("ffdec_dvvideo", "decoder"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - a_queue = gst_element_factory_make_or_warn ("queue", "a_queue"); - audiosink = gst_element_factory_make_or_warn ("alsasink", "a_sink"); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_bin_add (GST_BIN (pipeline), a_queue); - gst_bin_add (GST_BIN (pipeline), audiosink); - gst_bin_add (GST_BIN (pipeline), v_queue); - gst_bin_add (GST_BIN (pipeline), decoder); - gst_bin_add (GST_BIN (pipeline), videosink); - - gst_element_link (src, demux); - gst_element_link (a_queue, audiosink); - gst_element_link (v_queue, decoder); - gst_element_link (decoder, videosink); - - setup_dynamic_link (demux, "video", gst_element_get_static_pad (v_queue, - "sink"), NULL); - setup_dynamic_link (demux, "audio", gst_element_get_static_pad (a_queue, - "sink"), NULL); - - seekable = gst_element_get_static_pad (decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - - return pipeline; -} - -static GstElement * -make_wav_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *decoder, *audiosink; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - decoder = gst_element_factory_make_or_warn ("wavparse", "decoder"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink"); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), decoder); - gst_bin_add (GST_BIN (pipeline), audiosink); - - gst_element_link (src, decoder); - - setup_dynamic_link (decoder, "src", gst_element_get_static_pad (audiosink, - "sink"), NULL); - - seekable_elements = g_list_prepend (seekable_elements, audiosink); - - /* force element seeking on this pipeline */ - elem_seek = TRUE; - - return pipeline; -} - -static GstElement * -make_flac_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *decoder, *audiosink; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - decoder = gst_element_factory_make_or_warn ("flacdec", "decoder"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink"); - g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), decoder); - gst_bin_add (GST_BIN (pipeline), audiosink); - - gst_element_link (src, decoder); - gst_element_link (decoder, audiosink); - - seekable = gst_element_get_static_pad (decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink")); - - return pipeline; -} - -static GstElement * -make_sid_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *decoder, *audiosink; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - decoder = gst_element_factory_make_or_warn ("siddec", "decoder"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink"); - //g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), decoder); - gst_bin_add (GST_BIN (pipeline), audiosink); - - gst_element_link (src, decoder); - gst_element_link (decoder, audiosink); - - seekable = gst_element_get_static_pad (decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink")); - - return pipeline; -} - -static GstElement * -make_parse_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *parser, *fakesink; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - parser = gst_element_factory_make_or_warn ("mpegparse", "parse"); - fakesink = gst_element_factory_make_or_warn ("fakesink", "sink"); - g_object_set (G_OBJECT (fakesink), "silent", TRUE, NULL); - g_object_set (G_OBJECT (fakesink), "sync", TRUE, NULL); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), parser); - gst_bin_add (GST_BIN (pipeline), fakesink); - - gst_element_link (src, parser); - gst_element_link (parser, fakesink); - - seekable = gst_element_get_static_pad (parser, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (parser, "sink")); - - return pipeline; -} - -static GstElement * -make_vorbis_pipeline (const gchar * location) -{ - GstElement *pipeline, *audio_bin; - GstElement *src, *demux, *decoder, *convert, *audiosink; - GstPad *pad, *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - demux = gst_element_factory_make_or_warn ("oggdemux", "demux"); - decoder = gst_element_factory_make_or_warn ("vorbisdec", "decoder"); - convert = gst_element_factory_make_or_warn ("audioconvert", "convert"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink"); - g_object_set (G_OBJECT (audiosink), "sync", TRUE, NULL); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - audio_bin = gst_bin_new ("a_decoder_bin"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_bin_add (GST_BIN (audio_bin), decoder); - gst_bin_add (GST_BIN (audio_bin), convert); - gst_bin_add (GST_BIN (audio_bin), audiosink); - gst_bin_add (GST_BIN (pipeline), audio_bin); - - gst_element_link (src, demux); - gst_element_link (decoder, convert); - gst_element_link (convert, audiosink); - - pad = gst_element_get_static_pad (decoder, "sink"); - gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, NULL, gst_element_get_static_pad (audio_bin, - "sink"), NULL); - - seekable = gst_element_get_static_pad (decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink")); - - return pipeline; -} - -static GstElement * -make_theora_pipeline (const gchar * location) -{ - GstElement *pipeline, *video_bin; - GstElement *src, *demux, *decoder, *convert, *videosink; - GstPad *pad, *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - demux = gst_element_factory_make_or_warn ("oggdemux", "demux"); - decoder = gst_element_factory_make_or_warn ("theoradec", "decoder"); - convert = gst_element_factory_make_or_warn ("ffmpegcolorspace", "convert"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "sink"); - - g_object_set (G_OBJECT (src), "location", location, NULL); - - video_bin = gst_bin_new ("v_decoder_bin"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_bin_add (GST_BIN (video_bin), decoder); - gst_bin_add (GST_BIN (video_bin), convert); - gst_bin_add (GST_BIN (video_bin), videosink); - gst_bin_add (GST_BIN (pipeline), video_bin); - - gst_element_link (src, demux); - gst_element_link (decoder, convert); - gst_element_link (convert, videosink); - - pad = gst_element_get_static_pad (decoder, "sink"); - gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, NULL, gst_element_get_static_pad (video_bin, - "sink"), NULL); - - seekable = gst_element_get_static_pad (decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink")); - - return pipeline; -} - -static GstElement * -make_vorbis_theora_pipeline (const gchar * location) -{ - GstElement *pipeline, *audio_bin, *video_bin; - GstElement *src, *demux, *a_decoder, *a_convert, *v_decoder, *v_convert; - GstElement *audiosink, *videosink; - GstElement *a_queue, *v_queue, *v_scale; - GstPad *seekable; - GstPad *pad; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - g_object_set (G_OBJECT (src), "location", location, NULL); - - demux = gst_element_factory_make_or_warn ("oggdemux", "demux"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_element_link (src, demux); - - audio_bin = gst_bin_new ("a_decoder_bin"); - a_queue = gst_element_factory_make_or_warn ("queue", "a_queue"); - a_decoder = gst_element_factory_make_or_warn ("vorbisdec", "a_dec"); - a_convert = gst_element_factory_make_or_warn ("audioconvert", "a_convert"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink"); - - gst_bin_add (GST_BIN (pipeline), audio_bin); - - gst_bin_add (GST_BIN (audio_bin), a_queue); - gst_bin_add (GST_BIN (audio_bin), a_decoder); - gst_bin_add (GST_BIN (audio_bin), a_convert); - gst_bin_add (GST_BIN (audio_bin), audiosink); - - gst_element_link (a_queue, a_decoder); - gst_element_link (a_decoder, a_convert); - gst_element_link (a_convert, audiosink); - - pad = gst_element_get_static_pad (a_queue, "sink"); - gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, NULL, gst_element_get_static_pad (audio_bin, - "sink"), NULL); - - video_bin = gst_bin_new ("v_decoder_bin"); - v_queue = gst_element_factory_make_or_warn ("queue", "v_queue"); - v_decoder = gst_element_factory_make_or_warn ("theoradec", "v_dec"); - v_convert = - gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_convert"); - v_scale = gst_element_factory_make_or_warn ("videoscale", "v_scale"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - - gst_bin_add (GST_BIN (pipeline), video_bin); - - gst_bin_add (GST_BIN (video_bin), v_queue); - gst_bin_add (GST_BIN (video_bin), v_decoder); - gst_bin_add (GST_BIN (video_bin), v_convert); - gst_bin_add (GST_BIN (video_bin), v_scale); - gst_bin_add (GST_BIN (video_bin), videosink); - - gst_element_link_many (v_queue, v_decoder, v_convert, v_scale, videosink, - NULL); - - pad = gst_element_get_static_pad (v_queue, "sink"); - gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, NULL, gst_element_get_static_pad (video_bin, - "sink"), NULL); - - seekable = gst_element_get_static_pad (a_decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder, - "sink")); - - return pipeline; -} - -static GstElement * -make_avi_msmpeg4v3_mp3_pipeline (const gchar * location) -{ - GstElement *pipeline, *audio_bin, *video_bin; - GstElement *src, *demux, *a_decoder, *a_convert, *v_decoder, *v_convert; - GstElement *audiosink, *videosink; - GstElement *a_queue, *v_queue; - GstPad *seekable, *pad; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - g_object_set (G_OBJECT (src), "location", location, NULL); - - demux = gst_element_factory_make_or_warn ("avidemux", "demux"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_element_link (src, demux); - - audio_bin = gst_bin_new ("a_decoder_bin"); - a_queue = gst_element_factory_make_or_warn ("queue", "a_queue"); - a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec"); - a_convert = gst_element_factory_make_or_warn ("audioconvert", "a_convert"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink"); - - gst_bin_add (GST_BIN (audio_bin), a_queue); - gst_bin_add (GST_BIN (audio_bin), a_decoder); - gst_bin_add (GST_BIN (audio_bin), a_convert); - gst_bin_add (GST_BIN (audio_bin), audiosink); - - gst_element_link (a_queue, a_decoder); - gst_element_link (a_decoder, a_convert); - gst_element_link (a_convert, audiosink); - - gst_bin_add (GST_BIN (pipeline), audio_bin); - - pad = gst_element_get_static_pad (a_queue, "sink"); - gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, NULL, gst_element_get_static_pad (audio_bin, - "sink"), NULL); - - video_bin = gst_bin_new ("v_decoder_bin"); - v_queue = gst_element_factory_make_or_warn ("queue", "v_queue"); - v_decoder = gst_element_factory_make_or_warn ("ffdec_msmpeg4", "v_dec"); - v_convert = - gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_convert"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - - gst_bin_add (GST_BIN (video_bin), v_queue); - gst_bin_add (GST_BIN (video_bin), v_decoder); - gst_bin_add (GST_BIN (video_bin), v_convert); - gst_bin_add (GST_BIN (video_bin), videosink); - - gst_element_link_many (v_queue, v_decoder, v_convert, videosink, NULL); - - gst_bin_add (GST_BIN (pipeline), video_bin); - - pad = gst_element_get_static_pad (v_queue, "sink"); - gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, NULL, gst_element_get_static_pad (video_bin, - "sink"), NULL); - - seekable = gst_element_get_static_pad (a_decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder, - "sink")); - - return pipeline; -} - -static GstElement * -make_mp3_pipeline (const gchar * location) -{ - GstElement *pipeline; - GstElement *src, *parser, *decoder, *audiosink, *queue; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - parser = gst_element_factory_make_or_warn ("mp3parse", "parse"); - decoder = gst_element_factory_make_or_warn ("mad", "dec"); - queue = gst_element_factory_make_or_warn ("queue", "queue"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "sink"); - - seekable_elements = g_list_prepend (seekable_elements, audiosink); - - g_object_set (G_OBJECT (src), "location", location, NULL); - //g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), parser); - gst_bin_add (GST_BIN (pipeline), decoder); - gst_bin_add (GST_BIN (pipeline), queue); - gst_bin_add (GST_BIN (pipeline), audiosink); - - gst_element_link (src, parser); - gst_element_link (parser, decoder); - gst_element_link (decoder, queue); - gst_element_link (queue, audiosink); - - seekable = gst_element_get_static_pad (queue, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (decoder, "sink")); - - return pipeline; -} - -static GstElement * -make_avi_pipeline (const gchar * location) -{ - GstElement *pipeline, *audio_bin, *video_bin; - GstElement *src, *demux, *a_decoder, *v_decoder, *audiosink, *videosink; - GstElement *a_queue = NULL, *v_queue = NULL; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - g_object_set (G_OBJECT (src), "location", location, NULL); - - demux = gst_element_factory_make_or_warn ("avidemux", "demux"); - seekable_elements = g_list_prepend (seekable_elements, demux); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_element_link (src, demux); - - audio_bin = gst_bin_new ("a_decoder_bin"); - a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink"); - a_queue = gst_element_factory_make_or_warn ("queue", "a_queue"); - gst_element_link (a_decoder, a_queue); - gst_element_link (a_queue, audiosink); - gst_bin_add (GST_BIN (audio_bin), a_decoder); - gst_bin_add (GST_BIN (audio_bin), a_queue); - gst_bin_add (GST_BIN (audio_bin), audiosink); - gst_element_set_state (audio_bin, GST_STATE_PAUSED); - - setup_dynamic_link (demux, "audio_00", gst_element_get_static_pad (a_decoder, - "sink"), audio_bin); - - seekable = gst_element_get_static_pad (a_queue, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder, - "sink")); - - video_bin = gst_bin_new ("v_decoder_bin"); - v_decoder = gst_element_factory_make_or_warn ("ffmpegdecall", "v_dec"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - v_queue = gst_element_factory_make_or_warn ("queue", "v_queue"); - gst_element_link (v_decoder, v_queue); - gst_element_link (v_queue, videosink); - gst_bin_add (GST_BIN (video_bin), v_decoder); - gst_bin_add (GST_BIN (video_bin), v_queue); - gst_bin_add (GST_BIN (video_bin), videosink); - - gst_element_set_state (video_bin, GST_STATE_PAUSED); - - setup_dynamic_link (demux, "video_00", gst_element_get_static_pad (v_decoder, - "sink"), video_bin); - - seekable = gst_element_get_static_pad (v_queue, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (v_decoder, - "sink")); - - return pipeline; -} - -static GstElement * -make_mpeg_pipeline (const gchar * location) -{ - GstElement *pipeline, *audio_bin, *video_bin; - GstElement *src, *demux, *a_decoder, *v_decoder, *v_filter; - GstElement *audiosink, *videosink; - GstElement *a_queue, *v_queue; - GstPad *seekable; - GstPad *pad; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - g_object_set (G_OBJECT (src), "location", location, NULL); - - //demux = gst_element_factory_make_or_warn ("mpegdemux", "demux"); - demux = gst_element_factory_make_or_warn ("flupsdemux", "demux"); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_element_link (src, demux); - - audio_bin = gst_bin_new ("a_decoder_bin"); - a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec"); - a_queue = gst_element_factory_make_or_warn ("queue", "a_queue"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink"); - gst_bin_add (GST_BIN (audio_bin), a_decoder); - gst_bin_add (GST_BIN (audio_bin), a_queue); - gst_bin_add (GST_BIN (audio_bin), audiosink); - - gst_element_link (a_decoder, a_queue); - gst_element_link (a_queue, audiosink); - - gst_bin_add (GST_BIN (pipeline), audio_bin); - - pad = gst_element_get_static_pad (a_decoder, "sink"); - gst_element_add_pad (audio_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, "audio_c0", gst_element_get_static_pad (audio_bin, - "sink"), NULL); - - video_bin = gst_bin_new ("v_decoder_bin"); - v_decoder = gst_element_factory_make_or_warn ("mpeg2dec", "v_dec"); - v_queue = gst_element_factory_make_or_warn ("queue", "v_queue"); - v_filter = gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_filter"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - - gst_bin_add (GST_BIN (video_bin), v_decoder); - gst_bin_add (GST_BIN (video_bin), v_queue); - gst_bin_add (GST_BIN (video_bin), v_filter); - gst_bin_add (GST_BIN (video_bin), videosink); - - gst_element_link (v_decoder, v_queue); - gst_element_link (v_queue, v_filter); - gst_element_link (v_filter, videosink); - - gst_bin_add (GST_BIN (pipeline), video_bin); - - pad = gst_element_get_static_pad (v_decoder, "sink"); - gst_element_add_pad (video_bin, gst_ghost_pad_new ("sink", pad)); - gst_object_unref (pad); - - setup_dynamic_link (demux, "video_e0", gst_element_get_static_pad (video_bin, - "sink"), NULL); - - seekable = gst_element_get_static_pad (v_filter, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (v_decoder, - "sink")); - - return pipeline; -} - -static GstElement * -make_mpegnt_pipeline (const gchar * location) -{ - GstElement *pipeline, *audio_bin, *video_bin; - GstElement *src, *demux, *a_decoder, *v_decoder, *v_filter; - GstElement *audiosink, *videosink; - GstElement *a_queue; - GstPad *seekable; - - pipeline = gst_pipeline_new ("app"); - - src = gst_element_factory_make_or_warn (SOURCE, "src"); - g_object_set (G_OBJECT (src), "location", location, NULL); - - demux = gst_element_factory_make_or_warn ("mpegdemux", "demux"); - //g_object_set (G_OBJECT (demux), "sync", TRUE, NULL); - - seekable_elements = g_list_prepend (seekable_elements, demux); - - gst_bin_add (GST_BIN (pipeline), src); - gst_bin_add (GST_BIN (pipeline), demux); - gst_element_link (src, demux); - - audio_bin = gst_bin_new ("a_decoder_bin"); - a_decoder = gst_element_factory_make_or_warn ("mad", "a_dec"); - a_queue = gst_element_factory_make_or_warn ("queue", "a_queue"); - audiosink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink"); - //g_object_set (G_OBJECT (audiosink), "fragment", 0x00180008, NULL); - g_object_set (G_OBJECT (audiosink), "sync", FALSE, NULL); - gst_element_link (a_decoder, a_queue); - gst_element_link (a_queue, audiosink); - gst_bin_add (GST_BIN (audio_bin), a_decoder); - gst_bin_add (GST_BIN (audio_bin), a_queue); - gst_bin_add (GST_BIN (audio_bin), audiosink); - - setup_dynamic_link (demux, "audio_00", gst_element_get_static_pad (a_decoder, - "sink"), audio_bin); - - seekable = gst_element_get_static_pad (a_queue, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (a_decoder, - "sink")); - - video_bin = gst_bin_new ("v_decoder_bin"); - v_decoder = gst_element_factory_make_or_warn ("mpeg2dec", "v_dec"); - v_filter = gst_element_factory_make_or_warn ("ffmpegcolorspace", "v_filter"); - videosink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - gst_element_link_many (v_decoder, v_filter, videosink, NULL); - - gst_bin_add_many (GST_BIN (video_bin), v_decoder, v_filter, videosink, NULL); - - setup_dynamic_link (demux, "video_00", gst_element_get_static_pad (v_decoder, - "sink"), video_bin); - - seekable = gst_element_get_static_pad (v_decoder, "src"); - seekable_pads = g_list_prepend (seekable_pads, seekable); - rate_pads = g_list_prepend (rate_pads, seekable); - rate_pads = - g_list_prepend (rate_pads, gst_element_get_static_pad (v_decoder, - "sink")); - - return pipeline; -} - -static void -playerbin_set_uri (GstElement * player, const gchar * location) +playbin_set_uri (GstElement * playbin, const gchar * location) { gchar *uri; @@ -953,120 +213,63 @@ playerbin_set_uri (GstElement * player, const gchar * location) if (g_str_has_prefix (location, "/") || !gst_uri_is_valid (location)) { uri = gst_filename_to_uri (location, NULL); g_print ("Setting URI: %s\n", uri); - g_object_set (G_OBJECT (player), "uri", uri, NULL); + g_object_set (G_OBJECT (playbin), "uri", uri, NULL); g_free (uri); } else { g_print ("Setting URI: %s\n", location); - g_object_set (G_OBJECT (player), "uri", location, NULL); + g_object_set (G_OBJECT (playbin), "uri", location, NULL); } } -static GstElement * -construct_playerbin (const gchar * name, const gchar * location) +static void +make_playbin2_pipeline (SeekApp * app, const gchar * location) { - GstElement *player; - GstElement *avsink; + GstElement *pipeline; - player = gst_element_factory_make (name, "player"); - g_assert (player); + app->pipeline = pipeline = gst_element_factory_make ("playbin2", "playbin2"); + g_assert (pipeline); - playerbin_set_uri (player, location); - - seekable_elements = g_list_prepend (seekable_elements, player); - - /* force element seeking on this pipeline */ - elem_seek = TRUE; - - avsink = gst_element_factory_make_or_warn (opt_audiosink_str, "a_sink"); - if (avsink) - g_object_set (player, "audio-sink", avsink, NULL); - - avsink = gst_element_factory_make_or_warn (opt_videosink_str, "v_sink"); - if (avsink) - g_object_set (player, "video-sink", avsink, NULL); - - return player; -} - -static GstElement * -make_playerbin_pipeline (const gchar * location) -{ - return construct_playerbin ("playbin", location); -} - -static GstElement * -make_playerbin2_pipeline (const gchar * location) -{ - GstElement *pipeline = construct_playerbin ("playbin2", location); + playbin_set_uri (pipeline, location); g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb), - NULL); + app); - navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); - colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); - - return pipeline; + app->navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); + app->colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); } #ifndef GST_DISABLE_PARSE -static GstElement * -make_parselaunch_pipeline (const gchar * description) +static void +make_parselaunch_pipeline (SeekApp * app, const gchar * description) { - GstElement *pipeline; - GError *error = NULL; - - pipeline = gst_parse_launch (description, &error); - - seekable_elements = g_list_prepend (seekable_elements, pipeline); - - elem_seek = TRUE; - - return pipeline; + app->pipeline = gst_parse_launch (description, NULL); } #endif typedef struct { const gchar *name; - GstElement *(*func) (const gchar * location); + void (*func) (SeekApp * app, const gchar * location); } Pipeline; -static Pipeline pipelines[] = { - {"mp3", make_mp3_pipeline}, - {"avi", make_avi_pipeline}, - {"mpeg1", make_mpeg_pipeline}, - {"mpegparse", make_parse_pipeline}, - {"vorbis", make_vorbis_pipeline}, - {"theora", make_theora_pipeline}, - {"ogg/v/t", make_vorbis_theora_pipeline}, - {"avi/msmpeg4v3/mp3", make_avi_msmpeg4v3_mp3_pipeline}, - {"sid", make_sid_pipeline}, - {"flac", make_flac_pipeline}, - {"wav", make_wav_pipeline}, - {"mod", make_mod_pipeline}, - {"dv", make_dv_pipeline}, - {"mpeg1nothreads", make_mpegnt_pipeline}, - {"playerbin", make_playerbin_pipeline}, +static const Pipeline pipelines[] = { + {"playbin2", make_playbin2_pipeline}, #ifndef GST_DISABLE_PARSE {"parse-launch", make_parselaunch_pipeline}, #endif - {"playerbin2", make_playerbin2_pipeline}, - {NULL, NULL}, }; -#define NUM_TYPES ((sizeof (pipelines) / sizeof (Pipeline)) - 1) - /* ui callbacks and helpers */ static gchar * -format_value (GtkScale * scale, gdouble value) +format_value (GtkScale * scale, gdouble value, SeekApp * app) { gint64 real; gint64 seconds; gint64 subseconds; - real = value * duration / N_GRAD; + real = value * app->duration / N_GRAD; seconds = (gint64) real / GST_SECOND; subseconds = (gint64) real / (GST_SECOND / N_GRAD); @@ -1074,7 +277,6 @@ format_value (GtkScale * scale, gdouble value) G_GINT64_FORMAT, seconds / 60, seconds % 60, subseconds % 100); } - static gchar * shuttle_format_value (GtkScale * scale, gdouble value) { @@ -1096,426 +298,301 @@ static seek_format seek_formats[] = { {NULL, 0}, }; -G_GNUC_UNUSED static void -query_rates (void) +static void +query_positions (SeekApp * app) { - GList *walk = rate_pads; + gint i = 0; - while (walk) { - GstPad *pad = GST_PAD (walk->data); - gint i = 0; + g_print ("positions %8.8s: ", GST_ELEMENT_NAME (app->pipeline)); + while (seek_formats[i].name) { + gint64 position, total; + GstFormat format; - g_print ("rate/sec %8.8s: ", GST_PAD_NAME (pad)); - while (seek_formats[i].name) { - gint64 value; - GstFormat format; + format = seek_formats[i].format; - format = seek_formats[i].format; - - if (gst_pad_query_convert (pad, GST_FORMAT_TIME, GST_SECOND, &format, - &value)) { - g_print ("%s %13" G_GINT64_FORMAT " | ", seek_formats[i].name, value); - } else { - g_print ("%s %13.13s | ", seek_formats[i].name, "*NA*"); - } - - i++; + if (gst_element_query_position (app->pipeline, &format, &position) && + gst_element_query_duration (app->pipeline, &format, &total)) { + g_print ("%s %13" G_GINT64_FORMAT " / %13" G_GINT64_FORMAT " | ", + seek_formats[i].name, position, total); + } else { + g_print ("%s %13.13s / %13.13s | ", seek_formats[i].name, "*NA*", "*NA*"); } - g_print (" %s:%s\n", GST_DEBUG_PAD_NAME (pad)); - - walk = g_list_next (walk); + i++; } + g_print (" %s\n", GST_ELEMENT_NAME (app->pipeline)); } -G_GNUC_UNUSED static void -query_positions_elems (void) -{ - GList *walk = seekable_elements; - - while (walk) { - GstElement *element = GST_ELEMENT (walk->data); - gint i = 0; - - g_print ("positions %8.8s: ", GST_ELEMENT_NAME (element)); - while (seek_formats[i].name) { - gint64 position, total; - GstFormat format; - - format = seek_formats[i].format; - - if (gst_element_query_position (element, &format, &position) && - gst_element_query_duration (element, &format, &total)) { - g_print ("%s %13" G_GINT64_FORMAT " / %13" G_GINT64_FORMAT " | ", - seek_formats[i].name, position, total); - } else { - g_print ("%s %13.13s / %13.13s | ", seek_formats[i].name, "*NA*", - "*NA*"); - } - i++; - } - g_print (" %s\n", GST_ELEMENT_NAME (element)); - - walk = g_list_next (walk); - } -} - -G_GNUC_UNUSED static void -query_positions_pads (void) -{ - GList *walk = seekable_pads; - - while (walk) { - GstPad *pad = GST_PAD (walk->data); - gint i = 0; - - g_print ("positions %8.8s: ", GST_PAD_NAME (pad)); - while (seek_formats[i].name) { - GstFormat format; - gint64 position, total; - - format = seek_formats[i].format; - - if (gst_pad_query_position (pad, &format, &position) && - gst_pad_query_duration (pad, &format, &total)) { - g_print ("%s %13" G_GINT64_FORMAT " / %13" G_GINT64_FORMAT " | ", - seek_formats[i].name, position, total); - } else { - g_print ("%s %13.13s / %13.13s | ", seek_formats[i].name, "*NA*", - "*NA*"); - } - - i++; - } - g_print (" %s:%s\n", GST_DEBUG_PAD_NAME (pad)); - - walk = g_list_next (walk); - } -} - -static gboolean start_seek (GtkWidget * widget, GdkEventButton * event, - gpointer user_data); -static gboolean stop_seek (GtkWidget * widget, GdkEventButton * event, - gpointer user_data); -static void seek_cb (GtkWidget * widget); +static gboolean start_seek (GtkRange * range, GdkEventButton * event, + SeekApp * app); +static gboolean stop_seek (GtkRange * range, GdkEventButton * event, + SeekApp * app); +static void seek_cb (GtkRange * range, SeekApp * app); static void -set_scale (gdouble value) +set_scale (SeekApp * app, gdouble value) { - g_signal_handlers_block_by_func (hscale, (void *) start_seek, - (void *) pipeline); - g_signal_handlers_block_by_func (hscale, (void *) stop_seek, - (void *) pipeline); - g_signal_handlers_block_by_func (hscale, (void *) seek_cb, (void *) pipeline); - gtk_adjustment_set_value (adjustment, value); - g_signal_handlers_unblock_by_func (hscale, (void *) start_seek, - (void *) pipeline); - g_signal_handlers_unblock_by_func (hscale, (void *) stop_seek, - (void *) pipeline); - g_signal_handlers_unblock_by_func (hscale, (void *) seek_cb, - (void *) pipeline); - gtk_widget_queue_draw (hscale); + g_signal_handlers_block_by_func (app->seek_scale, start_seek, app); + g_signal_handlers_block_by_func (app->seek_scale, stop_seek, app); + g_signal_handlers_block_by_func (app->seek_scale, seek_cb, app); + gtk_range_set_value (GTK_RANGE (app->seek_scale), value); + g_signal_handlers_unblock_by_func (app->seek_scale, start_seek, app); + g_signal_handlers_unblock_by_func (app->seek_scale, stop_seek, app); + g_signal_handlers_unblock_by_func (app->seek_scale, seek_cb, app); + gtk_widget_queue_draw (app->seek_scale); } static gboolean -update_fill (gpointer data) +update_fill (SeekApp * app) { - if (elem_seek) { - if (seekable_elements) { - GstElement *element = GST_ELEMENT (seekable_elements->data); - GstQuery *query; + GstQuery *query; - query = gst_query_new_buffering (GST_FORMAT_PERCENT); - if (gst_element_query (element, query)) { - gint64 start, stop, buffering_total; - GstFormat format; - gdouble fill; - gboolean busy; - gint percent; - GstBufferingMode mode; - gint avg_in, avg_out; - gint64 buffering_left; + query = gst_query_new_buffering (GST_FORMAT_PERCENT); + if (gst_element_query (app->pipeline, query)) { + gint64 start, stop, buffering_total; + GstFormat format; + gdouble fill; + gboolean busy; + gint percent; + GstBufferingMode mode; + gint avg_in, avg_out; + gint64 buffering_left; - gst_query_parse_buffering_percent (query, &busy, &percent); - gst_query_parse_buffering_range (query, &format, &start, &stop, - &buffering_total); - gst_query_parse_buffering_stats (query, &mode, &avg_in, &avg_out, - &buffering_left); + gst_query_parse_buffering_percent (query, &busy, &percent); + gst_query_parse_buffering_range (query, &format, &start, &stop, + &buffering_total); + gst_query_parse_buffering_stats (query, &mode, &avg_in, &avg_out, + &buffering_left); - /* note that we could start the playback when buffering_left < remaining - * playback time */ - GST_DEBUG ("buffering total %" G_GINT64_FORMAT " ms, left %" - G_GINT64_FORMAT " ms", buffering_total, buffering_left); - GST_DEBUG ("start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, - start, stop); + /* note that we could start the playback when buffering_left < remaining + * playback time */ + GST_DEBUG ("buffering total %" G_GINT64_FORMAT " ms, left %" + G_GINT64_FORMAT " ms", buffering_total, buffering_left); + GST_DEBUG ("start %" G_GINT64_FORMAT ", stop %" G_GINT64_FORMAT, + start, stop); - if (stop != -1) - fill = N_GRAD * stop / GST_FORMAT_PERCENT_MAX; - else - fill = N_GRAD; + if (stop != -1) + fill = N_GRAD * stop / GST_FORMAT_PERCENT_MAX; + else + fill = N_GRAD; - gtk_range_set_fill_level (GTK_RANGE (hscale), fill); - } - gst_query_unref (query); - } + gtk_range_set_fill_level (GTK_RANGE (app->seek_scale), fill); } + gst_query_unref (query); + return TRUE; } static gboolean -update_scale (gpointer data) +update_scale (SeekApp * app) { GstFormat format = GST_FORMAT_TIME; //position = 0; //duration = 0; - if (elem_seek) { - if (seekable_elements) { - GstElement *element = GST_ELEMENT (seekable_elements->data); + gst_element_query_position (app->pipeline, &format, &app->position); + gst_element_query_duration (app->pipeline, &format, &app->duration); - gst_element_query_position (element, &format, &position); - gst_element_query_duration (element, &format, &duration); - } - } else { - if (seekable_pads) { - GstPad *pad = GST_PAD (seekable_pads->data); + if (app->stats) + query_positions (app); - gst_pad_query_position (pad, &format, &position); - gst_pad_query_duration (pad, &format, &duration); - } - } + if (app->position >= app->duration) + app->duration = app->position; - if (stats) { - if (elem_seek) { - query_positions_elems (); - } else { - query_positions_pads (); - } - query_rates (); - } - - if (position >= duration) - duration = position; - - if (duration > 0) { - set_scale (position * N_GRAD / duration); + if (app->duration > 0) { + set_scale (app, app->position * N_GRAD / app->duration); } return TRUE; } -static void do_seek (GtkWidget * widget); -static void connect_bus_signals (GstElement * pipeline); -static void set_update_scale (gboolean active); -static void set_update_fill (gboolean active); +static void set_update_scale (SeekApp * app, gboolean active); +static void set_update_fill (SeekApp * app, gboolean active); static gboolean -end_scrub (GtkWidget * widget) +end_scrub (SeekApp * app) { GST_DEBUG ("end scrub, PAUSE"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); - seek_timeout_id = 0; + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); + app->seek_timeout_id = 0; return FALSE; } static gboolean -send_event (GstEvent * event) +send_event (SeekApp * app, GstEvent * event) { gboolean res = FALSE; - if (!elem_seek) { - GList *walk = seekable_pads; + GST_DEBUG ("send event on element %s", GST_ELEMENT_NAME (app->pipeline)); + res = gst_element_send_event (app->pipeline, event); - while (walk) { - GstPad *seekable = GST_PAD (walk->data); - - GST_DEBUG ("send event on pad %s:%s", GST_DEBUG_PAD_NAME (seekable)); - - gst_event_ref (event); - res = gst_pad_send_event (seekable, event); - - walk = g_list_next (walk); - } - } else { - GList *walk = seekable_elements; - - while (walk) { - GstElement *seekable = GST_ELEMENT (walk->data); - - GST_DEBUG ("send event on element %s", GST_ELEMENT_NAME (seekable)); - - gst_event_ref (event); - res = gst_element_send_event (seekable, event); - - walk = g_list_next (walk); - } - } - gst_event_unref (event); return res; } static void -do_seek (GtkWidget * widget) +do_seek (SeekApp * app) { gint64 real; gboolean res = FALSE; GstEvent *s_event; GstSeekFlags flags; - real = gtk_range_get_value (GTK_RANGE (widget)) * duration / N_GRAD; + real = + gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / + N_GRAD; GST_DEBUG ("value=%f, real=%" G_GINT64_FORMAT, - gtk_range_get_value (GTK_RANGE (widget)), real); + gtk_range_get_value (GTK_RANGE (app->seek_scale)), real); flags = 0; - if (flush_seek) + if (app->flush_seek) flags |= GST_SEEK_FLAG_FLUSH; - if (accurate_seek) + if (app->accurate_seek) flags |= GST_SEEK_FLAG_ACCURATE; - if (keyframe_seek) + if (app->keyframe_seek) flags |= GST_SEEK_FLAG_KEY_UNIT; - if (loop_seek) + if (app->loop_seek) flags |= GST_SEEK_FLAG_SEGMENT; - if (skip_seek) + if (app->skip_seek) flags |= GST_SEEK_FLAG_SKIP; - if (rate >= 0) { - s_event = gst_event_new_seek (rate, + if (app->rate >= 0) { + s_event = gst_event_new_seek (app->rate, GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, real, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE); GST_DEBUG ("seek with rate %lf to %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT, - rate, GST_TIME_ARGS (real), GST_TIME_ARGS (duration)); + app->rate, GST_TIME_ARGS (real), GST_TIME_ARGS (app->duration)); } else { - s_event = gst_event_new_seek (rate, + s_event = gst_event_new_seek (app->rate, GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, G_GINT64_CONSTANT (0), GST_SEEK_TYPE_SET, real); GST_DEBUG ("seek with rate %lf to %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT, - rate, GST_TIME_ARGS (0), GST_TIME_ARGS (real)); + app->rate, GST_TIME_ARGS (0), GST_TIME_ARGS (real)); } - res = send_event (s_event); + res = send_event (app, s_event); if (res) { - if (flush_seek) { - gst_element_get_state (GST_ELEMENT (pipeline), NULL, NULL, SEEK_TIMEOUT); + if (app->flush_seek) { + gst_element_get_state (GST_ELEMENT (app->pipeline), NULL, NULL, + SEEK_TIMEOUT); } else { - set_update_scale (TRUE); + set_update_scale (app, TRUE); } } else { g_print ("seek failed\n"); - set_update_scale (TRUE); + set_update_scale (app, TRUE); } } static void -seek_cb (GtkWidget * widget) +seek_cb (GtkRange * range, SeekApp * app) { /* If the timer hasn't expired yet, then the pipeline is running */ - if (play_scrub && seek_timeout_id != 0) { + if (app->play_scrub && app->seek_timeout_id != 0) { GST_DEBUG ("do scrub seek, PAUSED"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); } GST_DEBUG ("do seek"); - do_seek (widget); + do_seek (app); - if (play_scrub) { + if (app->play_scrub) { GST_DEBUG ("do scrub seek, PLAYING"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); - if (seek_timeout_id == 0) { - seek_timeout_id = - g_timeout_add (SCRUB_TIME, (GSourceFunc) end_scrub, widget); + if (app->seek_timeout_id == 0) { + app->seek_timeout_id = + g_timeout_add (SCRUB_TIME, (GSourceFunc) end_scrub, app); } } } static void -set_update_fill (gboolean active) +set_update_fill (SeekApp * app, gboolean active) { GST_DEBUG ("fill scale is %d", active); if (active) { - if (fill_id == 0) { - fill_id = - g_timeout_add (FILL_INTERVAL, (GSourceFunc) update_fill, pipeline); + if (app->fill_id == 0) { + app->fill_id = + g_timeout_add (FILL_INTERVAL, (GSourceFunc) update_fill, app); } } else { - if (fill_id) { - g_source_remove (fill_id); - fill_id = 0; + if (app->fill_id) { + g_source_remove (app->fill_id); + app->fill_id = 0; } } } static void -set_update_scale (gboolean active) +set_update_scale (SeekApp * app, gboolean active) { - GST_DEBUG ("update scale is %d", active); if (active) { - if (update_id == 0) { - update_id = - g_timeout_add (UPDATE_INTERVAL, (GSourceFunc) update_scale, pipeline); + if (app->update_id == 0) { + app->update_id = + g_timeout_add (UPDATE_INTERVAL, (GSourceFunc) update_scale, app); } } else { - if (update_id) { - g_source_remove (update_id); - update_id = 0; + if (app->update_id) { + g_source_remove (app->update_id); + app->update_id = 0; } } } static gboolean -start_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) +start_seek (GtkRange * range, GdkEventButton * event, SeekApp * app) { if (event->type != GDK_BUTTON_PRESS) return FALSE; - set_update_scale (FALSE); + set_update_scale (app, FALSE); - if (state == GST_STATE_PLAYING && flush_seek && scrub) { + if (app->state == GST_STATE_PLAYING && app->flush_seek && app->scrub) { GST_DEBUG ("start scrub seek, PAUSE"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); } - if (changed_id == 0 && flush_seek && scrub) { - changed_id = - g_signal_connect (hscale, "value-changed", G_CALLBACK (seek_cb), - pipeline); + if (app->changed_id == 0 && app->flush_seek && app->scrub) { + app->changed_id = + g_signal_connect (app->seek_scale, "value-changed", + G_CALLBACK (seek_cb), app); } return FALSE; } static gboolean -stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) +stop_seek (GtkRange * range, GdkEventButton * event, SeekApp * app) { - if (changed_id) { - g_signal_handler_disconnect (hscale, changed_id); - changed_id = 0; + if (app->changed_id) { + g_signal_handler_disconnect (app->seek_scale, app->changed_id); + app->changed_id = 0; } - if (!flush_seek || !scrub) { + if (!app->flush_seek || !app->scrub) { GST_DEBUG ("do final seek"); - do_seek (widget); + do_seek (app); } - if (seek_timeout_id != 0) { - g_source_remove (seek_timeout_id); - seek_timeout_id = 0; + if (app->seek_timeout_id != 0) { + g_source_remove (app->seek_timeout_id); + app->seek_timeout_id = 0; /* Still scrubbing, so the pipeline is playing, see if we need PAUSED * instead. */ - if (state == GST_STATE_PAUSED) { + if (app->state == GST_STATE_PAUSED) { GST_DEBUG ("stop scrub seek, PAUSED"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); } } else { - if (state == GST_STATE_PLAYING) { + if (app->state == GST_STATE_PLAYING) { GST_DEBUG ("stop scrub seek, PLAYING"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); } } @@ -1523,26 +600,27 @@ stop_seek (GtkWidget * widget, GdkEventButton * event, gpointer user_data) } static void -play_cb (GtkButton * button, gpointer data) +play_cb (GtkButton * button, SeekApp * app) { GstStateChangeReturn ret; - if (state != GST_STATE_PLAYING) { + if (app->state != GST_STATE_PLAYING) { g_print ("PLAY pipeline\n"); - gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); + gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); - ret = gst_element_set_state (pipeline, GST_STATE_PLAYING); + ret = gst_element_set_state (app->pipeline, GST_STATE_PLAYING); switch (ret) { case GST_STATE_CHANGE_FAILURE: goto failed; case GST_STATE_CHANGE_NO_PREROLL: - is_live = TRUE; + app->is_live = TRUE; break; default: break; } - state = GST_STATE_PLAYING; - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Playing"); + app->state = GST_STATE_PLAYING; + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Playing"); } return; @@ -1550,202 +628,187 @@ play_cb (GtkButton * button, gpointer data) failed: { g_print ("PLAY failed\n"); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Play failed"); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Play failed"); } } static void -pause_cb (GtkButton * button, gpointer data) +pause_cb (GtkButton * button, SeekApp * app) { - g_static_mutex_lock (&state_mutex); - if (state != GST_STATE_PAUSED) { + g_static_mutex_lock (&app->state_mutex); + if (app->state != GST_STATE_PAUSED) { GstStateChangeReturn ret; - gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); + gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); g_print ("PAUSE pipeline\n"); - ret = gst_element_set_state (pipeline, GST_STATE_PAUSED); + ret = gst_element_set_state (app->pipeline, GST_STATE_PAUSED); switch (ret) { case GST_STATE_CHANGE_FAILURE: goto failed; case GST_STATE_CHANGE_NO_PREROLL: - is_live = TRUE; + app->is_live = TRUE; break; default: break; } - state = GST_STATE_PAUSED; - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Paused"); + app->state = GST_STATE_PAUSED; + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Paused"); } - g_static_mutex_unlock (&state_mutex); + g_static_mutex_unlock (&app->state_mutex); return; failed: { - g_static_mutex_unlock (&state_mutex); + g_static_mutex_unlock (&app->state_mutex); g_print ("PAUSE failed\n"); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Pause failed"); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Pause failed"); } } static void -stop_cb (GtkButton * button, gpointer data) +stop_cb (GtkButton * button, SeekApp * app) { - if (state != STOP_STATE) { + if (app->state != STOP_STATE) { GstStateChangeReturn ret; gint i; g_print ("READY pipeline\n"); - gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); + gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); - g_static_mutex_lock (&state_mutex); - ret = gst_element_set_state (pipeline, STOP_STATE); + g_static_mutex_lock (&app->state_mutex); + ret = gst_element_set_state (app->pipeline, STOP_STATE); if (ret == GST_STATE_CHANGE_FAILURE) goto failed; - state = STOP_STATE; - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stopped"); - gtk_widget_queue_draw (video_window); + app->state = STOP_STATE; + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Stopped"); + gtk_widget_queue_draw (app->video_window); - is_live = FALSE; - buffering = FALSE; - set_update_scale (FALSE); - set_scale (0.0); - set_update_fill (FALSE); + app->is_live = FALSE; + app->buffering = FALSE; + set_update_scale (app, FALSE); + set_scale (app, 0.0); + set_update_fill (app, FALSE); - if (pipeline_type == 16) - clear_streams (pipeline); - g_static_mutex_unlock (&state_mutex); + if (app->pipeline_type == 0) + clear_streams (app); + g_static_mutex_unlock (&app->state_mutex); -#if 0 - /* if one uses parse_launch, play, stop and play again it fails as all the - * pads after the demuxer can't be reconnected - */ - if (!strcmp (pipelines[pipeline_type].name, "parse-launch")) { - gst_element_set_state (pipeline, GST_STATE_NULL); - gst_object_unref (pipeline); - - g_list_free (seekable_elements); - seekable_elements = NULL; - g_list_free (seekable_pads); - seekable_pads = NULL; - g_list_free (rate_pads); - rate_pads = NULL; - - pipeline = pipelines[pipeline_type].func (pipeline_spec); - g_assert (pipeline); - gst_element_set_state (pipeline, STOP_STATE); - connect_bus_signals (pipeline); - } -#endif - gtk_widget_set_sensitive (GTK_WIDGET (hscale), TRUE); - for (i = 0; i < G_N_ELEMENTS (navigation_buttons); i++) - gtk_widget_set_sensitive (navigation_buttons[i].button, FALSE); + gtk_widget_set_sensitive (GTK_WIDGET (app->seek_scale), TRUE); + for (i = 0; i < G_N_ELEMENTS (app->navigation_buttons); i++) + gtk_widget_set_sensitive (app->navigation_buttons[i].button, FALSE); } return; failed: { - g_static_mutex_unlock (&state_mutex); + g_static_mutex_unlock (&app->state_mutex); g_print ("STOP failed\n"); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stop failed"); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Stop failed"); } } static void -accurate_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +accurate_toggle_cb (GtkToggleButton * button, SeekApp * app) { - accurate_seek = gtk_toggle_button_get_active (button); + app->accurate_seek = gtk_toggle_button_get_active (button); } static void -key_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +key_toggle_cb (GtkToggleButton * button, SeekApp * app) { - keyframe_seek = gtk_toggle_button_get_active (button); + app->keyframe_seek = gtk_toggle_button_get_active (button); } static void -loop_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +loop_toggle_cb (GtkToggleButton * button, SeekApp * app) { - loop_seek = gtk_toggle_button_get_active (button); - if (state == GST_STATE_PLAYING) { - do_seek (hscale); + app->loop_seek = gtk_toggle_button_get_active (button); + if (app->state == GST_STATE_PLAYING) { + do_seek (app); } } static void -flush_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +flush_toggle_cb (GtkToggleButton * button, SeekApp * app) { - flush_seek = gtk_toggle_button_get_active (button); + app->flush_seek = gtk_toggle_button_get_active (button); } static void -scrub_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +scrub_toggle_cb (GtkToggleButton * button, SeekApp * app) { - scrub = gtk_toggle_button_get_active (button); + app->scrub = gtk_toggle_button_get_active (button); } static void -play_scrub_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +play_scrub_toggle_cb (GtkToggleButton * button, SeekApp * app) { - play_scrub = gtk_toggle_button_get_active (button); + app->play_scrub = gtk_toggle_button_get_active (button); } static void -skip_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +skip_toggle_cb (GtkToggleButton * button, SeekApp * app) { - skip_seek = gtk_toggle_button_get_active (button); - if (state == GST_STATE_PLAYING) { - do_seek (hscale); + app->skip_seek = gtk_toggle_button_get_active (button); + if (app->state == GST_STATE_PLAYING) { + do_seek (app); } } static void -rate_spinbutton_changed_cb (GtkSpinButton * button, GstPipeline * pipeline) +rate_spinbutton_changed_cb (GtkSpinButton * button, SeekApp * app) { gboolean res = FALSE; GstEvent *s_event; GstSeekFlags flags; - rate = gtk_spin_button_get_value (button); + app->rate = gtk_spin_button_get_value (button); - GST_DEBUG ("rate changed to %lf", rate); + GST_DEBUG ("rate changed to %lf", app->rate); flags = 0; - if (flush_seek) + if (app->flush_seek) flags |= GST_SEEK_FLAG_FLUSH; - if (loop_seek) + if (app->loop_seek) flags |= GST_SEEK_FLAG_SEGMENT; - if (accurate_seek) + if (app->accurate_seek) flags |= GST_SEEK_FLAG_ACCURATE; - if (keyframe_seek) + if (app->keyframe_seek) flags |= GST_SEEK_FLAG_KEY_UNIT; - if (skip_seek) + if (app->skip_seek) flags |= GST_SEEK_FLAG_SKIP; - if (rate >= 0.0) { - s_event = gst_event_new_seek (rate, - GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, position, + if (app->rate >= 0.0) { + s_event = gst_event_new_seek (app->rate, + GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, app->position, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE); } else { - s_event = gst_event_new_seek (rate, + s_event = gst_event_new_seek (app->rate, GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, G_GINT64_CONSTANT (0), - GST_SEEK_TYPE_SET, position); + GST_SEEK_TYPE_SET, app->position); } - res = send_event (s_event); + res = send_event (app, s_event); if (res) { - if (flush_seek) { - gst_element_get_state (GST_ELEMENT (pipeline), NULL, NULL, SEEK_TIMEOUT); + if (app->flush_seek) { + gst_element_get_state (GST_ELEMENT (app->pipeline), NULL, NULL, + SEEK_TIMEOUT); } } else g_print ("seek failed\n"); } static void -update_flag (GstPipeline * pipeline, GstPlayFlags flag, gboolean state) +update_flag (GstElement * pipeline, GstPlayFlags flag, gboolean state) { gint flags; @@ -1760,162 +823,163 @@ update_flag (GstPipeline * pipeline, GstPlayFlags flag, gboolean state) } static void -vis_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +vis_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_VIS, state); - gtk_widget_set_sensitive (vis_combo, state); + update_flag (app->pipeline, GST_PLAY_FLAG_VIS, state); + gtk_widget_set_sensitive (app->vis_combo, state); } static void -audio_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +audio_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_AUDIO, state); - gtk_widget_set_sensitive (audio_combo, state); + update_flag (app->pipeline, GST_PLAY_FLAG_AUDIO, state); + gtk_widget_set_sensitive (app->audio_combo, state); } static void -video_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +video_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_VIDEO, state); - gtk_widget_set_sensitive (video_combo, state); + update_flag (app->pipeline, GST_PLAY_FLAG_VIDEO, state); + gtk_widget_set_sensitive (app->video_combo, state); } static void -text_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +text_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_TEXT, state); - gtk_widget_set_sensitive (text_combo, state); + update_flag (app->pipeline, GST_PLAY_FLAG_TEXT, state); + gtk_widget_set_sensitive (app->text_combo, state); } static void -mute_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +mute_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean mute; mute = gtk_toggle_button_get_active (button); - g_object_set (pipeline, "mute", mute, NULL); + g_object_set (app->pipeline, "mute", mute, NULL); } static void -download_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +download_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_DOWNLOAD, state); + update_flag (app->pipeline, GST_PLAY_FLAG_DOWNLOAD, state); } static void -buffering_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +buffering_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_BUFFERING, state); + update_flag (app->pipeline, GST_PLAY_FLAG_BUFFERING, state); } static void -soft_volume_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +soft_volume_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_SOFT_VOLUME, state); + update_flag (app->pipeline, GST_PLAY_FLAG_SOFT_VOLUME, state); } static void -native_audio_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +native_audio_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_NATIVE_AUDIO, state); + update_flag (app->pipeline, GST_PLAY_FLAG_NATIVE_AUDIO, state); } static void -native_video_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +native_video_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_NATIVE_VIDEO, state); + update_flag (app->pipeline, GST_PLAY_FLAG_NATIVE_VIDEO, state); } static void -deinterlace_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +deinterlace_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_DEINTERLACE, state); + update_flag (app->pipeline, GST_PLAY_FLAG_DEINTERLACE, state); } static void -soft_colorbalance_toggle_cb (GtkToggleButton * button, GstPipeline * pipeline) +soft_colorbalance_toggle_cb (GtkToggleButton * button, SeekApp * app) { gboolean state; state = gtk_toggle_button_get_active (button); - update_flag (pipeline, GST_PLAY_FLAG_SOFT_COLORBALANCE, state); + update_flag (app->pipeline, GST_PLAY_FLAG_SOFT_COLORBALANCE, state); } static void -clear_streams (GstElement * pipeline) +clear_streams (SeekApp * app) { gint i; /* remove previous info */ - for (i = 0; i < n_video; i++) - gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (video_combo), 0); - for (i = 0; i < n_audio; i++) - gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (audio_combo), 0); - for (i = 0; i < n_text; i++) - gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (text_combo), 0); + for (i = 0; i < app->n_video; i++) + gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (app->video_combo), 0); + for (i = 0; i < app->n_audio; i++) + gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (app->audio_combo), 0); + for (i = 0; i < app->n_text; i++) + gtk_combo_box_text_remove (GTK_COMBO_BOX_TEXT (app->text_combo), 0); - n_audio = n_video = n_text = 0; - gtk_widget_set_sensitive (video_combo, FALSE); - gtk_widget_set_sensitive (audio_combo, FALSE); - gtk_widget_set_sensitive (text_combo, FALSE); + app->n_audio = app->n_video = app->n_text = 0; + gtk_widget_set_sensitive (app->video_combo, FALSE); + gtk_widget_set_sensitive (app->audio_combo, FALSE); + gtk_widget_set_sensitive (app->text_combo, FALSE); - need_streams = TRUE; + app->need_streams = TRUE; } static void -update_streams (GstPipeline * pipeline) +update_streams (SeekApp * app) { gint i; - if (pipeline_type == 16 && need_streams) { + if (app->pipeline_type == 0 && app->need_streams) { GstTagList *tags; gchar *name, *str; gint active_idx; gboolean state; /* remove previous info */ - clear_streams (GST_ELEMENT_CAST (pipeline)); + clear_streams (app); /* here we get and update the different streams detected by playbin2 */ - g_object_get (pipeline, "n-video", &n_video, NULL); - g_object_get (pipeline, "n-audio", &n_audio, NULL); - g_object_get (pipeline, "n-text", &n_text, NULL); + g_object_get (app->pipeline, "n-video", &app->n_video, NULL); + g_object_get (app->pipeline, "n-audio", &app->n_audio, NULL); + g_object_get (app->pipeline, "n-text", &app->n_text, NULL); - g_print ("video %d, audio %d, text %d\n", n_video, n_audio, n_text); + g_print ("video %d, audio %d, text %d\n", app->n_video, app->n_audio, + app->n_text); active_idx = 0; - for (i = 0; i < n_video; i++) { - g_signal_emit_by_name (pipeline, "get-video-tags", i, &tags); + for (i = 0; i < app->n_video; i++) { + g_signal_emit_by_name (app->pipeline, "get-video-tags", i, &tags); if (tags) { str = gst_structure_to_string ((GstStructure *) tags); g_print ("video %d: %s\n", i, str); @@ -1923,16 +987,18 @@ update_streams (GstPipeline * pipeline) } /* find good name for the label */ name = g_strdup_printf ("video %d", i + 1); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (video_combo), name); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->video_combo), + name); g_free (name); } - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (video_checkbox)); - gtk_widget_set_sensitive (video_combo, state && n_video > 0); - gtk_combo_box_set_active (GTK_COMBO_BOX (video_combo), active_idx); + state = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->video_checkbox)); + gtk_widget_set_sensitive (app->video_combo, state && app->n_video > 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (app->video_combo), active_idx); active_idx = 0; - for (i = 0; i < n_audio; i++) { - g_signal_emit_by_name (pipeline, "get-audio-tags", i, &tags); + for (i = 0; i < app->n_audio; i++) { + g_signal_emit_by_name (app->pipeline, "get-audio-tags", i, &tags); if (tags) { str = gst_structure_to_string ((GstStructure *) tags); g_print ("audio %d: %s\n", i, str); @@ -1940,16 +1006,18 @@ update_streams (GstPipeline * pipeline) } /* find good name for the label */ name = g_strdup_printf ("audio %d", i + 1); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (audio_combo), name); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->audio_combo), + name); g_free (name); } - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (audio_checkbox)); - gtk_widget_set_sensitive (audio_combo, state && n_audio > 0); - gtk_combo_box_set_active (GTK_COMBO_BOX (audio_combo), active_idx); + state = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->audio_checkbox)); + gtk_widget_set_sensitive (app->audio_combo, state && app->n_audio > 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (app->audio_combo), active_idx); active_idx = 0; - for (i = 0; i < n_text; i++) { - g_signal_emit_by_name (pipeline, "get-text-tags", i, &tags); + for (i = 0; i < app->n_text; i++) { + g_signal_emit_by_name (app->pipeline, "get-text-tags", i, &tags); name = NULL; if (tags) { @@ -1969,52 +1037,54 @@ update_streams (GstPipeline * pipeline) if (name == NULL) name = g_strdup_printf ("text %d", i + 1); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (text_combo), name); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->text_combo), + name); g_free (name); } - state = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (text_checkbox)); - gtk_widget_set_sensitive (text_combo, state && n_text > 0); - gtk_combo_box_set_active (GTK_COMBO_BOX (text_combo), active_idx); + state = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->text_checkbox)); + gtk_widget_set_sensitive (app->text_combo, state && app->n_text > 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (app->text_combo), active_idx); - need_streams = FALSE; + app->need_streams = FALSE; } } static void -video_combo_cb (GtkComboBox * combo, GstPipeline * pipeline) +video_combo_cb (GtkComboBox * combo, SeekApp * app) { gint active; active = gtk_combo_box_get_active (combo); g_print ("setting current video track %d\n", active); - g_object_set (pipeline, "current-video", active, NULL); + g_object_set (app->pipeline, "current-video", active, NULL); } static void -audio_combo_cb (GtkComboBox * combo, GstPipeline * pipeline) +audio_combo_cb (GtkComboBox * combo, SeekApp * app) { gint active; active = gtk_combo_box_get_active (combo); g_print ("setting current audio track %d\n", active); - g_object_set (pipeline, "current-audio", active, NULL); + g_object_set (app->pipeline, "current-audio", active, NULL); } static void -text_combo_cb (GtkComboBox * combo, GstPipeline * pipeline) +text_combo_cb (GtkComboBox * combo, SeekApp * app) { gint active; active = gtk_combo_box_get_active (combo); g_print ("setting current text track %d\n", active); - g_object_set (pipeline, "current-text", active, NULL); + g_object_set (app->pipeline, "current-text", active, NULL); } static gboolean -filter_features (GstPluginFeature * feature, gpointer data) +filter_vis_features (GstPluginFeature * feature, gpointer data) { GstElementFactory *f; @@ -2028,14 +1098,14 @@ filter_features (GstPluginFeature * feature, gpointer data) } static void -init_visualization_features (void) +init_visualization_features (SeekApp * app) { GList *list, *walk; - vis_entries = g_array_new (FALSE, FALSE, sizeof (VisEntry)); + app->vis_entries = g_array_new (FALSE, FALSE, sizeof (VisEntry)); list = gst_registry_feature_filter (gst_registry_get_default (), - filter_features, FALSE, NULL); + filter_vis_features, FALSE, NULL); for (walk = list; walk; walk = g_list_next (walk)) { VisEntry entry; @@ -2044,23 +1114,23 @@ init_visualization_features (void) entry.factory = GST_ELEMENT_FACTORY (walk->data); name = gst_element_factory_get_longname (entry.factory); - g_array_append_val (vis_entries, entry); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (vis_combo), name); + g_array_append_val (app->vis_entries, entry); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->vis_combo), name); } - gtk_combo_box_set_active (GTK_COMBO_BOX (vis_combo), 0); + gtk_combo_box_set_active (GTK_COMBO_BOX (app->vis_combo), 0); } static void -vis_combo_cb (GtkComboBox * combo, GstPipeline * pipeline) +vis_combo_cb (GtkComboBox * combo, SeekApp * app) { guint index; VisEntry *entry; GstElement *element; /* get the selected index and get the factory for this index */ - index = gtk_combo_box_get_active (GTK_COMBO_BOX (vis_combo)); - if (vis_entries->len > 0) { - entry = &g_array_index (vis_entries, VisEntry, index); + index = gtk_combo_box_get_active (GTK_COMBO_BOX (app->vis_combo)); + if (app->vis_entries->len > 0) { + entry = &g_array_index (app->vis_entries, VisEntry, index); /* create an instance of the element from the factory */ element = gst_element_factory_create (entry->factory, NULL); @@ -2068,38 +1138,40 @@ vis_combo_cb (GtkComboBox * combo, GstPipeline * pipeline) return; /* set vis plugin for playbin2 */ - g_object_set (pipeline, "vis-plugin", element, NULL); + g_object_set (app->pipeline, "vis-plugin", element, NULL); } } static void -volume_spinbutton_changed_cb (GtkSpinButton * button, GstPipeline * pipeline) +volume_spinbutton_changed_cb (GtkSpinButton * button, SeekApp * app) { gdouble volume; volume = gtk_spin_button_get_value (button); - g_object_set (pipeline, "volume", volume, NULL); + g_object_set (app->pipeline, "volume", volume, NULL); } static void -volume_notify_cb (GstElement * pipeline, GParamSpec * arg, gpointer user_dat) +volume_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app) { gdouble cur_volume, new_volume; - g_object_get (pipeline, "volume", &new_volume, NULL); - cur_volume = gtk_spin_button_get_value (GTK_SPIN_BUTTON (volume_spinbutton)); + g_object_get (app->pipeline, "volume", &new_volume, NULL); + cur_volume = + gtk_spin_button_get_value (GTK_SPIN_BUTTON (app->volume_spinbutton)); if (fabs (cur_volume - new_volume) > 0.001) { - g_signal_handlers_block_by_func (volume_spinbutton, - volume_spinbutton_changed_cb, pipeline); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (volume_spinbutton), new_volume); - g_signal_handlers_unblock_by_func (volume_spinbutton, - volume_spinbutton_changed_cb, pipeline); + g_signal_handlers_block_by_func (app->volume_spinbutton, + volume_spinbutton_changed_cb, app); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->volume_spinbutton), + new_volume); + g_signal_handlers_unblock_by_func (app->volume_spinbutton, + volume_spinbutton_changed_cb, app); } } static void -shot_cb (GtkButton * button, gpointer data) +shot_cb (GtkButton * button, SeekApp * app) { GstBuffer *buffer; GstCaps *caps; @@ -2117,7 +1189,7 @@ shot_cb (GtkButton * button, gpointer data) "blue_mask", G_TYPE_INT, 0x0000ff, NULL); /* convert the latest frame to the requested format */ - g_signal_emit_by_name (pipeline, "convert-frame", caps, &buffer); + g_signal_emit_by_name (app->pipeline, "convert-frame", caps, &buffer); gst_caps_unref (caps); if (buffer) { @@ -2163,7 +1235,7 @@ shot_cb (GtkButton * button, gpointer data) /* called when the Step button is pressed */ static void -step_cb (GtkButton * button, gpointer data) +step_cb (GtkButton * button, SeekApp * app) { GstEvent *event; GstFormat format; @@ -2172,11 +1244,12 @@ step_cb (GtkButton * button, gpointer data) gboolean flush, res; gint active; - active = gtk_combo_box_get_active (GTK_COMBO_BOX (format_combo)); + active = gtk_combo_box_get_active (GTK_COMBO_BOX (app->format_combo)); amount = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON - (step_amount_spinbutton)); - rate = gtk_spin_button_get_value (GTK_SPIN_BUTTON (step_rate_spinbutton)); + (app->step_amount_spinbutton)); + rate = + gtk_spin_button_get_value (GTK_SPIN_BUTTON (app->step_rate_spinbutton)); flush = TRUE; switch (active) { @@ -2194,7 +1267,7 @@ step_cb (GtkButton * button, gpointer data) event = gst_event_new_step (format, amount, rate, flush, FALSE); - res = send_event (event); + res = send_event (app, event); if (!res) { g_print ("Sending step event failed\n"); @@ -2202,17 +1275,17 @@ step_cb (GtkButton * button, gpointer data) } static void -message_received (GstBus * bus, GstMessage * message, GstPipeline * pipeline) +message_received (GstBus * bus, GstMessage * message, SeekApp * app) { const GstStructure *s; switch (GST_MESSAGE_TYPE (message)) { case GST_MESSAGE_ERROR: - GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline), + GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (app->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "seek.error"); break; case GST_MESSAGE_WARNING: - GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline), + GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (app->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, "seek.warning"); break; default: @@ -2234,27 +1307,23 @@ message_received (GstBus * bus, GstMessage * message, GstPipeline * pipeline) } } -static gboolean shuttling = FALSE; -static gdouble shuttle_rate = 0.0; -static gdouble play_rate = 1.0; - static void -do_shuttle (GstElement * element) +do_shuttle (SeekApp * app) { guint64 duration; - if (shuttling) + if (app->shuttling) duration = 40 * GST_MSECOND; else duration = -1; - gst_element_send_event (element, - gst_event_new_step (GST_FORMAT_TIME, duration, shuttle_rate, FALSE, + gst_element_send_event (app->pipeline, + gst_event_new_step (GST_FORMAT_TIME, duration, app->shuttle_rate, FALSE, FALSE)); } static void -msg_sync_step_done (GstBus * bus, GstMessage * message, GstElement * element) +msg_sync_step_done (GstBus * bus, GstMessage * message, SeekApp * app) { GstFormat format; guint64 amount; @@ -2272,10 +1341,10 @@ msg_sync_step_done (GstBus * bus, GstMessage * message, GstElement * element) return; } - if (g_static_mutex_trylock (&state_mutex)) { - if (shuttling) - do_shuttle (element); - g_static_mutex_unlock (&state_mutex); + if (g_static_mutex_trylock (&app->state_mutex)) { + if (app->shuttling) + do_shuttle (app); + g_static_mutex_unlock (&app->state_mutex); } else { /* ignore step messages that come while we are doing a state change */ g_print ("state change is busy\n"); @@ -2283,113 +1352,125 @@ msg_sync_step_done (GstBus * bus, GstMessage * message, GstElement * element) } static void -shuttle_toggled (GtkToggleButton * button, GstElement * element) +shuttle_toggled (GtkToggleButton * button, SeekApp * app) { gboolean active; active = gtk_toggle_button_get_active (button); - if (active != shuttling) { - shuttling = active; - g_print ("shuttling %s\n", shuttling ? "active" : "inactive"); + if (active != app->shuttling) { + app->shuttling = active; + g_print ("shuttling %s\n", app->shuttling ? "active" : "inactive"); if (active) { - shuttle_rate = 0.0; - play_rate = 1.0; - pause_cb (NULL, NULL); - gst_element_get_state (element, NULL, NULL, -1); + app->shuttle_rate = 0.0; + app->play_rate = 1.0; + pause_cb (NULL, app); + gst_element_get_state (app->pipeline, NULL, NULL, -1); } } } static void -shuttle_rate_switch (GstElement * element) +shuttle_rate_switch (SeekApp * app) { GstSeekFlags flags; GstEvent *s_event; gboolean res; - if (state == GST_STATE_PLAYING) { + if (app->state == GST_STATE_PLAYING) { /* pause when we need to */ - pause_cb (NULL, NULL); - gst_element_get_state (element, NULL, NULL, -1); + pause_cb (NULL, app); + gst_element_get_state (app->pipeline, NULL, NULL, -1); } - if (play_rate == 1.0) - play_rate = -1.0; + if (app->play_rate == 1.0) + app->play_rate = -1.0; else - play_rate = 1.0; + app->play_rate = 1.0; - g_print ("rate changed to %lf %" GST_TIME_FORMAT "\n", play_rate, - GST_TIME_ARGS (position)); + g_print ("rate changed to %lf %" GST_TIME_FORMAT "\n", app->play_rate, + GST_TIME_ARGS (app->position)); flags = GST_SEEK_FLAG_FLUSH; flags |= GST_SEEK_FLAG_ACCURATE; - if (play_rate >= 0.0) { - s_event = gst_event_new_seek (play_rate, - GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, position, + if (app->play_rate >= 0.0) { + s_event = gst_event_new_seek (app->play_rate, + GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, app->position, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE); } else { - s_event = gst_event_new_seek (play_rate, + s_event = gst_event_new_seek (app->play_rate, GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, G_GINT64_CONSTANT (0), - GST_SEEK_TYPE_SET, position); + GST_SEEK_TYPE_SET, app->position); } - res = send_event (s_event); + res = send_event (app, s_event); if (res) { - gst_element_get_state (element, NULL, NULL, SEEK_TIMEOUT); + gst_element_get_state (app->pipeline, NULL, NULL, SEEK_TIMEOUT); } else { g_print ("seek failed\n"); } } static void -shuttle_value_changed (GtkRange * range, GstElement * element) +shuttle_value_changed (GtkRange * range, SeekApp * app) { gdouble rate; - rate = gtk_adjustment_get_value (shuttle_adjustment); + rate = gtk_range_get_value (range); if (rate == 0.0) { g_print ("rate 0.0, pause\n"); - pause_cb (NULL, NULL); - gst_element_get_state (element, NULL, NULL, -1); + pause_cb (NULL, app); + gst_element_get_state (app->pipeline, NULL, NULL, -1); } else { g_print ("rate changed %0.3g\n", rate); - if ((rate < 0.0 && play_rate > 0.0) || (rate > 0.0 && play_rate < 0.0)) { - shuttle_rate_switch (element); + if ((rate < 0.0 && app->play_rate > 0.0) || (rate > 0.0 + && app->play_rate < 0.0)) { + shuttle_rate_switch (app); } - shuttle_rate = ABS (rate); - if (state != GST_STATE_PLAYING) { - do_shuttle (element); - play_cb (NULL, NULL); + app->shuttle_rate = ABS (rate); + if (app->state != GST_STATE_PLAYING) { + do_shuttle (app); + play_cb (NULL, app); } } } static void -colorbalance_value_changed (GtkRange * range, gpointer user_data) +colorbalance_value_changed (GtkRange * range, SeekApp * app) { - const gchar *label = user_data; + const gchar *label; gdouble val; gint ival; GstColorBalanceChannel *channel = NULL; const GList *channels, *l; + if (range == GTK_RANGE (app->contrast_scale)) + label = "CONTRAST"; + else if (range == GTK_RANGE (app->brightness_scale)) + label = "BRIGHTNESS"; + else if (range == GTK_RANGE (app->hue_scale)) + label = "HUE"; + else if (range == GTK_RANGE (app->saturation_scale)) + label = "SATURATION"; + else + g_assert_not_reached (); + val = gtk_range_get_value (range); g_print ("colorbalance %s value changed %lf\n", label, val / 100.); - if (!colorbalance_element) { - find_interface_elements (); - if (!colorbalance_element) + if (!app->colorbalance_element) { + find_interface_elements (app); + if (!app->colorbalance_element) return; } channels = gst_color_balance_list_channels (GST_COLOR_BALANCE - (colorbalance_element)); + (app->colorbalance_element)); for (l = channels; l; l = l->next) { GstColorBalanceChannel *tmp = l->data; @@ -2406,42 +1487,42 @@ colorbalance_value_changed (GtkRange * range, gpointer user_data) (gint) (0.5 + channel->min_value + (val / 100.0) * ((gdouble) channel->max_value - (gdouble) channel->min_value)); - gst_color_balance_set_value (GST_COLOR_BALANCE (colorbalance_element), + gst_color_balance_set_value (GST_COLOR_BALANCE (app->colorbalance_element), channel, ival); } static void -msg_async_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) +msg_async_done (GstBus * bus, GstMessage * message, SeekApp * app) { GST_DEBUG ("async done"); /* when we get ASYNC_DONE we can query position, duration and other * properties */ - update_scale (pipeline); + update_scale (app); /* update the available streams */ - update_streams (pipeline); + update_streams (app); - find_interface_elements (); + find_interface_elements (app); } static void -msg_state_changed (GstBus * bus, GstMessage * message, GstPipeline * pipeline) +msg_state_changed (GstBus * bus, GstMessage * message, SeekApp * app) { const GstStructure *s; s = gst_message_get_structure (message); /* We only care about state changed on the pipeline */ - if (s && GST_MESSAGE_SRC (message) == GST_OBJECT_CAST (pipeline)) { + if (s && GST_MESSAGE_SRC (message) == GST_OBJECT_CAST (app->pipeline)) { GstState old, new, pending; gst_message_parse_state_changed (message, &old, &new, &pending); /* When state of the pipeline changes to paused or playing we start updating scale */ if (new == GST_STATE_PLAYING) { - set_update_scale (TRUE); + set_update_scale (app, TRUE); } else { - set_update_scale (FALSE); + set_update_scale (app, FALSE); } /* dump graph for (some) pipeline state changes */ @@ -2451,7 +1532,7 @@ msg_state_changed (GstBus * bus, GstMessage * message, GstPipeline * pipeline) dump_name = g_strdup_printf ("seek.%s_%s", gst_element_state_get_name (old), gst_element_state_get_name (new)); - GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (pipeline), + GST_DEBUG_BIN_TO_DOT_FILE_WITH_TS (GST_BIN (app->pipeline), GST_DEBUG_GRAPH_SHOW_ALL, dump_name); g_free (dump_name); @@ -2460,33 +1541,34 @@ msg_state_changed (GstBus * bus, GstMessage * message, GstPipeline * pipeline) } static void -msg_segment_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) +msg_segment_done (GstBus * bus, GstMessage * message, SeekApp * app) { GstEvent *s_event; GstSeekFlags flags; gboolean res; GstFormat format; - GST_DEBUG ("position is %" GST_TIME_FORMAT, GST_TIME_ARGS (position)); - gst_message_parse_segment_done (message, &format, &position); - GST_DEBUG ("end of segment at %" GST_TIME_FORMAT, GST_TIME_ARGS (position)); + GST_DEBUG ("position is %" GST_TIME_FORMAT, GST_TIME_ARGS (app->position)); + gst_message_parse_segment_done (message, &format, &app->position); + GST_DEBUG ("end of segment at %" GST_TIME_FORMAT, + GST_TIME_ARGS (app->position)); flags = 0; /* in the segment-done callback we never flush as this would not make sense * for seamless playback. */ - if (loop_seek) + if (app->loop_seek) flags |= GST_SEEK_FLAG_SEGMENT; - if (skip_seek) + if (app->skip_seek) flags |= GST_SEEK_FLAG_SKIP; - s_event = gst_event_new_seek (rate, + s_event = gst_event_new_seek (app->rate, GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, G_GINT64_CONSTANT (0), - GST_SEEK_TYPE_SET, duration); + GST_SEEK_TYPE_SET, app->duration); GST_DEBUG ("restart loop with rate %lf to 0 / %" GST_TIME_FORMAT, - rate, GST_TIME_ARGS (duration)); + app->rate, GST_TIME_ARGS (app->duration)); - res = send_event (s_event); + res = send_event (app, s_event); if (!res) g_print ("segment seek failed\n"); } @@ -2494,96 +1576,97 @@ msg_segment_done (GstBus * bus, GstMessage * message, GstPipeline * pipeline) /* in stream buffering mode we PAUSE the pipeline until we receive a 100% * message */ static void -do_stream_buffering (gint percent) +do_stream_buffering (SeekApp * app, gint percent) { gchar *bufstr; - gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); + gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); bufstr = g_strdup_printf ("Buffering...%d", percent); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, bufstr); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, bufstr); g_free (bufstr); if (percent == 100) { /* a 100% message means buffering is done */ - buffering = FALSE; + app->buffering = FALSE; /* if the desired state is playing, go back */ - if (state == GST_STATE_PLAYING) { + if (app->state == GST_STATE_PLAYING) { /* no state management needed for live pipelines */ - if (!is_live) { + if (!app->is_live) { fprintf (stderr, "Done buffering, setting pipeline to PLAYING ...\n"); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); } - gtk_statusbar_pop (GTK_STATUSBAR (statusbar), status_id); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Playing"); + gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Playing"); } } else { /* buffering busy */ - if (buffering == FALSE && state == GST_STATE_PLAYING) { + if (app->buffering == FALSE && app->state == GST_STATE_PLAYING) { /* we were not buffering but PLAYING, PAUSE the pipeline. */ - if (!is_live) { + if (!app->is_live) { fprintf (stderr, "Buffering, setting pipeline to PAUSED ...\n"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); } } - buffering = TRUE; + app->buffering = TRUE; } } static void -do_download_buffering (gint percent) +do_download_buffering (SeekApp * app, gint percent) { - if (!buffering && percent < 100) { + if (!app->buffering && percent < 100) { gchar *bufstr; - buffering = TRUE; + app->buffering = TRUE; bufstr = g_strdup_printf ("Downloading..."); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, bufstr); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, bufstr); g_free (bufstr); /* once we get a buffering message, we'll do the fill update */ - set_update_fill (TRUE); + set_update_fill (app, TRUE); - if (state == GST_STATE_PLAYING && !is_live) { + if (app->state == GST_STATE_PLAYING && !app->is_live) { fprintf (stderr, "Downloading, setting pipeline to PAUSED ...\n"); - gst_element_set_state (pipeline, GST_STATE_PAUSED); + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); /* user has to manually start the playback */ - state = GST_STATE_PAUSED; + app->state = GST_STATE_PAUSED; } } } static void -msg_buffering (GstBus * bus, GstMessage * message, GstPipeline * data) +msg_buffering (GstBus * bus, GstMessage * message, SeekApp * app) { gint percent; gst_message_parse_buffering (message, &percent); /* get more stats */ - gst_message_parse_buffering_stats (message, &mode, NULL, NULL, - &buffering_left); + gst_message_parse_buffering_stats (message, &app->mode, NULL, NULL, + &app->buffering_left); - switch (mode) { + switch (app->mode) { case GST_BUFFERING_DOWNLOAD: - do_download_buffering (percent); + do_download_buffering (app, percent); break; case GST_BUFFERING_LIVE: - is_live = TRUE; + app->is_live = TRUE; case GST_BUFFERING_TIMESHIFT: case GST_BUFFERING_STREAM: - do_stream_buffering (percent); + do_stream_buffering (app, percent); break; } } static void -msg_clock_lost (GstBus * bus, GstMessage * message, GstPipeline * data) +msg_clock_lost (GstBus * bus, GstMessage * message, SeekApp * app) { g_print ("clock lost! PAUSE and PLAY to select a new clock\n"); - if (state == GST_STATE_PLAYING) { - gst_element_set_state (pipeline, GST_STATE_PAUSED); - gst_element_set_state (pipeline, GST_STATE_PLAYING); + if (app->state == GST_STATE_PLAYING) { + gst_element_set_state (app->pipeline, GST_STATE_PAUSED); + gst_element_set_state (app->pipeline, GST_STATE_PLAYING); } } @@ -2615,27 +1698,27 @@ is_valid_color_balance_element (GstElement * element) } static void -find_interface_elements (void) +find_interface_elements (SeekApp * app) { GstIterator *it; gpointer item; gboolean done = FALSE, hardware = FALSE; - if (pipeline_type == 16) + if (app->pipeline_type == 0) return; - if (navigation_element) - gst_object_unref (navigation_element); - navigation_element = NULL; + if (app->navigation_element) + gst_object_unref (app->navigation_element); + app->navigation_element = NULL; - if (colorbalance_element) - gst_object_unref (colorbalance_element); - colorbalance_element = NULL; + if (app->colorbalance_element) + gst_object_unref (app->colorbalance_element); + app->colorbalance_element = NULL; - navigation_element = - gst_bin_get_by_interface (GST_BIN (pipeline), GST_TYPE_NAVIGATION); + app->navigation_element = + gst_bin_get_by_interface (GST_BIN (app->pipeline), GST_TYPE_NAVIGATION); - it = gst_bin_iterate_all_by_interface (GST_BIN (pipeline), + it = gst_bin_iterate_all_by_interface (GST_BIN (app->pipeline), GST_TYPE_COLOR_BALANCE); while (!done) { switch (gst_iterator_next (it, &item)) { @@ -2643,8 +1726,9 @@ find_interface_elements (void) GstElement *element = GST_ELEMENT (item); if (is_valid_color_balance_element (element)) { - if (!colorbalance_element) { - colorbalance_element = GST_ELEMENT_CAST (gst_object_ref (element)); + if (!app->colorbalance_element) { + app->colorbalance_element = + GST_ELEMENT_CAST (gst_object_ref (element)); hardware = (gst_color_balance_get_balance_type (GST_COLOR_BALANCE (element)) == GST_COLOR_BALANCE_HARDWARE); @@ -2654,9 +1738,9 @@ find_interface_elements (void) (element)) == GST_COLOR_BALANCE_HARDWARE); if (tmp) { - if (colorbalance_element) - gst_object_unref (colorbalance_element); - colorbalance_element = + if (app->colorbalance_element) + gst_object_unref (app->colorbalance_element); + app->colorbalance_element = GST_ELEMENT_CAST (gst_object_ref (element)); hardware = TRUE; } @@ -2665,7 +1749,7 @@ find_interface_elements (void) gst_object_unref (element); - if (hardware && colorbalance_element) + if (hardware && app->colorbalance_element) done = TRUE; break; } @@ -2673,9 +1757,9 @@ find_interface_elements (void) gst_iterator_resync (it); done = FALSE; hardware = FALSE; - if (colorbalance_element) - gst_object_unref (colorbalance_element); - colorbalance_element = NULL; + if (app->colorbalance_element) + gst_object_unref (app->colorbalance_element); + app->colorbalance_element = NULL; break; case GST_ITERATOR_DONE: case GST_ITERATOR_ERROR: @@ -2689,42 +1773,47 @@ find_interface_elements (void) /* called when Navigation command button is pressed */ static void -navigation_cmd_cb (GtkButton * button, gpointer data) +navigation_cmd_cb (GtkButton * button, SeekApp * app) { - GstNavigationCommand cmd = GPOINTER_TO_INT (data); + GstNavigationCommand cmd = GST_NAVIGATION_COMMAND_INVALID; + gint i; - if (!navigation_element) { - find_interface_elements (); - if (!navigation_element) + if (!app->navigation_element) { + find_interface_elements (app); + if (!app->navigation_element) return; } - gst_navigation_send_command (GST_NAVIGATION (navigation_element), cmd); + for (i = 0; i < G_N_ELEMENTS (app->navigation_buttons); i++) { + if (app->navigation_buttons[i].button == GTK_WIDGET (button)) { + cmd = app->navigation_buttons[i].cmd; + break; + } + } + + if (cmd != GST_NAVIGATION_COMMAND_INVALID) + gst_navigation_send_command (GST_NAVIGATION (app->navigation_element), cmd); } #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) - -static GstElement *xoverlay_element = NULL; -static guintptr embed_xid = 0; - /* We set the xid here in response to the prepare-xwindow-id message via a * bus sync handler because we don't know the actual videosink used from the * start (as we don't know the pipeline, or bin elements such as autovideosink * or gconfvideosink may be used which create the actual videosink only once * the pipeline is started) */ static GstBusSyncReply -bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) +bus_sync_handler (GstBus * bus, GstMessage * message, SeekApp * app) { if ((GST_MESSAGE_TYPE (message) == GST_MESSAGE_ELEMENT) && gst_structure_has_name (message->structure, "prepare-xwindow-id")) { GstElement *element = GST_ELEMENT (GST_MESSAGE_SRC (message)); - if (xoverlay_element) - gst_object_unref (xoverlay_element); - xoverlay_element = GST_ELEMENT (gst_object_ref (element)); + if (app->xoverlay_element) + gst_object_unref (app->xoverlay_element); + app->xoverlay_element = GST_ELEMENT (gst_object_ref (element)); g_print ("got prepare-xwindow-id, setting XID %" G_GUINTPTR_FORMAT "\n", - embed_xid); + app->embed_xid); if (g_object_class_find_property (G_OBJECT_GET_CLASS (element), "force-aspect-ratio")) { @@ -2736,21 +1825,21 @@ bus_sync_handler (GstBus * bus, GstMessage * message, GstPipeline * data) * be called from a streaming thread and GDK_WINDOW_XID maps to more than * a simple structure lookup with Gtk+ >= 2.18, where 'more' is stuff that * shouldn't be done from a non-GUI thread without explicit locking). */ - g_assert (embed_xid != 0); + g_assert (app->embed_xid != 0); - gst_x_overlay_set_window_handle (GST_X_OVERLAY (element), embed_xid); + gst_x_overlay_set_window_handle (GST_X_OVERLAY (element), app->embed_xid); gst_x_overlay_handle_events (GST_X_OVERLAY (element), FALSE); - find_interface_elements (); + find_interface_elements (app); } return GST_BUS_PASS; } #endif static gboolean -draw_cb (GtkWidget * widget, cairo_t * cr, gpointer data) +draw_cb (GtkWidget * widget, cairo_t * cr, SeekApp * app) { - if (state < GST_STATE_PAUSED) { + if (app->state < GST_STATE_PAUSED) { int width, height; width = gtk_widget_get_allocated_width (widget); @@ -2761,16 +1850,14 @@ draw_cb (GtkWidget * widget, cairo_t * cr, gpointer data) return TRUE; } - if (xoverlay_element) - gst_x_overlay_expose (GST_X_OVERLAY (xoverlay_element)); - else if (pipeline_type == 16) - gst_x_overlay_expose (GST_X_OVERLAY (pipeline)); + if (app->xoverlay_element) + gst_x_overlay_expose (GST_X_OVERLAY (app->xoverlay_element)); return FALSE; } static void -realize_cb (GtkWidget * widget, gpointer data) +realize_cb (GtkWidget * widget, SeekApp * app) { GdkWindow *window = gtk_widget_get_window (widget); @@ -2780,97 +1867,95 @@ realize_cb (GtkWidget * widget, gpointer data) g_error ("Couldn't create native window needed for GstXOverlay!"); #if defined (GDK_WINDOWING_WIN32) - embed_xid = GDK_WINDOW_HWND (window); - g_print ("Window realize: video window HWND = %lu\n", embed_xid); + app->embed_xid = GDK_WINDOW_HWND (window); + g_print ("Window realize: video window HWND = %lu\n", app->embed_xid); #elif defined (GDK_WINDOWING_QUARTZ) - embed_xid = gdk_quartz_window_get_nsview (window); - g_print ("Window realize: video window NSView = %p\n", embed_xid); + app->embed_xid = gdk_quartz_window_get_nsview (window); + g_print ("Window realize: video window NSView = %p\n", app->embed_xid); #elif defined (GDK_WINDOWING_X11) - embed_xid = GDK_WINDOW_XID (window); + app->embed_xid = GDK_WINDOW_XID (window); g_print ("Window realize: video window XID = %" G_GUINTPTR_FORMAT "\n", - embed_xid); + app->embed_xid); #endif } static gboolean -button_press_cb (GtkWidget * widget, GdkEventButton * event, gpointer user_data) +button_press_cb (GtkWidget * widget, GdkEventButton * event, SeekApp * app) { gtk_widget_grab_focus (widget); - if (navigation_element) - gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), + if (app->navigation_element) + gst_navigation_send_mouse_event (GST_NAVIGATION (app->navigation_element), "mouse-button-press", event->button, event->x, event->y); return FALSE; } static gboolean -button_release_cb (GtkWidget * widget, GdkEventButton * event, - gpointer user_data) +button_release_cb (GtkWidget * widget, GdkEventButton * event, SeekApp * app) { - if (navigation_element) - gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), + if (app->navigation_element) + gst_navigation_send_mouse_event (GST_NAVIGATION (app->navigation_element), "mouse-button-release", event->button, event->x, event->y); return FALSE; } static gboolean -key_press_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) +key_press_cb (GtkWidget * widget, GdkEventKey * event, SeekApp * app) { - if (navigation_element) - gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), + if (app->navigation_element) + gst_navigation_send_key_event (GST_NAVIGATION (app->navigation_element), "key-press", gdk_keyval_name (event->keyval)); return FALSE; } static gboolean -key_release_cb (GtkWidget * widget, GdkEventKey * event, gpointer user_data) +key_release_cb (GtkWidget * widget, GdkEventKey * event, SeekApp * app) { - if (navigation_element) - gst_navigation_send_key_event (GST_NAVIGATION (navigation_element), + if (app->navigation_element) + gst_navigation_send_key_event (GST_NAVIGATION (app->navigation_element), "key-release", gdk_keyval_name (event->keyval)); return FALSE; } static gboolean -motion_notify_cb (GtkWidget * widget, GdkEventMotion * event, - gpointer user_data) +motion_notify_cb (GtkWidget * widget, GdkEventMotion * event, SeekApp * app) { - if (navigation_element) - gst_navigation_send_mouse_event (GST_NAVIGATION (navigation_element), + if (app->navigation_element) + gst_navigation_send_mouse_event (GST_NAVIGATION (app->navigation_element), "mouse-move", 0, event->x, event->y); return FALSE; } static void -msg_eos (GstBus * bus, GstMessage * message, GstPipeline * data) +msg_eos (GstBus * bus, GstMessage * message, SeekApp * app) { - message_received (bus, message, data); + message_received (bus, message, app); /* Set new uri for playerbins and continue playback */ - if (l && (pipeline_type == 14 || pipeline_type == 16)) { - stop_cb (NULL, NULL); - l = g_list_next (l); - if (l) { - playerbin_set_uri (GST_ELEMENT (data), l->data); - play_cb (NULL, NULL); + if (app->current_path && app->pipeline_type == 0) { + stop_cb (NULL, app); + app->current_path = g_list_next (app->current_path); + if (app->current_path) { + playbin_set_uri (app->pipeline, app->current_path->data); + play_cb (NULL, app); } } } static void -msg_step_done (GstBus * bus, GstMessage * message, GstPipeline * data) +msg_step_done (GstBus * bus, GstMessage * message, SeekApp * app) { - if (!shuttling) - message_received (bus, message, data); + if (!app->shuttling) + message_received (bus, message, app); } static void -msg (GstBus * bus, GstMessage * message, GstPipeline * data) +msg (GstBus * bus, GstMessage * message, SeekApp * app) { GstNavigationMessageType nav_type; @@ -2884,8 +1969,8 @@ msg (GstBus * bus, GstMessage * message, GstPipeline * data) query = gst_navigation_query_new_commands (); res = gst_element_query (GST_ELEMENT (GST_MESSAGE_SRC (message)), query); - for (j = 0; j < G_N_ELEMENTS (navigation_buttons); j++) - gtk_widget_set_sensitive (navigation_buttons[j].button, FALSE); + for (j = 0; j < G_N_ELEMENTS (app->navigation_buttons); j++) + gtk_widget_set_sensitive (app->navigation_buttons[j].button, FALSE); if (res) { gboolean is_menu = FALSE; @@ -2904,21 +1989,23 @@ msg (GstBus * bus, GstMessage * message, GstPipeline * data) is_menu |= (cmd == GST_NAVIGATION_COMMAND_UP); is_menu |= (cmd == GST_NAVIGATION_COMMAND_DOWN); - for (j = 0; j < G_N_ELEMENTS (navigation_buttons); j++) { - if (navigation_buttons[j].cmd != cmd) + for (j = 0; j < G_N_ELEMENTS (app->navigation_buttons); j++) { + if (app->navigation_buttons[j].cmd != cmd) continue; - gtk_widget_set_sensitive (navigation_buttons[j].button, TRUE); + gtk_widget_set_sensitive (app->navigation_buttons[j].button, + TRUE); } } } - gtk_widget_set_sensitive (GTK_WIDGET (hscale), !is_menu); + gtk_widget_set_sensitive (GTK_WIDGET (app->seek_scale), !is_menu); } else { g_assert_not_reached (); } gst_query_unref (query); + message_received (bus, message, app); break; } default: @@ -2927,15 +2014,14 @@ msg (GstBus * bus, GstMessage * message, GstPipeline * data) } static void -connect_bus_signals (GstElement * pipeline) +connect_bus_signals (SeekApp * app) { - GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (pipeline)); + GstBus *bus = gst_pipeline_get_bus (GST_PIPELINE (app->pipeline)); #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) - if (pipeline_type != 16) { + if (app->pipeline_type != 0) { /* handle prepare-xwindow-id element message synchronously, but only for non-playbin2 */ - gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, - pipeline); + gst_bus_set_sync_handler (bus, (GstBusSyncHandler) bus_sync_handler, app); } #endif @@ -2943,36 +2029,33 @@ connect_bus_signals (GstElement * pipeline) gst_bus_enable_sync_message_emission (bus); g_signal_connect (bus, "message::state-changed", - (GCallback) msg_state_changed, pipeline); - g_signal_connect (bus, "message::segment-done", (GCallback) msg_segment_done, - pipeline); - g_signal_connect (bus, "message::async-done", (GCallback) msg_async_done, - pipeline); + G_CALLBACK (msg_state_changed), app); + g_signal_connect (bus, "message::segment-done", G_CALLBACK (msg_segment_done), + app); + g_signal_connect (bus, "message::async-done", G_CALLBACK (msg_async_done), + app); - g_signal_connect (bus, "message::new-clock", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::clock-lost", (GCallback) msg_clock_lost, - pipeline); - g_signal_connect (bus, "message::error", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::warning", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::eos", (GCallback) msg_eos, pipeline); - g_signal_connect (bus, "message::tag", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::element", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::segment-done", (GCallback) message_received, - pipeline); - g_signal_connect (bus, "message::buffering", (GCallback) msg_buffering, - pipeline); -// g_signal_connect (bus, "message::step-done", (GCallback) msg_step_done, -// pipeline); - g_signal_connect (bus, "message::step-start", (GCallback) msg_step_done, - pipeline); + g_signal_connect (bus, "message::new-clock", G_CALLBACK (message_received), + app); + g_signal_connect (bus, "message::clock-lost", G_CALLBACK (msg_clock_lost), + app); + g_signal_connect (bus, "message::error", G_CALLBACK (message_received), app); + g_signal_connect (bus, "message::warning", G_CALLBACK (message_received), + app); + g_signal_connect (bus, "message::eos", G_CALLBACK (msg_eos), app); + g_signal_connect (bus, "message::tag", G_CALLBACK (message_received), app); + g_signal_connect (bus, "message::element", G_CALLBACK (message_received), + app); + g_signal_connect (bus, "message::segment-done", G_CALLBACK (message_received), + app); + g_signal_connect (bus, "message::buffering", G_CALLBACK (msg_buffering), app); +// g_signal_connect (bus, "message::step-done", G_CALLBACK (msg_step_done), +// app); + g_signal_connect (bus, "message::step-start", G_CALLBACK (msg_step_done), + app); g_signal_connect (bus, "sync-message::step-done", - (GCallback) msg_sync_step_done, pipeline); - g_signal_connect (bus, "message", (GCallback) msg, pipeline); + G_CALLBACK (msg_sync_step_done), app); + g_signal_connect (bus, "message", G_CALLBACK (msg), app); gst_object_unref (bus); } @@ -3012,9 +2095,9 @@ out: } static void -delete_event_cb (void) +delete_event_cb (GtkWidget * widget, GdkEvent * event, SeekApp * app) { - stop_cb (NULL, NULL); + stop_cb (NULL, app); gtk_main_quit (); } @@ -3026,115 +2109,53 @@ print_usage (int argc, char **argv) g_print ("usage: %s \n", argv[0]); g_print (" possible types:\n"); - for (i = 0; i < NUM_TYPES; i++) { + for (i = 0; i < G_N_ELEMENTS (pipelines); i++) { g_print (" %d = %s\n", i, pipelines[i].name); } } -int -main (int argc, char **argv) +static void +create_ui (SeekApp * app) { - GtkWidget *window, *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, + GtkWidget *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, *flagtable, *boxes2, *step, *navigation, *colorbalance = NULL; GtkWidget *play_button, *pause_button, *stop_button, *shot_button; GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox; GtkWidget *rate_label, *volume_label; - GOptionEntry options[] = { - {"audiosink", '\0', 0, G_OPTION_ARG_STRING, &opt_audiosink_str, - "audio sink to use (default: " DEFAULT_AUDIOSINK ")", NULL}, - {"stats", 's', 0, G_OPTION_ARG_NONE, &stats, - "Show pad stats", NULL}, - {"elem", 'e', 0, G_OPTION_ARG_NONE, &elem_seek, - "Seek on elements instead of pads", NULL}, - {"verbose", 'v', 0, G_OPTION_ARG_NONE, &verbose, - "Verbose properties", NULL}, - {"videosink", '\0', 0, G_OPTION_ARG_STRING, &opt_videosink_str, - "video sink to use (default: " DEFAULT_VIDEOSINK ")", NULL}, - {NULL} - }; - GOptionContext *ctx; - GError *err = NULL; - -#if !GLIB_CHECK_VERSION (2, 31, 0) - if (!g_thread_supported ()) - g_thread_init (NULL); -#endif - - ctx = g_option_context_new ("- test seeking in gsteamer"); - g_option_context_add_main_entries (ctx, options, NULL); - g_option_context_add_group (ctx, gst_init_get_option_group ()); - g_option_context_add_group (ctx, gtk_get_option_group (TRUE)); - - if (!g_option_context_parse (ctx, &argc, &argv, &err)) { - g_print ("Error initializing: %s\n", err->message); - exit (1); - } - - if (opt_audiosink_str == NULL) - opt_audiosink_str = g_strdup (DEFAULT_AUDIOSINK); - - if (opt_videosink_str == NULL) - opt_videosink_str = g_strdup (DEFAULT_VIDEOSINK); - - GST_DEBUG_CATEGORY_INIT (seek_debug, "seek", 0, "seek example"); - - if (argc != 3) { - print_usage (argc, argv); - exit (-1); - } - - pipeline_type = atoi (argv[1]); - - if (pipeline_type < 0 || pipeline_type >= NUM_TYPES) { - print_usage (argc, argv); - exit (-1); - } - - pipeline_spec = argv[2]; - - if (g_path_is_absolute (pipeline_spec) && - (g_strrstr (pipeline_spec, "*") != NULL || - g_strrstr (pipeline_spec, "?") != NULL)) { - paths = handle_wildcards (pipeline_spec); - } else { - paths = g_list_prepend (paths, g_strdup (pipeline_spec)); - } - - if (!paths) { - g_print ("opening %s failed\n", pipeline_spec); - exit (-1); - } - - l = paths; - - pipeline = pipelines[pipeline_type].func ((gchar *) l->data); - g_assert (pipeline); + GtkWidget *skip_checkbox, *rate_spinbutton, *step_button, *shuttle_checkbox; + GtkWidget *soft_volume_checkbox, *native_audio_checkbox, + *native_video_checkbox; + GtkWidget *download_checkbox, *buffering_checkbox, *deinterlace_checkbox; + GtkWidget *soft_colorbalance_checkbox; + GtkAdjustment *adjustment; /* initialize gui elements ... */ - window = gtk_window_new (GTK_WINDOW_TOPLEVEL); - video_window = gtk_drawing_area_new (); - g_signal_connect (video_window, "draw", G_CALLBACK (draw_cb), NULL); - g_signal_connect (video_window, "realize", G_CALLBACK (realize_cb), NULL); - g_signal_connect (video_window, "button-press-event", - G_CALLBACK (button_press_cb), NULL); - g_signal_connect (video_window, "button-release-event", - G_CALLBACK (button_release_cb), NULL); - g_signal_connect (video_window, "key-press-event", G_CALLBACK (key_press_cb), - NULL); - g_signal_connect (video_window, "key-release-event", - G_CALLBACK (key_release_cb), NULL); - g_signal_connect (video_window, "motion-notify-event", - G_CALLBACK (motion_notify_cb), NULL); - gtk_widget_set_can_focus (video_window, TRUE); - gtk_widget_set_double_buffered (video_window, FALSE); - gtk_widget_add_events (video_window, + app->window = gtk_window_new (GTK_WINDOW_TOPLEVEL); + app->video_window = gtk_drawing_area_new (); + g_signal_connect (app->video_window, "draw", G_CALLBACK (draw_cb), app); + g_signal_connect (app->video_window, "realize", G_CALLBACK (realize_cb), app); + g_signal_connect (app->video_window, "button-press-event", + G_CALLBACK (button_press_cb), app); + g_signal_connect (app->video_window, "button-release-event", + G_CALLBACK (button_release_cb), app); + g_signal_connect (app->video_window, "key-press-event", + G_CALLBACK (key_press_cb), app); + g_signal_connect (app->video_window, "key-release-event", + G_CALLBACK (key_release_cb), app); + g_signal_connect (app->video_window, "motion-notify-event", + G_CALLBACK (motion_notify_cb), app); + gtk_widget_set_can_focus (app->video_window, TRUE); + gtk_widget_set_double_buffered (app->video_window, FALSE); + gtk_widget_add_events (app->video_window, GDK_POINTER_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_KEY_RELEASE_MASK); - statusbar = gtk_statusbar_new (); - status_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar), "seek"); - gtk_statusbar_push (GTK_STATUSBAR (statusbar), status_id, "Stopped"); + app->statusbar = gtk_statusbar_new (); + app->status_id = + gtk_statusbar_get_context_id (GTK_STATUSBAR (app->statusbar), "seek"); + gtk_statusbar_push (GTK_STATUSBAR (app->statusbar), app->status_id, + "Stopped"); hbox = gtk_hbox_new (FALSE, 0); vbox = gtk_vbox_new (FALSE, 0); flagtable = gtk_table_new (4, 2, FALSE); @@ -3173,7 +2194,7 @@ main (int argc, char **argv) gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flush_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrub_checkbox), TRUE); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate_spinbutton), rate); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate_spinbutton), app->rate); /* step expander */ { @@ -3182,50 +2203,54 @@ main (int argc, char **argv) step = gtk_expander_new ("step options"); hbox = gtk_hbox_new (FALSE, 0); - format_combo = gtk_combo_box_text_new (); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (format_combo), + app->format_combo = gtk_combo_box_text_new (); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->format_combo), "frames"); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (format_combo), + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->format_combo), "time (ms)"); - gtk_combo_box_set_active (GTK_COMBO_BOX (format_combo), 0); - gtk_box_pack_start (GTK_BOX (hbox), format_combo, FALSE, FALSE, 2); + gtk_combo_box_set_active (GTK_COMBO_BOX (app->format_combo), 0); + gtk_box_pack_start (GTK_BOX (hbox), app->format_combo, FALSE, FALSE, 2); - step_amount_spinbutton = gtk_spin_button_new_with_range (1, 1000, 1); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (step_amount_spinbutton), 0); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (step_amount_spinbutton), 1.0); - gtk_box_pack_start (GTK_BOX (hbox), step_amount_spinbutton, FALSE, FALSE, + app->step_amount_spinbutton = gtk_spin_button_new_with_range (1, 1000, 1); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (app->step_amount_spinbutton), + 0); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->step_amount_spinbutton), + 1.0); + gtk_box_pack_start (GTK_BOX (hbox), app->step_amount_spinbutton, FALSE, + FALSE, 2); + + app->step_rate_spinbutton = gtk_spin_button_new_with_range (0.0, 100, 0.1); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (app->step_rate_spinbutton), 3); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->step_rate_spinbutton), + 1.0); + gtk_box_pack_start (GTK_BOX (hbox), app->step_rate_spinbutton, FALSE, FALSE, 2); - step_rate_spinbutton = gtk_spin_button_new_with_range (0.0, 100, 0.1); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (step_rate_spinbutton), 3); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (step_rate_spinbutton), 1.0); - gtk_box_pack_start (GTK_BOX (hbox), step_rate_spinbutton, FALSE, FALSE, 2); - step_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_FORWARD); gtk_button_set_label (GTK_BUTTON (step_button), "Step"); gtk_box_pack_start (GTK_BOX (hbox), step_button, FALSE, FALSE, 2); g_signal_connect (G_OBJECT (step_button), "clicked", G_CALLBACK (step_cb), - pipeline); + app); /* shuttle scale */ shuttle_checkbox = gtk_check_button_new_with_label ("Shuttle"); gtk_box_pack_start (GTK_BOX (hbox), shuttle_checkbox, FALSE, FALSE, 2); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (shuttle_checkbox), FALSE); g_signal_connect (shuttle_checkbox, "toggled", G_CALLBACK (shuttle_toggled), - pipeline); + app); - shuttle_adjustment = + adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, -3.00, 4.0, 0.1, 1.0, 1.0)); - shuttle_hscale = gtk_hscale_new (shuttle_adjustment); - gtk_scale_set_digits (GTK_SCALE (shuttle_hscale), 2); - gtk_scale_set_value_pos (GTK_SCALE (shuttle_hscale), GTK_POS_TOP); - g_signal_connect (shuttle_hscale, "value-changed", - G_CALLBACK (shuttle_value_changed), pipeline); - g_signal_connect (shuttle_hscale, "format_value", - G_CALLBACK (shuttle_format_value), pipeline); + app->shuttle_scale = gtk_hscale_new (adjustment); + gtk_scale_set_digits (GTK_SCALE (app->shuttle_scale), 2); + gtk_scale_set_value_pos (GTK_SCALE (app->shuttle_scale), GTK_POS_TOP); + g_signal_connect (app->shuttle_scale, "value-changed", + G_CALLBACK (shuttle_value_changed), app); + g_signal_connect (app->shuttle_scale, "format_value", + G_CALLBACK (shuttle_format_value), app); - gtk_box_pack_start (GTK_BOX (hbox), shuttle_hscale, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (hbox), app->shuttle_scale, TRUE, TRUE, 2); gtk_container_add (GTK_CONTAINER (step), hbox); } @@ -3245,136 +2270,122 @@ main (int argc, char **argv) navigation_button = gtk_button_new_with_label ("Menu 1"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU1)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU1; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU1; navigation_button = gtk_button_new_with_label ("Menu 2"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU2)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Title Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU2; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU2; navigation_button = gtk_button_new_with_label ("Menu 3"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU3)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Root Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU3; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU3; navigation_button = gtk_button_new_with_label ("Menu 4"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU4)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Subpicture Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU4; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU4; navigation_button = gtk_button_new_with_label ("Menu 5"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU5)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Audio Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU5; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU5; navigation_button = gtk_button_new_with_label ("Menu 6"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU6)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Angle Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU6; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU6; navigation_button = gtk_button_new_with_label ("Menu 7"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_MENU7)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i, 0, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); gtk_widget_set_tooltip_text (navigation_button, "DVD Chapter Menu"); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU7; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_MENU7; navigation_button = gtk_button_new_with_label ("Left"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_LEFT)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_LEFT; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_LEFT; navigation_button = gtk_button_new_with_label ("Right"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_RIGHT)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_RIGHT; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_RIGHT; navigation_button = gtk_button_new_with_label ("Up"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_UP)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_UP; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_UP; navigation_button = gtk_button_new_with_label ("Down"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_DOWN)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_DOWN; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_DOWN; navigation_button = gtk_button_new_with_label ("Activate"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_ACTIVATE)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_ACTIVATE; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_ACTIVATE; navigation_button = gtk_button_new_with_label ("Prev. Angle"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_PREV_ANGLE)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_PREV_ANGLE; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_PREV_ANGLE; navigation_button = gtk_button_new_with_label ("Next. Angle"); g_signal_connect (G_OBJECT (navigation_button), "clicked", - G_CALLBACK (navigation_cmd_cb), - GINT_TO_POINTER (GST_NAVIGATION_COMMAND_NEXT_ANGLE)); + G_CALLBACK (navigation_cmd_cb), app); gtk_grid_attach (GTK_GRID (grid), navigation_button, i - 7, 1, 1, 1); gtk_widget_set_sensitive (navigation_button, FALSE); - navigation_buttons[i].button = navigation_button; - navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_NEXT_ANGLE; + app->navigation_buttons[i].button = navigation_button; + app->navigation_buttons[i++].cmd = GST_NAVIGATION_COMMAND_NEXT_ANGLE; gtk_container_add (GTK_CONTAINER (navigation), grid); } @@ -3390,44 +2401,44 @@ main (int argc, char **argv) frame = gtk_frame_new ("Contrast"); adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); - contrast_scale = gtk_hscale_new (adjustment); - gtk_scale_set_draw_value (GTK_SCALE (contrast_scale), FALSE); - g_signal_connect (contrast_scale, "value-changed", - G_CALLBACK (colorbalance_value_changed), (gpointer) "CONTRAST"); - gtk_container_add (GTK_CONTAINER (frame), contrast_scale); + app->contrast_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (app->contrast_scale), FALSE); + g_signal_connect (app->contrast_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), app); + gtk_container_add (GTK_CONTAINER (frame), app->contrast_scale); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); /* brightness scale */ frame = gtk_frame_new ("Brightness"); adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); - brightness_scale = gtk_hscale_new (adjustment); - gtk_scale_set_draw_value (GTK_SCALE (brightness_scale), FALSE); - g_signal_connect (brightness_scale, "value-changed", - G_CALLBACK (colorbalance_value_changed), (gpointer) "BRIGHTNESS"); - gtk_container_add (GTK_CONTAINER (frame), brightness_scale); + app->brightness_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (app->brightness_scale), FALSE); + g_signal_connect (app->brightness_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), app); + gtk_container_add (GTK_CONTAINER (frame), app->brightness_scale); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); /* hue scale */ frame = gtk_frame_new ("Hue"); adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); - hue_scale = gtk_hscale_new (adjustment); - gtk_scale_set_draw_value (GTK_SCALE (hue_scale), FALSE); - g_signal_connect (hue_scale, "value-changed", - G_CALLBACK (colorbalance_value_changed), (gpointer) "HUE"); - gtk_container_add (GTK_CONTAINER (frame), hue_scale); + app->hue_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (app->hue_scale), FALSE); + g_signal_connect (app->hue_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), app); + gtk_container_add (GTK_CONTAINER (frame), app->hue_scale); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); /* saturation scale */ frame = gtk_frame_new ("Saturation"); adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); - saturation_scale = gtk_hscale_new (adjustment); - gtk_scale_set_draw_value (GTK_SCALE (saturation_scale), FALSE); - g_signal_connect (saturation_scale, "value-changed", - G_CALLBACK (colorbalance_value_changed), (gpointer) "SATURATION"); - gtk_container_add (GTK_CONTAINER (frame), saturation_scale); + app->saturation_scale = gtk_hscale_new (adjustment); + gtk_scale_set_draw_value (GTK_SCALE (app->saturation_scale), FALSE); + g_signal_connect (app->saturation_scale, "value-changed", + G_CALLBACK (colorbalance_value_changed), app); + gtk_container_add (GTK_CONTAINER (frame), app->saturation_scale); gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 2); gtk_container_add (GTK_CONTAINER (colorbalance), vbox); @@ -3436,37 +2447,37 @@ main (int argc, char **argv) /* seek bar */ adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0.0, 0.00, N_GRAD, 0.1, 1.0, 1.0)); - hscale = gtk_hscale_new (adjustment); - gtk_scale_set_digits (GTK_SCALE (hscale), 2); - gtk_scale_set_value_pos (GTK_SCALE (hscale), GTK_POS_RIGHT); - gtk_range_set_show_fill_level (GTK_RANGE (hscale), TRUE); - gtk_range_set_fill_level (GTK_RANGE (hscale), N_GRAD); + app->seek_scale = gtk_hscale_new (adjustment); + gtk_scale_set_digits (GTK_SCALE (app->seek_scale), 2); + gtk_scale_set_value_pos (GTK_SCALE (app->seek_scale), GTK_POS_RIGHT); + gtk_range_set_show_fill_level (GTK_RANGE (app->seek_scale), TRUE); + gtk_range_set_fill_level (GTK_RANGE (app->seek_scale), N_GRAD); - g_signal_connect (hscale, "button_press_event", G_CALLBACK (start_seek), - pipeline); - g_signal_connect (hscale, "button_release_event", G_CALLBACK (stop_seek), - pipeline); - g_signal_connect (hscale, "format_value", G_CALLBACK (format_value), - pipeline); + g_signal_connect (app->seek_scale, "button_press_event", + G_CALLBACK (start_seek), app); + g_signal_connect (app->seek_scale, "button_release_event", + G_CALLBACK (stop_seek), app); + g_signal_connect (app->seek_scale, "format_value", G_CALLBACK (format_value), + app); - if (pipeline_type == 16) { + if (app->pipeline_type == 0) { /* the playbin2 panel controls for the video/audio/subtitle tracks */ panel = gtk_hbox_new (FALSE, 0); - video_combo = gtk_combo_box_text_new (); - audio_combo = gtk_combo_box_text_new (); - text_combo = gtk_combo_box_text_new (); - gtk_widget_set_sensitive (video_combo, FALSE); - gtk_widget_set_sensitive (audio_combo, FALSE); - gtk_widget_set_sensitive (text_combo, FALSE); - gtk_box_pack_start (GTK_BOX (panel), video_combo, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (panel), audio_combo, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (panel), text_combo, TRUE, TRUE, 2); - g_signal_connect (G_OBJECT (video_combo), "changed", - G_CALLBACK (video_combo_cb), pipeline); - g_signal_connect (G_OBJECT (audio_combo), "changed", - G_CALLBACK (audio_combo_cb), pipeline); - g_signal_connect (G_OBJECT (text_combo), "changed", - G_CALLBACK (text_combo_cb), pipeline); + app->video_combo = gtk_combo_box_text_new (); + app->audio_combo = gtk_combo_box_text_new (); + app->text_combo = gtk_combo_box_text_new (); + gtk_widget_set_sensitive (app->video_combo, FALSE); + gtk_widget_set_sensitive (app->audio_combo, FALSE); + gtk_widget_set_sensitive (app->text_combo, FALSE); + gtk_box_pack_start (GTK_BOX (panel), app->video_combo, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (panel), app->audio_combo, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (panel), app->text_combo, TRUE, TRUE, 2); + g_signal_connect (G_OBJECT (app->video_combo), "changed", + G_CALLBACK (video_combo_cb), app); + g_signal_connect (G_OBJECT (app->audio_combo), "changed", + G_CALLBACK (audio_combo_cb), app); + g_signal_connect (G_OBJECT (app->text_combo), "changed", + G_CALLBACK (text_combo_cb), app); /* playbin2 panel for flag checkboxes and volume/mute */ boxes = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (boxes), 2); @@ -3474,10 +2485,10 @@ main (int argc, char **argv) gtk_grid_set_column_spacing (GTK_GRID (boxes), 2); gtk_grid_set_column_homogeneous (GTK_GRID (boxes), TRUE); - video_checkbox = gtk_check_button_new_with_label ("Video"); - audio_checkbox = gtk_check_button_new_with_label ("Audio"); - text_checkbox = gtk_check_button_new_with_label ("Text"); - vis_checkbox = gtk_check_button_new_with_label ("Vis"); + app->video_checkbox = gtk_check_button_new_with_label ("Video"); + app->audio_checkbox = gtk_check_button_new_with_label ("Audio"); + app->text_checkbox = gtk_check_button_new_with_label ("Text"); + app->vis_checkbox = gtk_check_button_new_with_label ("Vis"); soft_volume_checkbox = gtk_check_button_new_with_label ("Soft Volume"); native_audio_checkbox = gtk_check_button_new_with_label ("Native Audio"); native_video_checkbox = gtk_check_button_new_with_label ("Native Video"); @@ -3486,14 +2497,14 @@ main (int argc, char **argv) deinterlace_checkbox = gtk_check_button_new_with_label ("Deinterlace"); soft_colorbalance_checkbox = gtk_check_button_new_with_label ("Soft Colorbalance"); - mute_checkbox = gtk_check_button_new_with_label ("Mute"); + app->mute_checkbox = gtk_check_button_new_with_label ("Mute"); volume_label = gtk_label_new ("Volume"); - volume_spinbutton = gtk_spin_button_new_with_range (0, 10.0, 0.1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (volume_spinbutton), 1.0); - gtk_grid_attach (GTK_GRID (boxes), video_checkbox, 0, 0, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), audio_checkbox, 1, 0, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), text_checkbox, 2, 0, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), vis_checkbox, 3, 0, 1, 1); + app->volume_spinbutton = gtk_spin_button_new_with_range (0, 10.0, 0.1); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->volume_spinbutton), 1.0); + gtk_grid_attach (GTK_GRID (boxes), app->video_checkbox, 0, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->audio_checkbox, 1, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->text_checkbox, 2, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->vis_checkbox, 3, 0, 1, 1); gtk_grid_attach (GTK_GRID (boxes), soft_volume_checkbox, 4, 0, 1, 1); gtk_grid_attach (GTK_GRID (boxes), native_audio_checkbox, 5, 0, 1, 1); gtk_grid_attach (GTK_GRID (boxes), native_video_checkbox, 0, 1, 1, 1); @@ -3502,13 +2513,15 @@ main (int argc, char **argv) gtk_grid_attach (GTK_GRID (boxes), deinterlace_checkbox, 3, 1, 1, 1); gtk_grid_attach (GTK_GRID (boxes), soft_colorbalance_checkbox, 4, 1, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), mute_checkbox, 7, 0, 2, 1); + gtk_grid_attach (GTK_GRID (boxes), app->mute_checkbox, 7, 0, 2, 1); gtk_grid_attach (GTK_GRID (boxes), volume_label, 6, 1, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), volume_spinbutton, 7, 1, 1, 1); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (video_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (audio_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (text_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (vis_checkbox), FALSE); + gtk_grid_attach (GTK_GRID (boxes), app->volume_spinbutton, 7, 1, 1, 1); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->video_checkbox), + TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->audio_checkbox), + TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->text_checkbox), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->vis_checkbox), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (soft_volume_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (native_audio_checkbox), @@ -3522,60 +2535,61 @@ main (int argc, char **argv) FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (soft_colorbalance_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (mute_checkbox), FALSE); - g_signal_connect (G_OBJECT (video_checkbox), "toggled", - G_CALLBACK (video_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (audio_checkbox), "toggled", - G_CALLBACK (audio_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (text_checkbox), "toggled", - G_CALLBACK (text_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (vis_checkbox), "toggled", - G_CALLBACK (vis_toggle_cb), pipeline); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->mute_checkbox), + FALSE); + g_signal_connect (G_OBJECT (app->video_checkbox), "toggled", + G_CALLBACK (video_toggle_cb), app); + g_signal_connect (G_OBJECT (app->audio_checkbox), "toggled", + G_CALLBACK (audio_toggle_cb), app); + g_signal_connect (G_OBJECT (app->text_checkbox), "toggled", + G_CALLBACK (text_toggle_cb), app); + g_signal_connect (G_OBJECT (app->vis_checkbox), "toggled", + G_CALLBACK (vis_toggle_cb), app); g_signal_connect (G_OBJECT (soft_volume_checkbox), "toggled", - G_CALLBACK (soft_volume_toggle_cb), pipeline); + G_CALLBACK (soft_volume_toggle_cb), app); g_signal_connect (G_OBJECT (native_audio_checkbox), "toggled", - G_CALLBACK (native_audio_toggle_cb), pipeline); + G_CALLBACK (native_audio_toggle_cb), app); g_signal_connect (G_OBJECT (native_video_checkbox), "toggled", - G_CALLBACK (native_video_toggle_cb), pipeline); + G_CALLBACK (native_video_toggle_cb), app); g_signal_connect (G_OBJECT (download_checkbox), "toggled", - G_CALLBACK (download_toggle_cb), pipeline); + G_CALLBACK (download_toggle_cb), app); g_signal_connect (G_OBJECT (buffering_checkbox), "toggled", - G_CALLBACK (buffering_toggle_cb), pipeline); + G_CALLBACK (buffering_toggle_cb), app); g_signal_connect (G_OBJECT (deinterlace_checkbox), "toggled", - G_CALLBACK (deinterlace_toggle_cb), pipeline); + G_CALLBACK (deinterlace_toggle_cb), app); g_signal_connect (G_OBJECT (soft_colorbalance_checkbox), "toggled", - G_CALLBACK (soft_colorbalance_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (mute_checkbox), "toggled", - G_CALLBACK (mute_toggle_cb), pipeline); - g_signal_connect (G_OBJECT (volume_spinbutton), "value-changed", - G_CALLBACK (volume_spinbutton_changed_cb), pipeline); + G_CALLBACK (soft_colorbalance_toggle_cb), app); + g_signal_connect (G_OBJECT (app->mute_checkbox), "toggled", + G_CALLBACK (mute_toggle_cb), app); + g_signal_connect (G_OBJECT (app->volume_spinbutton), "value-changed", + G_CALLBACK (volume_spinbutton_changed_cb), app); /* playbin2 panel for snapshot */ boxes2 = gtk_hbox_new (FALSE, 0); shot_button = gtk_button_new_from_stock (GTK_STOCK_SAVE); gtk_widget_set_tooltip_text (shot_button, "save a screenshot .png in the current directory"); g_signal_connect (G_OBJECT (shot_button), "clicked", G_CALLBACK (shot_cb), - pipeline); - vis_combo = gtk_combo_box_text_new (); - g_signal_connect (G_OBJECT (vis_combo), "changed", - G_CALLBACK (vis_combo_cb), pipeline); - gtk_widget_set_sensitive (vis_combo, FALSE); + app); + app->vis_combo = gtk_combo_box_text_new (); + g_signal_connect (G_OBJECT (app->vis_combo), "changed", + G_CALLBACK (vis_combo_cb), app); + gtk_widget_set_sensitive (app->vis_combo, FALSE); gtk_box_pack_start (GTK_BOX (boxes2), shot_button, TRUE, TRUE, 2); - gtk_box_pack_start (GTK_BOX (boxes2), vis_combo, TRUE, TRUE, 2); + gtk_box_pack_start (GTK_BOX (boxes2), app->vis_combo, TRUE, TRUE, 2); /* fill the vis combo box and the array of factories */ - init_visualization_features (); + init_visualization_features (app); } else { panel = boxes = boxes2 = NULL; } /* do the packing stuff ... */ - gtk_window_set_default_size (GTK_WINDOW (window), 250, 96); + gtk_window_set_default_size (GTK_WINDOW (app->window), 250, 96); /* FIXME: can we avoid this for audio only? */ - gtk_widget_set_size_request (GTK_WIDGET (video_window), -1, + gtk_widget_set_size_request (GTK_WIDGET (app->video_window), -1, DEFAULT_VIDEO_HEIGHT); - gtk_container_add (GTK_CONTAINER (window), vbox); - gtk_box_pack_start (GTK_BOX (vbox), video_window, TRUE, TRUE, 2); + gtk_container_add (GTK_CONTAINER (app->window), vbox); + gtk_box_pack_start (GTK_BOX (vbox), app->video_window, TRUE, TRUE, 2); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (hbox), play_button, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (hbox), pause_button, FALSE, FALSE, 2); @@ -3606,74 +2620,175 @@ main (int argc, char **argv) gtk_box_pack_start (GTK_BOX (vbox), navigation, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), gtk_hseparator_new (), FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX (vbox), hscale, FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX (vbox), statusbar, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox), app->seek_scale, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (vbox), app->statusbar, FALSE, FALSE, 2); /* connect things ... */ g_signal_connect (G_OBJECT (play_button), "clicked", G_CALLBACK (play_cb), - pipeline); + app); g_signal_connect (G_OBJECT (pause_button), "clicked", G_CALLBACK (pause_cb), - pipeline); + app); g_signal_connect (G_OBJECT (stop_button), "clicked", G_CALLBACK (stop_cb), - pipeline); + app); g_signal_connect (G_OBJECT (accurate_checkbox), "toggled", - G_CALLBACK (accurate_toggle_cb), pipeline); + G_CALLBACK (accurate_toggle_cb), app); g_signal_connect (G_OBJECT (key_checkbox), "toggled", - G_CALLBACK (key_toggle_cb), pipeline); + G_CALLBACK (key_toggle_cb), app); g_signal_connect (G_OBJECT (loop_checkbox), "toggled", - G_CALLBACK (loop_toggle_cb), pipeline); + G_CALLBACK (loop_toggle_cb), app); g_signal_connect (G_OBJECT (flush_checkbox), "toggled", - G_CALLBACK (flush_toggle_cb), pipeline); + G_CALLBACK (flush_toggle_cb), app); g_signal_connect (G_OBJECT (scrub_checkbox), "toggled", - G_CALLBACK (scrub_toggle_cb), pipeline); + G_CALLBACK (scrub_toggle_cb), app); g_signal_connect (G_OBJECT (play_scrub_checkbox), "toggled", - G_CALLBACK (play_scrub_toggle_cb), pipeline); + G_CALLBACK (play_scrub_toggle_cb), app); g_signal_connect (G_OBJECT (skip_checkbox), "toggled", - G_CALLBACK (skip_toggle_cb), pipeline); + G_CALLBACK (skip_toggle_cb), app); g_signal_connect (G_OBJECT (rate_spinbutton), "value-changed", - G_CALLBACK (rate_spinbutton_changed_cb), pipeline); + G_CALLBACK (rate_spinbutton_changed_cb), app); - g_signal_connect (G_OBJECT (window), "delete-event", delete_event_cb, NULL); + g_signal_connect (G_OBJECT (app->window), "delete-event", + G_CALLBACK (delete_event_cb), app); +} + +static void +set_defaults (SeekApp * app) +{ + memset (app, 0, sizeof (SeekApp)); + + app->flush_seek = TRUE; + app->scrub = TRUE; + app->rate = 1.0; + + app->position = app->duration = -1; + app->state = GST_STATE_NULL; + + app->need_streams = TRUE; + + g_static_mutex_init (&app->state_mutex); + + app->play_rate = 1.0; +} + +static void +reset_app (SeekApp * app) +{ + g_free (app->audiosink_str); + g_free (app->videosink_str); + + g_static_mutex_free (&app->state_mutex); + + if (app->xoverlay_element) + gst_object_unref (app->xoverlay_element); + if (app->navigation_element) + gst_object_unref (app->navigation_element); + + g_list_foreach (app->paths, (GFunc) g_free, NULL); + g_list_free (app->paths); + + g_print ("free pipeline\n"); + gst_object_unref (app->pipeline); +} + +int +main (int argc, char **argv) +{ + SeekApp app; + GOptionEntry options[] = { + {"stats", 's', 0, G_OPTION_ARG_NONE, &app.stats, + "Show pad stats", NULL}, + {"verbose", 'v', 0, G_OPTION_ARG_NONE, &app.verbose, + "Verbose properties", NULL}, + {NULL} + }; + GOptionContext *ctx; + GError *err = NULL; + + set_defaults (&app); + +#if !GLIB_CHECK_VERSION (2, 31, 0) + if (!g_thread_supported ()) + g_thread_init (NULL); +#endif + + ctx = g_option_context_new ("- test seeking in gsteamer"); + g_option_context_add_main_entries (ctx, options, NULL); + g_option_context_add_group (ctx, gst_init_get_option_group ()); + g_option_context_add_group (ctx, gtk_get_option_group (TRUE)); + + if (!g_option_context_parse (ctx, &argc, &argv, &err)) { + g_print ("Error initializing: %s\n", err->message); + exit (1); + } + + GST_DEBUG_CATEGORY_INIT (seek_debug, "seek", 0, "seek example"); + + if (argc != 3) { + print_usage (argc, argv); + exit (-1); + } + + app.pipeline_type = atoi (argv[1]); + + if (app.pipeline_type < 0 || app.pipeline_type >= G_N_ELEMENTS (pipelines)) { + print_usage (argc, argv); + exit (-1); + } + + app.pipeline_spec = argv[2]; + + if (g_path_is_absolute (app.pipeline_spec) && + (g_strrstr (app.pipeline_spec, "*") != NULL || + g_strrstr (app.pipeline_spec, "?") != NULL)) { + app.paths = handle_wildcards (app.pipeline_spec); + } else { + app.paths = g_list_prepend (app.paths, g_strdup (app.pipeline_spec)); + } + + if (!app.paths) { + g_print ("opening %s failed\n", app.pipeline_spec); + exit (-1); + } + + app.current_path = app.paths; + + pipelines[app.pipeline_type].func (&app, app.current_path->data); + g_assert (app.pipeline); + + create_ui (&app); /* show the gui. */ - gtk_widget_show_all (window); + gtk_widget_show_all (app.window); /* realize window now so that the video window gets created and we can * obtain its XID before the pipeline is started up and the videosink * asks for the XID of the window to render onto */ - gtk_widget_realize (window); + gtk_widget_realize (app.window); #if defined (GDK_WINDOWING_X11) || defined (GDK_WINDOWING_WIN32) || defined (GDK_WINDOWING_QUARTZ) /* we should have the XID now */ - g_assert (embed_xid != 0); + g_assert (app.embed_xid != 0); - if (pipeline_type == 16) { - gst_x_overlay_set_window_handle (GST_X_OVERLAY (pipeline), embed_xid); - gst_x_overlay_handle_events (GST_X_OVERLAY (pipeline), FALSE); + if (app.pipeline_type == 0) { + gst_x_overlay_set_window_handle (GST_X_OVERLAY (app.pipeline), + app.embed_xid); + gst_x_overlay_handle_events (GST_X_OVERLAY (app.pipeline), FALSE); } #endif - if (verbose) { - g_signal_connect (pipeline, "deep_notify", + if (app.verbose) { + g_signal_connect (app.pipeline, "deep_notify", G_CALLBACK (gst_object_default_deep_notify), NULL); } - connect_bus_signals (pipeline); + connect_bus_signals (&app); + gtk_main (); g_print ("NULL pipeline\n"); - gst_element_set_state (pipeline, GST_STATE_NULL); + gst_element_set_state (app.pipeline, GST_STATE_NULL); - if (xoverlay_element) - gst_object_unref (xoverlay_element); - if (navigation_element) - gst_object_unref (navigation_element); - - g_print ("free pipeline\n"); - gst_object_unref (pipeline); - - g_list_foreach (paths, (GFunc) g_free, NULL); - g_list_free (paths); + reset_app (&app); return 0; } From c672ffea77af58c9c6f71dc2a107a386dfd6f7da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 Feb 2012 12:00:41 +0100 Subject: [PATCH 32/50] seek: Change the volume/mute widgets from the main thread And also connect to notify::mute to get notified about mute changes. --- tests/examples/seek/seek.c | 43 +++++++++++++++++++++++++++++++++++--- 1 file changed, 40 insertions(+), 3 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index a5f8460bc5..fc99a3e315 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -174,9 +174,11 @@ typedef struct } SeekApp; static void clear_streams (SeekApp * app); +static void find_interface_elements (SeekApp * app); static void volume_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app); -static void find_interface_elements (SeekApp * app); +static void mute_notify_cb (GstElement * pipeline, GParamSpec * arg, + SeekApp * app); /* pipeline construction */ @@ -233,6 +235,7 @@ make_playbin2_pipeline (SeekApp * app, const gchar * location) g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb), app); + g_signal_connect (pipeline, "notify::mute", G_CALLBACK (mute_notify_cb), app); app->navigation_element = GST_ELEMENT (gst_object_ref (pipeline)); app->colorbalance_element = GST_ELEMENT (gst_object_ref (pipeline)); @@ -1152,8 +1155,8 @@ volume_spinbutton_changed_cb (GtkSpinButton * button, SeekApp * app) g_object_set (app->pipeline, "volume", volume, NULL); } -static void -volume_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app) +static gboolean +volume_notify_idle_cb (SeekApp * app) { gdouble cur_volume, new_volume; @@ -1168,6 +1171,40 @@ volume_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app) g_signal_handlers_unblock_by_func (app->volume_spinbutton, volume_spinbutton_changed_cb, app); } + + return FALSE; +} + +static void +volume_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app) +{ + /* Do this from the main thread */ + g_idle_add ((GSourceFunc) volume_notify_idle_cb, app); +} + +static gboolean +mute_notify_idle_cb (SeekApp * app) +{ + gboolean cur_mute, new_mute; + + g_object_get (app->pipeline, "mute", &new_mute, NULL); + cur_mute = + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (app->mute_checkbox)); + if (cur_mute != new_mute) { + g_signal_handlers_block_by_func (app->mute_checkbox, mute_toggle_cb, app); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->mute_checkbox), + new_mute); + g_signal_handlers_unblock_by_func (app->mute_checkbox, mute_toggle_cb, app); + } + + return FALSE; +} + +static void +mute_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app) +{ + /* Do this from the main thread */ + g_idle_add ((GSourceFunc) mute_notify_idle_cb, app); } static void From 8e46431836c04127e34255c2d7750e85439c9bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 Feb 2012 12:03:34 +0100 Subject: [PATCH 33/50] seek: Use the same adjustment for the color balance scales as for the seek scale --- tests/examples/seek/seek.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index fc99a3e315..da778e511a 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1497,7 +1497,7 @@ colorbalance_value_changed (GtkRange * range, SeekApp * app) val = gtk_range_get_value (range); - g_print ("colorbalance %s value changed %lf\n", label, val / 100.); + g_print ("colorbalance %s value changed %lf\n", label, val / N_GRAD); if (!app->colorbalance_element) { find_interface_elements (app); @@ -1522,7 +1522,7 @@ colorbalance_value_changed (GtkRange * range, SeekApp * app) ival = (gint) (0.5 + channel->min_value + - (val / 100.0) * ((gdouble) channel->max_value - + (val / N_GRAD) * ((gdouble) channel->max_value - (gdouble) channel->min_value)); gst_color_balance_set_value (GST_COLOR_BALANCE (app->colorbalance_element), channel, ival); @@ -2437,7 +2437,8 @@ create_ui (SeekApp * app) /* contrast scale */ frame = gtk_frame_new ("Contrast"); adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + GTK_ADJUSTMENT (gtk_adjustment_new (N_GRAD / 2.0, 0.00, N_GRAD, 0.1, + 1.0, 1.0)); app->contrast_scale = gtk_hscale_new (adjustment); gtk_scale_set_draw_value (GTK_SCALE (app->contrast_scale), FALSE); g_signal_connect (app->contrast_scale, "value-changed", @@ -2448,7 +2449,8 @@ create_ui (SeekApp * app) /* brightness scale */ frame = gtk_frame_new ("Brightness"); adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + GTK_ADJUSTMENT (gtk_adjustment_new (N_GRAD / 2.0, 0.00, N_GRAD, 0.1, + 1.0, 1.0)); app->brightness_scale = gtk_hscale_new (adjustment); gtk_scale_set_draw_value (GTK_SCALE (app->brightness_scale), FALSE); g_signal_connect (app->brightness_scale, "value-changed", @@ -2459,7 +2461,8 @@ create_ui (SeekApp * app) /* hue scale */ frame = gtk_frame_new ("Hue"); adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + GTK_ADJUSTMENT (gtk_adjustment_new (N_GRAD / 2.0, 0.00, N_GRAD, 0.1, + 1.0, 1.0)); app->hue_scale = gtk_hscale_new (adjustment); gtk_scale_set_draw_value (GTK_SCALE (app->hue_scale), FALSE); g_signal_connect (app->hue_scale, "value-changed", @@ -2470,7 +2473,8 @@ create_ui (SeekApp * app) /* saturation scale */ frame = gtk_frame_new ("Saturation"); adjustment = - GTK_ADJUSTMENT (gtk_adjustment_new (50.0, 0.0, 101.0, 1.0, 1.0, 1.0)); + GTK_ADJUSTMENT (gtk_adjustment_new (N_GRAD / 2.0, 0.00, N_GRAD, 0.1, + 1.0, 1.0)); app->saturation_scale = gtk_hscale_new (adjustment); gtk_scale_set_draw_value (GTK_SCALE (app->saturation_scale), FALSE); g_signal_connect (app->saturation_scale, "value-changed", From 9a627ed0713b70429fc2d41d04321264e04c10e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 Feb 2012 12:09:31 +0100 Subject: [PATCH 34/50] seek: Let the XOverlay element handle events Need for proper resizing. --- tests/examples/seek/seek.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index da778e511a..ac3efa134d 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -1865,7 +1865,6 @@ bus_sync_handler (GstBus * bus, GstMessage * message, SeekApp * app) g_assert (app->embed_xid != 0); gst_x_overlay_set_window_handle (GST_X_OVERLAY (element), app->embed_xid); - gst_x_overlay_handle_events (GST_X_OVERLAY (element), FALSE); find_interface_elements (app); } @@ -2813,7 +2812,6 @@ main (int argc, char **argv) if (app.pipeline_type == 0) { gst_x_overlay_set_window_handle (GST_X_OVERLAY (app.pipeline), app.embed_xid); - gst_x_overlay_handle_events (GST_X_OVERLAY (app.pipeline), FALSE); } #endif From 0cb4ccb1f09d39820682e052fc106f5fd7fa1309 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Fri, 24 Feb 2012 21:37:00 +0100 Subject: [PATCH 35/50] interfaces: fix ABI class padding after the recent changes --- gst-libs/gst/interfaces/colorbalance.h | 2 +- gst-libs/gst/interfaces/mixer.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/interfaces/colorbalance.h b/gst-libs/gst/interfaces/colorbalance.h index fd8ceaa51c..9f0a1cd839 100644 --- a/gst-libs/gst/interfaces/colorbalance.h +++ b/gst-libs/gst/interfaces/colorbalance.h @@ -102,7 +102,7 @@ struct _GstColorBalanceClass { GstColorBalanceType (*get_balance_type) (GstColorBalance *balance); /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; + gpointer _gst_reserved[GST_PADDING-1]; }; GType gst_color_balance_get_type (void); diff --git a/gst-libs/gst/interfaces/mixer.h b/gst-libs/gst/interfaces/mixer.h index b2a199c2b1..491c14c1be 100644 --- a/gst-libs/gst/interfaces/mixer.h +++ b/gst-libs/gst/interfaces/mixer.h @@ -172,7 +172,7 @@ struct _GstMixerClass { GstMixerType (* get_mixer_type) (GstMixer *mixer); /*< private >*/ - gpointer _gst_reserved[GST_PADDING]; + gpointer _gst_reserved[GST_PADDING-2]; }; GType gst_mixer_get_type (void); From 3fd82178980c982dfd747feb2fa36e646ae854b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 25 Feb 2012 15:21:30 +0000 Subject: [PATCH 36/50] appsink: implement SEEKING query We don't support seeking (in the sense that upstream can make us jump back and forth to certain offsets in the output). --- gst-libs/gst/app/gstappsink.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/gst-libs/gst/app/gstappsink.c b/gst-libs/gst/app/gstappsink.c index 9a891b6c9e..871d6f0ae1 100644 --- a/gst-libs/gst/app/gstappsink.c +++ b/gst-libs/gst/app/gstappsink.c @@ -158,6 +158,7 @@ static gboolean gst_app_sink_unlock_stop (GstBaseSink * bsink); static gboolean gst_app_sink_start (GstBaseSink * psink); static gboolean gst_app_sink_stop (GstBaseSink * psink); static gboolean gst_app_sink_event (GstBaseSink * sink, GstEvent * event); +static gboolean gst_app_sink_query (GstBaseSink * bsink, GstQuery * query); static GstFlowReturn gst_app_sink_preroll (GstBaseSink * psink, GstBuffer * buffer); static GstFlowReturn gst_app_sink_render_common (GstBaseSink * psink, @@ -436,6 +437,7 @@ gst_app_sink_class_init (GstAppSinkClass * klass) basesink_class->render = gst_app_sink_render; basesink_class->render_list = gst_app_sink_render_list; basesink_class->get_caps = gst_app_sink_getcaps; + basesink_class->query = gst_app_sink_query; klass->pull_preroll = gst_app_sink_pull_preroll; klass->pull_buffer = gst_app_sink_pull_buffer; @@ -875,6 +877,30 @@ gst_app_sink_getcaps (GstBaseSink * psink) return caps; } +static gboolean +gst_app_sink_query (GstBaseSink * bsink, GstQuery * query) +{ + gboolean ret; + + switch (GST_QUERY_TYPE (query)) { + case GST_QUERY_SEEKING:{ + GstFormat fmt; + + /* we don't supporting seeking */ + gst_query_parse_seeking (query, &fmt, NULL, NULL, NULL); + gst_query_set_seeking (query, fmt, FALSE, 0, -1); + ret = TRUE; + break; + } + + default: + ret = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query); + break; + } + + return ret; +} + static GstMiniObject * gst_app_sink_pull_object (GstAppSink * appsink) { From 5db562f13b77ea6040d9b9bc87c5277a0b745b9d Mon Sep 17 00:00:00 2001 From: Alessandro Decina Date: Sun, 26 Feb 2012 20:32:05 +0100 Subject: [PATCH 37/50] theoraenc: fix compiler warning --- ext/theora/gsttheoraenc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/theora/gsttheoraenc.c b/ext/theora/gsttheoraenc.c index de2fcfeab6..bff2384804 100644 --- a/ext/theora/gsttheoraenc.c +++ b/ext/theora/gsttheoraenc.c @@ -1399,7 +1399,7 @@ theora_enc_encode_and_push (GstTheoraEnc * enc, ogg_packet op, GstClockTime next_time, duration; GstClockTime timestamp = 0; GST_DEBUG_OBJECT (enc, "encoded. granule:%" G_GINT64_FORMAT ", packet:%p, " - "bytes:%ld", op.granulepos, op.packet, op.bytes); + "bytes:%ld", (gint64) op.granulepos, op.packet, op.bytes); next_time = th_granule_time (enc->encoder, op.granulepos) * GST_SECOND; duration = next_time - enc->next_ts; From 92ebd6bd2ae8d846b403cff1ceb15d05a8609630 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 26 Feb 2012 17:46:24 +0000 Subject: [PATCH 38/50] videoscale: fix videoscale test for new methods Not all scaling methods are supported for all formats, so can't just iterate over the template caps. --- tests/check/elements/videoscale.c | 108 +++++++++++++++++------------- 1 file changed, 63 insertions(+), 45 deletions(-) diff --git a/tests/check/elements/videoscale.c b/tests/check/elements/videoscale.c index f297efc413..fc528f1bd6 100644 --- a/tests/check/elements/videoscale.c +++ b/tests/check/elements/videoscale.c @@ -30,20 +30,20 @@ #define LINK_CHECK_FLAGS GST_PAD_LINK_CHECK_NOTHING static GstCaps ** -videoscale_get_allowed_caps (void) +videoscale_get_allowed_caps_for_method (int method) { - GstElement *scale = gst_element_factory_make ("videoscale", "scale"); - GstPadTemplate *templ; + GstElement *scale; GstCaps *caps, **ret; + GstPad *pad; GstStructure *s; gint i, n; - templ = - gst_element_class_get_pad_template (GST_ELEMENT_GET_CLASS (scale), - "sink"); - fail_unless (templ != NULL); - - caps = gst_pad_template_get_caps (templ); + scale = gst_element_factory_make ("videoscale", "vscale"); + g_object_set (scale, "method", method, NULL); + pad = gst_element_get_static_pad (scale, "sink"); + caps = gst_pad_get_caps (pad); + gst_object_unref (pad); + gst_object_unref (scale); n = gst_caps_get_size (caps); ret = g_new0 (GstCaps *, n + 1); @@ -52,10 +52,10 @@ videoscale_get_allowed_caps (void) s = gst_caps_get_structure (caps, i); ret[i] = gst_caps_new_empty (); gst_caps_append_structure (ret[i], gst_structure_copy (s)); + GST_LOG ("method %d supports: %" GST_PTR_FORMAT, method, s); } - gst_object_unref (scale); - + gst_caps_unref (caps); return ret; } @@ -206,52 +206,50 @@ on_src_handoff_passthrough (GstElement * element, GstBuffer * buffer, *list = g_list_prepend (*list, gst_buffer_ref (buffer)); } -GST_START_TEST (test_passthrough) +static void +test_passthrough (int method) { GList *l1, *l2, *src_buffers = NULL, *sink_buffers = NULL; GstCaps **allowed_caps = NULL, **p; - gint method; static const gint src_width = 640, src_height = 480; static const gint dest_width = 640, dest_height = 480; - p = allowed_caps = videoscale_get_allowed_caps (); + p = allowed_caps = videoscale_get_allowed_caps_for_method (method); while (*p) { GstCaps *caps = *p; - for (method = 0; method < 3; method++) { - /* skip formats that ffmpegcolorspace can't handle */ - if (caps_are_64bpp (caps)) - continue; + /* skip formats that ffmpegcolorspace can't handle */ + if (caps_are_64bpp (caps)) + continue; - GST_DEBUG ("Running test for caps '%" GST_PTR_FORMAT "'" - " from %dx%u to %dx%d with method %d", caps, src_width, src_height, - dest_width, dest_height, method); - run_test (caps, src_width, src_height, - dest_width, dest_height, method, - G_CALLBACK (on_src_handoff_passthrough), &src_buffers, - G_CALLBACK (on_sink_handoff_passthrough), &sink_buffers); + GST_DEBUG ("Running test for caps '%" GST_PTR_FORMAT "'" + " from %dx%u to %dx%d with method %d", caps, src_width, src_height, + dest_width, dest_height, method); + run_test (caps, src_width, src_height, + dest_width, dest_height, method, + G_CALLBACK (on_src_handoff_passthrough), &src_buffers, + G_CALLBACK (on_sink_handoff_passthrough), &sink_buffers); - fail_unless (src_buffers && sink_buffers); - fail_unless_equals_int (g_list_length (src_buffers), - g_list_length (sink_buffers)); + fail_unless (src_buffers && sink_buffers); + fail_unless_equals_int (g_list_length (src_buffers), + g_list_length (sink_buffers)); - for (l1 = src_buffers, l2 = sink_buffers; l1 && l2; - l1 = l1->next, l2 = l2->next) { - GstBuffer *a = l1->data; - GstBuffer *b = l2->data; + for (l1 = src_buffers, l2 = sink_buffers; l1 && l2; + l1 = l1->next, l2 = l2->next) { + GstBuffer *a = l1->data; + GstBuffer *b = l2->data; - fail_unless_equals_int (GST_BUFFER_SIZE (a), GST_BUFFER_SIZE (b)); - fail_unless (GST_BUFFER_DATA (a) == GST_BUFFER_DATA (b)); + fail_unless_equals_int (GST_BUFFER_SIZE (a), GST_BUFFER_SIZE (b)); + fail_unless (GST_BUFFER_DATA (a) == GST_BUFFER_DATA (b)); - gst_buffer_unref (a); - gst_buffer_unref (b); - } - g_list_free (src_buffers); - src_buffers = NULL; - g_list_free (sink_buffers); - sink_buffers = NULL; + gst_buffer_unref (a); + gst_buffer_unref (b); } + g_list_free (src_buffers); + src_buffers = NULL; + g_list_free (sink_buffers); + sink_buffers = NULL; gst_caps_unref (caps); p++; @@ -259,6 +257,25 @@ GST_START_TEST (test_passthrough) g_free (allowed_caps); } +GST_START_TEST (test_passthrough_method_0) +{ + test_passthrough (0); +} + +GST_END_TEST; + +GST_START_TEST (test_passthrough_method_1) +{ + test_passthrough (1); +} + +GST_END_TEST; + +GST_START_TEST (test_passthrough_method_2) +{ + test_passthrough (2); +} + GST_END_TEST; #define CREATE_TEST(name,method,src_width,src_height,dest_width,dest_height) \ @@ -266,7 +283,7 @@ GST_START_TEST (name) \ { \ GstCaps **allowed_caps = NULL, **p; \ \ - p = allowed_caps = videoscale_get_allowed_caps (); \ + p = allowed_caps = videoscale_get_allowed_caps_for_method (method); \ \ while (*p) { \ GstCaps *caps = *p; \ @@ -642,8 +659,7 @@ gst_test_reverse_negotiation_sink_base_init (gpointer g_class) "Test Reverse Negotiation Sink", "Sink", "Some test sink", "Sebastian Dröge "); - gst_element_class_add_static_pad_template (gstelement_class, - &sinktemplate); + gst_element_class_add_static_pad_template (gstelement_class, &sinktemplate); } static void @@ -818,7 +834,9 @@ videoscale_suite (void) suite_add_tcase (s, tc_chain); tcase_set_timeout (tc_chain, 180); - tcase_add_test (tc_chain, test_passthrough); + tcase_add_test (tc_chain, test_passthrough_method_0); + tcase_add_test (tc_chain, test_passthrough_method_1); + tcase_add_test (tc_chain, test_passthrough_method_2); tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_0); tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_1); tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_2); From 63d1316c0fd4ce22cf4a53f4aa7cb1ca16a07aa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 26 Feb 2012 18:19:57 +0000 Subject: [PATCH 39/50] videoscale: fix negotiation after addition of new formats and methods Now that we no longer support all methods for all formats, we need to cater for that in the transform function: we can't transform formats not supported by the currently-selected mehod. make check, folks. It's da bomb. --- gst/videoscale/gstvideoscale.c | 125 ++++++++++++++++++++++++++++++ tests/check/elements/videoscale.c | 4 +- 2 files changed, 128 insertions(+), 1 deletion(-) diff --git a/gst/videoscale/gstvideoscale.c b/gst/videoscale/gstvideoscale.c index 9f072a3458..60dd5ff65b 100644 --- a/gst/videoscale/gstvideoscale.c +++ b/gst/videoscale/gstvideoscale.c @@ -424,10 +424,118 @@ gst_video_scale_get_property (GObject * object, guint prop_id, GValue * value, } } +#define NEAREST (1 << GST_VIDEO_SCALE_NEAREST) +#define BILINEAR (1 << GST_VIDEO_SCALE_BILINEAR) +#define FOURTAP (1 << GST_VIDEO_SCALE_4TAP) +#define LANCZOS (1 << GST_VIDEO_SCALE_LANCZOS) + +/* or we could just do lookups via table[format] if we could be bothered.. */ +static const struct +{ + GstVideoFormat format; + guint8 methods; +} formats_methods_table[] = { + { + GST_VIDEO_FORMAT_RGBx, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_xRGB, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_BGRx, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_xBGR, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_RGBA, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_ARGB, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_BGRA, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_ABGR, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_AYUV, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_ARGB64, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_AYUV64, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_RGB, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_BGR, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_v308, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_YUY2, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_YVYU, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_UYVY, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_Y800, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_GRAY8, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_GRAY16_LE, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_GRAY16_BE, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_Y16, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_I420, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_YV12, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_Y444, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_Y42B, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_Y41B, NEAREST | BILINEAR | FOURTAP | LANCZOS}, { + GST_VIDEO_FORMAT_NV12, NEAREST | BILINEAR}, { + GST_VIDEO_FORMAT_RGB16, NEAREST | BILINEAR | FOURTAP}, { + GST_VIDEO_FORMAT_RGB15, NEAREST | BILINEAR | FOURTAP} +}; + +static gboolean +gst_video_scale_format_supported_for_method (GstVideoFormat format, + GstVideoScaleMethod method) +{ + int i; + + for (i = 0; i < G_N_ELEMENTS (formats_methods_table); ++i) { + if (formats_methods_table[i].format == format) + return ((formats_methods_table[i].methods & (1 << method)) != 0); + } + return FALSE; +} + +static gboolean +gst_video_scale_transform_supported (GstVideoScale * videoscale, + GstVideoScaleMethod method, GstStructure * structure) +{ + const GValue *val; + GstVideoFormat fmt; + gboolean supported = TRUE; + GstStructure *s; + GstCaps *c; + + /* we support these methods for all formats */ + if (method == GST_VIDEO_SCALE_NEAREST || method == GST_VIDEO_SCALE_BILINEAR) + return TRUE; + + /* we need fixed caps if we want to use gst_video_parse_caps() */ + s = gst_structure_new (gst_structure_get_name (structure), + "width", G_TYPE_INT, 1, "height", G_TYPE_INT, 1, NULL); + + if ((val = gst_structure_get_value (structure, "format"))) { + gst_structure_set_value (s, "format", val); + } else { + if ((val = gst_structure_get_value (structure, "endianness"))) + gst_structure_set_value (s, "endianness", val); + if ((val = gst_structure_get_value (structure, "red_mask"))) + gst_structure_set_value (s, "red_mask", val); + if ((val = gst_structure_get_value (structure, "blue_mask"))) + gst_structure_set_value (s, "blue_mask", val); + if ((val = gst_structure_get_value (structure, "green_mask"))) + gst_structure_set_value (s, "green_mask", val); + if ((val = gst_structure_get_value (structure, "alpha_mask"))) + gst_structure_set_value (s, "alpha_mask", val); + if ((val = gst_structure_get_value (structure, "depth"))) + gst_structure_set_value (s, "depth", val); + if ((val = gst_structure_get_value (structure, "bpp"))) + gst_structure_set_value (s, "bpp", val); + } + c = gst_caps_new_full (s, NULL); + if (!gst_video_format_parse_caps (c, &fmt, NULL, NULL)) { + GST_ERROR_OBJECT (videoscale, "couldn't parse %" GST_PTR_FORMAT, c); + } else if (!gst_video_scale_format_supported_for_method (fmt, method)) { + supported = FALSE; + } + GST_LOG_OBJECT (videoscale, "method %d %ssupported for format %d", + method, (supported) ? "" : "not ", fmt); + gst_caps_unref (c); + + return supported; +} + static GstCaps * gst_video_scale_transform_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps) { + GstVideoScale *videoscale = GST_VIDEO_SCALE (trans); + GstVideoScaleMethod method; GstCaps *ret; GstStructure *structure; @@ -441,6 +549,13 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, ret = gst_caps_copy (caps); structure = gst_structure_copy (gst_caps_get_structure (ret, 0)); + GST_OBJECT_LOCK (videoscale); + method = videoscale->method; + GST_OBJECT_UNLOCK (videoscale); + + if (!gst_video_scale_transform_supported (videoscale, method, structure)) + goto format_not_supported; + gst_structure_set (structure, "width", GST_TYPE_INT_RANGE, 1, G_MAXINT, "height", GST_TYPE_INT_RANGE, 1, G_MAXINT, NULL); @@ -452,9 +567,19 @@ gst_video_scale_transform_caps (GstBaseTransform * trans, } gst_caps_append_structure (ret, structure); +done: + GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret); return ret; + +format_not_supported: + { + gst_structure_free (structure); + gst_caps_unref (ret); + ret = gst_caps_new_empty (); + goto done; + } } static gboolean diff --git a/tests/check/elements/videoscale.c b/tests/check/elements/videoscale.c index fc528f1bd6..e2b65628a1 100644 --- a/tests/check/elements/videoscale.c +++ b/tests/check/elements/videoscale.c @@ -221,7 +221,7 @@ test_passthrough (int method) /* skip formats that ffmpegcolorspace can't handle */ if (caps_are_64bpp (caps)) - continue; + goto skip; GST_DEBUG ("Running test for caps '%" GST_PTR_FORMAT "'" " from %dx%u to %dx%d with method %d", caps, src_width, src_height, @@ -251,6 +251,8 @@ test_passthrough (int method) g_list_free (sink_buffers); sink_buffers = NULL; + skip: + gst_caps_unref (caps); p++; } From 2b0b1e4ece64ebdfae016d31a62695043ed14a61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 26 Feb 2012 23:35:06 +0000 Subject: [PATCH 40/50] tests: add some videoscale tests for new Lanczos-based method Some crash. Others show invalid memory access in valgrind. --- tests/check/elements/videoscale.c | 39 +++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/tests/check/elements/videoscale.c b/tests/check/elements/videoscale.c index e2b65628a1..557253309f 100644 --- a/tests/check/elements/videoscale.c +++ b/tests/check/elements/videoscale.c @@ -280,6 +280,13 @@ GST_START_TEST (test_passthrough_method_2) GST_END_TEST; +GST_START_TEST (test_passthrough_method_3) +{ + test_passthrough (3); +} + +GST_END_TEST; + #define CREATE_TEST(name,method,src_width,src_height,dest_width,dest_height) \ GST_START_TEST (name) \ { \ @@ -307,39 +314,51 @@ GST_END_TEST; CREATE_TEST (test_downscale_640x480_320x240_method_0, 0, 640, 480, 320, 240); CREATE_TEST (test_downscale_640x480_320x240_method_1, 1, 640, 480, 320, 240); CREATE_TEST (test_downscale_640x480_320x240_method_2, 2, 640, 480, 320, 240); +CREATE_TEST (test_downscale_640x480_320x240_method_3, 3, 640, 480, 320, 240); CREATE_TEST (test_upscale_320x240_640x480_method_0, 0, 320, 240, 640, 480); CREATE_TEST (test_upscale_320x240_640x480_method_1, 1, 320, 240, 640, 480); CREATE_TEST (test_upscale_320x240_640x480_method_2, 2, 320, 240, 640, 480); +CREATE_TEST (test_upscale_320x240_640x480_method_3, 3, 320, 240, 640, 480); CREATE_TEST (test_downscale_640x480_1x1_method_0, 0, 640, 480, 1, 1); CREATE_TEST (test_downscale_640x480_1x1_method_1, 1, 640, 480, 1, 1); CREATE_TEST (test_downscale_640x480_1x1_method_2, 2, 640, 480, 1, 1); +CREATE_TEST (test_downscale_640x480_1x1_method_3, 3, 640, 480, 1, 1); CREATE_TEST (test_upscale_1x1_640x480_method_0, 0, 1, 1, 640, 480); CREATE_TEST (test_upscale_1x1_640x480_method_1, 1, 1, 1, 640, 480); CREATE_TEST (test_upscale_1x1_640x480_method_2, 2, 1, 1, 640, 480); +CREATE_TEST (test_upscale_1x1_640x480_method_3, 3, 1, 1, 640, 480); CREATE_TEST (test_downscale_641x481_111x30_method_0, 0, 641, 481, 111, 30); CREATE_TEST (test_downscale_641x481_111x30_method_1, 1, 641, 481, 111, 30); CREATE_TEST (test_downscale_641x481_111x30_method_2, 2, 641, 481, 111, 30); +CREATE_TEST (test_downscale_641x481_111x30_method_3, 3, 641, 481, 111, 30); CREATE_TEST (test_upscale_111x30_641x481_method_0, 0, 111, 30, 641, 481); CREATE_TEST (test_upscale_111x30_641x481_method_1, 1, 111, 30, 641, 481); CREATE_TEST (test_upscale_111x30_641x481_method_2, 2, 111, 30, 641, 481); +CREATE_TEST (test_upscale_111x30_641x481_method_3, 2, 111, 30, 641, 481); CREATE_TEST (test_downscale_641x481_30x111_method_0, 0, 641, 481, 30, 111); CREATE_TEST (test_downscale_641x481_30x111_method_1, 1, 641, 481, 30, 111); CREATE_TEST (test_downscale_641x481_30x111_method_2, 2, 641, 481, 30, 111); +CREATE_TEST (test_downscale_641x481_30x111_method_3, 3, 641, 481, 30, 111); CREATE_TEST (test_upscale_30x111_641x481_method_0, 0, 30, 111, 641, 481); CREATE_TEST (test_upscale_30x111_641x481_method_1, 1, 30, 111, 641, 481); CREATE_TEST (test_upscale_30x111_641x481_method_2, 2, 30, 111, 641, 481); +CREATE_TEST (test_upscale_30x111_641x481_method_3, 3, 30, 111, 641, 481); CREATE_TEST (test_downscale_640x480_320x1_method_0, 0, 640, 480, 320, 1); CREATE_TEST (test_downscale_640x480_320x1_method_1, 1, 640, 480, 320, 1); CREATE_TEST (test_downscale_640x480_320x1_method_2, 2, 640, 480, 320, 1); +CREATE_TEST (test_downscale_640x480_320x1_method_3, 3, 640, 480, 320, 1); CREATE_TEST (test_upscale_320x1_640x480_method_0, 0, 320, 1, 640, 480); CREATE_TEST (test_upscale_320x1_640x480_method_1, 1, 320, 1, 640, 480); CREATE_TEST (test_upscale_320x1_640x480_method_2, 2, 320, 1, 640, 480); +CREATE_TEST (test_upscale_320x1_640x480_method_3, 3, 320, 1, 640, 480); CREATE_TEST (test_downscale_640x480_1x240_method_0, 0, 640, 480, 1, 240); CREATE_TEST (test_downscale_640x480_1x240_method_1, 1, 640, 480, 1, 240); CREATE_TEST (test_downscale_640x480_1x240_method_2, 2, 640, 480, 1, 240); +CREATE_TEST (test_downscale_640x480_1x240_method_3, 3, 640, 480, 1, 240); CREATE_TEST (test_upscale_1x240_640x480_method_0, 0, 1, 240, 640, 480); CREATE_TEST (test_upscale_1x240_640x480_method_1, 1, 1, 240, 640, 480); CREATE_TEST (test_upscale_1x240_640x480_method_2, 2, 1, 240, 640, 480); +CREATE_TEST (test_upscale_1x240_640x480_method_3, 3, 1, 240, 640, 480); typedef struct { @@ -828,6 +847,13 @@ GST_START_TEST (test_basetransform_negotiation) GST_END_TEST; +#ifndef tcase_skip_broken_test +#define tcase_skip_broken_test(chain,test_func) \ + if (0) { tcase_add_test(chain,test_func); } else { \ + GST_ERROR ("FIXME: skipping test %s because it's broken.", G_STRINGIFY (test_func)); \ + } +#endif + static Suite * videoscale_suite (void) { @@ -839,42 +865,55 @@ videoscale_suite (void) tcase_add_test (tc_chain, test_passthrough_method_0); tcase_add_test (tc_chain, test_passthrough_method_1); tcase_add_test (tc_chain, test_passthrough_method_2); + tcase_add_test (tc_chain, test_passthrough_method_3); tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_0); tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_1); tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_2); + tcase_add_test (tc_chain, test_downscale_640x480_320x240_method_3); tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_0); tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_1); tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_2); + tcase_add_test (tc_chain, test_upscale_320x240_640x480_method_3); tcase_add_test (tc_chain, test_downscale_640x480_1x1_method_0); tcase_add_test (tc_chain, test_downscale_640x480_1x1_method_1); tcase_add_test (tc_chain, test_downscale_640x480_1x1_method_2); + tcase_skip_broken_test (tc_chain, test_downscale_640x480_1x1_method_3); tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_0); tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_1); tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_2); + tcase_add_test (tc_chain, test_upscale_1x1_640x480_method_3); tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_0); tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_1); tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_2); + tcase_add_test (tc_chain, test_downscale_641x481_111x30_method_3); tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_0); tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_1); tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_2); + tcase_add_test (tc_chain, test_upscale_111x30_641x481_method_3); tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_0); tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_1); tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_2); + tcase_add_test (tc_chain, test_downscale_641x481_30x111_method_3); tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_0); tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_1); tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_2); + tcase_add_test (tc_chain, test_upscale_30x111_641x481_method_3); tcase_add_test (tc_chain, test_downscale_640x480_320x1_method_0); tcase_add_test (tc_chain, test_downscale_640x480_320x1_method_1); tcase_add_test (tc_chain, test_downscale_640x480_320x1_method_2); + tcase_skip_broken_test (tc_chain, test_downscale_640x480_320x1_method_3); tcase_add_test (tc_chain, test_upscale_320x1_640x480_method_0); tcase_add_test (tc_chain, test_upscale_320x1_640x480_method_1); tcase_add_test (tc_chain, test_upscale_320x1_640x480_method_2); + tcase_skip_broken_test (tc_chain, test_upscale_320x1_640x480_method_3); tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_0); tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_1); tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_2); + tcase_add_test (tc_chain, test_downscale_640x480_1x240_method_3); tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_0); tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_1); tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_2); + tcase_add_test (tc_chain, test_upscale_1x240_640x480_method_3); tcase_add_test (tc_chain, test_negotiation); tcase_add_test (tc_chain, test_reverse_negotiation); tcase_add_test (tc_chain, test_basetransform_negotiation); From 3975c10907b4a4fb53207736c6e9f57ef84c28c5 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 27 Feb 2012 09:58:18 +0100 Subject: [PATCH 41/50] adder: include event name in log message --- gst/adder/gstadder.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index f33b67b07d..2c89b1b873 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -1203,7 +1203,7 @@ gst_adder_collected (GstCollectPads2 * pads, gpointer user_data) if (event) { if (!gst_pad_push_event (adder->srcpad, event)) { - GST_WARNING_OBJECT (adder->srcpad, "Sending event failed"); + GST_WARNING_OBJECT (adder->srcpad, "Sending new segment event failed"); } } else { GST_WARNING_OBJECT (adder->srcpad, "Creating new segment event for " From 59918e841fa99152af45775c8271717b7c87721e Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Mon, 27 Feb 2012 14:28:15 +0100 Subject: [PATCH 42/50] Suppress deprecation warnings in selected files, for g_value_array_* mostly --- ext/alsa/gstalsadeviceprobe.c | 4 ++++ ext/theora/gsttheoraparse.c | 4 ++++ gst-libs/gst/audio/mixerutils.c | 4 ++++ gst/playback/gstplaybasebin.c | 4 ++++ gst/playback/gsturidecodebin.c | 4 ++++ sys/xvimage/xvimagesink.c | 4 ++++ tests/check/elements/alsa.c | 4 ++++ tests/check/elements/playbin.c | 4 ++++ tests/examples/v4l/probe.c | 4 ++++ tests/icles/test-colorkey.c | 2 ++ 10 files changed, 38 insertions(+) diff --git a/ext/alsa/gstalsadeviceprobe.c b/ext/alsa/gstalsadeviceprobe.c index 4b22d34104..337c21bcea 100644 --- a/ext/alsa/gstalsadeviceprobe.c +++ b/ext/alsa/gstalsadeviceprobe.c @@ -19,6 +19,10 @@ * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/ext/theora/gsttheoraparse.c b/ext/theora/gsttheoraparse.c index 4e356c6613..ed5e93478b 100644 --- a/ext/theora/gsttheoraparse.c +++ b/ext/theora/gsttheoraparse.c @@ -56,6 +56,10 @@ * Last reviewed on 2008-05-28 (0.10.20) */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/gst-libs/gst/audio/mixerutils.c b/gst-libs/gst/audio/mixerutils.c index 94cdde3dc7..f5004978de 100644 --- a/gst-libs/gst/audio/mixerutils.c +++ b/gst-libs/gst/audio/mixerutils.c @@ -31,6 +31,10 @@ * */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/playback/gstplaybasebin.c b/gst/playback/gstplaybasebin.c index 7ab2c29ac1..a89d649145 100644 --- a/gst/playback/gstplaybasebin.c +++ b/gst/playback/gstplaybasebin.c @@ -17,6 +17,10 @@ * Boston, MA 02111-1307, USA. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/gst/playback/gsturidecodebin.c b/gst/playback/gsturidecodebin.c index 2a5026f972..9fe1691639 100644 --- a/gst/playback/gsturidecodebin.c +++ b/gst/playback/gsturidecodebin.c @@ -24,6 +24,10 @@ * handle the given #GstURIDecodeBin:uri scheme and connects it to a decodebin2. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H # include "config.h" #endif diff --git a/sys/xvimage/xvimagesink.c b/sys/xvimage/xvimagesink.c index 0c386c161e..f20c877c01 100644 --- a/sys/xvimage/xvimagesink.c +++ b/sys/xvimage/xvimagesink.c @@ -109,6 +109,10 @@ /* for developers: there are two useful tools : xvinfo and xvattr */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H #include "config.h" #endif diff --git a/tests/check/elements/alsa.c b/tests/check/elements/alsa.c index ddd95c7321..feae0b5d29 100644 --- a/tests/check/elements/alsa.c +++ b/tests/check/elements/alsa.c @@ -20,6 +20,10 @@ * Boston, MA 02111-1307, USA. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include #include diff --git a/tests/check/elements/playbin.c b/tests/check/elements/playbin.c index c550571d9b..cc0ecd62e2 100644 --- a/tests/check/elements/playbin.c +++ b/tests/check/elements/playbin.c @@ -18,6 +18,10 @@ * Boston, MA 02111-1307, USA. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #ifdef HAVE_CONFIG_H # include #endif diff --git a/tests/examples/v4l/probe.c b/tests/examples/v4l/probe.c index 435aeac93f..c29be162b3 100644 --- a/tests/examples/v4l/probe.c +++ b/tests/examples/v4l/probe.c @@ -17,6 +17,10 @@ * Boston, MA 02111-1307, USA. */ +/* FIXME 0.11: suppress warnings for deprecated API such as GValueArray + * with newer GLib versions (>= 2.31.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS + #include #include #include diff --git a/tests/icles/test-colorkey.c b/tests/icles/test-colorkey.c index 4bd3dcb6bb..5ab1c33bfc 100644 --- a/tests/icles/test-colorkey.c +++ b/tests/icles/test-colorkey.c @@ -22,8 +22,10 @@ #ifdef HAVE_CONFIG_H #include "config.h" #endif + /* FIXME 0.11: suppress warnings for deprecated API such as GStaticRecMutex * with newer GTK versions (>= 3.3.0) */ +#define GLIB_DISABLE_DEPRECATION_WARNINGS #define GDK_DISABLE_DEPRECATION_WARNINGS #include From ce1b1d82e34b5ee9eaf6ab979799e52c6d558929 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Mon, 27 Feb 2012 11:57:55 +0100 Subject: [PATCH 43/50] adder: sink event handling fix Turn _sink_event() into the collectpads event function and merge the logic from the recently added gst_adder_event. Drop flush_start events as we allready handle them on the src-pad side. Fixes #670850. --- gst/adder/gstadder.c | 88 +++++++++++++++++--------------------------- 1 file changed, 33 insertions(+), 55 deletions(-) diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index 2c89b1b873..dfcacc4e57 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -132,7 +132,8 @@ static void gst_adder_get_property (GObject * object, guint prop_id, static gboolean gst_adder_setcaps (GstPad * pad, GstCaps * caps); static gboolean gst_adder_query (GstPad * pad, GstQuery * query); static gboolean gst_adder_src_event (GstPad * pad, GstEvent * event); -static gboolean gst_adder_sink_event (GstPad * pad, GstEvent * event); +static gboolean gst_adder_sink_event (GstCollectPads2 * pads, + GstCollectData2 * pad, GstEvent * event, gpointer user_data); static GstPad *gst_adder_request_new_pad (GstElement * element, GstPadTemplate * temp, const gchar * unused); @@ -146,8 +147,6 @@ static GstFlowReturn gst_adder_do_clip (GstCollectPads2 * pads, gpointer user_data); static GstFlowReturn gst_adder_collected (GstCollectPads2 * pads, gpointer user_data); -static gboolean gst_adder_event (GstCollectPads2 * pads, GstCollectData2 * pad, - GstEvent * event, gpointer user_data); /* non-clipping versions (for float) */ #define MAKE_FUNC_NC(name,type) \ @@ -545,6 +544,8 @@ gst_adder_query (GstPad * pad, GstQuery * query) return res; } +/* event handling */ + typedef struct { GstEvent *event; @@ -635,8 +636,8 @@ gst_adder_src_event (GstPad * pad, GstEvent * event) adder = GST_ADDER (gst_pad_get_parent (pad)); - GST_DEBUG_OBJECT (pad, "Got %s event on src pad", - GST_EVENT_TYPE_NAME (event)); + GST_DEBUG_OBJECT (pad, "Got %s event on src pad from %s", + GST_EVENT_TYPE_NAME (event), GST_OBJECT_NAME (GST_EVENT_SRC (event))); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: @@ -745,40 +746,47 @@ done: } static gboolean -gst_adder_sink_event (GstPad * pad, GstEvent * event) +gst_adder_sink_event (GstCollectPads2 * pads, GstCollectData2 * pad, + GstEvent * event, gpointer user_data) { - GstAdder *adder; - gboolean ret = TRUE; + GstAdder *adder = GST_ADDER (user_data); + gboolean res = FALSE; - adder = GST_ADDER (gst_pad_get_parent (pad)); - - GST_DEBUG_OBJECT (pad, "Got %s event on sink pad", - GST_EVENT_TYPE_NAME (event)); + GST_DEBUG_OBJECT (pad->pad, "Got %s event on sink pad from %s", + GST_EVENT_TYPE_NAME (event), GST_OBJECT_NAME (GST_EVENT_SRC (event))); switch (GST_EVENT_TYPE (event)) { + case GST_EVENT_FLUSH_START: + /* drop flush start events, as we forwarded one already when handing the + * flushing seek on the sink pad */ + gst_event_unref (event); + res = TRUE; + break; case GST_EVENT_FLUSH_STOP: - /* we received a flush-stop. The collect_event function will call the - * gst_adder_event function we have set on the GstCollectPads2, so we - * have control over whether the event is sent past our element. - * We will only forward it when flush_stop_pending is set, and we will - * unset it then. + /* we received a flush-stop. We will only forward it when + * flush_stop_pending is set, and we will unset it then. */ - GST_COLLECT_PADS2_STREAM_LOCK (adder->collect); - g_atomic_int_set (&adder->new_segment_pending, TRUE); + if (g_atomic_int_compare_and_exchange (&adder->flush_stop_pending, + TRUE, FALSE)) { + g_atomic_int_set (&adder->new_segment_pending, TRUE); + GST_DEBUG_OBJECT (pad->pad, "forwarding flush stop"); + } else { + gst_event_unref (event); + res = TRUE; + GST_DEBUG_OBJECT (pad->pad, "eating flush stop"); + } /* Clear pending tags */ if (adder->pending_events) { g_list_foreach (adder->pending_events, (GFunc) gst_event_unref, NULL); g_list_free (adder->pending_events); adder->pending_events = NULL; } - GST_COLLECT_PADS2_STREAM_UNLOCK (adder->collect); break; case GST_EVENT_TAG: - GST_COLLECT_PADS2_STREAM_LOCK (adder->collect); /* collect tags here so we can push them out when we collect data */ adder->pending_events = g_list_append (adder->pending_events, event); - GST_COLLECT_PADS2_STREAM_UNLOCK (adder->collect); - goto beach; + res = TRUE; + break; case GST_EVENT_NEWSEGMENT: if (g_atomic_int_compare_and_exchange (&adder->wait_for_new_segment, TRUE, FALSE)) { @@ -790,13 +798,7 @@ gst_adder_sink_event (GstPad * pad, GstEvent * event) default: break; } - - /* now GstCollectPads2 can take care of the rest, e.g. EOS */ - ret = adder->collect_event (pad, event); - -beach: - gst_object_unref (adder); - return ret; + return res; } static void @@ -874,7 +876,7 @@ gst_adder_init (GstAdder * adder, GstAdderClass * klass) gst_collect_pads2_set_clip_function (adder->collect, GST_DEBUG_FUNCPTR (gst_adder_do_clip), adder); gst_collect_pads2_set_event_function (adder->collect, - GST_DEBUG_FUNCPTR (gst_adder_event), adder); + GST_DEBUG_FUNCPTR (gst_adder_sink_event), adder); } static void @@ -980,12 +982,6 @@ gst_adder_request_new_pad (GstElement * element, GstPadTemplate * templ, gst_pad_set_setcaps_function (newpad, GST_DEBUG_FUNCPTR (gst_adder_setcaps)); gst_collect_pads2_add_pad (adder->collect, newpad, sizeof (GstCollectData2)); - /* FIXME: hacked way to override/extend the event function of - * GstCollectPads2; because it sets its own event function giving the - * element no access to events */ - adder->collect_event = (GstPadEventFunction) GST_PAD_EVENTFUNC (newpad); - gst_pad_set_event_function (newpad, GST_DEBUG_FUNCPTR (gst_adder_sink_event)); - /* takes ownership of the pad */ if (!gst_element_add_pad (GST_ELEMENT (adder), newpad)) goto could_not_add; @@ -1277,23 +1273,6 @@ eos: } } -static gboolean -gst_adder_event (GstCollectPads2 * pads, GstCollectData2 * pad, - GstEvent * event, gpointer user_data) -{ - GstAdder *adder = GST_ADDER (user_data); - if (GST_EVENT_TYPE (event) == GST_EVENT_FLUSH_STOP) { - if (g_atomic_int_compare_and_exchange (&adder->flush_stop_pending, - TRUE, FALSE)) { - return FALSE; - } else { - gst_event_unref (event); - return TRUE; - } - } else { - return FALSE; - } -} static GstStateChangeReturn gst_adder_change_state (GstElement * element, GstStateChange transition) @@ -1339,7 +1318,6 @@ gst_adder_change_state (GstElement * element, GstStateChange transition) return ret; } - static gboolean plugin_init (GstPlugin * plugin) { From 22bef18b96f50029c7ec5a52bf422326d69f0d1f Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Wed, 29 Feb 2012 21:39:44 +0100 Subject: [PATCH 44/50] test: improve adder test on event handling Use new consitency checker api to test event handling in more detail. --- tests/check/elements/adder.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/tests/check/elements/adder.c b/tests/check/elements/adder.c index a6cba90f15..fe3432c680 100644 --- a/tests/check/elements/adder.c +++ b/tests/check/elements/adder.c @@ -101,8 +101,8 @@ GST_START_TEST (test_event) GstBus *bus; GstEvent *seek_event; gboolean res; - GstPad *srcpad; - GstStreamConsistency *consist; + GstPad *srcpad, *sinkpad; + GstStreamConsistency *chk_1, *chk_2, *chk_3; GST_INFO ("preparing test"); @@ -130,7 +130,22 @@ GST_START_TEST (test_event) fail_unless (res == TRUE, NULL); srcpad = gst_element_get_static_pad (adder, "src"); - consist = gst_consistency_checker_new (srcpad); + chk_3 = gst_consistency_checker_new (srcpad); + gst_object_unref (srcpad); + + /* create consistency checkers for the pads */ + srcpad = gst_element_get_static_pad (src1, "src"); + chk_1 = gst_consistency_checker_new (srcpad); + sinkpad = gst_pad_get_peer (srcpad); + gst_consistency_checker_add_pad (chk_3, sinkpad); + gst_object_unref (sinkpad); + gst_object_unref (srcpad); + + srcpad = gst_element_get_static_pad (src2, "src"); + chk_2 = gst_consistency_checker_new (srcpad); + sinkpad = gst_pad_get_peer (srcpad); + gst_consistency_checker_add_pad (chk_3, sinkpad); + gst_object_unref (sinkpad); gst_object_unref (srcpad); seek_event = gst_event_new_seek (1.0, GST_FORMAT_TIME, @@ -174,7 +189,9 @@ GST_START_TEST (test_event) /* cleanup */ g_main_loop_unref (main_loop); - gst_consistency_checker_free (consist); + gst_consistency_checker_free (chk_1); + gst_consistency_checker_free (chk_2); + gst_consistency_checker_free (chk_3); gst_object_unref (G_OBJECT (bus)); gst_object_unref (G_OBJECT (bin)); } From 44ff1b3b89833c36c086ff4183897dcb7620745d Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Wed, 29 Feb 2012 21:54:49 +0100 Subject: [PATCH 45/50] adder: drop newsegment events on sink-pads Adder is sending an own newsegment event on the src pad. --- gst/adder/gstadder.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gst/adder/gstadder.c b/gst/adder/gstadder.c index dfcacc4e57..8910d6c989 100644 --- a/gst/adder/gstadder.c +++ b/gst/adder/gstadder.c @@ -794,6 +794,8 @@ gst_adder_sink_event (GstCollectPads2 * pads, GstCollectData2 * pad, * see FIXME in gst_adder_collected() */ g_atomic_int_set (&adder->new_segment_pending, TRUE); } + gst_event_unref (event); + res = TRUE; break; default: break; From 3e16ee0af11a52a6a90597d1028fb16ff3df6e6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 24 Feb 2012 13:54:47 +0100 Subject: [PATCH 46/50] seek: Move seek flags/settings into its own expander --- tests/examples/seek/seek.c | 94 +++++++++++++++++++++----------------- 1 file changed, 52 insertions(+), 42 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index ac3efa134d..d401cd41fb 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2154,7 +2154,7 @@ static void create_ui (SeekApp * app) { GtkWidget *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, - *flagtable, *boxes2, *step, *navigation, *colorbalance = NULL; + *flagtable, *boxes2, *seek, *step, *navigation, *colorbalance = NULL; GtkWidget *play_button, *pause_button, *stop_button, *shot_button; GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox; @@ -2194,7 +2194,6 @@ create_ui (SeekApp * app) "Stopped"); hbox = gtk_hbox_new (FALSE, 0); vbox = gtk_vbox_new (FALSE, 0); - flagtable = gtk_table_new (4, 2, FALSE); gtk_container_set_border_width (GTK_CONTAINER (vbox), 3); /* media controls */ @@ -2202,35 +2201,57 @@ create_ui (SeekApp * app) pause_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_PAUSE); stop_button = gtk_button_new_from_stock (GTK_STOCK_MEDIA_STOP); - /* seek flags */ - accurate_checkbox = gtk_check_button_new_with_label ("Accurate Seek"); - key_checkbox = gtk_check_button_new_with_label ("Key-unit Seek"); - loop_checkbox = gtk_check_button_new_with_label ("Loop"); - flush_checkbox = gtk_check_button_new_with_label ("Flush"); - scrub_checkbox = gtk_check_button_new_with_label ("Scrub"); - play_scrub_checkbox = gtk_check_button_new_with_label ("Play Scrub"); - skip_checkbox = gtk_check_button_new_with_label ("Play Skip"); - rate_spinbutton = gtk_spin_button_new_with_range (-100, 100, 0.1); - gtk_spin_button_set_digits (GTK_SPIN_BUTTON (rate_spinbutton), 3); - rate_label = gtk_label_new ("Rate"); + /* seek expander */ + { + seek = gtk_expander_new ("seek options"); + flagtable = gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (flagtable), 2); + gtk_grid_set_row_homogeneous (GTK_GRID (flagtable), TRUE); + gtk_grid_set_column_spacing (GTK_GRID (flagtable), 2); + gtk_grid_set_column_homogeneous (GTK_GRID (flagtable), TRUE); - gtk_widget_set_tooltip_text (accurate_checkbox, - "accurate position is requested, this might be considerably slower for some formats"); - gtk_widget_set_tooltip_text (key_checkbox, - "seek to the nearest keyframe. This might be faster but less accurate"); - gtk_widget_set_tooltip_text (loop_checkbox, "loop playback"); - gtk_widget_set_tooltip_text (flush_checkbox, "flush pipeline after seeking"); - gtk_widget_set_tooltip_text (rate_spinbutton, "define the playback rate, " - "negative value trigger reverse playback"); - gtk_widget_set_tooltip_text (scrub_checkbox, "show images while seeking"); - gtk_widget_set_tooltip_text (play_scrub_checkbox, "play video while seeking"); - gtk_widget_set_tooltip_text (skip_checkbox, - "Skip frames while playing at high frame rates"); + accurate_checkbox = gtk_check_button_new_with_label ("Accurate Seek"); + key_checkbox = gtk_check_button_new_with_label ("Key-unit Seek"); + loop_checkbox = gtk_check_button_new_with_label ("Loop"); + flush_checkbox = gtk_check_button_new_with_label ("Flush"); + scrub_checkbox = gtk_check_button_new_with_label ("Scrub"); + play_scrub_checkbox = gtk_check_button_new_with_label ("Play Scrub"); + skip_checkbox = gtk_check_button_new_with_label ("Play Skip"); + rate_spinbutton = gtk_spin_button_new_with_range (-100, 100, 0.1); + gtk_spin_button_set_digits (GTK_SPIN_BUTTON (rate_spinbutton), 3); + rate_label = gtk_label_new ("Rate"); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flush_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrub_checkbox), TRUE); + gtk_widget_set_tooltip_text (accurate_checkbox, + "accurate position is requested, this might be considerably slower for some formats"); + gtk_widget_set_tooltip_text (key_checkbox, + "seek to the nearest keyframe. This might be faster but less accurate"); + gtk_widget_set_tooltip_text (loop_checkbox, "loop playback"); + gtk_widget_set_tooltip_text (flush_checkbox, + "flush pipeline after seeking"); + gtk_widget_set_tooltip_text (rate_spinbutton, + "define the playback rate, " "negative value trigger reverse playback"); + gtk_widget_set_tooltip_text (scrub_checkbox, "show images while seeking"); + gtk_widget_set_tooltip_text (play_scrub_checkbox, + "play video while seeking"); + gtk_widget_set_tooltip_text (skip_checkbox, + "Skip frames while playing at high frame rates"); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate_spinbutton), app->rate); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (flush_checkbox), TRUE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (scrub_checkbox), TRUE); + + gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate_spinbutton), app->rate); + + gtk_grid_attach (GTK_GRID (flagtable), accurate_checkbox, 0, 0, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), flush_checkbox, 1, 0, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), loop_checkbox, 2, 0, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), key_checkbox, 0, 1, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), scrub_checkbox, 1, 1, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), play_scrub_checkbox, 2, 1, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), skip_checkbox, 3, 0, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), rate_label, 4, 0, 1, 1); + gtk_grid_attach (GTK_GRID (flagtable), rate_spinbutton, 4, 1, 1, 1); + + } /* step expander */ { @@ -2288,7 +2309,7 @@ create_ui (SeekApp * app) gtk_box_pack_start (GTK_BOX (hbox), app->shuttle_scale, TRUE, TRUE, 2); - gtk_container_add (GTK_CONTAINER (step), hbox); + gtk_container_add (GTK_CONTAINER (seek), flagtable); } /* navigation command expander */ @@ -2634,19 +2655,8 @@ create_ui (SeekApp * app) gtk_box_pack_start (GTK_BOX (hbox), play_button, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (hbox), pause_button, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (hbox), stop_button, FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX (hbox), flagtable, FALSE, FALSE, 2); - gtk_table_attach_defaults (GTK_TABLE (flagtable), accurate_checkbox, 0, 1, 0, - 1); - gtk_table_attach_defaults (GTK_TABLE (flagtable), flush_checkbox, 1, 2, 0, 1); - gtk_table_attach_defaults (GTK_TABLE (flagtable), loop_checkbox, 2, 3, 0, 1); - gtk_table_attach_defaults (GTK_TABLE (flagtable), key_checkbox, 0, 1, 1, 2); - gtk_table_attach_defaults (GTK_TABLE (flagtable), scrub_checkbox, 1, 2, 1, 2); - gtk_table_attach_defaults (GTK_TABLE (flagtable), play_scrub_checkbox, 2, 3, - 1, 2); - gtk_table_attach_defaults (GTK_TABLE (flagtable), skip_checkbox, 3, 4, 0, 1); - gtk_table_attach_defaults (GTK_TABLE (flagtable), rate_label, 4, 5, 0, 1); - gtk_table_attach_defaults (GTK_TABLE (flagtable), rate_spinbutton, 4, 5, 1, - 2); + + gtk_box_pack_start (GTK_BOX (vbox), seek, FALSE, FALSE, 2); if (panel && boxes && boxes2) { expander = gtk_expander_new ("playbin2 options"); pb2vbox = gtk_vbox_new (FALSE, 0); From dbeeade50479d3b93b3bd1da6c2598c2f6f7bf3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 1 Mar 2012 09:46:45 +0100 Subject: [PATCH 47/50] seek: Some more variable moving --- tests/examples/seek/seek.c | 82 ++++++++++++++++++++------------------ 1 file changed, 44 insertions(+), 38 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index d401cd41fb..a5270e2181 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -2153,17 +2153,8 @@ print_usage (int argc, char **argv) static void create_ui (SeekApp * app) { - GtkWidget *hbox, *vbox, *panel, *expander, *pb2vbox, *boxes, - *flagtable, *boxes2, *seek, *step, *navigation, *colorbalance = NULL; - GtkWidget *play_button, *pause_button, *stop_button, *shot_button; - GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, *flush_checkbox; - GtkWidget *scrub_checkbox, *play_scrub_checkbox; - GtkWidget *rate_label, *volume_label; - GtkWidget *skip_checkbox, *rate_spinbutton, *step_button, *shuttle_checkbox; - GtkWidget *soft_volume_checkbox, *native_audio_checkbox, - *native_video_checkbox; - GtkWidget *download_checkbox, *buffering_checkbox, *deinterlace_checkbox; - GtkWidget *soft_colorbalance_checkbox; + GtkWidget *hbox, *vbox, *seek, *playbin, *step, *navigation, *colorbalance; + GtkWidget *play_button, *pause_button, *stop_button; GtkAdjustment *adjustment; /* initialize gui elements ... */ @@ -2203,6 +2194,12 @@ create_ui (SeekApp * app) /* seek expander */ { + GtkWidget *accurate_checkbox, *key_checkbox, *loop_checkbox, + *flush_checkbox; + GtkWidget *scrub_checkbox, *play_scrub_checkbox, *rate_label; + GtkWidget *skip_checkbox, *rate_spinbutton; + GtkWidget *flagtable; + seek = gtk_expander_new ("seek options"); flagtable = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (flagtable), 2); @@ -2241,6 +2238,23 @@ create_ui (SeekApp * app) gtk_spin_button_set_value (GTK_SPIN_BUTTON (rate_spinbutton), app->rate); + g_signal_connect (G_OBJECT (accurate_checkbox), "toggled", + G_CALLBACK (accurate_toggle_cb), app); + g_signal_connect (G_OBJECT (key_checkbox), "toggled", + G_CALLBACK (key_toggle_cb), app); + g_signal_connect (G_OBJECT (loop_checkbox), "toggled", + G_CALLBACK (loop_toggle_cb), app); + g_signal_connect (G_OBJECT (flush_checkbox), "toggled", + G_CALLBACK (flush_toggle_cb), app); + g_signal_connect (G_OBJECT (scrub_checkbox), "toggled", + G_CALLBACK (scrub_toggle_cb), app); + g_signal_connect (G_OBJECT (play_scrub_checkbox), "toggled", + G_CALLBACK (play_scrub_toggle_cb), app); + g_signal_connect (G_OBJECT (skip_checkbox), "toggled", + G_CALLBACK (skip_toggle_cb), app); + g_signal_connect (G_OBJECT (rate_spinbutton), "value-changed", + G_CALLBACK (rate_spinbutton_changed_cb), app); + gtk_grid_attach (GTK_GRID (flagtable), accurate_checkbox, 0, 0, 1, 1); gtk_grid_attach (GTK_GRID (flagtable), flush_checkbox, 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (flagtable), loop_checkbox, 2, 0, 1, 1); @@ -2256,6 +2270,7 @@ create_ui (SeekApp * app) /* step expander */ { GtkWidget *hbox; + GtkWidget *step_button, *shuttle_checkbox; step = gtk_expander_new ("step options"); hbox = gtk_hbox_new (FALSE, 0); @@ -2309,7 +2324,7 @@ create_ui (SeekApp * app) gtk_box_pack_start (GTK_BOX (hbox), app->shuttle_scale, TRUE, TRUE, 2); - gtk_container_add (GTK_CONTAINER (seek), flagtable); + gtk_container_add (GTK_CONTAINER (step), hbox); } /* navigation command expander */ @@ -2522,6 +2537,14 @@ create_ui (SeekApp * app) app); if (app->pipeline_type == 0) { + GtkWidget *pb2vbox, *boxes, *boxes2, *panel; + GtkWidget *volume_label, *shot_button; + GtkWidget *soft_volume_checkbox, *native_audio_checkbox, + *native_video_checkbox; + GtkWidget *download_checkbox, *buffering_checkbox, *deinterlace_checkbox; + GtkWidget *soft_colorbalance_checkbox; + + playbin = gtk_expander_new ("playbin2 options"); /* the playbin2 panel controls for the video/audio/subtitle tracks */ panel = gtk_hbox_new (FALSE, 0); app->video_combo = gtk_combo_box_text_new (); @@ -2640,8 +2663,14 @@ create_ui (SeekApp * app) /* fill the vis combo box and the array of factories */ init_visualization_features (app); + + pb2vbox = gtk_vbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (pb2vbox), panel, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (pb2vbox), boxes, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (pb2vbox), boxes2, FALSE, FALSE, 2); + gtk_container_add (GTK_CONTAINER (playbin), pb2vbox); } else { - panel = boxes = boxes2 = NULL; + playbin = NULL; } /* do the packing stuff ... */ @@ -2657,15 +2686,8 @@ create_ui (SeekApp * app) gtk_box_pack_start (GTK_BOX (hbox), stop_button, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), seek, FALSE, FALSE, 2); - if (panel && boxes && boxes2) { - expander = gtk_expander_new ("playbin2 options"); - pb2vbox = gtk_vbox_new (FALSE, 0); - gtk_box_pack_start (GTK_BOX (pb2vbox), panel, FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX (pb2vbox), boxes, FALSE, FALSE, 2); - gtk_box_pack_start (GTK_BOX (pb2vbox), boxes2, FALSE, FALSE, 2); - gtk_container_add (GTK_CONTAINER (expander), pb2vbox); - gtk_box_pack_start (GTK_BOX (vbox), expander, FALSE, FALSE, 2); - } + if (playbin) + gtk_box_pack_start (GTK_BOX (vbox), playbin, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), step, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), navigation, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (vbox), colorbalance, FALSE, FALSE, 2); @@ -2680,22 +2702,6 @@ create_ui (SeekApp * app) app); g_signal_connect (G_OBJECT (stop_button), "clicked", G_CALLBACK (stop_cb), app); - g_signal_connect (G_OBJECT (accurate_checkbox), "toggled", - G_CALLBACK (accurate_toggle_cb), app); - g_signal_connect (G_OBJECT (key_checkbox), "toggled", - G_CALLBACK (key_toggle_cb), app); - g_signal_connect (G_OBJECT (loop_checkbox), "toggled", - G_CALLBACK (loop_toggle_cb), app); - g_signal_connect (G_OBJECT (flush_checkbox), "toggled", - G_CALLBACK (flush_toggle_cb), app); - g_signal_connect (G_OBJECT (scrub_checkbox), "toggled", - G_CALLBACK (scrub_toggle_cb), app); - g_signal_connect (G_OBJECT (play_scrub_checkbox), "toggled", - G_CALLBACK (play_scrub_toggle_cb), app); - g_signal_connect (G_OBJECT (skip_checkbox), "toggled", - G_CALLBACK (skip_toggle_cb), app); - g_signal_connect (G_OBJECT (rate_spinbutton), "value-changed", - G_CALLBACK (rate_spinbutton_changed_cb), app); g_signal_connect (G_OBJECT (app->window), "delete-event", G_CALLBACK (delete_event_cb), app); From 3d32372e8be12360ad7e3bc80a9b252c1ba09183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 1 Mar 2012 10:45:51 +0100 Subject: [PATCH 48/50] seek: Add advanced seek ability This allows to seek to a specific value in a specific format and also lists the current position and duration in a specific format. --- tests/examples/seek/seek.c | 252 ++++++++++++++++++++++++++++++++----- 1 file changed, 223 insertions(+), 29 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index a5270e2181..dcccafbc9b 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -106,10 +106,13 @@ typedef struct GtkWidget *text_checkbox, *mute_checkbox, *volume_spinbutton; GtkWidget *video_window; + GtkWidget *seek_format_combo, *seek_position_label, *seek_duration_label; + GtkWidget *seek_entry; + GtkWidget *seek_scale, *statusbar; guint status_id; - GtkWidget *format_combo, *step_amount_spinbutton, *step_rate_spinbutton; + GtkWidget *step_format_combo, *step_amount_spinbutton, *step_rate_spinbutton; GtkWidget *shuttle_scale; GtkWidget *contrast_scale, *brightness_scale, *hue_scale, *saturation_scale; @@ -171,6 +174,9 @@ typedef struct gboolean shuttling; gdouble shuttle_rate; gdouble play_rate; + + const GstFormatDefinition *seek_format; + GList *formats; } SeekApp; static void clear_streams (SeekApp * app); @@ -389,6 +395,8 @@ static gboolean update_scale (SeekApp * app) { GstFormat format = GST_FORMAT_TIME; + gint64 seek_pos, seek_dur; + gchar *str; //position = 0; //duration = 0; @@ -406,6 +414,21 @@ update_scale (SeekApp * app) set_scale (app, app->position * N_GRAD / app->duration); } + if (app->seek_format) { + format = app->seek_format->value; + seek_pos = seek_dur = -1; + gst_element_query_position (app->pipeline, &format, &seek_pos); + gst_element_query_duration (app->pipeline, &format, &seek_dur); + + str = g_strdup_printf ("%" G_GINT64_FORMAT, seek_pos); + gtk_label_set_text (GTK_LABEL (app->seek_position_label), str); + g_free (str); + + str = g_strdup_printf ("%" G_GINT64_FORMAT, seek_dur); + gtk_label_set_text (GTK_LABEL (app->seek_duration_label), str); + g_free (str); + } + return TRUE; } @@ -434,20 +457,12 @@ send_event (SeekApp * app, GstEvent * event) } static void -do_seek (SeekApp * app) +do_seek (SeekApp * app, GstFormat format, gint64 position) { - gint64 real; gboolean res = FALSE; GstEvent *s_event; GstSeekFlags flags; - real = - gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / - N_GRAD; - - GST_DEBUG ("value=%f, real=%" G_GINT64_FORMAT, - gtk_range_get_value (GTK_RANGE (app->seek_scale)), real); - flags = 0; if (app->flush_seek) flags |= GST_SEEK_FLAG_FLUSH; @@ -462,16 +477,16 @@ do_seek (SeekApp * app) if (app->rate >= 0) { s_event = gst_event_new_seek (app->rate, - GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, real, GST_SEEK_TYPE_SET, + format, flags, GST_SEEK_TYPE_SET, position, GST_SEEK_TYPE_SET, GST_CLOCK_TIME_NONE); GST_DEBUG ("seek with rate %lf to %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT, - app->rate, GST_TIME_ARGS (real), GST_TIME_ARGS (app->duration)); + app->rate, GST_TIME_ARGS (position), GST_TIME_ARGS (app->duration)); } else { s_event = gst_event_new_seek (app->rate, - GST_FORMAT_TIME, flags, GST_SEEK_TYPE_SET, G_GINT64_CONSTANT (0), - GST_SEEK_TYPE_SET, real); + format, flags, GST_SEEK_TYPE_SET, G_GINT64_CONSTANT (0), + GST_SEEK_TYPE_SET, position); GST_DEBUG ("seek with rate %lf to %" GST_TIME_FORMAT " / %" GST_TIME_FORMAT, - app->rate, GST_TIME_ARGS (0), GST_TIME_ARGS (real)); + app->rate, GST_TIME_ARGS (0), GST_TIME_ARGS (position)); } res = send_event (app, s_event); @@ -492,14 +507,22 @@ do_seek (SeekApp * app) static void seek_cb (GtkRange * range, SeekApp * app) { + gint64 real; /* If the timer hasn't expired yet, then the pipeline is running */ if (app->play_scrub && app->seek_timeout_id != 0) { GST_DEBUG ("do scrub seek, PAUSED"); gst_element_set_state (app->pipeline, GST_STATE_PAUSED); } + real = + gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / + N_GRAD; + + GST_DEBUG ("value=%f, real=%" G_GINT64_FORMAT, + gtk_range_get_value (GTK_RANGE (app->seek_scale)), real); + GST_DEBUG ("do seek"); - do_seek (app); + do_seek (app, GST_FORMAT_TIME, real); if (app->play_scrub) { GST_DEBUG ("do scrub seek, PLAYING"); @@ -512,6 +535,24 @@ seek_cb (GtkRange * range, SeekApp * app) } } +static void +advanced_seek_button_cb (GtkButton * button, SeekApp * app) +{ + GstFormat fmt; + gint64 pos; + const gchar *text; + gchar *endptr; + + fmt = app->seek_format->value; + + text = gtk_entry_get_text (GTK_ENTRY (app->seek_entry)); + + pos = g_ascii_strtoll (text, &endptr, 10); + if (endptr != text && pos != G_MAXINT64 && pos != G_MININT64) { + do_seek (app, fmt, pos); + } +} + static void set_update_fill (SeekApp * app, gboolean active) { @@ -579,8 +620,13 @@ stop_seek (GtkRange * range, GdkEventButton * event, SeekApp * app) } if (!app->flush_seek || !app->scrub) { + gint64 real; + GST_DEBUG ("do final seek"); - do_seek (app); + real = + gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / + N_GRAD; + do_seek (app, GST_FORMAT_TIME, real); } if (app->seek_timeout_id != 0) { @@ -735,7 +781,12 @@ loop_toggle_cb (GtkToggleButton * button, SeekApp * app) { app->loop_seek = gtk_toggle_button_get_active (button); if (app->state == GST_STATE_PLAYING) { - do_seek (app); + gint64 real; + + real = + gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / + N_GRAD; + do_seek (app, GST_FORMAT_TIME, real); } } @@ -762,7 +813,12 @@ skip_toggle_cb (GtkToggleButton * button, SeekApp * app) { app->skip_seek = gtk_toggle_button_get_active (button); if (app->state == GST_STATE_PLAYING) { - do_seek (app); + gint64 real; + + real = + gtk_range_get_value (GTK_RANGE (app->seek_scale)) * app->duration / + N_GRAD; + do_seek (app, GST_FORMAT_TIME, real); } } @@ -1281,7 +1337,7 @@ step_cb (GtkButton * button, SeekApp * app) gboolean flush, res; gint active; - active = gtk_combo_box_get_active (GTK_COMBO_BOX (app->format_combo)); + active = gtk_combo_box_get_active (GTK_COMBO_BOX (app->step_format_combo)); amount = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (app->step_amount_spinbutton)); @@ -1528,10 +1584,106 @@ colorbalance_value_changed (GtkRange * range, SeekApp * app) channel, ival); } +static void +seek_format_changed_cb (GtkComboBox * box, SeekApp * app) +{ + gchar *format_str; + GList *l; + const GstFormatDefinition *format = NULL; + + format_str = gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT (box)); + + for (l = app->formats; l; l = l->next) { + const GstFormatDefinition *tmp = l->data; + + if (g_strcmp0 (tmp->nick, format_str) == 0) { + format = tmp; + break; + } + } + + if (!format) + goto done; + + app->seek_format = format; + update_scale (app); + +done: + g_free (format_str); +} + +static void +update_formats (SeekApp * app) +{ + GstIterator *it; + gboolean done; + GList *l; + gpointer item; + gchar *selected; + gint selected_idx = 0, i; + + selected = + gtk_combo_box_text_get_active_text (GTK_COMBO_BOX_TEXT + (app->seek_format_combo)); + if (selected == NULL) + selected = g_strdup ("time"); + + it = gst_format_iterate_definitions (); + done = FALSE; + + g_list_free (app->formats); + app->formats = NULL; + + while (!done) { + switch (gst_iterator_next (it, &item)) { + case GST_ITERATOR_OK: + app->formats = g_list_prepend (app->formats, item); + break; + case GST_ITERATOR_RESYNC: + g_list_free (app->formats); + app->formats = NULL; + gst_iterator_resync (it); + break; + case GST_ITERATOR_ERROR: + case GST_ITERATOR_DONE: + default: + done = TRUE; + break; + } + } + + app->formats = g_list_reverse (app->formats); + gst_iterator_free (it); + + g_signal_handlers_block_by_func (app->seek_format_combo, + seek_format_changed_cb, app); + gtk_combo_box_text_remove_all (GTK_COMBO_BOX_TEXT (app->seek_format_combo)); + + for (i = 0, l = app->formats; l; l = l->next, i++) { + const GstFormatDefinition *def = l->data; + + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->seek_format_combo), + def->nick); + if (g_strcmp0 (def->nick, selected) == 0) + selected_idx = i; + } + g_signal_handlers_unblock_by_func (app->seek_format_combo, + seek_format_changed_cb, app); + + gtk_combo_box_set_active (GTK_COMBO_BOX (app->seek_format_combo), + selected_idx); + + g_free (selected); +} + static void msg_async_done (GstBus * bus, GstMessage * message, SeekApp * app) { GST_DEBUG ("async done"); + + /* Now query all available GstFormats */ + update_formats (app); + /* when we get ASYNC_DONE we can query position, duration and other * properties */ update_scale (app); @@ -2198,12 +2350,13 @@ create_ui (SeekApp * app) *flush_checkbox; GtkWidget *scrub_checkbox, *play_scrub_checkbox, *rate_label; GtkWidget *skip_checkbox, *rate_spinbutton; - GtkWidget *flagtable; + GtkWidget *flagtable, *advanced_seek, *advanced_seek_grid; + GtkWidget *duration_label, *position_label, *seek_button; seek = gtk_expander_new ("seek options"); flagtable = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (flagtable), 2); - gtk_grid_set_row_homogeneous (GTK_GRID (flagtable), TRUE); + gtk_grid_set_row_homogeneous (GTK_GRID (flagtable), FALSE); gtk_grid_set_column_spacing (GTK_GRID (flagtable), 2); gtk_grid_set_column_homogeneous (GTK_GRID (flagtable), TRUE); @@ -2265,6 +2418,44 @@ create_ui (SeekApp * app) gtk_grid_attach (GTK_GRID (flagtable), rate_label, 4, 0, 1, 1); gtk_grid_attach (GTK_GRID (flagtable), rate_spinbutton, 4, 1, 1, 1); + advanced_seek = gtk_frame_new ("Advanced Seek"); + advanced_seek_grid = gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (advanced_seek_grid), 2); + gtk_grid_set_row_homogeneous (GTK_GRID (advanced_seek_grid), FALSE); + gtk_grid_set_column_spacing (GTK_GRID (advanced_seek_grid), 5); + gtk_grid_set_column_homogeneous (GTK_GRID (advanced_seek_grid), FALSE); + + app->seek_format_combo = gtk_combo_box_text_new (); + g_signal_connect (app->seek_format_combo, "changed", + G_CALLBACK (seek_format_changed_cb), app); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_format_combo, 0, + 0, 1, 1); + + app->seek_entry = gtk_entry_new (); + gtk_entry_set_width_chars (GTK_ENTRY (app->seek_entry), 12); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_entry, 0, 1, 1, + 1); + + seek_button = gtk_button_new_with_label ("Seek"); + g_signal_connect (G_OBJECT (seek_button), "clicked", + G_CALLBACK (advanced_seek_button_cb), app); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), seek_button, 1, 0, 1, 1); + + position_label = gtk_label_new ("Position:"); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), position_label, 2, 0, 1, 1); + duration_label = gtk_label_new ("Duration:"); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), duration_label, 2, 1, 1, 1); + + app->seek_position_label = gtk_label_new ("-1"); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_position_label, 3, + 0, 1, 1); + app->seek_duration_label = gtk_label_new ("-1"); + gtk_grid_attach (GTK_GRID (advanced_seek_grid), app->seek_duration_label, 3, + 1, 1, 1); + + gtk_container_add (GTK_CONTAINER (advanced_seek), advanced_seek_grid); + gtk_grid_attach (GTK_GRID (flagtable), advanced_seek, 0, 2, 3, 2); + gtk_container_add (GTK_CONTAINER (seek), flagtable); } /* step expander */ @@ -2275,13 +2466,14 @@ create_ui (SeekApp * app) step = gtk_expander_new ("step options"); hbox = gtk_hbox_new (FALSE, 0); - app->format_combo = gtk_combo_box_text_new (); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->format_combo), + app->step_format_combo = gtk_combo_box_text_new (); + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->step_format_combo), "frames"); - gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->format_combo), + gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (app->step_format_combo), "time (ms)"); - gtk_combo_box_set_active (GTK_COMBO_BOX (app->format_combo), 0); - gtk_box_pack_start (GTK_BOX (hbox), app->format_combo, FALSE, FALSE, 2); + gtk_combo_box_set_active (GTK_COMBO_BOX (app->step_format_combo), 0); + gtk_box_pack_start (GTK_BOX (hbox), app->step_format_combo, FALSE, FALSE, + 2); app->step_amount_spinbutton = gtk_spin_button_new_with_range (1, 1000, 1); gtk_spin_button_set_digits (GTK_SPIN_BUTTON (app->step_amount_spinbutton), @@ -2336,7 +2528,7 @@ create_ui (SeekApp * app) navigation = gtk_expander_new ("navigation commands"); grid = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (grid), 2); - gtk_grid_set_row_homogeneous (GTK_GRID (grid), TRUE); + gtk_grid_set_row_homogeneous (GTK_GRID (grid), FALSE); gtk_grid_set_column_spacing (GTK_GRID (grid), 2); gtk_grid_set_column_homogeneous (GTK_GRID (grid), TRUE); @@ -2565,7 +2757,7 @@ create_ui (SeekApp * app) /* playbin2 panel for flag checkboxes and volume/mute */ boxes = gtk_grid_new (); gtk_grid_set_row_spacing (GTK_GRID (boxes), 2); - gtk_grid_set_row_homogeneous (GTK_GRID (boxes), TRUE); + gtk_grid_set_row_homogeneous (GTK_GRID (boxes), FALSE); gtk_grid_set_column_spacing (GTK_GRID (boxes), 2); gtk_grid_set_column_homogeneous (GTK_GRID (boxes), TRUE); @@ -2732,6 +2924,8 @@ reset_app (SeekApp * app) g_free (app->audiosink_str); g_free (app->videosink_str); + g_list_free (app->formats); + g_static_mutex_free (&app->state_mutex); if (app->xoverlay_element) From ad1b38a7f1aad096cd75d23749b5f62691993b1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 1 Mar 2012 12:52:21 +0100 Subject: [PATCH 49/50] seek: Add support for changing the remaining playbin2 properties Including video/audio/text sinks. --- tests/examples/seek/seek.c | 347 +++++++++++++++++++++++++++++++++---- 1 file changed, 309 insertions(+), 38 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index dcccafbc9b..dd5206d5a7 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -102,9 +102,19 @@ typedef struct /* GTK widgets */ GtkWidget *window; GtkWidget *video_combo, *audio_combo, *text_combo, *vis_combo; + GtkWidget *video_window; + GtkWidget *vis_checkbox, *video_checkbox, *audio_checkbox; GtkWidget *text_checkbox, *mute_checkbox, *volume_spinbutton; - GtkWidget *video_window; + GtkWidget *soft_volume_checkbox, *native_audio_checkbox, + *native_video_checkbox; + GtkWidget *download_checkbox, *buffering_checkbox, *deinterlace_checkbox; + GtkWidget *soft_colorbalance_checkbox; + GtkWidget *video_sink_entry, *audio_sink_entry, *text_sink_entry; + GtkWidget *buffer_size_entry, *buffer_duration_entry; + GtkWidget *ringbuffer_maxsize_entry, *connection_speed_entry; + GtkWidget *av_offset_entry, *subtitle_encoding_entry; + GtkWidget *subtitle_fontdesc_button; GtkWidget *seek_format_combo, *seek_position_label, *seek_duration_label; GtkWidget *seek_entry; @@ -186,9 +196,18 @@ static void volume_notify_cb (GstElement * pipeline, GParamSpec * arg, static void mute_notify_cb (GstElement * pipeline, GParamSpec * arg, SeekApp * app); +static void video_sink_activate_cb (GtkEntry * entry, SeekApp * app); +static void text_sink_activate_cb (GtkEntry * entry, SeekApp * app); +static void audio_sink_activate_cb (GtkEntry * entry, SeekApp * app); +static void buffer_size_activate_cb (GtkEntry * entry, SeekApp * app); +static void buffer_duration_activate_cb (GtkEntry * entry, SeekApp * app); +static void ringbuffer_maxsize_activate_cb (GtkEntry * entry, SeekApp * app); +static void connection_speed_activate_cb (GtkEntry * entry, SeekApp * app); +static void av_offset_activate_cb (GtkEntry * entry, SeekApp * app); +static void subtitle_encoding_activate_cb (GtkEntry * entry, SeekApp * app); + /* pipeline construction */ -#if 0 static GstElement * gst_element_factory_make_or_warn (const gchar * type, const gchar * name) { @@ -210,7 +229,6 @@ gst_element_factory_make_or_warn (const gchar * type, const gchar * name) return element; } -#endif static void playbin_set_uri (GstElement * playbin, const gchar * location) @@ -657,6 +675,21 @@ play_cb (GtkButton * button, SeekApp * app) g_print ("PLAY pipeline\n"); gtk_statusbar_pop (GTK_STATUSBAR (app->statusbar), app->status_id); + if (app->pipeline_type == 0) { + video_sink_activate_cb (GTK_ENTRY (app->video_sink_entry), app); + audio_sink_activate_cb (GTK_ENTRY (app->audio_sink_entry), app); + text_sink_activate_cb (GTK_ENTRY (app->text_sink_entry), app); + buffer_size_activate_cb (GTK_ENTRY (app->buffer_size_entry), app); + buffer_duration_activate_cb (GTK_ENTRY (app->buffer_duration_entry), app); + ringbuffer_maxsize_activate_cb (GTK_ENTRY (app->ringbuffer_maxsize_entry), + app); + connection_speed_activate_cb (GTK_ENTRY (app->connection_speed_entry), + app); + av_offset_activate_cb (GTK_ENTRY (app->av_offset_entry), app); + subtitle_encoding_activate_cb (GTK_ENTRY (app->subtitle_encoding_entry), + app); + } + ret = gst_element_set_state (app->pipeline, GST_STATE_PLAYING); switch (ret) { case GST_STATE_CHANGE_FAILURE: @@ -2289,6 +2322,151 @@ delete_event_cb (GtkWidget * widget, GdkEvent * event, SeekApp * app) gtk_main_quit (); } +static void +video_sink_activate_cb (GtkEntry * entry, SeekApp * app) +{ + GstElement *sink = NULL; + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + sink = gst_element_factory_make_or_warn (text, NULL); + } + + g_object_set (app->pipeline, "video-sink", sink, NULL); +} + +static void +audio_sink_activate_cb (GtkEntry * entry, SeekApp * app) +{ + GstElement *sink = NULL; + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + sink = gst_element_factory_make_or_warn (text, NULL); + } + + g_object_set (app->pipeline, "audio-sink", sink, NULL); +} + +static void +text_sink_activate_cb (GtkEntry * entry, SeekApp * app) +{ + GstElement *sink = NULL; + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + sink = gst_element_factory_make_or_warn (text, NULL); + } + + g_object_set (app->pipeline, "text-sink", sink, NULL); +} + +static void +buffer_size_activate_cb (GtkEntry * entry, SeekApp * app) +{ + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + gint v; + gchar *endptr; + + v = g_ascii_strtoll (text, &endptr, 10); + if (endptr != text && v != G_MAXINT64 && v != G_MININT64) { + g_object_set (app->pipeline, "buffer-size", v, NULL); + } + } +} + +static void +buffer_duration_activate_cb (GtkEntry * entry, SeekApp * app) +{ + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + gint64 v; + gchar *endptr; + + v = g_ascii_strtoll (text, &endptr, 10); + if (endptr != text && v != G_MAXINT64 && v != G_MININT64) { + g_object_set (app->pipeline, "buffer-duration", v, NULL); + } + } +} + +static void +ringbuffer_maxsize_activate_cb (GtkEntry * entry, SeekApp * app) +{ + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + guint64 v; + gchar *endptr; + + v = g_ascii_strtoull (text, &endptr, 10); + if (endptr != text && v != G_MAXUINT64) { + g_object_set (app->pipeline, "ring-buffer-max-size", v, NULL); + } + } +} + +static void +connection_speed_activate_cb (GtkEntry * entry, SeekApp * app) +{ + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + guint v; + gchar *endptr; + + v = g_ascii_strtoll (text, &endptr, 10); + if (endptr != text && v != G_MAXINT64 && v != G_MININT64) { + g_object_set (app->pipeline, "connection-speed", v, NULL); + } + } +} + +static void +subtitle_encoding_activate_cb (GtkEntry * entry, SeekApp * app) +{ + const gchar *text; + + text = gtk_entry_get_text (entry); + g_object_set (app->pipeline, "subtitle-encoding", text, NULL); +} + +static void +subtitle_fontdesc_cb (GtkFontButton * button, SeekApp * app) +{ + const gchar *text; + + text = gtk_font_button_get_font_name (button); + g_object_set (app->pipeline, "subtitle-font-desc", text, NULL); +} + +static void +av_offset_activate_cb (GtkEntry * entry, SeekApp * app) +{ + const gchar *text; + + text = gtk_entry_get_text (entry); + if (text != NULL && *text != '\0') { + gint64 v; + gchar *endptr; + + v = g_ascii_strtoll (text, &endptr, 10); + if (endptr != text && v != G_MAXINT64 && v != G_MININT64) { + g_object_set (app->pipeline, "av-offset", v, NULL); + } + } +} + static void print_usage (int argc, char **argv) { @@ -2729,12 +2907,9 @@ create_ui (SeekApp * app) app); if (app->pipeline_type == 0) { - GtkWidget *pb2vbox, *boxes, *boxes2, *panel; + GtkWidget *pb2vbox, *boxes, *boxes2, *panel, *boxes3; GtkWidget *volume_label, *shot_button; - GtkWidget *soft_volume_checkbox, *native_audio_checkbox, - *native_video_checkbox; - GtkWidget *download_checkbox, *buffering_checkbox, *deinterlace_checkbox; - GtkWidget *soft_colorbalance_checkbox; + GtkWidget *label; playbin = gtk_expander_new ("playbin2 options"); /* the playbin2 panel controls for the video/audio/subtitle tracks */ @@ -2765,54 +2940,61 @@ create_ui (SeekApp * app) app->audio_checkbox = gtk_check_button_new_with_label ("Audio"); app->text_checkbox = gtk_check_button_new_with_label ("Text"); app->vis_checkbox = gtk_check_button_new_with_label ("Vis"); - soft_volume_checkbox = gtk_check_button_new_with_label ("Soft Volume"); - native_audio_checkbox = gtk_check_button_new_with_label ("Native Audio"); - native_video_checkbox = gtk_check_button_new_with_label ("Native Video"); - download_checkbox = gtk_check_button_new_with_label ("Download"); - buffering_checkbox = gtk_check_button_new_with_label ("Buffering"); - deinterlace_checkbox = gtk_check_button_new_with_label ("Deinterlace"); - soft_colorbalance_checkbox = + app->soft_volume_checkbox = gtk_check_button_new_with_label ("Soft Volume"); + app->native_audio_checkbox = + gtk_check_button_new_with_label ("Native Audio"); + app->native_video_checkbox = + gtk_check_button_new_with_label ("Native Video"); + app->download_checkbox = gtk_check_button_new_with_label ("Download"); + app->buffering_checkbox = gtk_check_button_new_with_label ("Buffering"); + app->deinterlace_checkbox = gtk_check_button_new_with_label ("Deinterlace"); + app->soft_colorbalance_checkbox = gtk_check_button_new_with_label ("Soft Colorbalance"); app->mute_checkbox = gtk_check_button_new_with_label ("Mute"); volume_label = gtk_label_new ("Volume"); app->volume_spinbutton = gtk_spin_button_new_with_range (0, 10.0, 0.1); - gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->volume_spinbutton), 1.0); + gtk_grid_attach (GTK_GRID (boxes), app->video_checkbox, 0, 0, 1, 1); gtk_grid_attach (GTK_GRID (boxes), app->audio_checkbox, 1, 0, 1, 1); gtk_grid_attach (GTK_GRID (boxes), app->text_checkbox, 2, 0, 1, 1); gtk_grid_attach (GTK_GRID (boxes), app->vis_checkbox, 3, 0, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), soft_volume_checkbox, 4, 0, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), native_audio_checkbox, 5, 0, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), native_video_checkbox, 0, 1, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), download_checkbox, 1, 1, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), buffering_checkbox, 2, 1, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), deinterlace_checkbox, 3, 1, 1, 1); - gtk_grid_attach (GTK_GRID (boxes), soft_colorbalance_checkbox, 4, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->soft_volume_checkbox, 4, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->native_audio_checkbox, 5, 0, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->native_video_checkbox, 0, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->download_checkbox, 1, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->buffering_checkbox, 2, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->deinterlace_checkbox, 3, 1, 1, 1); + gtk_grid_attach (GTK_GRID (boxes), app->soft_colorbalance_checkbox, 4, 1, 1, + 1); gtk_grid_attach (GTK_GRID (boxes), app->mute_checkbox, 7, 0, 2, 1); gtk_grid_attach (GTK_GRID (boxes), volume_label, 6, 1, 1, 1); gtk_grid_attach (GTK_GRID (boxes), app->volume_spinbutton, 7, 1, 1, 1); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->video_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->audio_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->text_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->vis_checkbox), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (soft_volume_checkbox), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->soft_volume_checkbox), TRUE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (native_audio_checkbox), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (app->native_audio_checkbox), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON + (app->native_video_checkbox), FALSE); + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->download_checkbox), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (native_video_checkbox), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->buffering_checkbox), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (download_checkbox), FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (buffering_checkbox), - FALSE); - gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (deinterlace_checkbox), + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->deinterlace_checkbox), FALSE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON - (soft_colorbalance_checkbox), TRUE); + (app->soft_colorbalance_checkbox), TRUE); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (app->mute_checkbox), FALSE); + gtk_spin_button_set_value (GTK_SPIN_BUTTON (app->volume_spinbutton), 1.0); + g_signal_connect (G_OBJECT (app->video_checkbox), "toggled", G_CALLBACK (video_toggle_cb), app); g_signal_connect (G_OBJECT (app->audio_checkbox), "toggled", @@ -2821,19 +3003,19 @@ create_ui (SeekApp * app) G_CALLBACK (text_toggle_cb), app); g_signal_connect (G_OBJECT (app->vis_checkbox), "toggled", G_CALLBACK (vis_toggle_cb), app); - g_signal_connect (G_OBJECT (soft_volume_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->soft_volume_checkbox), "toggled", G_CALLBACK (soft_volume_toggle_cb), app); - g_signal_connect (G_OBJECT (native_audio_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->native_audio_checkbox), "toggled", G_CALLBACK (native_audio_toggle_cb), app); - g_signal_connect (G_OBJECT (native_video_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->native_video_checkbox), "toggled", G_CALLBACK (native_video_toggle_cb), app); - g_signal_connect (G_OBJECT (download_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->download_checkbox), "toggled", G_CALLBACK (download_toggle_cb), app); - g_signal_connect (G_OBJECT (buffering_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->buffering_checkbox), "toggled", G_CALLBACK (buffering_toggle_cb), app); - g_signal_connect (G_OBJECT (deinterlace_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->deinterlace_checkbox), "toggled", G_CALLBACK (deinterlace_toggle_cb), app); - g_signal_connect (G_OBJECT (soft_colorbalance_checkbox), "toggled", + g_signal_connect (G_OBJECT (app->soft_colorbalance_checkbox), "toggled", G_CALLBACK (soft_colorbalance_toggle_cb), app); g_signal_connect (G_OBJECT (app->mute_checkbox), "toggled", G_CALLBACK (mute_toggle_cb), app); @@ -2856,10 +3038,99 @@ create_ui (SeekApp * app) /* fill the vis combo box and the array of factories */ init_visualization_features (app); + /* Grid with other properties */ + boxes3 = gtk_grid_new (); + gtk_grid_set_row_spacing (GTK_GRID (boxes3), 2); + gtk_grid_set_row_homogeneous (GTK_GRID (boxes3), FALSE); + gtk_grid_set_column_spacing (GTK_GRID (boxes3), 2); + gtk_grid_set_column_homogeneous (GTK_GRID (boxes3), TRUE); + + label = gtk_label_new ("Video sink"); + gtk_grid_attach (GTK_GRID (boxes3), label, 0, 0, 1, 1); + app->video_sink_entry = gtk_entry_new (); + g_signal_connect (app->video_sink_entry, "activate", + G_CALLBACK (video_sink_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->video_sink_entry, 0, 1, 1, 1); + + label = gtk_label_new ("Audio sink"); + gtk_grid_attach (GTK_GRID (boxes3), label, 1, 0, 1, 1); + app->audio_sink_entry = gtk_entry_new (); + g_signal_connect (app->audio_sink_entry, "activate", + G_CALLBACK (audio_sink_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->audio_sink_entry, 1, 1, 1, 1); + + label = gtk_label_new ("Text sink"); + gtk_grid_attach (GTK_GRID (boxes3), label, 2, 0, 1, 1); + app->text_sink_entry = gtk_entry_new (); + g_signal_connect (app->text_sink_entry, "activate", + G_CALLBACK (text_sink_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->text_sink_entry, 2, 1, 1, 1); + + label = gtk_label_new ("Buffer Size"); + gtk_grid_attach (GTK_GRID (boxes3), label, 0, 2, 1, 1); + app->buffer_size_entry = gtk_entry_new (); + gtk_entry_set_text (GTK_ENTRY (app->buffer_size_entry), "-1"); + g_signal_connect (app->buffer_size_entry, "activate", + G_CALLBACK (buffer_size_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->buffer_size_entry, 0, 3, 1, 1); + + label = gtk_label_new ("Buffer Duration"); + gtk_grid_attach (GTK_GRID (boxes3), label, 1, 2, 1, 1); + app->buffer_duration_entry = gtk_entry_new (); + gtk_entry_set_text (GTK_ENTRY (app->buffer_duration_entry), "-1"); + g_signal_connect (app->buffer_duration_entry, "activate", + G_CALLBACK (buffer_duration_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->buffer_duration_entry, 1, 3, 1, 1); + + label = gtk_label_new ("Ringbuffer Max Size"); + gtk_grid_attach (GTK_GRID (boxes3), label, 2, 2, 1, 1); + app->ringbuffer_maxsize_entry = gtk_entry_new (); + gtk_entry_set_text (GTK_ENTRY (app->ringbuffer_maxsize_entry), "0"); + g_signal_connect (app->ringbuffer_maxsize_entry, "activate", + G_CALLBACK (ringbuffer_maxsize_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->ringbuffer_maxsize_entry, 2, 3, 1, + 1); + + label = gtk_label_new ("Connection Speed"); + gtk_grid_attach (GTK_GRID (boxes3), label, 3, 2, 1, 1); + app->connection_speed_entry = gtk_entry_new (); + gtk_entry_set_text (GTK_ENTRY (app->connection_speed_entry), "0"); + g_signal_connect (app->connection_speed_entry, "activate", + G_CALLBACK (connection_speed_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->connection_speed_entry, 3, 3, 1, + 1); + + label = gtk_label_new ("A/V offset"); + gtk_grid_attach (GTK_GRID (boxes3), label, 4, 2, 1, 1); + app->av_offset_entry = gtk_entry_new (); + g_signal_connect (app->av_offset_entry, "activate", + G_CALLBACK (av_offset_activate_cb), app); + gtk_entry_set_text (GTK_ENTRY (app->av_offset_entry), "0"); + g_signal_connect (app->av_offset_entry, "activate", + G_CALLBACK (av_offset_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->av_offset_entry, 4, 3, 1, 1); + + label = gtk_label_new ("Subtitle Encoding"); + gtk_grid_attach (GTK_GRID (boxes3), label, 0, 4, 1, 1); + app->subtitle_encoding_entry = gtk_entry_new (); + g_signal_connect (app->subtitle_encoding_entry, "activate", + G_CALLBACK (subtitle_encoding_activate_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->subtitle_encoding_entry, 0, 5, 1, + 1); + + label = gtk_label_new ("Subtitle Fontdesc"); + gtk_grid_attach (GTK_GRID (boxes3), label, 1, 4, 1, 1); + app->subtitle_fontdesc_button = gtk_font_button_new (); + g_signal_connect (app->subtitle_fontdesc_button, "font-set", + G_CALLBACK (subtitle_fontdesc_cb), app); + gtk_grid_attach (GTK_GRID (boxes3), app->subtitle_fontdesc_button, 1, 5, 1, + 1); + pb2vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (pb2vbox), panel, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (pb2vbox), boxes, FALSE, FALSE, 2); gtk_box_pack_start (GTK_BOX (pb2vbox), boxes2, FALSE, FALSE, 2); + gtk_box_pack_start (GTK_BOX (pb2vbox), boxes3, FALSE, FALSE, 2); gtk_container_add (GTK_CONTAINER (playbin), pb2vbox); } else { playbin = NULL; From 87d41b87a0bf12a403221964a8588bf611b15c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Thu, 1 Mar 2012 13:24:45 +0100 Subject: [PATCH 50/50] seek: Add support for setting a subtitle URI --- tests/examples/seek/seek.c | 47 ++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 7 deletions(-) diff --git a/tests/examples/seek/seek.c b/tests/examples/seek/seek.c index dd5206d5a7..9502c8d42c 100644 --- a/tests/examples/seek/seek.c +++ b/tests/examples/seek/seek.c @@ -158,6 +158,7 @@ typedef struct const gchar *pipeline_spec; gint pipeline_type; GList *paths, *current_path; + GList *sub_paths, *current_sub_path; gchar *audiosink_str, *videosink_str; @@ -231,22 +232,32 @@ gst_element_factory_make_or_warn (const gchar * type, const gchar * name) } static void -playbin_set_uri (GstElement * playbin, const gchar * location) +set_uri_property (GObject * object, const gchar * property, + const gchar * location) { gchar *uri; /* Add "file://" prefix for convenience */ - if (g_str_has_prefix (location, "/") || !gst_uri_is_valid (location)) { + if (location && (g_str_has_prefix (location, "/") + || !gst_uri_is_valid (location))) { uri = gst_filename_to_uri (location, NULL); g_print ("Setting URI: %s\n", uri); - g_object_set (G_OBJECT (playbin), "uri", uri, NULL); + g_object_set (object, property, uri, NULL); g_free (uri); } else { g_print ("Setting URI: %s\n", location); - g_object_set (G_OBJECT (playbin), "uri", location, NULL); + g_object_set (object, property, location, NULL); } } +static void +playbin_set_uri (GstElement * playbin, const gchar * location, + const gchar * sub_location) +{ + set_uri_property (G_OBJECT (playbin), "uri", location); + set_uri_property (G_OBJECT (playbin), "suburi", sub_location); +} + static void make_playbin2_pipeline (SeekApp * app, const gchar * location) { @@ -255,7 +266,8 @@ make_playbin2_pipeline (SeekApp * app, const gchar * location) app->pipeline = pipeline = gst_element_factory_make ("playbin2", "playbin2"); g_assert (pipeline); - playbin_set_uri (pipeline, location); + playbin_set_uri (pipeline, location, + app->current_sub_path ? app->current_sub_path->data : NULL); g_signal_connect (pipeline, "notify::volume", G_CALLBACK (volume_notify_cb), app); @@ -2161,8 +2173,10 @@ msg_eos (GstBus * bus, GstMessage * message, SeekApp * app) if (app->current_path && app->pipeline_type == 0) { stop_cb (NULL, app); app->current_path = g_list_next (app->current_path); + app->current_sub_path = g_list_next (app->current_sub_path); if (app->current_path) { - playbin_set_uri (app->pipeline, app->current_path->data); + playbin_set_uri (app->pipeline, app->current_path->data, + app->current_sub_path ? app->current_sub_path->data : NULL); play_cb (NULL, app); } } @@ -3206,6 +3220,8 @@ reset_app (SeekApp * app) g_list_foreach (app->paths, (GFunc) g_free, NULL); g_list_free (app->paths); + g_list_foreach (app->sub_paths, (GFunc) g_free, NULL); + g_list_free (app->sub_paths); g_print ("free pipeline\n"); gst_object_unref (app->pipeline); @@ -3244,7 +3260,7 @@ main (int argc, char **argv) GST_DEBUG_CATEGORY_INIT (seek_debug, "seek", 0, "seek example"); - if (argc != 3) { + if (argc < 3) { print_usage (argc, argv); exit (-1); } @@ -3273,6 +3289,23 @@ main (int argc, char **argv) app.current_path = app.paths; + if (argc > 3 && argv[3]) { + if (g_path_is_absolute (argv[3]) && + (g_strrstr (argv[3], "*") != NULL || + g_strrstr (argv[3], "?") != NULL)) { + app.sub_paths = handle_wildcards (argv[3]); + } else { + app.sub_paths = g_list_prepend (app.sub_paths, g_strdup (argv[3])); + } + + if (!app.sub_paths) { + g_print ("opening %s failed\n", argv[3]); + exit (-1); + } + + app.current_sub_path = app.sub_paths; + } + pipelines[app.pipeline_type].func (&app, app.current_path->data); g_assert (app.pipeline);