[meta-freescale] fsl kernel 3.14.28 Can't detect pcie device

Stiff.Yin 1020833481 at qq.com
Tue Mar 29 22:07:16 PDT 2016


Hi, 
   I use the kernel 3.14.28 ,yotco, the pcie device failed to detect, here is the log :
    0.253208] imx6q-pcie 1ffc000.pcie:  get reset gpio
[    0.455135] imx6q-pcie 1ffc000.pcie: phy link never came up
[    0.455147] imx6q-pcie 1ffc000.pcie: DEBUG_R0: 0x004abc43, DEBUG_R1: 0x08000000
[    0.455156] imx6q-pcie 1ffc000.pcie: Failed to bring link up!
[    0.455181] imx6q-pcie 1ffc000.pcie: failed to initialize host
[    0.455227] imx6q-pcie: probe of 1ffc000.pcie failed with error -22
[    0.455483] i.MX PCIE endpoint device driver, version 0.1
 any update about this?
       


 




------------------ Original ------------------
From:  "meta-freescale-request";<meta-freescale-request at yoctoproject.org>;
Date:  Wed, Mar 30, 2016 03:00 AM
To:  "meta-freescale"<meta-freescale at yoctoproject.org>; 

Subject:  meta-freescale Digest, Vol 41, Issue 22



Send meta-freescale mailing list submissions to
	meta-freescale at yoctoproject.org

To subscribe or unsubscribe via the World Wide Web, visit
	https://lists.yoctoproject.org/listinfo/meta-freescale
or, via email, send a message with subject or body 'help' to
	meta-freescale-request at yoctoproject.org

You can reach the person managing the list at
	meta-freescale-owner at yoctoproject.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of meta-freescale digest..."


Today's Topics:

   1. Re: [meta-fsl-arm][PATCH v2 1/2] gstreamer1.0-plugins-base:
      Fix IMXCameraApp image time cannot display issue.
      (Carlos Rafael Giani)
   2. Re: [meta-fsl-arm][PATCH v2 2/2] gstreamer1.0-plugins-base:
      Make memory copy when video buffer's memory is read only
      (Carlos Rafael Giani)
   3. Re: [meta-fsl-arm][PATCH v2 3/3] gstreamer1.0-plugins-bad:
      Change wayland default resolution to 1024x768 (Carlos Rafael Giani)
   4. Re: [meta-fsl-arm][PATCH v2 2/3] gstreamer1.0-plugins-bad:
      Support video crop for glimagesink (Carlos Rafael Giani)
   5. Re: [meta-fsl-arm][PATCH v2 1/3] gstreamer1.0-plugins-bad:
      Add directviv to glimagesink to improve playback performance
      (Carlos Rafael Giani)
   6. Updates to meta-fsl-arm (master) in 2016-03-29 (Otavio Salvador)


----------------------------------------------------------------------

Message: 1
Date: Tue, 29 Mar 2016 08:58:53 +0200
From: Carlos Rafael Giani <dv at pseudoterminal.org>
To: Yuqing Zhu <b54851 at freescale.com>, meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 1/2]
	gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display
	issue.
Message-ID: <56FA27AD.6010708 at pseudoterminal.org>
Content-Type: text/plain; charset=windows-1252; format=flowed

As said in the previous submission, I think this patch is acceptable, 
and a good example of something truly i.MX specific.

Since 8/16-pixel alignments aren't exactly uncommon, I think this should 
be turned into a solution that can be upstreamed and is applicable to 
many other GStreamer plugins that generate video frames.
However, at least for now, we can live with this patch.

On 2016-01-29 10:41, Yuqing Zhu wrote:
> IMXCameraApp: When Enabled "save time to image" item, preview,
> find the time can not display completely.
>
> As IPU need 8 pixels alignment, add one workaround in base text overlay
> to generate 8 pixels alignment text video buffer. The side effect should
> cause all text a little smaller.
>
> Signed-off-by: Yuqing Zhu <b54851 at freescale.com>
> ---
>   ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  8 ++-
>   2 files changed, 64 insertions(+), 2 deletions(-)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch
> new file mode 100755
> index 0000000..1f54fc1
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch
> @@ -0,0 +1,58 @@
> +From f19e83a1a69a3dbbeb16dc4bcee3fb87317bb65b Mon Sep 17 00:00:00 2001
> +From: Song Bing <b06498 at freescale.com>
> +Date: Mon, 11 Jan 2016 14:51:17 +0800
> +Subject: [PATCH] MMFMWK-7030 [Linux_MX6QP_ARD]IMXCameraApp:When Enabled "save
> + time to image" item, preview, find the time can not display
> + completely. 100%
> +
> +As IPU need 8 pixels alignment, add one workaround in base text overlay
> +to generate 8 pixels alignment text video buffer. The side effect should
> +cause all text a little smaller.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Song Bing b06498 at freescale.com
> +---
> + ext/pango/gstbasetextoverlay.c |   12 ++++++++++--
> + 1 file changed, 10 insertions(+), 2 deletions(-)
> +
> +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c
> +index 3e98aa1..de64c92 100755
> +--- a/ext/pango/gstbasetextoverlay.c
> ++++ b/ext/pango/gstbasetextoverlay.c
> +@@ -1545,7 +1545,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
> +   gint unscaled_width, unscaled_height;
> +   gint width, height;
> +   gboolean full_width = FALSE;
> +-  double scalef = 1.0;
> ++  double scalef = 1.0, scalefx, scalefy;
> +   double a, r, g, b;
> +   gdouble shadow_offset = 0.0;
> +   gdouble outline_offset = 0.0;
> +@@ -1673,6 +1673,14 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
> +   height = ceil (height * overlay->render_scale);
> +   scalef *= overlay->render_scale;
> +
> ++  /* i.MX special, will cause text a little small */
> ++  scalefx = scalef * ((gdouble)GST_ROUND_DOWN_8 (width)) / width;
> ++  scalefy = scalef * ((gdouble)GST_ROUND_DOWN_8 (height)) / height;
> ++  width = GST_ROUND_DOWN_8 (width);
> ++  height = GST_ROUND_DOWN_8 (height);
> ++  GST_DEBUG_OBJECT (overlay, "Rendering with width %d and height %d "
> ++      , width, height);
> ++
> +   if (width <= 0 || height <= 0) {
> +     g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock);
> +     GST_DEBUG_OBJECT (overlay,
> +@@ -1689,7 +1697,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,
> +   /* Prepare the transformation matrix. Note that the transformation happens
> +    * in reverse order. So for horizontal text, we will translate and then
> +    * scale. This is important to understand which scale shall be used. */
> +-  cairo_matrix_init_scale (&cairo_matrix, scalef, scalef);
> ++  cairo_matrix_init_scale (&cairo_matrix, scalefx, scalefy);
> +
> +   if (overlay->use_vertical_render) {
> +     gint tmp;
> +--
> +1.7.9.5
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> index ff4d77b..f1992c3 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> @@ -1,7 +1,11 @@
>   FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
>   
> -SRC_URI_append_mx6 = " file://gstplaybin-remove-flag-deinterlace.patch"
> -SRC_URI_append_mx7 = " file://gstplaybin-remove-flag-deinterlace.patch"
> +IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \
> +                file://0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \
> +"
> +
> +SRC_URI_append_mx6 = "${IMX_PATCHES}"
> +SRC_URI_append_mx7 = "${IMX_PATCHES}"
>   
>   PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
>   PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}"



------------------------------

Message: 2
Date: Tue, 29 Mar 2016 09:05:58 +0200
From: Carlos Rafael Giani <dv at pseudoterminal.org>
To: Yuqing Zhu <b54851 at freescale.com>, meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 2/2]
	gstreamer1.0-plugins-base: Make memory copy when video buffer's memory
	is read only
Message-ID: <56FA2956.4040205 at pseudoterminal.org>
Content-Type: text/plain; charset=utf-8; format=flowed

I do see the reason behind the patch. As you explained earlier, the 
VPU's output buffers are re-used as references, so they should not be 
modified.

Before I give this patch an Ack however, I need to know if the 
suggestions from https://bugzilla.gnome.org/show_bug.cgi?id=747495 
regarding the NO_SHARE flag were tried out. They seem less invasive to 
me while accomplishing the same end result.

On 2016-01-29 10:41, Yuqing Zhu wrote:
> The VPU decoder need the output framebuffer as a reference buffer for decoding.
> The output buffer shouldn?t be changed, if we blend the subtitle on the buffer directly,
> then the decoded video frame will have artificial jitter around the subtitle.
>
> Since gst_buffer_make_writable just lookup the refcount to determine if
> a buffer is writable, and it will use _gst_buffer_copy() which don't
> perform a deep memory copy even if the flag of a memory is set to
> GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use
> gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform
> deep memory copy. if the allocator of a memory don't support mem_copy
> interface, then it will return NULL, if this case, we can use
> gst_buffer_make_writable() to get a shared memory buffer or the orignal
> buffer if the buffer's refcount is 1.
>
> Signed-off-by: Yuqing Zhu <b54851 at freescale.com>
> ---
>   ...rlay-make-memory-copy-when-video-buffer-s.patch | 82 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  1 +
>   2 files changed, 83 insertions(+)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
> new file mode 100755
> index 0000000..33628c9
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
> @@ -0,0 +1,82 @@
> +From 0092d07195aa5d950bc10dfb05bd9547f67028a3 Mon Sep 17 00:00:00 2001
> +From: Mingke Wang <mingke.wang at freescale.com>
> +Date: Fri, 16 Oct 2015 19:31:32 +0800
> +Subject: [PATCH 1/9] basetextoverlay: make memory copy when video buffer's
> + memory is ready only
> +
> +1. since gst_buffer_make_writable just lookup the refcount to determine if
> +   a buffer is writable, and it will use _gst_buffer_copy() which don't
> +   perform a deep memory copy even if the flag of a memory is set to
> +   GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use
> +   gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform
> +   deep memory copy. if the allocator of a memory don't support mem_copy
> +   interface, the it will return NULL, if this case, we can use
> +   gst_buffer_make_writable() to get a shared memory buffer or the orignal
> +   buffer if the buffer's refcount is 1.
> +
> +https://bugzilla.gnome.org/show_bug.cgi?id=747495
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Mingke Wang <mingke.wang at freescale.com>
> +---
> + ext/pango/gstbasetextoverlay.c | 32 ++++++++++++++++++++++++++++++--
> + 1 file changed, 30 insertions(+), 2 deletions(-)
> + mode change 100644 => 100755 ext/pango/gstbasetextoverlay.c
> +
> +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c
> +old mode 100644
> +new mode 100755
> +index bde4303..3e98aa1
> +--- a/ext/pango/gstbasetextoverlay.c
> ++++ b/ext/pango/gstbasetextoverlay.c
> +@@ -2085,16 +2085,44 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay,
> +   if (gst_pad_check_reconfigure (overlay->srcpad))
> +     gst_base_text_overlay_negotiate (overlay, NULL);
> +
> +-  video_frame = gst_buffer_make_writable (video_frame);
> +-
> +   if (overlay->attach_compo_to_buffer) {
> +     GST_DEBUG_OBJECT (overlay, "Attaching text overlay image to video buffer");
> ++    video_frame = gst_buffer_make_writable (video_frame);
> +     gst_buffer_add_video_overlay_composition_meta (video_frame,
> +         overlay->composition);
> +     /* FIXME: emulate shaded background box if want_shading=true */
> +     goto done;
> +   }
> +
> ++  gint idx = 0;
> ++  gboolean mem_rdonly = FALSE;
> ++  GstMemory *mem;
> ++  guint n = gst_buffer_n_memory(video_frame);
> ++  while ((idx < n) && (mem = gst_buffer_get_memory(video_frame, idx++))) {
> ++    if (GST_MEMORY_IS_READONLY(mem)) {
> ++      gst_memory_unref (mem);
> ++      mem_rdonly = TRUE;
> ++      break;
> ++    }
> ++    gst_memory_unref (mem);
> ++  }
> ++
> ++  if (mem_rdonly) {
> ++    GstBuffer *new_buf = gst_buffer_copy_region (video_frame,
> ++        GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1);
> ++
> ++    if (!new_buf) {
> ++      GST_WARNING_OBJECT(overlay,
> ++                "buffer memory read only, but copy memory failed");
> ++      goto done;
> ++    } else {
> ++      gst_buffer_unref (video_frame);
> ++      video_frame = new_buf;
> ++    }
> ++  } else {
> ++    video_frame = gst_buffer_make_writable (video_frame);
> ++  }
> ++
> +   if (!gst_video_frame_map (&frame, &overlay->info, video_frame,
> +           GST_MAP_READWRITE))
> +     goto invalid_frame;
> +--
> +1.9.1
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> index f1992c3..4ad87bb 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> @@ -2,6 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
>   
>   IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \
>                   file://0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \
> +                file://0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
>   "
>   
>   SRC_URI_append_mx6 = "${IMX_PATCHES}"



------------------------------

Message: 3
Date: Tue, 29 Mar 2016 09:07:45 +0200
From: Carlos Rafael Giani <dv at pseudoterminal.org>
To: Yuqing Zhu <b54851 at freescale.com>, meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 3/3]
	gstreamer1.0-plugins-bad: Change wayland default resolution to
	1024x768
Message-ID: <56FA29C1.4050305 at pseudoterminal.org>
Content-Type: text/plain; charset=utf-8; format=flowed

This gets an Ack from me. It doesn't break anything, and is truly i.MX 
specific. There may be i.MX devices with screens smaller than 1024x768, 
though to me this seems to be the minority.

On 2016-02-02 15:01, Yuqing Zhu wrote:
> In our release, the default display is full screen in LVDS.
> The 1024x768 resolution will be better in testing for our
> release platform.
>
> Signed-off-by: Yuqing Zhu <b54851 at freescale.com>
> ---
>   ...in-Change-wayland-default-res-to-1024x768.patch | 41 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend  |  1 +
>   2 files changed, 42 insertions(+)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glplugin-Change-wayland-default-res-to-1024x768.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glplugin-Change-wayland-default-res-to-1024x768.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glplugin-Change-wayland-default-res-to-1024x768.patch
> new file mode 100755
> index 0000000..49a0a9d
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glplugin-Change-wayland-default-res-to-1024x768.patch
> @@ -0,0 +1,41 @@
> +From decc71a707d3b3596888d30a4c7ca25b57a686b2 Mon Sep 17 00:00:00 2001
> +From: Jian <Jian.Li at freescale.com>
> +Date: Tue, 17 Nov 2015 14:39:07 +0800
> +Subject: [PATCH 2/3] [glplugin] Change wayland default res to 1024x768
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +Change wayland backend default window resolution
> +from 320x240 to 1024x768
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Jian <Jian.Li at freescale.com>
> +---
> + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c |    4 ++--
> + 1 file changed, 2 insertions(+), 2 deletions(-)
> +
> +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
> +index b34ad42..b557daa 100644
> +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
> ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c
> +@@ -305,13 +305,13 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl)
> +   if (window_egl->window.window_width > 0)
> +     width = window_egl->window.window_width;
> +   else
> +-    width = 320;
> ++    width = 1024;
> +   window_egl->window.window_width = width;
> +
> +   if (window_egl->window.window_height > 0)
> +     height = window_egl->window.window_height;
> +   else
> +-    height = 240;
> ++    height = 768;
> +   window_egl->window.window_height = height;
> +
> +   if (!window_egl->window.native) {
> +--
> +1.7.9.5
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> index 9ce22eb..ea66be9 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> @@ -13,6 +13,7 @@ PACKAGECONFIG_GL_mx6sl = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \
>   IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch \
>                   file://0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch \
>                   file://0003-glplugin-support-video-crop-for-glimagesink.patch \
> +                file://0004-glplugin-Change-wayland-default-res-to-1024x768.patch \
>   "
>   
>   SRC_URI_append_mx6 = "${IMX_PATCHES}"



------------------------------

Message: 4
Date: Tue, 29 Mar 2016 09:14:26 +0200
From: Carlos Rafael Giani <dv at pseudoterminal.org>
To: Yuqing Zhu <b54851 at freescale.com>, meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 2/3]
	gstreamer1.0-plugins-bad: Support video crop for glimagesink
Message-ID: <56FA2B52.9010506 at pseudoterminal.org>
Content-Type: text/plain; charset=windows-1252; format=flowed

This seems to be quite useful to me. But it is not i.MX specific - I 
could for example even use this on the PC.

However, modifying the global vertices array is not good, for two reasons:
1. This will not work well in a multithreaded environment (with multiple 
glimagesink instances)
2. The vertex data is not reset properly when the state change goes back 
to READY

So, instead, I'd keep this array const, and instead copy it & modify and 
upload the local copy. Crop metas are not updated so often, so the costs 
for a copy are negligible.

Once this is fixed, I strongly recommend to put this on GStreamer's 
bugzilla.

On 2016-02-02 15:01, Yuqing Zhu wrote:
> 1. Add video crop meta copy in glupload.
> 2. Calculate the new texture coordinate in vertices array and bind to buffer object.
> 3. Make glimagesink only updating vertices array when video crop meta changed.
>
> Signed-off-by: Yuqing Zhu <b54851 at freescale.com>
> ---
>   ...plugin-support-video-crop-for-glimagesink.patch | 155 +++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend  |   1 +
>   2 files changed, 156 insertions(+)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glplugin-support-video-crop-for-glimagesink.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glplugin-support-video-crop-for-glimagesink.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glplugin-support-video-crop-for-glimagesink.patch
> new file mode 100755
> index 0000000..0d0ade7
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glplugin-support-video-crop-for-glimagesink.patch
> @@ -0,0 +1,155 @@
> +From 1a917447c3749f0a6d3ff98b8dcbc7439b48293d Mon Sep 17 00:00:00 2001
> +From: Haihua Hu <b55597 at freescale.com>
> +Date: Fri, 13 Nov 2015 10:51:25 +0800
> +Subject: [PATCH] [glplugin] support video crop for glimagesink
> +
> +1.Add video crop meta copy in glupload
> +2.Calculate the new texture coordinate in vertices array and bind to buffer object
> +3.Make glimagesink only updating vertices array when video crop meta changed
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Haihua Hu <b55597 at freescale.com>
> +---
> + ext/gl/gstglimagesink.c       |   53 ++++++++++++++++++++++++++++++++++++++++-
> + ext/gl/gstglimagesink.h       |    3 +++
> + gst-libs/gst/gl/gstglupload.c |   10 ++++++++
> + 3 files changed, 65 insertions(+), 1 deletion(-)
> +
> +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
> +index 1e5dc05..6fc0f9e 100644
> +--- a/ext/gl/gstglimagesink.c
> ++++ b/ext/gl/gstglimagesink.c
> +@@ -585,6 +585,8 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink)
> +   glimage_sink->handle_events = TRUE;
> +   glimage_sink->ignore_alpha = TRUE;
> +   glimage_sink->overlay_compositor = NULL;
> ++  glimage_sink->cropmeta = NULL;
> ++  glimage_sink->prev_cropmeta = NULL;
> +
> +   glimage_sink->mview_output_mode = DEFAULT_MULTIVIEW_MODE;
> +   glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS;
> +@@ -1039,6 +1041,12 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)
> +         gst_object_unref (glimage_sink->display);
> +         glimage_sink->display = NULL;
> +       }
> ++
> ++      glimage_sink->cropmeta = NULL;
> ++      if (glimage_sink->prev_cropmeta)
> ++        g_slice_free(GstVideoCropMeta, glimage_sink->prev_cropmeta);
> ++      glimage_sink->prev_cropmeta = NULL;
> ++
> +       break;
> +     default:
> +       break;
> +@@ -1452,6 +1460,8 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)
> +       GST_VIDEO_SINK_WIDTH (glimage_sink),
> +       GST_VIDEO_SINK_HEIGHT (glimage_sink));
> +
> ++  glimage_sink->cropmeta = gst_buffer_get_video_crop_meta (buf);
> ++
> +   /* Ask the underlying window to redraw its content */
> +   if (!gst_glimage_sink_redisplay (glimage_sink))
> +     goto redisplay_failed;
> +@@ -1638,7 +1648,7 @@ config_failed:
> + }
> +
> + /* *INDENT-OFF* */
> +-static const GLfloat vertices[] = {
> ++static GLfloat vertices[] = {
> +      1.0f,  1.0f, 0.0f, 1.0f, 0.0f,
> +     -1.0f,  1.0f, 0.0f, 0.0f, 0.0f,
> +     -1.0f, -1.0f, 0.0f, 0.0f, 1.0f,
> +@@ -1898,6 +1908,47 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
> +
> +     gst_gl_shader_use (gl_sink->redisplay_shader);
> +
> ++    if (gl_sink->cropmeta) {
> ++      gint width = GST_VIDEO_SINK_WIDTH (gl_sink);
> ++      gint height = GST_VIDEO_SINK_HEIGHT (gl_sink);
> ++
> ++      if (!gl_sink->prev_cropmeta){
> ++        /* Initialize the previous crop meta and set all memroy to zero */
> ++        gl_sink->prev_cropmeta = (GstVideoCropMeta *) g_slice_new0(GstVideoCropMeta);
> ++      }
> ++
> ++      /* If crop meta not equal to the previous, recalculate the vertices */
> ++      if (gl_sink->prev_cropmeta->x != gl_sink->cropmeta->x
> ++        || gl_sink->prev_cropmeta->y != gl_sink->cropmeta->y
> ++        || gl_sink->prev_cropmeta->width != gl_sink->cropmeta->width
> ++        || gl_sink->prev_cropmeta->height != gl_sink->cropmeta->height){
> ++
> ++        vertices[8] = (float)(gl_sink->cropmeta->x) / width;
> ++        vertices[9] = (float)(gl_sink->cropmeta->y) / height;
> ++
> ++        vertices[3] = (float)(gl_sink->cropmeta->width + gl_sink->cropmeta->x) / width;
> ++        vertices[4] = vertices[9];
> ++
> ++        vertices[13] = vertices[8];
> ++        vertices[14] = (float)(gl_sink->cropmeta->height + gl_sink->cropmeta->y) / height;
> ++
> ++        vertices[18] = vertices[3];
> ++        vertices[19] = vertices[14];
> ++
> ++        gl->BindBuffer (GL_ARRAY_BUFFER, gl_sink->vertex_buffer);
> ++        gl->BufferData (GL_ARRAY_BUFFER, 4 * 5 * sizeof (GLfloat), vertices,
> ++            GL_STATIC_DRAW);
> ++
> ++        gl->BindBuffer (GL_ARRAY_BUFFER, 0);
> ++
> ++        /* Store the previous crop meta */
> ++        gl_sink->prev_cropmeta->x = gl_sink->cropmeta->x;
> ++        gl_sink->prev_cropmeta->y = gl_sink->cropmeta->y;
> ++        gl_sink->prev_cropmeta->width = gl_sink->cropmeta->width;
> ++        gl_sink->prev_cropmeta->height = gl_sink->cropmeta->height;
> ++      }
> ++    }
> ++
> +     if (gl->GenVertexArrays)
> +       gl->BindVertexArray (gl_sink->vao);
> +     else
> +diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h
> +index f7b3bfb..a26ca4b 100644
> +--- a/ext/gl/gstglimagesink.h
> ++++ b/ext/gl/gstglimagesink.h
> +@@ -102,6 +102,9 @@ struct _GstGLImageSink
> +     guint window_width;
> +     guint window_height;
> +
> ++    GstVideoCropMeta *cropmeta;
> ++    GstVideoCropMeta *prev_cropmeta;
> ++
> +     GstVideoRectangle display_rect;
> +
> +     GstGLShader *redisplay_shader;
> +diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c
> +index acaa329..0d36248 100644
> +--- a/gst-libs/gst/gl/gstglupload.c
> ++++ b/gst-libs/gst/gl/gstglupload.c
> +@@ -756,6 +756,7 @@ _physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **ou
> + {
> +   struct PhyBufferUpload *phyBuffer = impl;
> +   GstVideoInfo *info;
> ++  GstVideoCropMeta *incropmeta, *outcropmeta;
> +   gint n_mem;
> +
> +   info = &phyBuffer->upload->priv->out_info;
> +@@ -774,6 +775,15 @@ _physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **ou
> +   gst_buffer_add_video_meta_full (*outbuf, 0,
> +       GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
> +       GST_VIDEO_INFO_HEIGHT (info), n_mem, info->offset, info->stride);
> ++  /* add video crop meta to out buffer if need */
> ++  incropmeta = gst_buffer_get_video_crop_meta(buffer);
> ++  if(incropmeta){
> ++    outcropmeta = gst_buffer_add_video_crop_meta(*outbuf);
> ++    outcropmeta->x = incropmeta->x;
> ++    outcropmeta->y = incropmeta->y;
> ++    outcropmeta->width = incropmeta->width;
> ++    outcropmeta->height = incropmeta->height;
> ++  }
> +
> +   return GST_GL_UPLOAD_DONE;
> + }
> +--
> +1.7.9.5
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> index 0728009..9ce22eb 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> @@ -12,6 +12,7 @@ PACKAGECONFIG_GL_mx6sl = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \
>   
>   IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch \
>                   file://0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch \
> +                file://0003-glplugin-support-video-crop-for-glimagesink.patch \
>   "
>   
>   SRC_URI_append_mx6 = "${IMX_PATCHES}"



------------------------------

Message: 5
Date: Tue, 29 Mar 2016 09:32:47 +0200
From: Carlos Rafael Giani <dv at pseudoterminal.org>
To: Yuqing Zhu <b54851 at freescale.com>, meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 1/3]
	gstreamer1.0-plugins-bad: Add directviv to glimagesink to improve
	playback performance
Message-ID: <56FA2F9F.6050707 at pseudoterminal.org>
Content-Type: text/plain; charset=utf-8; format=flowed

Generally this patch seems OK. There are some places that need 
clarification.


@@ -231,6 +233,18 @@ gst_gl_upload_element_prepare_output_buffer 
(GstBaseTransform * bt,
      return GST_FLOW_ERROR;
    }

+  /* check if the output buffer's meta format equals to the caps format */
+  GstVideoMeta *vmeta = gst_buffer_get_video_meta(*outbuf);
+  gst_video_info_from_caps (&info, upload->out_caps);
+  if(vmeta->format != GST_VIDEO_INFO_FORMAT (&info))
+  {
+    caps = gst_caps_copy(upload->out_caps);
+    gst_caps_set_simple (caps, "format", G_TYPE_STRING,
+        gst_video_format_to_string (vmeta->format), NULL);
+    gst_caps_replace (&upload->out_caps, caps);
+    gst_base_transform_update_src_caps (upload, caps);
+  }
+

This is to ensure that the output format always corresponds to the 
actual video frame's format? This is because the direct textures can 
handle pixel format conversions automatically, right? But what if the 
meta contains a format that is not supported by the direct texture? 
(Y42B for example, which is not uncommon with USB webcams)


@@ -998,7 +1110,7 @@ gst_gl_upload_transform_caps (GstGLContext * 
context, GstPadDirection direction,


    if (filter) {
-    result = gst_caps_intersect_full (filter, tmp, 
GST_CAPS_INTERSECT_FIRST);
+    result = gst_caps_intersect_full (tmp, filter, 
GST_CAPS_INTERSECT_FIRST);
      gst_caps_unref (tmp);
    } else {
      result = tmp;

Why is this done?


@@ -896,6 +896,11 @@ gst_glimage_sink_query (GstBaseSink * bsink, 
GstQuery * query)
        res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
        break;
      }
+    case GST_QUERY_ALLOCATION:
+    {
+      res = gst_glimage_sink_propose_allocation(bsink, query);
+      break;
+    }
      default:
        res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
        break;

This one is interesting. Without this, there will be a memory copy? 
Seems counter intuitive for glimagesink to do this.

Also, I think a similar patch was being used in a separate project. I 
will look it up. Perhaps these can be merged.


On 2016-02-02 15:01, Yuqing Zhu wrote:
> 1. Add a physical buffer uploader in glupload plugin and using viv direct
>     texture to bind physical continious buffer with texture to avoid memory
>     copy from videobuffer to texture to gain good performance.
>
> 2. Reduce glimagesink load latency by override glimagesink ALLOCATION query to
>     avoid memory copy.
>
> Signed-off-by: Yuqing Zhu <b54851 at freescale.com>
> ---
>   ...imagesink-to-improve-playback-performance.patch | 454 +++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend  |   9 +-
>   2 files changed, 460 insertions(+), 3 deletions(-)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch
> new file mode 100755
> index 0000000..2739355
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch
> @@ -0,0 +1,454 @@
> +From 587db892fdaac18780c8024e5a976ea182f36ff4 Mon Sep 17 00:00:00 2001
> +From: Haihua Hu <b55597 at freescale.com>
> +Date: Tue, 13 Oct 2015 09:33:54 +0800
> +Subject: [PATCH 1/2] [glplugin] Add directviv to glimagesink to improve
> + playback performance
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +1.Add a physical buffer uploader in glupload plugin and using viv direct
> +  texture to bind physical continious buffer with texture to avoid memory
> +  copy from videobuffer to texture to gain good performance.
> +2.Reduce glimagesink load latency by override glimagesink ALLOCATION query to
> +  avoid memory copy.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Haihua Hu <b55597 at freescale.com>
> +---
> + ext/gl/gstglimagesink.c                 |    5 ++
> + ext/gl/gstgluploadelement.c             |   14 +++
> + gst-libs/gst/gl/Makefile.am             |    2 +
> + gst-libs/gst/gl/gstglupload.c           |  118 ++++++++++++++++++++++++-
> + gst-libs/gst/gl/gstglvivdirecttexture.c |  143 +++++++++++++++++++++++++++++++
> + gst-libs/gst/gl/gstglvivdirecttexture.h |   35 ++++++++
> + 6 files changed, 314 insertions(+), 3 deletions(-)
> + create mode 100644 gst-libs/gst/gl/gstglvivdirecttexture.c
> + create mode 100644 gst-libs/gst/gl/gstglvivdirecttexture.h
> +
> +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
> +index f629df7..1e5dc05 100644
> +--- a/ext/gl/gstglimagesink.c
> ++++ b/ext/gl/gstglimagesink.c
> +@@ -896,6 +896,11 @@ gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query)
> +       res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
> +       break;
> +     }
> ++    case GST_QUERY_ALLOCATION:
> ++    {
> ++      res = gst_glimage_sink_propose_allocation(bsink, query);
> ++      break;
> ++    }
> +     default:
> +       res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);
> +       break;
> +diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c
> +index 83ff24c..e74da3a 100644
> +--- a/ext/gl/gstgluploadelement.c
> ++++ b/ext/gl/gstgluploadelement.c
> +@@ -208,6 +208,8 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt,
> +   GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt);
> +   GstGLUploadReturn ret;
> +   GstBaseTransformClass *bclass;
> ++  GstVideoInfo info;
> ++  GstCaps *caps;
> +
> +   bclass = GST_BASE_TRANSFORM_GET_CLASS (bt);
> +
> +@@ -231,6 +233,18 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt,
> +     return GST_FLOW_ERROR;
> +   }
> +
> ++  /* check if the output buffer's meta format equals to the caps format */
> ++  GstVideoMeta *vmeta = gst_buffer_get_video_meta(*outbuf);
> ++  gst_video_info_from_caps (&info, upload->out_caps);
> ++  if(vmeta->format != GST_VIDEO_INFO_FORMAT (&info))
> ++  {
> ++    caps = gst_caps_copy(upload->out_caps);
> ++    gst_caps_set_simple (caps, "format", G_TYPE_STRING,
> ++        gst_video_format_to_string (vmeta->format), NULL);
> ++    gst_caps_replace (&upload->out_caps, caps);
> ++    gst_base_transform_update_src_caps (upload, caps);
> ++  }
> ++
> +   /* basetransform doesn't unref if they're the same */
> +   if (buffer == *outbuf)
> +     gst_buffer_unref (*outbuf);
> +diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am
> +index 36f3bf7..402e37a 100644
> +--- a/gst-libs/gst/gl/Makefile.am
> ++++ b/gst-libs/gst/gl/Makefile.am
> +@@ -30,6 +30,7 @@ libgstgl_ at GST_API_VERSION@_la_SOURCES = \
> + 	gstglsyncmeta.c \
> + 	gstglviewconvert.c \
> + 	gstgloverlaycompositor.c \
> ++	gstglvivdirecttexture.c \
> + 	utils/opengl_versions.h
> +
> + libgstgl_ at GST_API_VERSION@includedir = $(includedir)/gstreamer- at GST_API_VERSION@/gst/gl
> +@@ -56,6 +57,7 @@ libgstgl_ at GST_API_VERSION@include_HEADERS = \
> + 	gstglviewconvert.h \
> + 	gstgloverlaycompositor.h \
> + 	gstgl_fwd.h \
> ++	gstglvivdirecttexture.h \
> + 	gl.h
> +
> + libgstgl_ at GST_API_VERSION@_la_LIBADD = \
> +diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c
> +index 0addca1..acaa329 100644
> +--- a/gst-libs/gst/gl/gstglupload.c
> ++++ b/gst-libs/gst/gl/gstglupload.c
> +@@ -23,6 +23,7 @@
> + #endif
> +
> + #include <stdio.h>
> ++#include <gst/gl/gstglvivdirecttexture.h>
> +
> + #include "gl.h"
> + #include "gstglupload.h"
> +@@ -47,7 +48,7 @@
> + #define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))
> + #define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))
> +
> +-GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug);
> ++GST_DEBUG_CATEGORY (gst_gl_upload_debug);
> + #define GST_CAT_DEFAULT gst_gl_upload_debug
> +
> + #define DEBUG_INIT \
> +@@ -698,6 +699,114 @@ static const UploadMethod _upload_meta_upload = {
> +   &_upload_meta_upload_free
> + };
> +
> ++struct PhyBufferUpload
> ++{
> ++  GstGLUpload *upload;
> ++};
> ++
> ++static gpointer
> ++_physical_buffer_upload_new(GstGLUpload *upload)
> ++{
> ++  struct PhyBufferUpload *phybuffer = g_new0 (struct PhyBufferUpload, 1);
> ++
> ++  phybuffer->upload = upload;
> ++
> ++  return phybuffer;
> ++}
> ++
> ++static GstCaps *
> ++_physical_buffer_upload_transform_caps(GstGLContext *context,
> ++    GstPadDirection direction, GstCaps *caps)
> ++{
> ++  GstCaps *ret;
> ++
> ++  if (direction == GST_PAD_SINK) {
> ++    ret = _set_caps_features (caps, GST_CAPS_FEATURE_MEMORY_GL_MEMORY);
> ++    gst_caps_set_simple (ret, "format", G_TYPE_STRING, "RGBA", NULL);
> ++  } else {
> ++    ret = gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES
> ++            (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY,GST_GL_DIRECTVIV_FORMAT));
> ++  }
> ++
> ++  return ret;
> ++}
> ++
> ++static gboolean
> ++_physical_buffer_upload_accept(gpointer impl, GstBuffer *buffer,
> ++    GstCaps *in_caps, GstCaps *out_caps)
> ++{
> ++  GstCapsFeatures *features;
> ++
> ++  features = gst_caps_get_features (out_caps, 0);
> ++  if (!gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY))
> ++    return FALSE;
> ++
> ++  return gst_is_physical_buffer(buffer);
> ++}
> ++
> ++static void
> ++_physical_buffer_upload_propose_allocation(gpointer impl, GstQuery *decide_query,
> ++    GstQuery *query)
> ++{
> ++  gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);
> ++}
> ++
> ++static GstGLUploadReturn
> ++_physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **outbuf)
> ++{
> ++  struct PhyBufferUpload *phyBuffer = impl;
> ++  GstVideoInfo *info;
> ++  gint n_mem;
> ++
> ++  info = &phyBuffer->upload->priv->out_info;
> ++  n_mem = GST_VIDEO_INFO_N_PLANES (info);
> ++  GST_LOG_OBJECT (phyBuffer->upload, "Attempting viv direct upload");
> ++  *outbuf = gst_buffer_new ();
> ++  gst_gl_memory_setup_buffer (phyBuffer->upload->context,
> ++      NULL, info, NULL, *outbuf);
> ++
> ++  GstGLMemory *out_gl_mem =
> ++      (GstGLMemory *) gst_buffer_peek_memory (*outbuf, 0);
> ++
> ++  gst_gl_viv_direct_bind_gstbuffer(phyBuffer->upload->context, out_gl_mem->tex_id,
> ++      &phyBuffer->upload->priv->in_info, buffer);
> ++
> ++  gst_buffer_add_video_meta_full (*outbuf, 0,
> ++      GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),
> ++      GST_VIDEO_INFO_HEIGHT (info), n_mem, info->offset, info->stride);
> ++
> ++  return GST_GL_UPLOAD_DONE;
> ++}
> ++
> ++static void
> ++_physical_buffer_upload_release(gpointer impl, GstBuffer *buffer)
> ++{
> ++}
> ++
> ++static void
> ++_physical_buffer_upload_free(gpointer impl)
> ++{
> ++  struct PhyBufferUpload *phyBuffer = impl;
> ++
> ++  g_free(phyBuffer);
> ++}
> ++
> ++static GstStaticCaps _physical_buffer_upload_caps =
> ++GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_GL_DIRECTVIV_FORMAT));
> ++
> ++static const UploadMethod _physical_buffer_upload = {
> ++  "Physical buffer",
> ++  0,
> ++  &_physical_buffer_upload_caps,
> ++  &_physical_buffer_upload_new,
> ++  &_physical_buffer_upload_transform_caps,
> ++  &_physical_buffer_upload_accept,
> ++  &_physical_buffer_upload_propose_allocation,
> ++  &_physical_buffer_upload_perform,
> ++  &_physical_buffer_upload_release,
> ++  &_physical_buffer_upload_free
> ++};
> ++
> + struct RawUploadFrame
> + {
> +   gint ref_count;
> +@@ -813,6 +922,7 @@ _raw_data_upload_perform (gpointer impl, GstBuffer * buffer,
> +   struct RawUpload *raw = impl;
> +   int i;
> +   GstVideoInfo *in_info = &raw->upload->priv->in_info;
> ++
> +   guint max_planes = GST_VIDEO_INFO_N_PLANES (in_info);
> +
> +   /* Support stereo views for separated multiview mode */
> +@@ -870,7 +980,9 @@ static const UploadMethod *upload_methods[] = { &_gl_memory_upload,
> + #if GST_GL_HAVE_PLATFORM_EGL
> +   &_egl_image_upload,
> + #endif
> +-  &_upload_meta_upload, &_raw_data_upload
> ++  &_upload_meta_upload,
> ++  &_physical_buffer_upload,
> ++  &_raw_data_upload
> + };
> +
> + static GMutex upload_global_lock;
> +@@ -998,7 +1110,7 @@ gst_gl_upload_transform_caps (GstGLContext * context, GstPadDirection direction,
> +
> +
> +   if (filter) {
> +-    result = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);
> ++    result = gst_caps_intersect_full (tmp, filter, GST_CAPS_INTERSECT_FIRST);
> +     gst_caps_unref (tmp);
> +   } else {
> +     result = tmp;
> +diff --git a/gst-libs/gst/gl/gstglvivdirecttexture.c b/gst-libs/gst/gl/gstglvivdirecttexture.c
> +new file mode 100644
> +index 0000000..c19b617
> +--- /dev/null
> ++++ b/gst-libs/gst/gl/gstglvivdirecttexture.c
> +@@ -0,0 +1,143 @@
> ++/*
> ++ * GStreamer
> ++ * Copyright (c) 2015, Freescale Semiconductor, Inc.
> ++ *
> ++ * This library is free software; you can redistribute it and/or
> ++ * modify it under the terms of the GNU Library General Public
> ++ * License as published by the Free Software Foundation; either
> ++ * version 2 of the License, or (at your option) any later version.
> ++ *
> ++ * This library is distributed in the hope that it will be useful,
> ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
> ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> ++ * Library General Public License for more details.
> ++ *
> ++ * You should have received a copy of the GNU Library General Public
> ++ * License along with this library; if not, write to the
> ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
> ++ * Boston, MA 02110-1301, USA.
> ++ */
> ++
> ++#ifdef HAVE_CONFIG_H
> ++#include "config.h"
> ++#endif
> ++
> ++#include "gl.h"
> ++
> ++GST_DEBUG_CATEGORY_EXTERN (gst_gl_upload_debug);
> ++#define GST_CAT_DEFAULT gst_gl_upload_debug
> ++
> ++typedef struct {
> ++  guint tex_id;
> ++  guint w;
> ++  guint h;
> ++  guint fmt;
> ++  void *vaddr;
> ++  guint paddr;
> ++  gboolean ret;
> ++} GstVivDirectTexture;
> ++
> ++gboolean
> ++gst_is_physical_buffer (GstBuffer *buffer)
> ++{
> ++
> ++  GstMemory *mem;
> ++
> ++  mem = gst_buffer_peek_memory (buffer, 0);
> ++  if (!mem->allocator)
> ++    return FALSE;
> ++
> ++  return g_type_check_instance_is_a (mem->allocator, g_type_from_name("GstAllocatorPhyMem"));
> ++}
> ++
> ++static void
> ++_do_viv_direct_tex_bind_mem (GstGLContext * context, GstVivDirectTexture * viv_tex)
> ++{
> ++  GST_DEBUG ("viv direct upload, tex_id %d, fmt: %d, res: (%dx%d)", viv_tex->tex_id, viv_tex->fmt, viv_tex->w, viv_tex->h);
> ++  GST_DEBUG ("Physical memory buffer, vaddr: %p, paddr: %p", viv_tex->vaddr, viv_tex->paddr);
> ++
> ++  glBindTexture (GL_TEXTURE_2D, viv_tex->tex_id);
> ++  glTexDirectVIVMap (GL_TEXTURE_2D, viv_tex->w, viv_tex->h, viv_tex->fmt, &viv_tex->vaddr, &viv_tex->paddr);
> ++  glTexDirectInvalidateVIV (GL_TEXTURE_2D);
> ++  viv_tex->ret = TRUE;
> ++
> ++  return;
> ++}
> ++
> ++gboolean
> ++gst_gl_viv_direct_bind_gstbuffer (GstGLContext * context, guint tex_id, GstVideoInfo * info, GstBuffer * buffer)
> ++{
> ++  typedef struct {
> ++    guint8 *vaddr;
> ++    guint8 *paddr;
> ++    guint8 *caddr;
> ++    gsize size;
> ++    gpointer *user_data;
> ++  } PhyMemBlock;
> ++  //Note: structure PhyMemBlock is copied from gst1.0-fsl-plugin/libs/allocator/gstallocatorphymem.h
> ++
> ++  typedef struct {
> ++    GstMemory mem;
> ++    guint8 *vaddr;
> ++    guint8 *paddr;
> ++    PhyMemBlock block;
> ++  } GstMemoryPhy;
> ++  //Note: structure GstMemoryPhy is copied from gst1.0-fsl-plugin/libs/allocator/gstallocatorphymem.c
> ++
> ++  GstMemory *mem = gst_buffer_peek_memory (buffer, 0);
> ++  GstMemoryPhy *memphy = (GstMemoryPhy*) mem;
> ++  PhyMemBlock *memblk = &memphy->block;
> ++
> ++  GstVideoFormat fmt = GST_VIDEO_INFO_FORMAT (info);
> ++  gint width, height;
> ++  GstVideoMeta *vmeta = gst_buffer_get_video_meta (buffer);
> ++  if (vmeta && (fmt == GST_VIDEO_FORMAT_I420 || fmt == GST_VIDEO_FORMAT_NV12)) {
> ++    width = vmeta->stride[0];
> ++    height = vmeta->offset[1] / width;
> ++  }
> ++  else {
> ++    width = GST_VIDEO_INFO_WIDTH (info);
> ++    height = GST_VIDEO_INFO_HEIGHT (info);
> ++  }
> ++
> ++  guint viv_fmt;
> ++  switch (fmt) {
> ++    case GST_VIDEO_FORMAT_I420:
> ++      viv_fmt = GL_VIV_I420;
> ++      break;
> ++    case GST_VIDEO_FORMAT_YV12:
> ++      viv_fmt = GL_VIV_YV12;
> ++      break;
> ++    case GST_VIDEO_FORMAT_NV12:
> ++      viv_fmt = GL_VIV_NV12;
> ++      break;
> ++    case GST_VIDEO_FORMAT_NV21:
> ++      viv_fmt = GL_VIV_NV21;
> ++      break;
> ++    case GST_VIDEO_FORMAT_YUY2:
> ++      viv_fmt = GL_VIV_YUY2;
> ++      break;
> ++    case GST_VIDEO_FORMAT_UYVY:
> ++      viv_fmt = GL_VIV_UYVY;
> ++      break;
> ++    case GST_VIDEO_FORMAT_RGBA:
> ++      viv_fmt = GL_RGBA;
> ++      break;
> ++    case GST_VIDEO_FORMAT_BGRA:
> ++      viv_fmt = GL_BGRA_EXT;
> ++      break;
> ++    case GST_VIDEO_FORMAT_RGB16:
> ++      viv_fmt = GL_RGB565_OES;
> ++      break;
> ++    default:
> ++      GST_ERROR ("Not supported format %d for viv direct texture upload.", fmt);
> ++      viv_fmt = GL_NONE;
> ++      return FALSE;
> ++  }
> ++
> ++  GstVivDirectTexture viv_tex = {tex_id, width, height, viv_fmt, memblk->vaddr, memblk->paddr, FALSE};
> ++  gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _do_viv_direct_tex_bind_mem, &viv_tex);
> ++
> ++  return viv_tex.ret;
> ++}
> ++
> +diff --git a/gst-libs/gst/gl/gstglvivdirecttexture.h b/gst-libs/gst/gl/gstglvivdirecttexture.h
> +new file mode 100644
> +index 0000000..fa88e1a
> +--- /dev/null
> ++++ b/gst-libs/gst/gl/gstglvivdirecttexture.h
> +@@ -0,0 +1,35 @@
> ++/*
> ++ * GStreamer
> ++ * Copyright (c) 2015, Freescale Semiconductor, Inc.
> ++ *
> ++ * This library is free software; you can redistribute it and/or
> ++ * modify it under the terms of the GNU Library General Public
> ++ * License as published by the Free Software Foundation; either
> ++ * version 2 of the License, or (at your option) any later version.
> ++ *
> ++ * This library is distributed in the hope that it will be useful,
> ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
> ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
> ++ * Library General Public License for more details.
> ++ *
> ++ * You should have received a copy of the GNU Library General Public
> ++ * License along with this library; if not, write to the
> ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
> ++ * Boston, MA 02110-1301, USA.
> ++ */
> ++
> ++#ifndef __GST_GL_VIVDIRECT_H__
> ++#define __GST_GL_VIVDIRECT_H__
> ++
> ++#include <gst/video/video.h>
> ++#include <gst/gl/gstgl_fwd.h>
> ++
> ++#define GST_GL_DIRECTVIV_FORMAT "{RGBA, I420, YV12, NV12, NV21, YUY2, UYVY, BGRA, RGB16}"
> ++G_BEGIN_DECLS
> ++
> ++gboolean gst_is_physical_buffer (GstBuffer *buffer);
> ++gboolean gst_gl_viv_direct_bind_gstbuffer (GstGLContext * context, guint tex_id, GstVideoInfo * info, GstBuffer * buffer);
> ++
> ++G_END_DECLS
> ++
> ++#endif /* __GST_GL_VIVDIRECT_H__ */
> +--
> +1.7.9.5
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> index 7e6f3ff..0728009 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend
> @@ -10,10 +10,13 @@ PACKAGECONFIG_GL_mx6sl = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \
>                              base_contains('DISTRO_FEATURES', 'x11', \
>                                       'opengl', '', d), '', d)}"
>   
> -SRC_URI_append_mx6 = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch"
> -SRC_URI_append_mx6ul = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch"
> -SRC_URI_append_mx7 = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch"
> +IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch \
> +                file://0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch \
> +"
>   
> +SRC_URI_append_mx6 = "${IMX_PATCHES}"
> +SRC_URI_append_mx6ul = "${IMX_PATCHES}"
> +SRC_URI_append_mx7 = "${IMX_PATCHES}"
>   
>   PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
>   PACKAGE_ARCH_mx6ul = "${MACHINE_SOCARCH}"



------------------------------

Message: 6
Date: Tue, 29 Mar 2016 10:07:42 -0300
From: "Otavio Salvador" <otavio.salvador at gmail.com>
To: meta-freescale at yoctoproject.org
Subject: [meta-freescale] Updates to meta-fsl-arm (master) in
	2016-03-29
Message-ID: <56fa7e22.d0d7370a.37f92.ffffa290 at mx.google.com>

Hello,

I pushed following updates:

commit 4b243b7a91ba0243dfa192de582afd2a0d5ff744 (HEAD -> pending, yocto/master-next, yocto/master)
Author: Yuqing Zhu <b54851 at freescale.com>
Date:   Fri Jan 29 17:41:55 2016 +0800

    gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue.
    
    IMXCameraApp: When Enabled "save time to image" item, preview,
    find the time can not display completely.
    
    As IPU need 8 pixels alignment, add one workaround in base text overlay
    to generate 8 pixels alignment text video buffer. The side effect should
    cause all text a little smaller.
    
    Signed-off-by: Yuqing Zhu <b54851 at freescale.com>
    Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>

Regards,

--
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750


------------------------------

-- 
_______________________________________________
meta-freescale mailing list
meta-freescale at yoctoproject.org
https://lists.yoctoproject.org/listinfo/meta-freescale


End of meta-freescale Digest, Vol 41, Issue 22
**********************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.yoctoproject.org/pipermail/meta-freescale/attachments/20160330/97f65564/attachment.html>


More information about the meta-freescale mailing list