Commit ca9532cc authored by Wim Taymans's avatar Wim Taymans

update for new memory api

parent 8530c0f6
......@@ -1558,7 +1558,7 @@ gst_avi_mux_write_index (GstAviMux * avimux)
avimux->idx = NULL; /* will be free()'ed by gst_buffer_unref() */
gst_buffer_take_memory (buffer, -1,
gst_memory_new_wrapped (0, data, g_free, size, 0, size));
gst_memory_new_wrapped (0, data, size, 0, size, data, g_free));
avimux->total_data += size + 8;
......
......@@ -154,7 +154,7 @@ gst_avi_subtitle_extract_file (GstAviSubtitle * sub, GstBuffer * buffer,
ret = gst_buffer_new ();
slen = strlen (utf8);
gst_buffer_take_memory (ret, -1,
gst_memory_new_wrapped (0, utf8, g_free, slen, 0, slen));
gst_memory_new_wrapped (0, utf8, slen, 0, slen, utf8, g_free));
GST_BUFFER_OFFSET (ret) = 0;
}
......
......@@ -138,7 +138,7 @@ _gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY,
mem, free_func, size, 0, size));
mem, size, 0, size, mem, free_func));
return buf;
}
......
......@@ -2909,7 +2909,7 @@ _gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY,
mem, free_func, size, 0, size));
mem, size, 0, size, mem, free_func));
return buf;
}
......
......@@ -1187,7 +1187,7 @@ _gst_buffer_new_take_data (guint8 * data, guint size)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, data, g_free, size, 0, size));
gst_memory_new_wrapped (0, data, size, 0, size, data, g_free));
return buf;
}
......
......@@ -548,7 +548,7 @@ _gst_buffer_new_wrapped (gpointer mem, gsize size, GFreeFunc free_func)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (free_func ? 0 : GST_MEMORY_FLAG_READONLY,
mem, free_func, size, 0, size));
mem, size, 0, size, mem, free_func));
return buf;
}
......
......@@ -387,7 +387,7 @@ gst_multi_file_src_create (GstPushSrc * src, GstBuffer ** buffer)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, data, g_free, size, 0, size));
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;
multifilesrc->offset += size;
......
......@@ -182,8 +182,8 @@ flush_data (GstRtpQDM2Depay * depay)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, data, g_free, depay->packetsize, 0,
depay->packetsize));
gst_memory_new_wrapped (0, data, depay->packetsize, 0,
depay->packetsize, data, g_free));
gst_adapter_push (depay->adapter, buf);
......
......@@ -329,7 +329,7 @@ gst_rtp_theora_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
confbuf = gst_buffer_new ();
gst_buffer_take_memory (confbuf, -1,
gst_memory_new_wrapped (0, data, g_free, size, 0, size));
gst_memory_new_wrapped (0, data, size, 0, size, data, g_free));
if (!gst_rtp_theora_depay_parse_configuration (rtptheoradepay, confbuf))
goto invalid_configuration;
......@@ -543,8 +543,9 @@ gst_rtp_theora_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
if (G_UNLIKELY (to_free)) {
outbuf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, to_free, g_free,
(payload - to_free) + length, payload - to_free, length));
gst_memory_new_wrapped (0, to_free,
(payload - to_free) + length, payload - to_free, length, to_free,
g_free));
to_free = NULL;
} else {
outbuf = gst_buffer_new_and_alloc (length);
......
......@@ -370,7 +370,7 @@ gst_rtp_vorbis_depay_setcaps (GstRTPBaseDepayload * depayload, GstCaps * caps)
confbuf = gst_buffer_new ();
gst_buffer_take_memory (confbuf, -1,
gst_memory_new_wrapped (0, data, g_free, size, 0, size));
gst_memory_new_wrapped (0, data, size, 0, size, data, g_free));
if (!gst_rtp_vorbis_depay_parse_configuration (rtpvorbisdepay, confbuf))
goto invalid_configuration;
} else {
......@@ -594,8 +594,9 @@ gst_rtp_vorbis_depay_process (GstRTPBaseDepayload * depayload, GstBuffer * buf)
if (G_UNLIKELY (to_free)) {
outbuf = gst_buffer_new ();
gst_buffer_take_memory (outbuf, -1,
gst_memory_new_wrapped (0, to_free, g_free,
(payload - to_free) + length, payload - to_free, length));
gst_memory_new_wrapped (0, to_free,
(payload - to_free) + length, payload - to_free, length, to_free,
g_free));
to_free = NULL;
} else {
outbuf = gst_buffer_new_and_alloc (length);
......
......@@ -3603,7 +3603,7 @@ gst_rtspsrc_loop_interleaved (GstRTSPSrc * src)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, data, g_free, size, 0, size));
gst_memory_new_wrapped (0, data, size, 0, size, data, g_free));
/* don't need message anymore */
gst_rtsp_message_unset (&message);
......
......@@ -459,7 +459,8 @@ no_select:
outbuf = gst_buffer_new ();
gst_buffer_take_memory (outbuf, -1,
gst_memory_new_wrapped (0, pktdata, g_free, pktsize, offset, ret));
gst_memory_new_wrapped (0, pktdata, pktsize, offset, ret, pktdata,
g_free));
/* use buffer metadata so receivers can also track the address */
if (saddr) {
......@@ -525,7 +526,7 @@ gst_udpsrc_set_uri (GstUDPSrc * src, const gchar * uri, GError ** error)
if (!gst_udp_parse_uri (uri, &host, &port))
goto wrong_uri;
if (port == (guint16) -1)
if (port == (guint16) - 1)
port = UDP_DEFAULT_PORT;
g_free (src->host);
......
......@@ -240,7 +240,7 @@ gst_y4m_encode_get_stream_header (GstY4mEncode * filter, gboolean tff)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, header, g_free, len, 0, len));
gst_memory_new_wrapped (0, header, len, 0, len, header, g_free));
return buf;
}
......@@ -257,7 +257,7 @@ gst_y4m_encode_get_frame_header (GstY4mEncode * filter)
buf = gst_buffer_new ();
gst_buffer_take_memory (buf, -1,
gst_memory_new_wrapped (0, header, g_free, len, 0, len));
gst_memory_new_wrapped (0, header, len, 0, len, header, g_free));
return buf;
}
......
......@@ -173,7 +173,8 @@ gst_v4l2_buffer_pool_alloc_buffer (GstBufferPool * bpool, GstBuffer ** buffer,
gst_buffer_take_memory (newbuf, -1,
gst_memory_new_wrapped (0,
meta->mem, NULL, meta->vbuffer.length, 0, meta->vbuffer.length));
meta->mem, meta->vbuffer.length, 0, meta->vbuffer.length, NULL,
NULL));
/* add metadata to raw video buffers */
if (pool->add_videometa && info->finfo) {
......
......@@ -423,7 +423,7 @@ gst_ximageutil_ximage_new (GstXContext * xcontext,
gst_buffer_take_memory (ximage, -1,
gst_memory_new_wrapped (GST_MEMORY_FLAG_NO_SHARE, meta->ximage->data,
NULL, meta->size, 0, meta->size));
meta->size, 0, meta->size, NULL, NULL));
/* Keep a ref to our src */
meta->parent = gst_object_ref (parent);
......
......@@ -454,8 +454,8 @@ 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, g_free,
size, 0, size));
gst_buffer_take_memory (buf, -1, gst_memory_new_wrapped (0, data,
size, 0, size, data, g_free));
GST_BUFFER_OFFSET (buf) = 0;
GST_BUFFER_TIMESTAMP (buf) = 0;
}
......
......@@ -415,8 +415,8 @@ 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, g_free,
size, 0, size));
gst_buffer_take_memory (buffer, -1, gst_memory_new_wrapped (0, data,
size, 0, size, data, g_free));
GST_BUFFER_OFFSET (buffer) = GST_BUFFER_OFFSET_NONE;
GST_BUFFER_TIMESTAMP (buffer) = GST_CLOCK_TIME_NONE;
......
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