diff options
author | Tim-Philipp Müller <tim@centricular.com> | 2015-02-05 13:49:47 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2015-02-05 13:49:47 +0000 |
commit | 08167e3234a3fb277bccb2de6370ff14e218616d (patch) | |
tree | ec35feda6d19eee4a92cd354989750355434a718 /gst/gstpad.c | |
parent | 423bd42d44fdf0d8969d38d963aab15f1bb7f016 (diff) |
pad: add "offset" property to go with gst_pad_set_offset()
So we can set the offset via gst-launch.
Diffstat (limited to 'gst/gstpad.c')
-rw-r--r-- | gst/gstpad.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c index 90f3ab00c..dfa1eeabb 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -115,7 +115,8 @@ enum PAD_PROP_CAPS, PAD_PROP_DIRECTION, PAD_PROP_TEMPLATE, - /* FILL ME */ + PAD_PROP_OFFSET + /* FILL ME */ }; #define GST_PAD_GET_PRIVATE(obj) \ @@ -355,6 +356,18 @@ gst_pad_class_init (GstPadClass * klass) "The GstPadTemplate of this pad", GST_TYPE_PAD_TEMPLATE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + /** + * GstPad:offset: + * + * The offset that will be applied to the running time of the pad. + * + * Since: 1.6 + */ + g_object_class_install_property (gobject_class, PAD_PROP_OFFSET, + g_param_spec_int64 ("offset", "Offset", + "The running time offset of the pad", 0, G_MAXINT64, 0, + G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); + gstobject_class->path_string_separator = "."; /* Register common function pointer descriptions */ @@ -747,6 +760,9 @@ gst_pad_set_property (GObject * object, guint prop_id, gst_pad_set_pad_template (GST_PAD_CAST (object), (GstPadTemplate *) g_value_get_object (value)); break; + case PAD_PROP_OFFSET: + gst_pad_set_offset (GST_PAD_CAST (object), g_value_get_int64 (value)); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; @@ -771,6 +787,9 @@ gst_pad_get_property (GObject * object, guint prop_id, case PAD_PROP_TEMPLATE: g_value_set_object (value, GST_PAD_PAD_TEMPLATE (object)); break; + case PAD_PROP_OFFSET: + g_value_set_int64 (value, gst_pad_get_offset (GST_PAD_CAST (object))); + break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; |