From 7e12b58e37d7fa669d21b9b4144fd29686091ace Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 10 Nov 2011 18:32:58 +0100 Subject: [PATCH] update for adapter api changes --- ext/flac/gstflactag.c | 2 +- gst/auparse/gstauparse.c | 11 ++++++----- gst/avi/gstavidemux.c | 4 ++-- gst/goom/gstgoom.c | 4 ++-- gst/icydemux/gsticydemux.c | 3 ++- gst/isomp4/qtdemux.c | 6 +++--- gst/multipart/multipartdemux.c | 14 +++++++------- gst/rtp/gstrtph263pay.c | 3 ++- gst/rtp/gstrtph263ppay.c | 2 +- gst/rtp/gstrtph264pay.c | 3 ++- gst/wavparse/gstwavparse.c | 9 +++++---- 11 files changed, 33 insertions(+), 28 deletions(-) diff --git a/ext/flac/gstflactag.c b/ext/flac/gstflactag.c index 579ee84173..d7df97e888 100644 --- a/ext/flac/gstflactag.c +++ b/ext/flac/gstflactag.c @@ -249,7 +249,7 @@ gst_flac_tag_chain (GstPad * pad, GstBuffer * buffer) size = (block_header[1] << 16) | (block_header[2] << 8) | block_header[3]; - gst_adapter_unmap (tag->adapter, 0); + gst_adapter_unmap (tag->adapter); /* The 4 bytes long header isn't included in the metadata size */ tag->metadata_block_size = size + 4; diff --git a/gst/auparse/gstauparse.c b/gst/auparse/gstauparse.c index bf7b6398ac..e6c32a77ac 100644 --- a/gst/auparse/gstauparse.c +++ b/gst/auparse/gstauparse.c @@ -351,7 +351,8 @@ gst_au_parse_parse_header (GstAuParse * auparse) gst_au_parse_negotiate_srcpad (auparse, tempcaps); GST_DEBUG_OBJECT (auparse, "offset=%" G_GINT64_FORMAT, auparse->offset); - gst_adapter_unmap (auparse->adapter, auparse->offset); + gst_adapter_unmap (auparse->adapter); + gst_adapter_flush (auparse->adapter, auparse->offset); gst_caps_unref (tempcaps); return GST_FLOW_OK; @@ -359,27 +360,27 @@ gst_au_parse_parse_header (GstAuParse * auparse) /* ERRORS */ unknown_header: { - gst_adapter_unmap (auparse->adapter, 0); + gst_adapter_unmap (auparse->adapter); GST_ELEMENT_ERROR (auparse, STREAM, WRONG_TYPE, (NULL), (NULL)); return GST_FLOW_ERROR; } unsupported_sample_rate: { - gst_adapter_unmap (auparse->adapter, 0); + gst_adapter_unmap (auparse->adapter); GST_ELEMENT_ERROR (auparse, STREAM, FORMAT, (NULL), ("Unsupported samplerate: %u", auparse->samplerate)); return GST_FLOW_ERROR; } unsupported_number_of_channels: { - gst_adapter_unmap (auparse->adapter, 0); + gst_adapter_unmap (auparse->adapter); GST_ELEMENT_ERROR (auparse, STREAM, FORMAT, (NULL), ("Unsupported number of channels: %u", auparse->channels)); return GST_FLOW_ERROR; } unknown_format: { - gst_adapter_unmap (auparse->adapter, 0); + gst_adapter_unmap (auparse->adapter); GST_ELEMENT_ERROR (auparse, STREAM, FORMAT, (NULL), ("Unsupported encoding: %u", auparse->encoding)); return GST_FLOW_ERROR; diff --git a/gst/avi/gstavidemux.c b/gst/avi/gstavidemux.c index 604ae1e44a..98e353c3bd 100644 --- a/gst/avi/gstavidemux.c +++ b/gst/avi/gstavidemux.c @@ -914,7 +914,7 @@ gst_avi_demux_peek_chunk_info (GstAviDemux * avi, guint32 * tag, guint32 * size) data = gst_adapter_map (avi->adapter, 8); *tag = GST_READ_UINT32_LE (data); *size = GST_READ_UINT32_LE (data + 4); - gst_adapter_unmap (avi->adapter, 0); + gst_adapter_unmap (avi->adapter); return TRUE; } @@ -3248,7 +3248,7 @@ gst_avi_demux_stream_header_push (GstAviDemux * avi) tag = GST_READ_UINT32_LE (data); size = GST_READ_UINT32_LE (data + 4); ltag = GST_READ_UINT32_LE (data + 8); - gst_adapter_unmap (avi->adapter, 0); + gst_adapter_unmap (avi->adapter); if (tag == GST_RIFF_TAG_LIST) { switch (ltag) { diff --git a/gst/goom/gstgoom.c b/gst/goom/gstgoom.c index df50cea321..3fc283c606 100644 --- a/gst/goom/gstgoom.c +++ b/gst/goom/gstgoom.c @@ -612,7 +612,7 @@ gst_goom_chain (GstPad * pad, GstBuffer * buffer) GST_DEBUG_OBJECT (goom, "allocating output buffer"); ret = gst_buffer_pool_acquire_buffer (goom->pool, &outbuf, NULL); if (ret != GST_FLOW_OK) { - gst_adapter_unmap (goom->adapter, 0); + gst_adapter_unmap (goom->adapter); goto beach; } } @@ -623,7 +623,7 @@ gst_goom_chain (GstPad * pad, GstBuffer * buffer) out_frame = (guchar *) goom_update (goom->plugin, goom->datain, 0, 0); gst_buffer_fill (outbuf, 0, out_frame, goom->outsize); - gst_adapter_unmap (goom->adapter, 0); + gst_adapter_unmap (goom->adapter); GST_DEBUG ("Pushing frame with time=%" GST_TIME_FORMAT ", duration=%" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp), diff --git a/gst/icydemux/gsticydemux.c b/gst/icydemux/gsticydemux.c index a3f12fb51f..ac93dd119c 100644 --- a/gst/icydemux/gsticydemux.c +++ b/gst/icydemux/gsticydemux.c @@ -331,7 +331,8 @@ gst_icydemux_parse_and_send_tags (GstICYDemux * icydemux) g_strfreev (strings); g_free (buffer); - gst_adapter_unmap (icydemux->meta_adapter, length); + gst_adapter_unmap (icydemux->meta_adapter); + gst_adapter_flush (icydemux->meta_adapter, length); if (!gst_tag_list_is_empty (tags)) gst_icydemux_tag_found (icydemux, tags); diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 784648e00c..e07f11b478 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -4050,7 +4050,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf) /* get fourcc/length, set neededbytes */ extract_initial_length_and_fourcc ((guint8 *) data, demux->neededbytes, &size, &fourcc); - gst_adapter_unmap (demux->adapter, 0); + gst_adapter_unmap (demux->adapter); data = NULL; GST_DEBUG_OBJECT (demux, "Peeking found [%" GST_FOURCC_FORMAT "] " "size: %" G_GUINT64_FORMAT, GST_FOURCC_ARGS (fourcc), size); @@ -4174,7 +4174,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf) GST_DEBUG_OBJECT (demux, "Parsing [moof]"); if (!qtdemux_parse_moof (demux, data, demux->neededbytes, demux->offset, NULL)) { - gst_adapter_unmap (demux->adapter, 0); + gst_adapter_unmap (demux->adapter); ret = GST_FLOW_ERROR; goto done; } @@ -4193,7 +4193,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstBuffer * inbuf) GST_FOURCC_ARGS (fourcc)); /* Let's jump that one and go back to initial state */ } - gst_adapter_unmap (demux->adapter, 0); + gst_adapter_unmap (demux->adapter); data = NULL; if (demux->mdatbuffer && demux->n_streams) { diff --git a/gst/multipart/multipartdemux.c b/gst/multipart/multipartdemux.c index 5dfa36d46d..4b6c21234d 100644 --- a/gst/multipart/multipartdemux.c +++ b/gst/multipart/multipartdemux.c @@ -443,7 +443,7 @@ multipart_parse_header (GstMultipartDemux * multipart) GST_DEBUG_OBJECT (multipart, "Parsed the header - boundary: %s, mime-type: %s, content-length: %d", multipart->boundary, multipart->mime_type, multipart->content_length); - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); return next - data; } @@ -466,7 +466,7 @@ multipart_parse_header (GstMultipartDemux * multipart) need_more_data: GST_DEBUG_OBJECT (multipart, "Need more data for the header"); - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); return MULTIPART_NEED_MORE_DATA; @@ -474,13 +474,13 @@ wrong_header: { GST_ELEMENT_ERROR (multipart, STREAM, DEMUX, (NULL), ("Boundary not found in the multipart header")); - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); return MULTIPART_DATA_ERROR; } eos: { GST_DEBUG_OBJECT (multipart, "we are EOS"); - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); return MULTIPART_DATA_EOS; } } @@ -506,7 +506,7 @@ multipart_find_boundary (GstMultipartDemux * multipart, gint * datalen) else if (data[len] == '\n') len += 1; - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); /* Don't check if boundary is actually there, but let the header parsing * bail out if it isn't */ return len; @@ -535,12 +535,12 @@ multipart_find_boundary (GstMultipartDemux * multipart, gint * datalen) len -= 1; *datalen = len; - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); multipart->scanpos = 0; return pos - data; } } - gst_adapter_unmap (multipart->adapter, 0); + gst_adapter_unmap (multipart->adapter); multipart->scanpos = pos - data; return MULTIPART_NEED_MORE_DATA; } diff --git a/gst/rtp/gstrtph263pay.c b/gst/rtp/gstrtph263pay.c index 1efbb2dbd6..82ec6169f3 100644 --- a/gst/rtp/gstrtph263pay.c +++ b/gst/rtp/gstrtph263pay.c @@ -1769,7 +1769,8 @@ gst_rtp_h263_pay_flush (GstRtpH263Pay * rtph263pay) end: gst_rtp_h263_pay_context_destroy (context, context->piclayer->ptype_srcformat); - gst_adapter_unmap (rtph263pay->adapter, rtph263pay->available_data); + gst_adapter_unmap (rtph263pay->adapter); + gst_adapter_flush (rtph263pay->adapter, rtph263pay->available_data); return ret; } diff --git a/gst/rtp/gstrtph263ppay.c b/gst/rtp/gstrtph263ppay.c index 4ddfbb6bf3..db97f33181 100644 --- a/gst/rtp/gstrtph263ppay.c +++ b/gst/rtp/gstrtph263ppay.c @@ -678,7 +678,7 @@ gst_rtp_h263p_pay_flush (GstRtpH263PPay * rtph263ppay) } parsed_len++; } - gst_adapter_unmap (rtph263ppay->adapter, 0); + gst_adapter_unmap (rtph263ppay->adapter); } /* for picture start frames (non-fragmented), we need to remove the first diff --git a/gst/rtp/gstrtph264pay.c b/gst/rtp/gstrtph264pay.c index d300e9a89d..1e1f19150f 100644 --- a/gst/rtp/gstrtph264pay.c +++ b/gst/rtp/gstrtph264pay.c @@ -1303,7 +1303,8 @@ gst_rtp_h264_pay_handle_buffer (GstBaseRTPPayload * basepayload, done: if (bytestream) { - gst_adapter_unmap (rtph264pay->adapter, pushed); + gst_adapter_unmap (rtph264pay->adapter); + gst_adapter_flush (rtph264pay->adapter, pushed); } else { gst_buffer_unmap (buffer, bdata, bsize); gst_buffer_unref (buffer); diff --git a/gst/wavparse/gstwavparse.c b/gst/wavparse/gstwavparse.c index fd6b85ca15..0a90936fea 100644 --- a/gst/wavparse/gstwavparse.c +++ b/gst/wavparse/gstwavparse.c @@ -1014,7 +1014,7 @@ gst_wavparse_peek_chunk_info (GstWavParse * wav, guint32 * tag, guint32 * size) data = gst_adapter_map (wav->adapter, 8); *tag = GST_READ_UINT32_LE (data); *size = GST_READ_UINT32_LE (data + 4); - gst_adapter_unmap (wav->adapter, 0); + gst_adapter_unmap (wav->adapter); GST_DEBUG ("Next chunk size is %d bytes, type %" GST_FOURCC_FORMAT, *size, GST_FOURCC_ARGS (*tag)); @@ -1357,7 +1357,8 @@ gst_wavparse_stream_headers (GstWavParse * wav) gst_adapter_flush (wav->adapter, 8); data = gst_adapter_map (wav->adapter, data_size); wav->fact = GST_READ_UINT32_LE (data); - gst_adapter_unmap (wav->adapter, GST_ROUND_UP_2 (size)); + gst_adapter_unmap (wav->adapter); + gst_adapter_flush (wav->adapter, GST_ROUND_UP_2 (size)); } else { gst_buffer_unref (buf); if ((res = @@ -1402,7 +1403,7 @@ gst_wavparse_stream_headers (GstWavParse * wav) acid = (const gst_riff_acid *) gst_adapter_map (wav->adapter, data_size); tempo = acid->tempo; - gst_adapter_unmap (wav->adapter, 0); + gst_adapter_unmap (wav->adapter); } else { gst_buffer_unref (buf); if ((res = @@ -1441,7 +1442,7 @@ gst_wavparse_stream_headers (GstWavParse * wav) } data = gst_adapter_map (wav->adapter, 12); ltag = GST_READ_UINT32_LE (data + 8); - gst_adapter_unmap (wav->adapter, 0); + gst_adapter_unmap (wav->adapter); } else { gst_buffer_unref (buf); if ((res =