From: Wim Taymans Date: Fri, 30 Mar 2012 16:13:08 +0000 (+0200) Subject: update for buffer api change X-Git-Tag: 1.19.3~509^2~7158 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3d61d12e03f8c661552454c351e40b1c2da95470;p=platform%2Fupstream%2Fgstreamer.git update for buffer api change --- diff --git a/ext/jpeg/gstjpegenc.c b/ext/jpeg/gstjpegenc.c index 24eaca8..a21f525 100644 --- a/ext/jpeg/gstjpegenc.c +++ b/ext/jpeg/gstjpegenc.c @@ -628,7 +628,7 @@ gst_jpegenc_chain (GstPad * pad, GstObject * parent, GstBuffer * buf) outbuf = gst_buffer_new (); gst_buffer_copy_into (outbuf, buf, GST_BUFFER_COPY_METADATA, 0, -1); - gst_buffer_take_memory (outbuf, -1, jpegenc->output_mem); + gst_buffer_append_memory (outbuf, jpegenc->output_mem); jpegenc->output_mem = NULL; ret = gst_pad_push (jpegenc->srcpad, outbuf); diff --git a/gst/avi/gstavimux.c b/gst/avi/gstavimux.c index 6786d51..68d177c 100644 --- a/gst/avi/gstavimux.c +++ b/gst/avi/gstavimux.c @@ -1557,7 +1557,7 @@ gst_avi_mux_write_index (GstAviMux * avimux) data = (guint8 *) avimux->idx; avimux->idx = NULL; /* will be free()'ed by gst_buffer_unref() */ - gst_buffer_take_memory (buffer, -1, + gst_buffer_append_memory (buffer, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); avimux->total_data += size + 8; diff --git a/gst/avi/gstavisubtitle.c b/gst/avi/gstavisubtitle.c index 5f5e139..f280b5a 100644 --- a/gst/avi/gstavisubtitle.c +++ b/gst/avi/gstavisubtitle.c @@ -153,7 +153,7 @@ gst_avi_subtitle_extract_file (GstAviSubtitle * sub, GstBuffer * buffer, ret = gst_buffer_new (); slen = strlen (utf8); - gst_buffer_take_memory (ret, -1, + gst_buffer_append_memory (ret, gst_memory_new_wrapped (0, utf8, slen, 0, slen, utf8, g_free)); GST_BUFFER_OFFSET (ret) = 0; diff --git a/gst/flv/gstflvmux.c b/gst/flv/gstflvmux.c index 06daf91..4aa9672 100644 --- a/gst/flv/gstflvmux.c +++ b/gst/flv/gstflvmux.c @@ -136,7 +136,7 @@ _gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func) GstBuffer *buf; buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY, mem, size, 0, size, mem, free_func)); diff --git a/gst/isomp4/atoms.c b/gst/isomp4/atoms.c index bffc17c..68a90de 100644 --- a/gst/isomp4/atoms.c +++ b/gst/isomp4/atoms.c @@ -2907,7 +2907,7 @@ _gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func) GstBuffer *buf; buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY, mem, size, 0, size, mem, free_func)); diff --git a/gst/isomp4/gstqtmux.c b/gst/isomp4/gstqtmux.c index 531df78..332ba48 100644 --- a/gst/isomp4/gstqtmux.c +++ b/gst/isomp4/gstqtmux.c @@ -1189,7 +1189,7 @@ _gst_buffer_new_take_data (guint8 * data, guint size) GstBuffer *buf; buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); return buf; diff --git a/gst/isomp4/qtdemux.c b/gst/isomp4/qtdemux.c index 587b5bb..4bc4168 100644 --- a/gst/isomp4/qtdemux.c +++ b/gst/isomp4/qtdemux.c @@ -548,7 +548,7 @@ _gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func) GstBuffer *buf; buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY, mem, size, 0, size, mem, free_func)); diff --git a/gst/multifile/gstmultifilesink.c b/gst/multifile/gstmultifilesink.c index 2ce4ad0..7cade33 100644 --- a/gst/multifile/gstmultifilesink.c +++ b/gst/multifile/gstmultifilesink.c @@ -693,7 +693,7 @@ buffer_list_copy_data (GstBuffer ** buf, guint idx, gpointer data) GstMemory *mem; mem = gst_buffer_get_memory (*buf, i); - gst_buffer_take_memory (dest, -1, mem); + gst_buffer_append_memory (dest, mem); } return TRUE; diff --git a/gst/multifile/gstmultifilesrc.c b/gst/multifile/gstmultifilesrc.c index 9e9c337..4006d81 100644 --- a/gst/multifile/gstmultifilesrc.c +++ b/gst/multifile/gstmultifilesrc.c @@ -386,7 +386,7 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer) } buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); GST_BUFFER_OFFSET (buf) = multifilesrc->offset; GST_BUFFER_OFFSET_END (buf) = multifilesrc->offset + size; diff --git a/gst/rtp/gstrtpqdmdepay.c b/gst/rtp/gstrtpqdmdepay.c index bad239c..e55cb3d 100644 --- a/gst/rtp/gstrtpqdmdepay.c +++ b/gst/rtp/gstrtpqdmdepay.c @@ -181,7 +181,7 @@ flush_data (GstRtpQDM2Depay * depay) GST_MEMDUMP ("Extracted packet", data, depay->packetsize); buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, data, depay->packetsize, 0, depay->packetsize, data, g_free)); diff --git a/gst/rtp/gstrtptheoradepay.c b/gst/rtp/gstrtptheoradepay.c index e86c543..76afa08 100644 --- a/gst/rtp/gstrtptheoradepay.c +++ b/gst/rtp/gstrtptheoradepay.c @@ -328,7 +328,7 @@ gst_rtp_theora_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) data = g_base64_decode (configuration, &size); confbuf = gst_buffer_new (); - gst_buffer_take_memory (confbuf, -1, + gst_buffer_append_memory (confbuf, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); if (!gst_rtp_theora_depay_parse_configuration (rtptheoradepay, confbuf)) @@ -542,7 +542,7 @@ gst_rtp_theora_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) /* create buffer for packet */ if (G_UNLIKELY (to_free)) { outbuf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, to_free, (payload - to_free) + length, payload - to_free, length, to_free, g_free)); diff --git a/gst/rtp/gstrtpvorbisdepay.c b/gst/rtp/gstrtpvorbisdepay.c index 6906410..daa3018 100644 --- a/gst/rtp/gstrtpvorbisdepay.c +++ b/gst/rtp/gstrtpvorbisdepay.c @@ -369,7 +369,7 @@ gst_rtp_vorbis_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps) data = g_base64_decode (configuration, &size); confbuf = gst_buffer_new (); - gst_buffer_take_memory (confbuf, -1, + gst_buffer_append_memory (confbuf, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); if (!gst_rtp_vorbis_depay_parse_configuration (rtpvorbisdepay, confbuf)) goto invalid_configuration; @@ -593,7 +593,7 @@ gst_rtp_vorbis_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf) /* create buffer for packet */ if (G_UNLIKELY (to_free)) { outbuf = gst_buffer_new (); - gst_buffer_take_memory (outbuf, -1, + gst_buffer_append_memory (outbuf, gst_memory_new_wrapped (0, to_free, (payload - to_free) + length, payload - to_free, length, to_free, g_free)); diff --git a/gst/rtsp/gstrtspsrc.c b/gst/rtsp/gstrtspsrc.c index e8e5888..9293baa 100644 --- a/gst/rtsp/gstrtspsrc.c +++ b/gst/rtsp/gstrtspsrc.c @@ -3631,7 +3631,7 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src) size -= 1; buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); /* don't need message anymore */ diff --git a/gst/udp/gstudpsrc.c b/gst/udp/gstudpsrc.c index d8d142f..0635151 100644 --- a/gst/udp/gstudpsrc.c +++ b/gst/udp/gstudpsrc.c @@ -462,7 +462,7 @@ no_select: } outbuf = gst_buffer_new (); - gst_buffer_take_memory (outbuf, -1, + gst_buffer_append_memory (outbuf, gst_memory_new_wrapped (0, pktdata, pktsize, offset, ret, pktdata, g_free)); diff --git a/gst/y4m/gsty4mencode.c b/gst/y4m/gsty4mencode.c index 748cf6c..eaa2d71 100644 --- a/gst/y4m/gsty4mencode.c +++ b/gst/y4m/gsty4mencode.c @@ -239,7 +239,7 @@ gst_y4m_encode_get_stream_header (GstY4mEncode * filter, gboolean tff) len = strlen (header); buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, header, len, 0, len, header, g_free)); return buf; @@ -256,7 +256,7 @@ gst_y4m_encode_get_frame_header (GstY4mEncode * filter) len = strlen (header); buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, header, len, 0, len, header, g_free)); return buf; diff --git a/sys/v4l2/gstv4l2bufferpool.c b/sys/v4l2/gstv4l2bufferpool.c index 038ce51..36e6d2b 100644 --- a/sys/v4l2/gstv4l2bufferpool.c +++ b/sys/v4l2/gstv4l2bufferpool.c @@ -183,7 +183,7 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer, if (meta->mem == MAP_FAILED) goto mmap_failed; - gst_buffer_take_memory (newbuf, -1, + gst_buffer_append_memory (newbuf, gst_memory_new_wrapped (0, meta->mem, meta->vbuffer.length, 0, meta->vbuffer.length, NULL, NULL)); diff --git a/sys/ximage/ximageutil.c b/sys/ximage/ximageutil.c index 907aa3a..d81e9a4 100644 --- a/sys/ximage/ximageutil.c +++ b/sys/ximage/ximageutil.c @@ -433,7 +433,7 @@ gst_ximageutil_ximage_new (GstXContext * xcontext, } succeeded = TRUE; - gst_buffer_take_memory (ximage, -1, + gst_buffer_append_memory (ximage, gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE, meta->ximage->data, meta->size, 0, meta->size, NULL, NULL)); diff --git a/tests/check/elements/deinterleave.c b/tests/check/elements/deinterleave.c index a2c802d..7ff393e 100644 --- a/tests/check/elements/deinterleave.c +++ b/tests/check/elements/deinterleave.c @@ -454,7 +454,7 @@ src_handoff_float32_8ch (GstElement * src, GstBuffer * buf, GstPad * pad, } buf = gst_buffer_new (); - gst_buffer_take_memory (buf, -1, gst_memory_new_wrapped (0, data, + gst_buffer_append_memory (buf, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); GST_BUFFER_OFFSET (buf) = 0; GST_BUFFER_TIMESTAMP (buf) = 0; diff --git a/tests/check/elements/interleave.c b/tests/check/elements/interleave.c index 6f2d51f..f48e3a3 100644 --- a/tests/check/elements/interleave.c +++ b/tests/check/elements/interleave.c @@ -419,7 +419,7 @@ src_handoff_float32 (GstElement * element, GstBuffer * buffer, GstPad * pad, for (i = 0; i < 48000; i++) data[i] = (n % 2 == 0) ? -1.0 : 1.0; - gst_buffer_take_memory (buffer, -1, gst_memory_new_wrapped (0, data, + gst_buffer_append_memory (buffer, gst_memory_new_wrapped (0, data, size, 0, size, data, g_free)); GST_BUFFER_OFFSET (buffer) = GST_BUFFER_OFFSET_NONE;