gst/switch/gstswitch.c (gst_stream_selector_class_init)
authorAndy Wingo <wingo@pobox.com>
Mon, 17 Dec 2007 14:58:18 +0000 (14:58 +0000)
committerAndy Wingo <wingo@pobox.com>
Mon, 17 Dec 2007 14:58:18 +0000 (14:58 +0000)
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.

ChangeLog
gst/switch/gstswitch.c

index 916cd0b82fde52cd8614ca789c7a6121331c7701..709e32f66b557732a34a5b3319d4575862ba1c36 100644 (file)
--- 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.
 
index 687dac3ed10701476e3e52ad506ed21f140fcc8f..e7456dced62a354b772491823d64161a49286787 100644 (file)
@@ -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;