update for buffer api change

This commit is contained in:
Wim Taymans 2012-03-30 18:12:39 +02:00
parent 9289476e77
commit 345dc31f20
16 changed files with 47 additions and 47 deletions

View file

@ -70,7 +70,7 @@ gst_rtcp_buffer_new_take_data (gpointer data, guint len)
g_return_val_if_fail (len > 0, NULL);
result = gst_buffer_new ();
gst_buffer_take_memory (result, -1,
gst_buffer_append_memory (result,
gst_memory_new_wrapped (0, data, len, 0, len, data, g_free));
return result;
@ -235,7 +235,7 @@ gst_rtcp_buffer_new (guint mtu)
data = g_malloc0 (mtu);
result = gst_buffer_new ();
gst_buffer_take_memory (result, -1,
gst_buffer_append_memory (result,
gst_memory_new_wrapped (0, data, mtu, 0, 0, data, g_free));
return result;

View file

@ -126,7 +126,7 @@ gst_rtp_buffer_allocate_data (GstBuffer * buffer, guint payload_len,
GST_RTP_HEADER_SSRC (map.data) = 0;
gst_memory_unmap (mem, &map);
gst_buffer_take_memory (buffer, -1, mem);
gst_buffer_append_memory (buffer, mem);
}
/**
@ -149,7 +149,7 @@ gst_rtp_buffer_new_take_data (gpointer data, gsize len)
g_return_val_if_fail (len > 0, NULL);
result = gst_buffer_new ();
gst_buffer_take_memory (result, -1,
gst_buffer_append_memory (result,
gst_memory_new_wrapped (0, data, len, 0, len, data, g_free));
return result;

View file

@ -1353,7 +1353,7 @@ parse_exif_undefined_tag (GstExifReader * reader, const GstExifTagMatch * tag,
GstBuffer *buf;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, count, 0, count, data, g_free));
data = NULL;

View file

@ -1875,7 +1875,7 @@ gst_tag_list_to_xmp_buffer_full (const GstTagList * list, gboolean read_only,
bdata = g_string_free (data, FALSE);
buffer = gst_buffer_new ();
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (0, bdata, bsize, 0, bsize, bdata, g_free));
return buffer;

View file

@ -227,12 +227,12 @@ gst_gdp_buffer_from_caps (GstGDPPay * this, GstCaps * caps)
GST_LOG_OBJECT (this, "creating GDP header and payload buffer from caps");
headerbuf = gst_buffer_new ();
gst_buffer_take_memory (headerbuf, -1,
gst_buffer_append_memory (headerbuf,
gst_memory_new_wrapped (0, header, len, 0, len, header, g_free));
payloadbuf = gst_buffer_new ();
plen = gst_dp_header_payload_length (header);
gst_buffer_take_memory (payloadbuf, -1,
gst_buffer_append_memory (payloadbuf,
gst_memory_new_wrapped (0, payload, plen, 0, plen, payload, g_free));
return gst_buffer_append (headerbuf, payloadbuf);
@ -258,7 +258,7 @@ gst_gdp_pay_buffer_from_buffer (GstGDPPay * this, GstBuffer * buffer)
GST_LOG_OBJECT (this, "creating GDP header and payload buffer from buffer");
headerbuf = gst_buffer_new ();
gst_buffer_take_memory (headerbuf, -1,
gst_buffer_append_memory (headerbuf,
gst_memory_new_wrapped (0, header, len, 0, len, header, g_free));
/* we do not want to lose the ref on the incoming buffer */
@ -291,13 +291,13 @@ gst_gdp_buffer_from_event (GstGDPPay * this, GstEvent * event)
GST_LOG_OBJECT (this, "creating GDP header and payload buffer from event");
headerbuf = gst_buffer_new ();
gst_buffer_take_memory (headerbuf, -1,
gst_buffer_append_memory (headerbuf,
gst_memory_new_wrapped (0, header, len, 0, len, header, g_free));
payloadbuf = gst_buffer_new ();
plen = gst_dp_header_payload_length (header);
if (plen && payload != NULL) {
gst_buffer_take_memory (payloadbuf, -1,
gst_buffer_append_memory (payloadbuf,
gst_memory_new_wrapped (0, payload, plen, 0, plen, payload, g_free));
}

View file

@ -231,7 +231,7 @@ gst_buffer_add_ximage_meta (GstBuffer * buffer, GstXImageBufferPool * xpool)
error_caught = FALSE;
XSetErrorHandler (handler);
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE, meta->ximage->data,
meta->size, 0, meta->size, NULL, NULL));

View file

@ -265,7 +265,7 @@ gst_buffer_add_xvimage_meta (GstBuffer * buffer, GstXvImageBufferPool * xvpool)
error_caught = FALSE;
XSetErrorHandler (handler);
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE, meta->xvimage->data,
meta->size, 0, meta->size, NULL, NULL));

View file

@ -50,7 +50,7 @@ src_need_data_cb (GstElement * src, guint size, gpointer data)
GstFlowReturn ret;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, 0,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) dummytext, sizeof (dummytext), 0,
sizeof (dummytext), NULL, NULL));

View file

@ -48,7 +48,7 @@ buffer_from_static_string (const gchar * s)
len = strlen (s);
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) s, len, 0, len, NULL, NULL));

View file

@ -62,7 +62,7 @@ GST_START_TEST (test_quicktime_mpeg4video)
GstCaps *caps = NULL;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) qt_redirect_396042,
sizeof (qt_redirect_396042), 0, sizeof (qt_redirect_396042), NULL,
@ -93,7 +93,7 @@ GST_START_TEST (test_broken_flac_in_ogg)
GstCaps *caps = NULL;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) flac_id_packet,
sizeof (flac_id_packet), 0, sizeof (flac_id_packet), NULL, NULL));
@ -130,7 +130,7 @@ typefind_test_file (const gchar * filename)
}
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) data, data_len, 0, data_len, NULL, NULL));
@ -352,7 +352,7 @@ GST_START_TEST (test_random_data)
data[i] = g_random_int () & 0xff;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
data, TEST_RANDOM_DATA_SIZE, 0, TEST_RANDOM_DATA_SIZE, NULL, NULL));

View file

@ -41,7 +41,7 @@ GST_START_TEST (test_buffer_clipping_time)
/* Clip start and end */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_TIME);
@ -71,7 +71,7 @@ GST_START_TEST (test_buffer_clipping_time)
/* Clip only start */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_TIME);
@ -101,7 +101,7 @@ GST_START_TEST (test_buffer_clipping_time)
/* Clip only stop */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_TIME);
@ -131,7 +131,7 @@ GST_START_TEST (test_buffer_clipping_time)
/* Buffer outside segment */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_TIME);
@ -150,7 +150,7 @@ GST_START_TEST (test_buffer_clipping_time)
/* Clip start and end but don't touch duration and offset_end */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_TIME);
@ -183,7 +183,7 @@ GST_START_TEST (test_buffer_clipping_time)
*/
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_TIME);
@ -207,7 +207,7 @@ GST_START_TEST (test_buffer_clipping_time)
*/
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_PERCENT);
@ -239,7 +239,7 @@ GST_START_TEST (test_buffer_clipping_samples)
/* Clip start and end */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_DEFAULT);
@ -269,7 +269,7 @@ GST_START_TEST (test_buffer_clipping_samples)
/* Clip only start */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_DEFAULT);
@ -299,7 +299,7 @@ GST_START_TEST (test_buffer_clipping_samples)
/* Clip only stop */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_DEFAULT);
@ -329,7 +329,7 @@ GST_START_TEST (test_buffer_clipping_samples)
/* Buffer outside segment */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_DEFAULT);
@ -348,7 +348,7 @@ GST_START_TEST (test_buffer_clipping_samples)
/* Clip start and end but don't touch duration and offset_end */
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_DEFAULT);
@ -381,7 +381,7 @@ GST_START_TEST (test_buffer_clipping_samples)
*/
buf = gst_buffer_new ();
data = (guint8 *) g_malloc (1000);
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, data, 1000, 0, 1000, data, g_free));
gst_segment_init (&s, GST_FORMAT_DEFAULT);

View file

@ -444,7 +444,7 @@ GST_START_TEST (test_vorbis_tags)
gchar *vendor = NULL;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) speex_comments_buf1,
sizeof (speex_comments_buf1), 0, sizeof (speex_comments_buf1), NULL,
@ -490,7 +490,7 @@ GST_START_TEST (test_vorbis_tags)
gchar *vendor = NULL;
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
(gpointer) vorbis_comments_buf,
sizeof (vorbis_comments_buf), 0, sizeof (vorbis_comments_buf), NULL,
@ -1047,7 +1047,7 @@ GST_START_TEST (test_xmp_parsing)
buf = gst_buffer_new ();
len = strlen (text) + 1;
gst_buffer_take_memory (buf, -1,
gst_buffer_append_memory (buf,
gst_memory_new_wrapped (0, text, len, 0, len, NULL, NULL));
list = gst_tag_list_from_xmp_buffer (buf);

View file

@ -71,8 +71,6 @@ feed_data (GstElement * appsrc, guint size, App * app)
GstBuffer *buffer;
GstFlowReturn ret;
buffer = gst_buffer_new ();
if (app->offset >= app->length) {
/* we are EOS, send end-of-stream */
g_signal_emit_by_name (app->appsrc, "end-of-stream", &ret);
@ -80,10 +78,12 @@ feed_data (GstElement * appsrc, guint size, App * app)
}
/* read the amount of data, we are allowed to return less if we are EOS */
buffer = gst_buffer_new ();
if (app->offset + size > app->length)
size = app->length - app->offset;
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
app->data, app->length, app->offset, size, NULL, NULL));

View file

@ -76,8 +76,6 @@ feed_data (GstElement * appsrc, guint size, App * app)
guint len;
GstFlowReturn ret;
buffer = gst_buffer_new ();
if (app->offset >= app->length) {
/* we are EOS, send end-of-stream */
g_signal_emit_by_name (app->appsrc, "end-of-stream", &ret);
@ -85,11 +83,13 @@ feed_data (GstElement * appsrc, guint size, App * app)
}
/* read any amount of data, we are allowed to return less if we are EOS */
buffer = gst_buffer_new ();
len = CHUNK_SIZE;
if (app->offset + len > app->length)
len = app->length - app->offset;
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
app->data, app->length, app->offset, len, NULL, NULL));

View file

@ -83,8 +83,6 @@ read_data (App * app)
guint len;
GstFlowReturn ret;
buffer = gst_buffer_new ();
if (app->offset >= app->length) {
/* we are EOS, send end-of-stream and remove the source */
g_signal_emit_by_name (app->appsrc, "end-of-stream", &ret);
@ -92,11 +90,13 @@ read_data (App * app)
}
/* read the next chunk */
buffer = gst_buffer_new ();
len = CHUNK_SIZE;
if (app->offset + len > app->length)
len = app->length - app->offset;
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
app->data, app->length, app->offset, len, NULL, NULL));

View file

@ -83,8 +83,6 @@ feed_data (GstElement * appsrc, guint size, App * app)
guint len;
GstFlowReturn ret;
buffer = gst_buffer_new ();
if (app->offset >= app->length) {
/* we are EOS, send end-of-stream */
g_signal_emit_by_name (app->appsrc, "end-of-stream", &ret);
@ -92,11 +90,13 @@ feed_data (GstElement * appsrc, guint size, App * app)
}
/* read the next chunk */
buffer = gst_buffer_new ();
len = CHUNK_SIZE;
if (app->offset + len > app->length)
len = app->length - app->offset;
gst_buffer_take_memory (buffer, -1,
gst_buffer_append_memory (buffer,
gst_memory_new_wrapped (GST_MEMORY_FLAG_READONLY,
app->data, app->length, app->offset, len, NULL, NULL));