summaryrefslogtreecommitdiffstats
path: root/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
diff options
context:
space:
mode:
authorYuqing Zhu <b54851@freescale.com>2015-08-10 11:41:36 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-09-01 21:19:35 +0100
commitbdf4d19dc39d8ee860201ca68e30ebf203016a41 (patch)
tree1aa3f60929ea44ef3b8f8fe130193f3c4e6ba00a /meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
parent29ef78c85ad669b3971bf45674b0edff07fa1219 (diff)
downloadpoky-bdf4d19dc39d8ee860201ca68e30ebf203016a41.tar.gz
gstreamer1.0-plugins-base: Fix output buffer can't writable after frame_map() issue
-Add GST_VIDEO_FRAME_MAP_FLAG_NO_REF This makes sure that the buffer is not reffed another time when storing it in the GstVideoFrame, keeping it writable if it was writable. -Use new GST_VIDEO_FRAME_MAP_FLAG_NO_REF to replace the old one because it's kind of ugly. -Don't ref buffers twice when mapping (From OE-Core master rev: a618f60675dbcc6568d6b9bdee015456cef78a77) (From OE-Core rev: b75f09af7c4bfa023299c4f82bd6c3f781b93354) Signed-off-by: Yuqing Zhu <b54851@freescale.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch')
-rw-r--r--meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
new file mode 100644
index 0000000000..132bf06f75
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-videofilter-Use-new-GST_VIDEO_FRAME_MAP_FLAG_NO_REF.patch
@@ -0,0 +1,69 @@
1From 3a7cdcdfc9c5b0d20394fe51b3b8cda23931ca6d Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= <sebastian@centricular.com>
3Date: Fri, 12 Sep 2014 14:41:01 +0300
4Subject: [PATCH 3/3] videofilter: Use new GST_VIDEO_FRAME_MAP_FLAG_NO_REF
5
6Upstream-Status: Backport [1.5.1]
7https://bugzilla.gnome.org/show_bug.cgi?id=736118
8---
9 gst-libs/gst/video/gstvideofilter.c | 23 ++++-------------------
10 1 file changed, 4 insertions(+), 19 deletions(-)
11
12diff --git a/gst-libs/gst/video/gstvideofilter.c b/gst-libs/gst/video/gstvideofilter.c
13index e1fa2c1..874b2e8 100644
14--- a/gst-libs/gst/video/gstvideofilter.c
15+++ b/gst-libs/gst/video/gstvideofilter.c
16@@ -260,23 +260,15 @@ gst_video_filter_transform (GstBaseTransform * trans, GstBuffer * inbuf,
17 if (fclass->transform_frame) {
18 GstVideoFrame in_frame, out_frame;
19
20- if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf, GST_MAP_READ))
21+ if (!gst_video_frame_map (&in_frame, &filter->in_info, inbuf,
22+ GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
23 goto invalid_buffer;
24
25 if (!gst_video_frame_map (&out_frame, &filter->out_info, outbuf,
26- GST_MAP_WRITE))
27+ GST_MAP_WRITE | GST_VIDEO_FRAME_MAP_FLAG_NO_REF))
28 goto invalid_buffer;
29
30- /* GstVideoFrame has another reference, so the buffer looks unwriteable,
31- * meaning that we can't attach any metas or anything to it. Other
32- * map() functions like gst_buffer_map() don't get another reference
33- * of the buffer and expect the buffer reference to be kept until
34- * the buffer is unmapped again. */
35- gst_buffer_unref (inbuf);
36- gst_buffer_unref (outbuf);
37 res = fclass->transform_frame (filter, &in_frame, &out_frame);
38- gst_buffer_ref (inbuf);
39- gst_buffer_ref (outbuf);
40
41 gst_video_frame_unmap (&out_frame);
42 gst_video_frame_unmap (&in_frame);
43@@ -317,7 +309,7 @@ gst_video_filter_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
44 GstVideoFrame frame;
45 GstMapFlags flags;
46
47- flags = GST_MAP_READ;
48+ flags = GST_MAP_READ | GST_VIDEO_FRAME_MAP_FLAG_NO_REF;
49
50 if (!gst_base_transform_is_passthrough (trans))
51 flags |= GST_MAP_WRITE;
52@@ -325,14 +317,7 @@ gst_video_filter_transform_ip (GstBaseTransform * trans, GstBuffer * buf)
53 if (!gst_video_frame_map (&frame, &filter->in_info, buf, flags))
54 goto invalid_buffer;
55
56- /* GstVideoFrame has another reference, so the buffer looks unwriteable,
57- * meaning that we can't attach any metas or anything to it. Other
58- * map() functions like gst_buffer_map() don't get another reference
59- * of the buffer and expect the buffer reference to be kept until
60- * the buffer is unmapped again. */
61- gst_buffer_unref (buf);
62 res = fclass->transform_frame_ip (filter, &frame);
63- gst_buffer_ref (buf);
64
65 gst_video_frame_unmap (&frame);
66 } else {
67--
681.7.9.5
69