Commit 248ab2d0 authored by Wim Taymans's avatar Wim Taymans

Fix for latest API changes

parent 68814a69
......@@ -327,7 +327,7 @@ gst_gio_base_src_create (GstBaseSrc * base_src, guint64 offset, guint size,
GST_DEBUG_OBJECT (src, "Creating subbuffer from cached buffer: offset %"
G_GUINT64_FORMAT " length %u", offset, size);
buf = gst_buffer_create_sub (src->cache,
buf = gst_buffer_copy_region (src->cache, GST_BUFFER_COPY_ALL,
offset - GST_BUFFER_OFFSET (src->cache), size);
GST_BUFFER_OFFSET (buf) = offset;
......@@ -400,7 +400,9 @@ gst_gio_base_src_create (GstBaseSrc * base_src, guint64 offset, guint size,
"cached buffer: offset %" G_GUINT64_FORMAT " length %u", offset,
size);
buf = gst_buffer_create_sub (src->cache, 0, MIN (size, read));
buf =
gst_buffer_copy_region (src->cache, GST_BUFFER_COPY_ALL, 0, MIN (size,
read));
GST_BUFFER_OFFSET (buf) = offset;
GST_BUFFER_OFFSET_END (buf) = offset + MIN (size, read);
......
......@@ -260,7 +260,7 @@ gst_ogg_avi_parse_setcaps (GstPad * pad, GstCaps * caps)
GstBuffer *out;
/* now output the raw vorbis header packets */
out = gst_buffer_create_sub (buffer, offs, sizes[i]);
out = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, offs, sizes[i]);
gst_buffer_set_caps (out, outcaps);
gst_pad_push (ogg->srcpad, out);
......
......@@ -764,7 +764,9 @@ gst_ogm_parse_data_packet (GstOgmParse * ogm, GstBuffer * buf,
GST_LOG_OBJECT (ogm, "[0x%02x] samples: %d, hdrbytes: %d, datasize: %d",
data[0], xsize, len, size - len - 1);
sbuf = gst_buffer_create_sub (buf, len + 1, size - len - 1);
sbuf =
gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, len + 1,
size - len - 1);
if (GST_BUFFER_OFFSET_END_IS_VALID (buf))
ogm->next_granulepos = GST_BUFFER_OFFSET_END (buf);
......
......@@ -741,7 +741,8 @@ theora_dec_setcaps (GstPad * pad, GstCaps * caps)
/* make sure we don't read too much */
psize = MIN (psize, left);
buf = gst_buffer_create_sub (buffer, offset, psize);
buf =
gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, offset, psize);
/* first buffer is a discont buffer */
if (offset == 2)
......
......@@ -1160,7 +1160,7 @@ gst_vorbis_enc_chain (GstPad * pad, GstBuffer * buffer)
return GST_FLOW_OK;
}
buffer = gst_buffer_make_writable (buffer);
gst_buffer_trim (buffer, diff_bytes, size - diff_bytes);
gst_buffer_resize (buffer, diff_bytes, size - diff_bytes);
GST_BUFFER_TIMESTAMP (buffer) += diff;
if (GST_BUFFER_DURATION_IS_VALID (buffer))
......
......@@ -418,7 +418,7 @@ gst_audio_buffer_clip (GstBuffer * buffer, GstSegment * segment, gint rate,
/* Get a writable buffer and apply all changes */
GST_DEBUG ("trim %" G_GSIZE_FORMAT " size %" G_GSIZE_FORMAT, trim, size);
ret = gst_buffer_create_sub (buffer, trim, size);
ret = gst_buffer_copy_region (buffer, GST_BUFFER_COPY_ALL, trim, size);
gst_buffer_unref (buffer);
GST_DEBUG ("timestamp %" GST_TIME_FORMAT, GST_TIME_ARGS (timestamp));
......
......@@ -172,7 +172,8 @@ gst_riff_parse_chunk (GstElement * element, GstBuffer * buf,
}
if (size)
*chunk_data = gst_buffer_create_sub (buf, offset + 8, size);
*chunk_data =
gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, offset + 8, size);
else
*chunk_data = NULL;
......@@ -411,8 +412,9 @@ gst_riff_parse_strf_vids (GstElement * element,
strf->size = size;
}
if (sizeof (gst_riff_strf_vids) < size) {
*data = gst_buffer_create_sub (buf, sizeof (gst_riff_strf_vids),
size - sizeof (gst_riff_strf_vids));
*data =
gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL,
sizeof (gst_riff_strf_vids), size - sizeof (gst_riff_strf_vids));
}
gst_buffer_unref (buf);
......@@ -507,7 +509,8 @@ gst_riff_parse_strf_auds (GstElement * element,
len = bsize - 2 - sizeof (gst_riff_strf_auds);
}
if (len)
*data = gst_buffer_create_sub (buf, sizeof (gst_riff_strf_auds) + 2, len);
*data = gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL,
sizeof (gst_riff_strf_auds) + 2, len);
}
/* debug */
......
......@@ -955,7 +955,8 @@ gst_rtp_buffer_get_payload_subbuffer (GstRTPBuffer * rtp, guint offset,
if (len != -1 && len < plen)
plen = len;
return gst_buffer_create_sub (rtp->buffer, poffset, plen);
return gst_buffer_copy_region (rtp->buffer, GST_BUFFER_COPY_ALL, poffset,
plen);
/* ERRORS */
wrong_offset:
......
......@@ -453,7 +453,9 @@ gst_tag_demux_trim_buffer (GstTagDemux * tagdemux, GstBuffer ** buf_ref,
G_GINT64_FORMAT " to %d offset %" G_GINT64_FORMAT,
bsize, boffset, out_size, out_offset);
sub = gst_buffer_create_sub (buf, trim_start, out_size);
sub =
gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, trim_start,
out_size);
g_return_val_if_fail (sub != NULL, FALSE);
gst_buffer_unref (buf);
*buf_ref = buf = sub;
......
......@@ -709,7 +709,9 @@ gst_audio_rate_chain (GstPad * pad, GstBuffer * buf)
truncsize = truncsamples * audiorate->bytes_per_sample;
leftsize = in_size - truncsize;
trunc = gst_buffer_create_sub (buf, truncsize, leftsize);
trunc =
gst_buffer_copy_region (buf, GST_BUFFER_COPY_ALL, truncsize,
leftsize);
gst_buffer_unref (buf);
buf = trunc;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment