summaryrefslogtreecommitdiffstats
path: root/meta-rcar-gen2/recipes-multimedia/gstreamer/gstreamer1.0-omx/0005-gssomxbufferpool-add-exported-flag.patch
blob: c6b5c36b5e1e7b7d6b5ec77b19daed91bd25591e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
From c4e86a58041cd4408d283444dcba6f532a80697c Mon Sep 17 00:00:00 2001
From: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
Date: Thu, 1 Sep 2016 17:33:44 +0300
Subject: [PATCH 05/10] gssomxbufferpool: add exported flag

This flag indicates that buffer are used outside of OMX component

Signed-off-by: Andrey Gusakov <andrey.gusakov@cogentembedded.com>
---
 omx/gstomx.c           |    1 +
 omx/gstomx.h           |    5 +++++
 omx/gstomxbufferpool.c |    5 ++++-
 3 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/omx/gstomx.c b/omx/gstomx.c
index c018e72..5a916dc 100644
--- a/omx/gstomx.c
+++ b/omx/gstomx.c
@@ -1663,6 +1663,7 @@ gst_omx_port_allocate_buffers_unlocked (GstOMXPort * port,
     buf = g_slice_new0 (GstOMXBuffer);
     buf->port = port;
     buf->used = FALSE;
+    buf->exported = FALSE;
     buf->settings_cookie = port->settings_cookie;
     g_ptr_array_add (port->buffers, buf);
 
diff --git a/omx/gstomx.h b/omx/gstomx.h
index 84980f3..27cb2a9 100644
--- a/omx/gstomx.h
+++ b/omx/gstomx.h
@@ -279,6 +279,11 @@ struct _GstOMXBuffer {
    */
   gboolean used;
 
+  /* TRUE if the buffer exported outside the component,
+   * i.e. someone acquired this buffer
+   */
+  gboolean exported;
+
   /* Cookie of the settings when this buffer was allocated */
   gint settings_cookie;
 
diff --git a/omx/gstomxbufferpool.c b/omx/gstomxbufferpool.c
index b9fa769..1e0a14c 100644
--- a/omx/gstomxbufferpool.c
+++ b/omx/gstomxbufferpool.c
@@ -695,7 +695,7 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
           pool->enc_buffer_index = 0;
 
         count += 1;
-      } while (omx_buf->used == TRUE &&
+      } while (omx_buf->exported == TRUE &&
           count < pool->port->port_def.nBufferCountActual * 3);
 
       if (count == pool->port->port_def.nBufferCountActual * 3) {
@@ -703,6 +703,7 @@ gst_omx_buffer_pool_acquire_buffer (GstBufferPool * bpool,
         GST_ERROR_OBJECT (pool,
             "Can not acquire buffer after 3 times searching");
       } else {
+        omx_buf->exported = TRUE;
         *buffer = buf;
         ret = GST_FLOW_OK;
       }
@@ -731,6 +732,8 @@ gst_omx_buffer_pool_release_buffer (GstBufferPool * bpool, GstBuffer * buffer)
     omx_buf =
         gst_mini_object_get_qdata (GST_MINI_OBJECT_CAST (buffer),
         gst_omx_buffer_data_quark);
+    if (GST_IS_OMX_VIDEO_ENC (pool->element))
+      omx_buf->exported = FALSE;
     if (pool->port->port_def.eDir == OMX_DirOutput && !omx_buf->used) {
       /* Release back to the port, can be filled again */
       err = gst_omx_port_release_buffer (pool->port, omx_buf);
-- 
1.7.10.4
and other platforms for In-Vehicle Infotainment system. * `meta-agl/meta-agl`\ `meta-agl` is a layer which contains AGL common and middleware packages. * `meta-agl/meta-agl-bsp`\ `meta-agl-bsp` is a layer which contains required packages to boot AGL distribution on an emulated machine(QEMU). * `meta-agl/meta-netboot`\ `meta-netboot` contains the netboot initrd support recipes. This is needed in case of booting over the network as NFS does not support the securitylabels. ## Packagegroups AGL package group design: * packagegroup-agl-image-minimal packagegroup-agl-core-automotive.bb packagegroup-agl-core-connectivity.bb packagegroup-agl-core-graphics.bb packagegroup-agl-core-kernel.bb packagegroup-agl-core-multimedia.bb packagegroup-agl-core-navi-lbs.bb packagegroup-agl-core-os-commonlibs.bb packagegroup-agl-core-security.bb packagegroup-agl-core-speech-services.bb These are for making image ``agl-image-minimal`` which is small image just capable of allowing a device to boot. Subsystem should maintain packagegroup-agl-core-[subsystem].bb which should hold sufficient packages to build ``agl-image-minimal``. * packagegroup-agl-image-ivi packagegroup-agl-ivi-automotive.bb packagegroup-agl-ivi-connectivity.bb packagegroup-agl-ivi-graphics.bb packagegroup-agl-ivi-kernel.bb packagegroup-agl-ivi-multimedia.bb packagegroup-agl-ivi-navi-lbs.bb packagegroup-agl-ivi-os-commonlibs.bb packagegroup-agl-ivi-security.bb packagegroup-agl-ivi-speech-services.bb These are for making image ``agl-image-ivi`` which is baseline for the profiles of AGL distro. 'Baseline' means Service Layer and Operating System Layer defined in AGL Spec v1.0. * packagegroup-agl-test.bb Additional tools used in QA tests (for agl-image*-qa). * packagegroup-ivi-common* packagegroup-ivi-common-core-automotive.bb packagegroup-ivi-common-core.bb packagegroup-ivi-common-core-connectivity.bb packagegroup-ivi-common-core-graphics.bb packagegroup-ivi-common-core-kernel.bb packagegroup-ivi-common-core-multimedia.bb packagegroup-ivi-common-core-navi-lbs.bb packagegroup-ivi-common-core-os-commonlibs.bb packagegroup-ivi-common-core-security.bb packagegroup-ivi-common-core-speech-services.bb packagegroup-ivi-common-test.bb These are for picking up some packages from upstreams like GENIVI/Tizen/Others. The layer of ``meta-ivi-common`` has no image to build, all packagegroups are aggregated to ``packagegroup-ivi-common-core' and it is included by images, ``agl-image-ivi.bb`` and ``agl-demo-platform.bb``. ## Supported Machines See [docs.automotivelinux.org](http://docs.automotivelinux.org)