gst-plugins-base: videofilter: don't map writable in passthrough

Wim Taymans wtay at kemper.freedesktop.org
Sun Apr 1 09:02:28 PDT 2012


Module: gst-plugins-base
Branch: master
Commit: 6f8347de9fe2ff06af426e3a17c2d27c4ac753ab
URL:    http://cgit.freedesktop.org/gstreamer/gst-plugins-base/commit/?id=6f8347de9fe2ff06af426e3a17c2d27c4ac753ab

Author: Wim Taymans <wim.taymans at collabora.co.uk>
Date:   Sun Apr  1 17:57:59 2012 +0200

videofilter: don't map writable in passthrough

In passthrough mode we shouldn't map the buffer in write mode because the buffer
might not be writable.

---

 gst-libs/gst/video/gstvideofilter.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/gst-libs/gst/video/gstvideofilter.c b/gst-libs/gst/video/gstvideofilter.c
index 782fbb0..e36e45d 100644
--- a/gst-libs/gst/video/gstvideofilter.c
+++ b/gst-libs/gst/video/gstvideofilter.c
@@ -277,8 +277,14 @@ gst_video_filter_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
   fclass = GST_VIDEO_FILTER_GET_CLASS (filter);
   if (fclass->transform_frame_ip) {
     GstVideoFrame frame;
+    GstMapFlags flags;
 
-    if (!gst_video_frame_map (&frame, &filter->in_info, buf, GST_MAP_READWRITE))
+    flags = GST_MAP_READ;
+
+    if (!gst_base_transform_is_passthrough (trans))
+      flags |= GST_MAP_WRITE;
+
+    if (!gst_video_frame_map (&frame, &filter->in_info, buf, flags))
       goto invalid_buffer;
 
     res = fclass->transform_frame_ip (filter, &frame);



More information about the gstreamer-commits mailing list