summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--gst/switch/gstswitch.c19
2 files changed, 22 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 916cd0b8..709e32f6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
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.
+
* gst/switch/gstswitch.h (struct _GstStreamSelector): Add some
state variables.
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;