summaryrefslogtreecommitdiffstats
path: root/ext/metadata
diff options
context:
space:
mode:
authorEdgard Lima <edgard.lima@indt.org.br>2007-11-26 09:38:24 +0000
committerEdgard Lima <edgard.lima@indt.org.br>2007-11-26 09:38:24 +0000
commitfcebc2b4f548bcb9d6b8f0b4aaa7c1272205bf2d (patch)
treebaaa7672f01dc6442b6668e6afd31d9e493f84fc /ext/metadata
parentd222cb6c1456a48b90b2887ba8f5f2e9358bc79d (diff)
downloadgst-plugins-bad-fcebc2b4f548bcb9d6b8f0b4aaa7c1272205bf2d.tar.gz
gst-plugins-bad-fcebc2b4f548bcb9d6b8f0b4aaa7c1272205bf2d.tar.bz2
gst-plugins-bad-fcebc2b4f548bcb9d6b8f0b4aaa7c1272205bf2d.zip
Now works when get_range is not available upstream.
Original commit message from CVS: Now works when get_range is not available upstream.
Diffstat (limited to 'ext/metadata')
-rw-r--r--ext/metadata/gstmetadataparse.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/metadata/gstmetadataparse.c b/ext/metadata/gstmetadataparse.c
index dfe7502e..cf7783db 100644
--- a/ext/metadata/gstmetadataparse.c
+++ b/ext/metadata/gstmetadataparse.c
@@ -137,6 +137,8 @@ static gboolean gst_metadata_parse_sink_event (GstPad * pad, GstEvent * event);
static GstFlowReturn gst_metadata_parse_chain (GstPad * pad, GstBuffer * buf);
+static gboolean gst_metadata_parse_checkgetrange (GstPad * srcpad);
+
static gboolean
gst_metadata_parse_get_range (GstPad * pad, guint64 offset_orig, guint size,
GstBuffer ** buf);
@@ -272,6 +274,8 @@ gst_metadata_parse_init (GstMetadataParse * filter,
GST_DEBUG_FUNCPTR (gst_metadata_parse_get_query_types));
gst_pad_use_fixed_caps (filter->srcpad);
+ gst_pad_set_checkgetrange_function (filter->srcpad,
+ GST_DEBUG_FUNCPTR (gst_metadata_parse_checkgetrange));
gst_pad_set_getrange_function (filter->srcpad, gst_metadata_parse_get_range);
gst_pad_set_activatepull_function (filter->srcpad,
@@ -982,7 +986,8 @@ gst_metadata_parse_chain (GstPad * pad, GstBuffer * buf)
new_buf =
gst_buffer_new_and_alloc (GST_BUFFER_SIZE (buf) -
filter->next_offset);
- memcpy (GST_BUFFER_DATA (new_buf), GST_BUFFER_DATA (buf),
+ memcpy (GST_BUFFER_DATA (new_buf),
+ GST_BUFFER_DATA (buf) + filter->next_offset,
GST_BUFFER_SIZE (buf) - filter->next_offset);
filter->next_offset = 0;
gst_adapter_push (filter->adapter_parsing, new_buf);
@@ -1593,6 +1598,16 @@ done:
}
static gboolean
+gst_metadata_parse_checkgetrange (GstPad * srcpad)
+{
+ GstMetadataParse *filter = NULL;
+
+ filter = GST_METADATA_PARSE (GST_PAD_PARENT (srcpad));
+
+ return gst_pad_check_pull_range (filter->sinkpad);
+}
+
+static gboolean
gst_metadata_parse_get_range (GstPad * pad,
guint64 offset, guint size, GstBuffer ** buf)
{