diff options
author | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-05-19 16:26:06 +0200 |
---|---|---|
committer | Wim Taymans <wim.taymans@collabora.co.uk> | 2011-05-19 18:34:43 +0200 |
commit | c8340e77620fbd9d1090590dc1d00e201541ee67 (patch) | |
tree | 116302570099f48e3c2385cd629207a0c7347dae /gst | |
parent | 9c4ce4ae16822622ab25b525640b4e19109935c3 (diff) |
pad: add methods to adjust the offset
Add methods to adjust the offset. This will be used to change the segment events
with an offset so that we can tweak the timing of the stream on a per-pad base.
Diffstat (limited to 'gst')
-rw-r--r-- | gst/gstpad.c | 42 | ||||
-rw-r--r-- | gst/gstpad.h | 7 |
2 files changed, 49 insertions, 0 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c index b058b9e67..c2ce2e5ee 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -3584,6 +3584,48 @@ flushing: } } +/* pad offsets */ + +/** + * gst_pad_get_offset: + * @pad: a #GstPad + * + * Get the offset applied to the running time of @pad. + * + * Returns: the offset. + */ +gint64 +gst_pad_get_offset (GstPad * pad) +{ + gint64 result; + + g_return_val_if_fail (GST_IS_PAD (pad), 0); + + GST_OBJECT_LOCK (pad); + result = pad->offset; + GST_OBJECT_UNLOCK (pad); + + return result; +} + +/** + * gst_pad_set_offset: + * @pad: a #GstPad + * @offset: the offset + * + * Set the offset that will be applied to the running time of @pad. + */ +void +gst_pad_set_offset (GstPad * pad, gint64 offset) +{ + g_return_if_fail (GST_IS_PAD (pad)); + + GST_OBJECT_LOCK (pad); + pad->offset = offset; + GST_OBJECT_UNLOCK (pad); +} + + /********************************************************************** * Data passing functions */ diff --git a/gst/gstpad.h b/gst/gstpad.h index 18b7776d6..0e3c19b8e 100644 --- a/gst/gstpad.h +++ b/gst/gstpad.h @@ -630,6 +630,9 @@ struct _GstPad { GstPadGetRangeFunction getrangefunc; GstPadEventFunction eventfunc; + /* pad offset */ + gint64 offset; + /* generic query method */ GstPadQueryTypeFunction querytypefunc; GstPadQueryFunction queryfunc; @@ -865,6 +868,10 @@ gboolean gst_pad_peer_accept_caps (GstPad * pad, GstCaps *caps); GstCaps * gst_pad_get_allowed_caps (GstPad * pad); GstCaps * gst_pad_get_negotiated_caps (GstPad * pad); +/* pad offsets */ +gint64 gst_pad_get_offset (GstPad *pad); +void gst_pad_set_offset (GstPad *pad, gint64 offset); + /* data passing functions to peer */ GstFlowReturn gst_pad_push (GstPad *pad, GstBuffer *buffer); GstFlowReturn gst_pad_push_list (GstPad *pad, GstBufferList *list); |