From 47546ab2df30d5090562fd6e313f0e98ef226e03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Mon, 23 Jul 2012 10:54:17 +0200 Subject: [PATCH] schro: Map raw video buffers with the correct read/write flags --- ext/schroedinger/gstschrodec.c | 5 +++-- ext/schroedinger/gstschroenc.c | 1 + ext/schroedinger/gstschroutils.c | 6 +++--- ext/schroedinger/gstschroutils.h | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/ext/schroedinger/gstschrodec.c b/ext/schroedinger/gstschrodec.c index 939588dd39..ced46018d8 100644 --- a/ext/schroedinger/gstschrodec.c +++ b/ext/schroedinger/gstschrodec.c @@ -458,8 +458,9 @@ gst_schro_dec_process (GstSchroDec * schro_dec, gboolean eos) gst_video_decoder_allocate_output_buffer (GST_VIDEO_DECODER (schro_dec)); schro_frame = - gst_schro_buffer_wrap (outbuf, GST_VIDEO_INFO_FORMAT (&state->info), - state->info.width, state->info.height); + gst_schro_buffer_wrap (outbuf, TRUE, + GST_VIDEO_INFO_FORMAT (&state->info), state->info.width, + state->info.height); schro_decoder_add_output_picture (schro_dec->decoder, schro_frame); gst_video_codec_state_unref (state); break; diff --git a/ext/schroedinger/gstschroenc.c b/ext/schroedinger/gstschroenc.c index 48907a4880..0affaa29e4 100644 --- a/ext/schroedinger/gstschroenc.c +++ b/ext/schroedinger/gstschroenc.c @@ -525,6 +525,7 @@ gst_schro_enc_handle_frame (GstVideoEncoder * base_video_encoder, /* FIXME : We could make that method just take GstVideoInfo ... */ schro_frame = gst_schro_buffer_wrap (gst_buffer_ref (frame->input_buffer), + FALSE, GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info), GST_VIDEO_INFO_HEIGHT (info)); diff --git a/ext/schroedinger/gstschroutils.c b/ext/schroedinger/gstschroutils.c index c08a8ff681..32792090b2 100644 --- a/ext/schroedinger/gstschroutils.c +++ b/ext/schroedinger/gstschroutils.c @@ -64,14 +64,14 @@ gst_schro_frame_get_buffer (SchroFrame * frame) } SchroFrame * -gst_schro_buffer_wrap (GstBuffer * buf, GstVideoFormat format, int width, - int height) +gst_schro_buffer_wrap (GstBuffer * buf, gboolean write, GstVideoFormat format, + int width, int height) { SchroFrame *frame; GstMapInfo info; FrameData *data; - if (!gst_buffer_map (buf, &info, GST_MAP_READ)) + if (!gst_buffer_map (buf, &info, (write ? GST_MAP_READWRITE : GST_MAP_READ))) return NULL; switch (format) { diff --git a/ext/schroedinger/gstschroutils.h b/ext/schroedinger/gstschroutils.h index 149ab3e1a1..705dd8ca4a 100644 --- a/ext/schroedinger/gstschroutils.h +++ b/ext/schroedinger/gstschroutils.h @@ -35,7 +35,7 @@ #endif SchroFrame * -gst_schro_buffer_wrap (GstBuffer *buf, GstVideoFormat format, int width, +gst_schro_buffer_wrap (GstBuffer *buf, gboolean write, GstVideoFormat format, int width, int height); GstBuffer * gst_schro_frame_get_buffer (SchroFrame * frame);