summaryrefslogtreecommitdiff
path: root/gst/gdp
diff options
context:
space:
mode:
authorWim Taymans <wim.taymans@collabora.co.uk>2012-01-20 16:11:54 +0100
committerTim-Philipp Müller <tim@centricular.net>2012-09-11 01:54:44 +0100
commit33344dc2b9724408a7440602bd3b6a06a5e951b2 (patch)
tree03bc3c288fdf759a297ec3f87700b75438d0306a /gst/gdp
parent0a817d23e68951664d196900a0b4dd0907ff95c7 (diff)
downloadgstreamer-plugins-bad-33344dc2b9724408a7440602bd3b6a06a5e951b2.tar.gz
port to new map API
Diffstat (limited to 'gst/gdp')
-rw-r--r--gst/gdp/dataprotocol.c11
-rw-r--r--gst/gdp/gstgdpdepay.c8
2 files changed, 9 insertions, 10 deletions
diff --git a/gst/gdp/dataprotocol.c b/gst/gdp/dataprotocol.c
index 0308df9a0..e17583db8 100644
--- a/gst/gdp/dataprotocol.c
+++ b/gst/gdp/dataprotocol.c
@@ -131,8 +131,7 @@ gst_dp_header_from_buffer_any (const GstBuffer * buffer, GstDPHeaderFlag flags,
{
guint8 *h;
guint16 flags_mask;
- guint8 *data;
- gsize size;
+ GstMapInfo map;
g_return_val_if_fail (GST_IS_BUFFER (buffer), FALSE);
g_return_val_if_fail (length, FALSE);
@@ -144,10 +143,10 @@ gst_dp_header_from_buffer_any (const GstBuffer * buffer, GstDPHeaderFlag flags,
/* version, flags, type */
GST_DP_INIT_HEADER (h, version, flags, GST_DP_PAYLOAD_BUFFER);
- data = gst_buffer_map ((GstBuffer *) buffer, &size, NULL, GST_MAP_READ);
+ gst_buffer_map ((GstBuffer *) buffer, &map, GST_MAP_READ);
/* buffer properties */
- GST_WRITE_UINT32_BE (h + 6, size);
+ GST_WRITE_UINT32_BE (h + 6, map.size);
GST_WRITE_UINT64_BE (h + 10, GST_BUFFER_TIMESTAMP (buffer));
GST_WRITE_UINT64_BE (h + 18, GST_BUFFER_DURATION (buffer));
GST_WRITE_UINT64_BE (h + 26, GST_BUFFER_OFFSET (buffer));
@@ -161,9 +160,9 @@ gst_dp_header_from_buffer_any (const GstBuffer * buffer, GstDPHeaderFlag flags,
GST_WRITE_UINT16_BE (h + 42, GST_BUFFER_FLAGS (buffer) & flags_mask);
- GST_DP_SET_CRC (h, flags, data, size);
+ GST_DP_SET_CRC (h, flags, map.data, map.size);
- gst_buffer_unmap ((GstBuffer *) buffer, data, size);
+ gst_buffer_unmap ((GstBuffer *) buffer, &map);
GST_LOG ("created header from buffer:");
gst_dp_dump_byte_array (h, GST_DP_HEADER_LENGTH);
diff --git a/gst/gdp/gstgdpdepay.c b/gst/gdp/gstgdpdepay.c
index f397a3fe4..35a5c1610 100644
--- a/gst/gdp/gstgdpdepay.c
+++ b/gst/gdp/gstgdpdepay.c
@@ -308,11 +308,11 @@ gst_gdp_depay_chain (GstPad * pad, GstObject * parent, GstBuffer * buffer)
/* now take the payload if there is any */
if (this->payload_length > 0) {
- guint8 *payload;
+ GstMapInfo map;
- payload = gst_buffer_map (buf, NULL, NULL, GST_MAP_WRITE);
- gst_adapter_copy (this->adapter, payload, 0, this->payload_length);
- gst_buffer_unmap (buf, payload, this->payload_length);
+ gst_buffer_map (buf, &map, GST_MAP_WRITE);
+ gst_adapter_copy (this->adapter, map.data, 0, this->payload_length);
+ gst_buffer_unmap (buf, &map);
gst_adapter_flush (this->adapter, this->payload_length);
}