diff options
author | Andy Wingo <wingo@pobox.com> | 2007-12-17 14:58:18 +0000 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2007-12-17 14:58:18 +0000 |
commit | 632461e211200b2293d987c2d48c77f2db89e046 (patch) | |
tree | 414a9c6b708061dc0be3fa26caa012c705befb51 /gst | |
parent | 7a36821856aacdc8273dbd0c2e6b25b335ecab76 (diff) | |
download | gst-plugins-bad-632461e211200b2293d987c2d48c77f2db89e046.tar.gz gst-plugins-bad-632461e211200b2293d987c2d48c77f2db89e046.tar.bz2 gst-plugins-bad-632461e211200b2293d987c2d48c77f2db89e046.zip |
gst/switch/gstswitch.c (gst_stream_selector_class_init)
Original commit message from CVS:
2007-12-17 Andy Wingo <wingo@pobox.com>
* gst/switch/gstswitch.c (gst_stream_selector_class_init)
(gst_stream_selector_get_property): Add last-stop-time readable
property. Patch 6/12.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/switch/gstswitch.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/gst/switch/gstswitch.c b/gst/switch/gstswitch.c index 687dac3e..e7456dce 100644 --- a/gst/switch/gstswitch.c +++ b/gst/switch/gstswitch.c @@ -55,7 +55,8 @@ GST_STATIC_PAD_TEMPLATE ("src", enum { - PROP_ACTIVE_PAD = 1 + PROP_ACTIVE_PAD = 1, + PROP_LAST_STOP_TIME }; enum @@ -443,6 +444,10 @@ gst_stream_selector_class_init (GstStreamSelectorClass * klass) g_object_class_install_property (gobject_class, PROP_ACTIVE_PAD, g_param_spec_string ("active-pad", "Active pad", "Name of the currently" " active sink pad", NULL, G_PARAM_READWRITE)); + g_object_class_install_property (gobject_class, PROP_LAST_STOP_TIME, + g_param_spec_uint64 ("last-stop-time", "Last stop time", + "Last stop time on active pad", 0, G_MAXUINT64, GST_CLOCK_TIME_NONE, + G_PARAM_READABLE)); gobject_class->dispose = gst_stream_selector_dispose; gstelement_class->request_new_pad = gst_stream_selector_request_new_pad; gstelement_class->release_pad = gst_stream_selector_release_pad; @@ -592,6 +597,18 @@ gst_stream_selector_get_property (GObject * object, guint prop_id, GST_OBJECT_UNLOCK (object); break; } + case PROP_LAST_STOP_TIME:{ + GstSelectorPad *spad; + + GST_OBJECT_LOCK (object); + spad = GST_SELECTOR_PAD_CAST (sel->active_sinkpad); + if (spad && spad->active) + g_value_set_uint64 (value, spad->segment.last_stop); + else + g_value_set_uint64 (value, GST_CLOCK_TIME_NONE); + GST_OBJECT_UNLOCK (object); + break; + } default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; |