Commit 69002aa2 authored by Wim Taymans's avatar Wim Taymans

update for buffer changes

parent 8f68db9c
......@@ -304,12 +304,7 @@ gst_mikmod_loop (GstElement * element)
break;
} else {
if (mikmod->Buffer) {
GstBuffer *merge;
merge = gst_buffer_merge (mikmod->Buffer, buffer_in);
gst_buffer_unref (buffer_in);
gst_buffer_unref (mikmod->Buffer);
mikmod->Buffer = merge;
mikmod->Buffer = gst_buffer_append (mikmod->Buffer, buffer_in);
} else {
mikmod->Buffer = buffer_in;
}
......
......@@ -582,7 +582,7 @@ gst_wavpack_enc_push_block (void *id, void *data, int32_t count)
enc->pending_buffer = buffer;
enc->pending_offset = wph.block_index;
} else if (enc->pending_offset == wph.block_index) {
enc->pending_buffer = gst_buffer_join (enc->pending_buffer, buffer);
enc->pending_buffer = gst_buffer_append (enc->pending_buffer, buffer);
} else {
GST_ERROR ("Got incomplete block, dropping");
gst_buffer_unref (enc->pending_buffer);
......
......@@ -1912,10 +1912,10 @@ gst_avi_mux_do_buffer (GstAviMux * avimux, GstAviPad * avipad)
GstAviVideoPad *vidpad = (GstAviVideoPad *) avipad;
if (vidpad->prepend_buffer) {
GstBuffer *newdata = gst_buffer_merge (vidpad->prepend_buffer, data);
GstBuffer *newdata =
gst_buffer_append (vidpad->prepend_buffer, gst_buffer_ref (data));
gst_buffer_copy_into (newdata, data, GST_BUFFER_COPY_TIMESTAMPS, 0, -1);
gst_buffer_unref (data);
gst_buffer_unref (vidpad->prepend_buffer);
data = newdata;
vidpad->prepend_buffer = NULL;
......
......@@ -711,13 +711,13 @@ gst_flv_mux_create_metadata (GstFlvMux * mux, gboolean full)
data[2] = 10; /* length 10 */
memcpy (&data[3], "onMetaData", 10);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
n_tags = (tags) ? gst_structure_n_fields ((GstStructure *) tags) : 0;
_gst_buffer_new_and_alloc (5, &tmp, &data);
data[0] = 8; /* ECMA array */
GST_WRITE_UINT32_BE (data + 1, n_tags);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
if (!full)
goto tags;
......@@ -726,18 +726,18 @@ gst_flv_mux_create_metadata (GstFlvMux * mux, gboolean full)
after querying the pads or after getting EOS */
if (!mux->streamable) {
tmp = gst_flv_mux_create_number_script_value ("duration", 86400);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
/* Sometimes the information about the total file size is useful for the
player. It will be filled later, after getting EOS */
tmp = gst_flv_mux_create_number_script_value ("filesize", 0);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
/* Preallocate space for the index to be written at EOS */
tmp = gst_flv_mux_preallocate_index (mux);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
} else {
GST_DEBUG_OBJECT (mux, "not preallocating index, streamable mode");
}
......@@ -774,7 +774,7 @@ tags:
data[3 + strlen (t)] = (strlen (s) >> 8) & 0xff;
data[4 + strlen (t)] = (strlen (s)) & 0xff;
memcpy (&data[5 + strlen (t)], s, strlen (s));
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
g_free (s);
tags_written++;
......@@ -838,7 +838,7 @@ tags:
tmp = gst_flv_mux_create_number_script_value ("videocodecid",
cpad->video_codec);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
caps = gst_pad_get_current_caps (video_pad);
......@@ -849,7 +849,7 @@ tags:
GST_DEBUG_OBJECT (mux, "putting width %d in the metadata", size);
tmp = gst_flv_mux_create_number_script_value ("width", size);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
}
......@@ -857,7 +857,7 @@ tags:
GST_DEBUG_OBJECT (mux, "putting height %d in the metadata", size);
tmp = gst_flv_mux_create_number_script_value ("height", size);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
}
......@@ -868,14 +868,14 @@ tags:
GST_DEBUG_OBJECT (mux, "putting AspectRatioX %f in the metadata", d);
tmp = gst_flv_mux_create_number_script_value ("AspectRatioX", d);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
d = den;
GST_DEBUG_OBJECT (mux, "putting AspectRatioY %f in the metadata", d);
tmp = gst_flv_mux_create_number_script_value ("AspectRatioY", d);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
}
......@@ -886,7 +886,7 @@ tags:
GST_DEBUG_OBJECT (mux, "putting framerate %f in the metadata", d);
tmp = gst_flv_mux_create_number_script_value ("framerate", d);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
}
}
......@@ -911,7 +911,7 @@ tags:
tmp = gst_flv_mux_create_number_script_value ("audiocodecid",
cpad->audio_codec);
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
}
}
......@@ -927,7 +927,7 @@ tags:
data[18] = (strlen (s) >> 8) & 0xff;
data[19] = (strlen (s)) & 0xff;
memcpy (&data[20], s, strlen (s));
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
}
......@@ -961,7 +961,7 @@ tags:
data[15] = (strlen (s) >> 8) & 0xff;
data[16] = (strlen (s)) & 0xff;
memcpy (&data[17], s, strlen (s));
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
g_free (s);
tags_written++;
......@@ -979,12 +979,12 @@ end:
data[0] = 0; /* 0 byte size */
data[1] = 0;
data[2] = 9; /* end marker */
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
tags_written++;
_gst_buffer_new_and_alloc (4, &tmp, &data);
GST_WRITE_UINT32_BE (data, gst_buffer_get_size (script_tag));
script_tag = gst_buffer_join (script_tag, tmp);
script_tag = gst_buffer_append (script_tag, tmp);
gst_buffer_map (script_tag, &map, GST_MAP_WRITE);
map.data[1] = ((gst_buffer_get_size (script_tag) - 11 - 4) >> 16) & 0xff;
......@@ -1363,7 +1363,7 @@ gst_flv_mux_rewrite_header (GstFlvMux * mux)
GST_DEBUG_OBJECT (mux, "putting total filesize %f in the metadata", d);
tmp = gst_flv_mux_create_number_script_value ("filesize", d);
rewrite = gst_buffer_join (rewrite, tmp);
rewrite = gst_buffer_append (rewrite, tmp);
if (!mux->index) {
/* no index, so push buffer and return */
......@@ -1447,10 +1447,10 @@ gst_flv_mux_rewrite_header (GstFlvMux * mux)
GST_DEBUG_OBJECT (mux, "Remaining filler size is %d bytes",
remaining_filler_size);
GST_WRITE_UINT16_BE (data + 12, remaining_filler_size);
index = gst_buffer_join (index, tmp);
index = gst_buffer_append (index, tmp);
}
rewrite = gst_buffer_join (rewrite, index);
rewrite = gst_buffer_append (rewrite, index);
return gst_flv_mux_push (mux, rewrite);
}
......
......@@ -426,7 +426,7 @@ gst_icydemux_typefind_or_forward (GstICYDemux * icydemux, GstBuffer * buf)
}
if (icydemux->typefind_buf) {
icydemux->typefind_buf = gst_buffer_join (icydemux->typefind_buf, buf);
icydemux->typefind_buf = gst_buffer_append (icydemux->typefind_buf, buf);
} else {
icydemux->typefind_buf = buf;
}
......
......@@ -4274,7 +4274,7 @@ gst_qtdemux_chain (GstPad * sinkpad, GstObject * parent, GstBuffer * inbuf)
GST_DEBUG_OBJECT (demux, "mdatbuffer starts with %" GST_FOURCC_FORMAT,
GST_FOURCC_ARGS (QT_FOURCC (fourcc)));
if (demux->mdatbuffer)
demux->mdatbuffer = gst_buffer_join (demux->mdatbuffer, buf);
demux->mdatbuffer = gst_buffer_append (demux->mdatbuffer, buf);
else
demux->mdatbuffer = buf;
demux->offset += demux->neededbytes;
......
......@@ -2836,7 +2836,7 @@ gst_matroska_mux_handle_dirac_packet (GstMatroskaMux * mux,
}
if (ctx->dirac_unit)
ctx->dirac_unit = gst_buffer_join (ctx->dirac_unit, gst_buffer_ref (buf));
ctx->dirac_unit = gst_buffer_append (ctx->dirac_unit, gst_buffer_ref (buf));
else
ctx->dirac_unit = gst_buffer_ref (buf);
......
......@@ -2501,13 +2501,8 @@ gst_matroska_parse_accumulate_streamheader (GstMatroskaParse * parse,
}
if (parse->streamheader) {
GstBuffer *buf;
buf = gst_buffer_span (parse->streamheader, 0, buffer,
gst_buffer_get_size (parse->streamheader) +
gst_buffer_get_size (buffer));
gst_buffer_unref (parse->streamheader);
parse->streamheader = buf;
parse->streamheader = gst_buffer_append (parse->streamheader,
gst_buffer_ref (buffer));
} else {
parse->streamheader = gst_buffer_ref (buffer);
}
......
......@@ -819,7 +819,7 @@ gst_rtp_h264_depay_handle_nal (GstRtpH264Depay * rtph264depay, GstBuffer * nal,
/* prepend codec_data */
if (rtph264depay->codec_data) {
GST_DEBUG_OBJECT (depayload, "prepending codec_data");
outbuf = gst_buffer_join (rtph264depay->codec_data, outbuf);
outbuf = gst_buffer_append (rtph264depay->codec_data, outbuf);
rtph264depay->codec_data = NULL;
out_keyframe = TRUE;
}
......
......@@ -814,7 +814,7 @@ gst_rtp_jpeg_pay_handle_buffer (GstRTPBasePayload * basepayload,
jpeg_header_size + offset, payload_size);
/* join memory parts */
outbuf = gst_buffer_join (outbuf, paybuf);
outbuf = gst_buffer_append (outbuf, paybuf);
GST_BUFFER_TIMESTAMP (outbuf) = timestamp;
......
......@@ -303,7 +303,7 @@ gst_rtp_mp4v_pay_flush (GstRtpMP4VPay * rtpmp4vpay)
gst_rtp_buffer_set_marker (&rtp, avail == 0);
gst_rtp_buffer_unmap (&rtp);
outbuf = gst_buffer_join (outbuf, outbuf_data);
outbuf = gst_buffer_append (outbuf, outbuf_data);
GST_BUFFER_TIMESTAMP (outbuf) = rtpmp4vpay->first_timestamp;
......@@ -533,17 +533,12 @@ gst_rtp_mp4v_pay_handle_buffer (GstRTPBasePayload * basepayload,
if (send_config) {
/* we need to send config now first */
GstBuffer *superbuf;
GST_LOG_OBJECT (rtpmp4vpay, "inserting config in stream");
/* insert header */
superbuf = gst_buffer_merge (rtpmp4vpay->config, buffer);
GST_BUFFER_TIMESTAMP (superbuf) = timestamp;
gst_buffer_unref (buffer);
buffer = superbuf;
buffer = gst_buffer_append (gst_buffer_ref (rtpmp4vpay->config), buffer);
GST_BUFFER_TIMESTAMP (buffer) = timestamp;
size = gst_buffer_get_size (buffer);
if (timestamp != -1) {
......
......@@ -283,12 +283,13 @@ gst_y4m_encode_chain (GstPad * pad, GstObject * parent, GstBuffer * buf)
}
outbuf = gst_y4m_encode_get_stream_header (filter, tff);
filter->header = TRUE;
outbuf = gst_buffer_join (outbuf, gst_y4m_encode_get_frame_header (filter));
outbuf =
gst_buffer_append (outbuf, gst_y4m_encode_get_frame_header (filter));
} else {
outbuf = gst_y4m_encode_get_frame_header (filter);
}
/* join with data, FIXME, strides are all wrong etc */
outbuf = gst_buffer_join (outbuf, buf);
outbuf = gst_buffer_append (outbuf, buf);
/* decorate */
outbuf = gst_buffer_make_writable (outbuf);
......
......@@ -249,7 +249,7 @@ gst_parser_test_run (GstParserTest * test, GstCaps ** out_caps)
if (!k)
buffer = buffer_new (test->series[j].data, test->series[j].size);
else {
buffer = gst_buffer_join (buffer,
buffer = gst_buffer_append (buffer,
buffer_new (test->series[j].data, test->series[j].size));
}
}
......
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