update for memory API

This commit is contained in:
Wim Taymans 2012-01-19 12:44:39 +01:00
parent 1584806634
commit b22c0dd3f6
2 changed files with 4 additions and 8 deletions

View file

@ -176,8 +176,7 @@ ensure_memory (GstJpegEnc * jpegenc)
/* copy previous data if any */
if (jpegenc->output_mem) {
memcpy (new_data, jpegenc->output_data, old_size);
gst_memory_unmap (jpegenc->output_mem, jpegenc->output_data,
jpegenc->output_size);
gst_memory_unmap (jpegenc->output_mem);
gst_memory_unref (jpegenc->output_mem);
}
@ -216,8 +215,9 @@ gst_jpegenc_term_destination (j_compress_ptr cinfo)
GstJpegEnc *jpegenc = (GstJpegEnc *) (cinfo->client_data);
GST_DEBUG_OBJECT (jpegenc, "gst_jpegenc_chain: term_source");
gst_memory_unmap (jpegenc->output_mem);
/* Trim the buffer size. we will push it in the chain function */
gst_memory_unmap (jpegenc->output_mem, jpegenc->output_data,
gst_memory_resize (jpegenc->output_mem, 0,
jpegenc->output_size - jpegenc->jdest.free_in_buffer);
jpegenc->output_data = NULL;
jpegenc->output_size = 0;

View file

@ -511,11 +511,7 @@ gst_multiudpsink_render (GstBaseSink * bsink, GstBuffer * buffer)
/* unmap all memory again */
for (i = 0; i < n_mem; i++) {
mem = gst_buffer_peek_memory (buffer, i, GST_MAP_READ);
bdata = (guint8 *) vec[i].buffer;
bsize = vec[i].size;
gst_memory_unmap (mem, bdata, bsize);
gst_memory_unmap (mem);
}
g_free (vec);