summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kost <ensonic@users.sf.net>2010-09-08 09:37:42 +0300
committerStefan Kost <ensonic@users.sf.net>2010-09-08 10:25:55 +0300
commit770694f0f126a5cbeddf0fc14bee84bfb82049d9 (patch)
treebca2728b81db1a936c4b2bc0fdcccffaa67c1fb2
parent63667aa9b4d6070d8852d6e42428041184e4a636 (diff)
pad: add a unchecked variant for pull
Add internal _get_range_unchecked thats is called from _get_range and _pull_range.
-rw-r--r--gst/gstpad.c62
1 files changed, 34 insertions, 28 deletions
diff --git a/gst/gstpad.c b/gst/gstpad.c
index 79764ebf5..52909fab5 100644
--- a/gst/gstpad.c
+++ b/gst/gstpad.c
@@ -4630,29 +4630,8 @@ not_connected:
}
}
-/**
- * gst_pad_get_range:
- * @pad: a src #GstPad, returns #GST_FLOW_ERROR if not.
- * @offset: The start offset of the buffer
- * @size: The length of the buffer
- * @buffer: a pointer to hold the #GstBuffer, returns #GST_FLOW_ERROR if %NULL.
- *
- * When @pad is flushing this function returns #GST_FLOW_WRONG_STATE
- * immediatly and @buffer is %NULL.
- *
- * Calls the getrange function of @pad, see #GstPadGetRangeFunction for a
- * description of a getrange function. If @pad has no getrange function
- * installed (see gst_pad_set_getrange_function()) this function returns
- * #GST_FLOW_NOT_SUPPORTED.
- *
- * This is a lowlevel function. Usualy gst_pad_pull_range() is used.
- *
- * Returns: a #GstFlowReturn from the pad.
- *
- * MT safe.
- */
-GstFlowReturn
-gst_pad_get_range (GstPad * pad, guint64 offset, guint size,
+static GstFlowReturn
+gst_pad_get_range_unchecked (GstPad * pad, guint64 offset, guint size,
GstBuffer ** buffer)
{
GstFlowReturn ret;
@@ -4661,10 +4640,6 @@ gst_pad_get_range (GstPad * pad, guint64 offset, guint size,
GstCaps *caps;
gboolean caps_changed;
- g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
- g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
- g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR);
-
GST_PAD_STREAM_LOCK (pad);
GST_OBJECT_LOCK (pad);
@@ -4754,6 +4729,37 @@ not_negotiated:
}
}
+/**
+ * gst_pad_get_range:
+ * @pad: a src #GstPad, returns #GST_FLOW_ERROR if not.
+ * @offset: The start offset of the buffer
+ * @size: The length of the buffer
+ * @buffer: a pointer to hold the #GstBuffer, returns #GST_FLOW_ERROR if %NULL.
+ *
+ * When @pad is flushing this function returns #GST_FLOW_WRONG_STATE
+ * immediatly and @buffer is %NULL.
+ *
+ * Calls the getrange function of @pad, see #GstPadGetRangeFunction for a
+ * description of a getrange function. If @pad has no getrange function
+ * installed (see gst_pad_set_getrange_function()) this function returns
+ * #GST_FLOW_NOT_SUPPORTED.
+ *
+ * This is a lowlevel function. Usualy gst_pad_pull_range() is used.
+ *
+ * Returns: a #GstFlowReturn from the pad.
+ *
+ * MT safe.
+ */
+GstFlowReturn
+gst_pad_get_range (GstPad * pad, guint64 offset, guint size,
+ GstBuffer ** buffer)
+{
+ g_return_val_if_fail (GST_IS_PAD (pad), GST_FLOW_ERROR);
+ g_return_val_if_fail (GST_PAD_IS_SRC (pad), GST_FLOW_ERROR);
+ g_return_val_if_fail (buffer != NULL, GST_FLOW_ERROR);
+
+ return gst_pad_get_range_unchecked (pad, offset, size, buffer);
+}
/**
* gst_pad_pull_range:
@@ -4813,7 +4819,7 @@ gst_pad_pull_range (GstPad * pad, guint64 offset, guint size,
gst_object_ref (peer);
GST_OBJECT_UNLOCK (pad);
- ret = gst_pad_get_range (peer, offset, size, buffer);
+ ret = gst_pad_get_range_unchecked (peer, offset, size, buffer);
gst_object_unref (peer);