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.
This commit is contained in:
Andy Wingo 2007-12-17 14:58:18 +00:00
parent 7a36821856
commit 632461e211
2 changed files with 22 additions and 1 deletions

View file

@ -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.

View 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;