]> code.ossystems Code Review - meta-freescale.git/blob
f8a5e3007fffa7203cda0dcb9f28c21b3a47aff4
[meta-freescale.git] /
1 From faec2f8b60cb8b01dacb7e3dd22367dda3ea5d94 Mon Sep 17 00:00:00 2001
2 From: Carlos Rafael Giani <dv@pseudoterminal.org>
3 Date: Wed, 7 Jun 2017 20:15:24 +0200
4 Subject: [PATCH] v4l2videodec: Hack to make sure DMABUF is the default capture
5  io mode
6
7 This is necessary to guarantee that zerocopy is used for video decoding.
8 Zerocopy requires dmabuf usage. And without zerocopy, video playback is
9 slow because pixels get copied by the CPU.
10
11 Upstream is already working on a better solution that sets dmabuf as
12 default: https://bugzilla.gnome.org/show_bug.cgi?id=779466
13
14 Upstream-Status: Inapproproate [i.MX/CODA specific hack]
15 ---
16  sys/v4l2/gstv4l2videodec.c | 9 +++++++++
17  1 file changed, 9 insertions(+)
18
19 diff --git a/sys/v4l2/gstv4l2videodec.c b/sys/v4l2/gstv4l2videodec.c
20 index 2c07c30..4c7b1e6 100644
21 --- a/sys/v4l2/gstv4l2videodec.c
22 +++ b/sys/v4l2/gstv4l2videodec.c
23 @@ -898,6 +898,15 @@ gst_v4l2_video_dec_subinstance_init (GTypeInstance * instance, gpointer g_class)
24        gst_v4l2_get_input, gst_v4l2_set_input, NULL);
25    self->v4l2capture->no_initial_format = TRUE;
26    self->v4l2output->keep_aspect = FALSE;
27 +
28 +  /* XXX Hack to make sure dmabuf is used as default for capture io mode */
29 +  {
30 +    GValue val = G_VALUE_INIT;
31 +    g_value_init (&val, GST_TYPE_V4L2_IO_MODE);
32 +    g_value_set_enum (&val, GST_V4L2_IO_DMABUF);
33 +    gst_v4l2_object_set_property_helper (self->v4l2capture,
34 +        PROP_CAPTURE_IO_MODE, &val, NULL);
35 +  }
36  }
37  
38  static void
39 -- 
40 2.7.4
41