summaryrefslogtreecommitdiff
path: root/gst/pcapparse
diff options
context:
space:
mode:
authorOlivier CrĂȘte <olivier.crete@collabora.com>2015-04-10 20:15:52 -0400
committerOlivier CrĂȘte <olivier.crete@collabora.com>2015-04-10 20:27:15 -0400
commita2b093af471e6e7d76c92ff97eb5bbbb8f88b903 (patch)
tree459b37dd707e97b8ae5865bde997cbb2ea79b0e6 /gst/pcapparse
parent5a1c73a1054f31e9a3169d747b6ffd3fd50e969c (diff)
downloadgstreamer-plugins-bad-a2b093af471e6e7d76c92ff97eb5bbbb8f88b903.tar.gz
pcapparse: Produce GstBufferList
Diffstat (limited to 'gst/pcapparse')
-rw-r--r--gst/pcapparse/gstpcapparse.c37
1 files changed, 24 insertions, 13 deletions
diff --git a/gst/pcapparse/gstpcapparse.c b/gst/pcapparse/gstpcapparse.c
index ade724d1a..70e6f46f5 100644
--- a/gst/pcapparse/gstpcapparse.c
+++ b/gst/pcapparse/gstpcapparse.c
@@ -453,6 +453,7 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
{
GstPcapParse *self = GST_PCAP_PARSE (parent);
GstFlowReturn ret = GST_FLOW_OK;
+ GstBufferList *list = NULL;
gst_adapter_push (self->adapter, buffer);
@@ -498,20 +499,10 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
gst_buffer_unmap (out_buf, &map);
GST_BUFFER_TIMESTAMP (out_buf) = self->cur_ts;
- if (!self->newsegment_sent &&
- GST_CLOCK_TIME_IS_VALID (self->cur_ts)) {
- GstSegment segment;
-
- if (self->caps)
- gst_pad_set_caps (self->src_pad, self->caps);
- gst_segment_init (&segment, GST_FORMAT_TIME);
- segment.start = self->cur_ts;
- gst_pad_push_event (self->src_pad,
- gst_event_new_segment (&segment));
- self->newsegment_sent = TRUE;
- }
- ret = gst_pad_push (self->src_pad, out_buf);
+ if (list == NULL)
+ list = gst_buffer_list_new ();
+ gst_buffer_list_add (list, out_buf);
self->buffer_offset += payload_size;
}
@@ -594,7 +585,27 @@ gst_pcap_parse_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
}
}
+ if (list) {
+ if (!self->newsegment_sent && GST_CLOCK_TIME_IS_VALID (self->cur_ts)) {
+ GstSegment segment;
+
+ if (self->caps)
+ gst_pad_set_caps (self->src_pad, self->caps);
+ gst_segment_init (&segment, GST_FORMAT_TIME);
+ segment.start = self->cur_ts;
+ gst_pad_push_event (self->src_pad, gst_event_new_segment (&segment));
+ self->newsegment_sent = TRUE;
+ }
+
+ ret = gst_pad_push_list (self->src_pad, list);
+ list = NULL;
+ }
+
out:
+
+ if (list)
+ gst_buffer_list_unref (list);
+
if (ret != GST_FLOW_OK)
gst_pcap_parse_reset (self);