<div><br></div><div>Hi, </div><div> I use the kernel 3.14.28 ,yotco, the pcie device failed to detect, here is the log :</div><div> 0.253208] imx6q-pcie 1ffc000.pcie: get reset gpio</div><div>[ 0.455135] imx6q-pcie 1ffc000.pcie: phy link never came up</div><div>[ 0.455147] imx6q-pcie 1ffc000.pcie: DEBUG_R0: 0x004abc43, DEBUG_R1: 0x08000000</div><div>[ 0.455156] imx6q-pcie 1ffc000.pcie: Failed to bring link up!</div><div>[ 0.455181] imx6q-pcie 1ffc000.pcie: failed to initialize host</div><div>[ 0.455227] imx6q-pcie: probe of 1ffc000.pcie failed with error -22</div><div>[ 0.455483] i.MX PCIE endpoint device driver, version 0.1</div><div> any update about this?</div><div><div style="font-size:14px;font-family:Verdana;color:#000;"> <div> </div></div></div><div> </div><div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "meta-freescale-request";<meta-freescale-request@yoctoproject.org>;</div><div><b>Date: </b> Wed, Mar 30, 2016 03:00 AM</div><div><b>To: </b> "meta-freescale"<meta-freescale@yoctoproject.org>; <wbr></div><div></div><div><b>Subject: </b> meta-freescale Digest, Vol 41, Issue 22</div></div><div><br></div>Send meta-freescale mailing list submissions to<br> meta-freescale@yoctoproject.org<br><br>To subscribe or unsubscribe via the World Wide Web, visit<br> https://lists.yoctoproject.org/listinfo/meta-freescale<br>or, via email, send a message with subject or body 'help' to<br> meta-freescale-request@yoctoproject.org<br><br>You can reach the person managing the list at<br> meta-freescale-owner@yoctoproject.org<br><br>When replying, please edit your Subject line so it is more specific<br>than "Re: Contents of meta-freescale digest..."<br><br><br>Today's Topics:<br><br> 1. Re: [meta-fsl-arm][PATCH v2 1/2] gstreamer1.0-plugins-base:<br> Fix IMXCameraApp image time cannot display issue.<br> (Carlos Rafael Giani)<br> 2. Re: [meta-fsl-arm][PATCH v2 2/2] gstreamer1.0-plugins-base:<br> Make memory copy when video buffer's memory is read only<br> (Carlos Rafael Giani)<br> 3. Re: [meta-fsl-arm][PATCH v2 3/3] gstreamer1.0-plugins-bad:<br> Change wayland default resolution to 1024x768 (Carlos Rafael Giani)<br> 4. Re: [meta-fsl-arm][PATCH v2 2/3] gstreamer1.0-plugins-bad:<br> Support video crop for glimagesink (Carlos Rafael Giani)<br> 5. Re: [meta-fsl-arm][PATCH v2 1/3] gstreamer1.0-plugins-bad:<br> Add directviv to glimagesink to improve playback performance<br> (Carlos Rafael Giani)<br> 6. Updates to meta-fsl-arm (master) in 2016-03-29 (Otavio Salvador)<br><br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 29 Mar 2016 08:58:53 +0200<br>From: Carlos Rafael Giani <dv@pseudoterminal.org><br>To: Yuqing Zhu <b54851@freescale.com>, meta-freescale@yoctoproject.org<br>Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 1/2]<br> gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display<br> issue.<br>Message-ID: <56FA27AD.6010708@pseudoterminal.org><br>Content-Type: text/plain; charset=windows-1252; format=flowed<br><br>As said in the previous submission, I think this patch is acceptable, <br>and a good example of something truly i.MX specific.<br><br>Since 8/16-pixel alignments aren't exactly uncommon, I think this should <br>be turned into a solution that can be upstreamed and is applicable to <br>many other GStreamer plugins that generate video frames.<br>However, at least for now, we can live with this patch.<br><br>On 2016-01-29 10:41, Yuqing Zhu wrote:<br>> IMXCameraApp: When Enabled "save time to image" item, preview,<br>> find the time can not display completely.<br>><br>> As IPU need 8 pixels alignment, add one workaround in base text overlay<br>> to generate 8 pixels alignment text video buffer. The side effect should<br>> cause all text a little smaller.<br>><br>> Signed-off-by: Yuqing Zhu <b54851@freescale.com><br>> ---<br>> ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 ++++++++++++++++++++++<br>> .../gstreamer/gstreamer1.0-plugins-base_%.bbappend | 8 ++-<br>> 2 files changed, 64 insertions(+), 2 deletions(-)<br>> create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch<br>><br>> 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<br>> new file mode 100755<br>> index 0000000..1f54fc1<br>> --- /dev/null<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch<br>> @@ -0,0 +1,58 @@<br>> +From f19e83a1a69a3dbbeb16dc4bcee3fb87317bb65b Mon Sep 17 00:00:00 2001<br>> +From: Song Bing <b06498@freescale.com><br>> +Date: Mon, 11 Jan 2016 14:51:17 +0800<br>> +Subject: [PATCH] MMFMWK-7030 [Linux_MX6QP_ARD]IMXCameraApp:When Enabled "save<br>> + time to image" item, preview, find the time can not display<br>> + completely. 100%<br>> +<br>> +As IPU need 8 pixels alignment, add one workaround in base text overlay<br>> +to generate 8 pixels alignment text video buffer. The side effect should<br>> +cause all text a little smaller.<br>> +<br>> +Upstream-Status: Inappropriate [i.MX specific]<br>> +<br>> +Signed-off-by: Song Bing b06498@freescale.com<br>> +---<br>> + ext/pango/gstbasetextoverlay.c | 12 ++++++++++--<br>> + 1 file changed, 10 insertions(+), 2 deletions(-)<br>> +<br>> +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c<br>> +index 3e98aa1..de64c92 100755<br>> +--- a/ext/pango/gstbasetextoverlay.c<br>> ++++ b/ext/pango/gstbasetextoverlay.c<br>> +@@ -1545,7 +1545,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,<br>> + gint unscaled_width, unscaled_height;<br>> + gint width, height;<br>> + gboolean full_width = FALSE;<br>> +- double scalef = 1.0;<br>> ++ double scalef = 1.0, scalefx, scalefy;<br>> + double a, r, g, b;<br>> + gdouble shadow_offset = 0.0;<br>> + gdouble outline_offset = 0.0;<br>> +@@ -1673,6 +1673,14 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,<br>> + height = ceil (height * overlay->render_scale);<br>> + scalef *= overlay->render_scale;<br>> +<br>> ++ /* i.MX special, will cause text a little small */<br>> ++ scalefx = scalef * ((gdouble)GST_ROUND_DOWN_8 (width)) / width;<br>> ++ scalefy = scalef * ((gdouble)GST_ROUND_DOWN_8 (height)) / height;<br>> ++ width = GST_ROUND_DOWN_8 (width);<br>> ++ height = GST_ROUND_DOWN_8 (height);<br>> ++ GST_DEBUG_OBJECT (overlay, "Rendering with width %d and height %d "<br>> ++ , width, height);<br>> ++<br>> + if (width <= 0 || height <= 0) {<br>> + g_mutex_unlock (GST_BASE_TEXT_OVERLAY_GET_CLASS (overlay)->pango_lock);<br>> + GST_DEBUG_OBJECT (overlay,<br>> +@@ -1689,7 +1697,7 @@ gst_base_text_overlay_render_pangocairo (GstBaseTextOverlay * overlay,<br>> + /* Prepare the transformation matrix. Note that the transformation happens<br>> + * in reverse order. So for horizontal text, we will translate and then<br>> + * scale. This is important to understand which scale shall be used. */<br>> +- cairo_matrix_init_scale (&cairo_matrix, scalef, scalef);<br>> ++ cairo_matrix_init_scale (&cairo_matrix, scalefx, scalefy);<br>> +<br>> + if (overlay->use_vertical_render) {<br>> + gint tmp;<br>> +--<br>> +1.7.9.5<br>> +<br>> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend<br>> index ff4d77b..f1992c3 100644<br>> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend<br>> @@ -1,7 +1,11 @@<br>> FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"<br>> <br>> -SRC_URI_append_mx6 = " file://gstplaybin-remove-flag-deinterlace.patch"<br>> -SRC_URI_append_mx7 = " file://gstplaybin-remove-flag-deinterlace.patch"<br>> +IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \<br>> + file://0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \<br>> +"<br>> +<br>> +SRC_URI_append_mx6 = "${IMX_PATCHES}"<br>> +SRC_URI_append_mx7 = "${IMX_PATCHES}"<br>> <br>> PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"<br>> PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}"<br><br><br><br>------------------------------<br><br>Message: 2<br>Date: Tue, 29 Mar 2016 09:05:58 +0200<br>From: Carlos Rafael Giani <dv@pseudoterminal.org><br>To: Yuqing Zhu <b54851@freescale.com>, meta-freescale@yoctoproject.org<br>Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 2/2]<br> gstreamer1.0-plugins-base: Make memory copy when video buffer's memory<br> is read only<br>Message-ID: <56FA2956.4040205@pseudoterminal.org><br>Content-Type: text/plain; charset=utf-8; format=flowed<br><br>I do see the reason behind the patch. As you explained earlier, the <br>VPU's output buffers are re-used as references, so they should not be <br>modified.<br><br>Before I give this patch an Ack however, I need to know if the <br>suggestions from https://bugzilla.gnome.org/show_bug.cgi?id=747495 <br>regarding the NO_SHARE flag were tried out. They seem less invasive to <br>me while accomplishing the same end result.<br><br>On 2016-01-29 10:41, Yuqing Zhu wrote:<br>> The VPU decoder need the output framebuffer as a reference buffer for decoding.<br>> The output buffer shouldn?t be changed, if we blend the subtitle on the buffer directly,<br>> then the decoded video frame will have artificial jitter around the subtitle.<br>><br>> Since gst_buffer_make_writable just lookup the refcount to determine if<br>> a buffer is writable, and it will use _gst_buffer_copy() which don't<br>> perform a deep memory copy even if the flag of a memory is set to<br>> GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use<br>> gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform<br>> deep memory copy. if the allocator of a memory don't support mem_copy<br>> interface, then it will return NULL, if this case, we can use<br>> gst_buffer_make_writable() to get a shared memory buffer or the orignal<br>> buffer if the buffer's refcount is 1.<br>><br>> Signed-off-by: Yuqing Zhu <b54851@freescale.com><br>> ---<br>> ...rlay-make-memory-copy-when-video-buffer-s.patch | 82 ++++++++++++++++++++++<br>> .../gstreamer/gstreamer1.0-plugins-base_%.bbappend | 1 +<br>> 2 files changed, 83 insertions(+)<br>> create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch<br>><br>> 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<br>> new file mode 100755<br>> index 0000000..33628c9<br>> --- /dev/null<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch<br>> @@ -0,0 +1,82 @@<br>> +From 0092d07195aa5d950bc10dfb05bd9547f67028a3 Mon Sep 17 00:00:00 2001<br>> +From: Mingke Wang <mingke.wang@freescale.com><br>> +Date: Fri, 16 Oct 2015 19:31:32 +0800<br>> +Subject: [PATCH 1/9] basetextoverlay: make memory copy when video buffer's<br>> + memory is ready only<br>> +<br>> +1. since gst_buffer_make_writable just lookup the refcount to determine if<br>> + a buffer is writable, and it will use _gst_buffer_copy() which don't<br>> + perform a deep memory copy even if the flag of a memory is set to<br>> + GST_MEMORY_FLAG_READONLY. So, we detect the memory flag and use<br>> + gst_buffer_copy_region with GST_BUFFER_COPY_DEEP parameter to perform<br>> + deep memory copy. if the allocator of a memory don't support mem_copy<br>> + interface, the it will return NULL, if this case, we can use<br>> + gst_buffer_make_writable() to get a shared memory buffer or the orignal<br>> + buffer if the buffer's refcount is 1.<br>> +<br>> +https://bugzilla.gnome.org/show_bug.cgi?id=747495<br>> +<br>> +Upstream-Status: Inappropriate [i.MX specific]<br>> +<br>> +Signed-off-by: Mingke Wang <mingke.wang@freescale.com><br>> +---<br>> + ext/pango/gstbasetextoverlay.c | 32 ++++++++++++++++++++++++++++++--<br>> + 1 file changed, 30 insertions(+), 2 deletions(-)<br>> + mode change 100644 => 100755 ext/pango/gstbasetextoverlay.c<br>> +<br>> +diff --git a/ext/pango/gstbasetextoverlay.c b/ext/pango/gstbasetextoverlay.c<br>> +old mode 100644<br>> +new mode 100755<br>> +index bde4303..3e98aa1<br>> +--- a/ext/pango/gstbasetextoverlay.c<br>> ++++ b/ext/pango/gstbasetextoverlay.c<br>> +@@ -2085,16 +2085,44 @@ gst_base_text_overlay_push_frame (GstBaseTextOverlay * overlay,<br>> + if (gst_pad_check_reconfigure (overlay->srcpad))<br>> + gst_base_text_overlay_negotiate (overlay, NULL);<br>> +<br>> +- video_frame = gst_buffer_make_writable (video_frame);<br>> +-<br>> + if (overlay->attach_compo_to_buffer) {<br>> + GST_DEBUG_OBJECT (overlay, "Attaching text overlay image to video buffer");<br>> ++ video_frame = gst_buffer_make_writable (video_frame);<br>> + gst_buffer_add_video_overlay_composition_meta (video_frame,<br>> + overlay->composition);<br>> + /* FIXME: emulate shaded background box if want_shading=true */<br>> + goto done;<br>> + }<br>> +<br>> ++ gint idx = 0;<br>> ++ gboolean mem_rdonly = FALSE;<br>> ++ GstMemory *mem;<br>> ++ guint n = gst_buffer_n_memory(video_frame);<br>> ++ while ((idx < n) && (mem = gst_buffer_get_memory(video_frame, idx++))) {<br>> ++ if (GST_MEMORY_IS_READONLY(mem)) {<br>> ++ gst_memory_unref (mem);<br>> ++ mem_rdonly = TRUE;<br>> ++ break;<br>> ++ }<br>> ++ gst_memory_unref (mem);<br>> ++ }<br>> ++<br>> ++ if (mem_rdonly) {<br>> ++ GstBuffer *new_buf = gst_buffer_copy_region (video_frame,<br>> ++ GST_BUFFER_COPY_ALL | GST_BUFFER_COPY_DEEP, 0, -1);<br>> ++<br>> ++ if (!new_buf) {<br>> ++ GST_WARNING_OBJECT(overlay,<br>> ++ "buffer memory read only, but copy memory failed");<br>> ++ goto done;<br>> ++ } else {<br>> ++ gst_buffer_unref (video_frame);<br>> ++ video_frame = new_buf;<br>> ++ }<br>> ++ } else {<br>> ++ video_frame = gst_buffer_make_writable (video_frame);<br>> ++ }<br>> ++<br>> + if (!gst_video_frame_map (&frame, &overlay->info, video_frame,<br>> + GST_MAP_READWRITE))<br>> + goto invalid_frame;<br>> +--<br>> +1.9.1<br>> +<br>> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend<br>> index f1992c3..4ad87bb 100644<br>> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend<br>> @@ -2,6 +2,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"<br>> <br>> IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \<br>> file://0001-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \<br>> + file://0002-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \<br>> "<br>> <br>> SRC_URI_append_mx6 = "${IMX_PATCHES}"<br><br><br><br>------------------------------<br><br>Message: 3<br>Date: Tue, 29 Mar 2016 09:07:45 +0200<br>From: Carlos Rafael Giani <dv@pseudoterminal.org><br>To: Yuqing Zhu <b54851@freescale.com>, meta-freescale@yoctoproject.org<br>Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 3/3]<br> gstreamer1.0-plugins-bad: Change wayland default resolution to<br> 1024x768<br>Message-ID: <56FA29C1.4050305@pseudoterminal.org><br>Content-Type: text/plain; charset=utf-8; format=flowed<br><br>This gets an Ack from me. It doesn't break anything, and is truly i.MX <br>specific. There may be i.MX devices with screens smaller than 1024x768, <br>though to me this seems to be the minority.<br><br>On 2016-02-02 15:01, Yuqing Zhu wrote:<br>> In our release, the default display is full screen in LVDS.<br>> The 1024x768 resolution will be better in testing for our<br>> release platform.<br>><br>> Signed-off-by: Yuqing Zhu <b54851@freescale.com><br>> ---<br>> ...in-Change-wayland-default-res-to-1024x768.patch | 41 ++++++++++++++++++++++<br>> .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend | 1 +<br>> 2 files changed, 42 insertions(+)<br>> create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glplugin-Change-wayland-default-res-to-1024x768.patch<br>><br>> 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<br>> new file mode 100755<br>> index 0000000..49a0a9d<br>> --- /dev/null<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0004-glplugin-Change-wayland-default-res-to-1024x768.patch<br>> @@ -0,0 +1,41 @@<br>> +From decc71a707d3b3596888d30a4c7ca25b57a686b2 Mon Sep 17 00:00:00 2001<br>> +From: Jian <Jian.Li@freescale.com><br>> +Date: Tue, 17 Nov 2015 14:39:07 +0800<br>> +Subject: [PATCH 2/3] [glplugin] Change wayland default res to 1024x768<br>> +MIME-Version: 1.0<br>> +Content-Type: text/plain; charset=UTF-8<br>> +Content-Transfer-Encoding: 8bit<br>> +<br>> +Change wayland backend default window resolution<br>> +from 320x240 to 1024x768<br>> +<br>> +Upstream-Status: Inappropriate [i.MX specific]<br>> +<br>> +Signed-off-by: Jian <Jian.Li@freescale.com><br>> +---<br>> + gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c | 4 ++--<br>> + 1 file changed, 2 insertions(+), 2 deletions(-)<br>> +<br>> +diff --git a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c<br>> +index b34ad42..b557daa 100644<br>> +--- a/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c<br>> ++++ b/gst-libs/gst/gl/wayland/gstglwindow_wayland_egl.c<br>> +@@ -305,13 +305,13 @@ create_surfaces (GstGLWindowWaylandEGL * window_egl)<br>> + if (window_egl->window.window_width > 0)<br>> + width = window_egl->window.window_width;<br>> + else<br>> +- width = 320;<br>> ++ width = 1024;<br>> + window_egl->window.window_width = width;<br>> +<br>> + if (window_egl->window.window_height > 0)<br>> + height = window_egl->window.window_height;<br>> + else<br>> +- height = 240;<br>> ++ height = 768;<br>> + window_egl->window.window_height = height;<br>> +<br>> + if (!window_egl->window.native) {<br>> +--<br>> +1.7.9.5<br>> +<br>> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> index 9ce22eb..ea66be9 100644<br>> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> @@ -13,6 +13,7 @@ PACKAGECONFIG_GL_mx6sl = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \<br>> IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch \<br>> file://0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch \<br>> file://0003-glplugin-support-video-crop-for-glimagesink.patch \<br>> + file://0004-glplugin-Change-wayland-default-res-to-1024x768.patch \<br>> "<br>> <br>> SRC_URI_append_mx6 = "${IMX_PATCHES}"<br><br><br><br>------------------------------<br><br>Message: 4<br>Date: Tue, 29 Mar 2016 09:14:26 +0200<br>From: Carlos Rafael Giani <dv@pseudoterminal.org><br>To: Yuqing Zhu <b54851@freescale.com>, meta-freescale@yoctoproject.org<br>Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 2/3]<br> gstreamer1.0-plugins-bad: Support video crop for glimagesink<br>Message-ID: <56FA2B52.9010506@pseudoterminal.org><br>Content-Type: text/plain; charset=windows-1252; format=flowed<br><br>This seems to be quite useful to me. But it is not i.MX specific - I <br>could for example even use this on the PC.<br><br>However, modifying the global vertices array is not good, for two reasons:<br>1. This will not work well in a multithreaded environment (with multiple <br>glimagesink instances)<br>2. The vertex data is not reset properly when the state change goes back <br>to READY<br><br>So, instead, I'd keep this array const, and instead copy it & modify and <br>upload the local copy. Crop metas are not updated so often, so the costs <br>for a copy are negligible.<br><br>Once this is fixed, I strongly recommend to put this on GStreamer's <br>bugzilla.<br><br>On 2016-02-02 15:01, Yuqing Zhu wrote:<br>> 1. Add video crop meta copy in glupload.<br>> 2. Calculate the new texture coordinate in vertices array and bind to buffer object.<br>> 3. Make glimagesink only updating vertices array when video crop meta changed.<br>><br>> Signed-off-by: Yuqing Zhu <b54851@freescale.com><br>> ---<br>> ...plugin-support-video-crop-for-glimagesink.patch | 155 +++++++++++++++++++++<br>> .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend | 1 +<br>> 2 files changed, 156 insertions(+)<br>> create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glplugin-support-video-crop-for-glimagesink.patch<br>><br>> 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<br>> new file mode 100755<br>> index 0000000..0d0ade7<br>> --- /dev/null<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0003-glplugin-support-video-crop-for-glimagesink.patch<br>> @@ -0,0 +1,155 @@<br>> +From 1a917447c3749f0a6d3ff98b8dcbc7439b48293d Mon Sep 17 00:00:00 2001<br>> +From: Haihua Hu <b55597@freescale.com><br>> +Date: Fri, 13 Nov 2015 10:51:25 +0800<br>> +Subject: [PATCH] [glplugin] support video crop for glimagesink<br>> +<br>> +1.Add video crop meta copy in glupload<br>> +2.Calculate the new texture coordinate in vertices array and bind to buffer object<br>> +3.Make glimagesink only updating vertices array when video crop meta changed<br>> +<br>> +Upstream-Status: Inappropriate [i.MX specific]<br>> +<br>> +Signed-off-by: Haihua Hu <b55597@freescale.com><br>> +---<br>> + ext/gl/gstglimagesink.c | 53 ++++++++++++++++++++++++++++++++++++++++-<br>> + ext/gl/gstglimagesink.h | 3 +++<br>> + gst-libs/gst/gl/gstglupload.c | 10 ++++++++<br>> + 3 files changed, 65 insertions(+), 1 deletion(-)<br>> +<br>> +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c<br>> +index 1e5dc05..6fc0f9e 100644<br>> +--- a/ext/gl/gstglimagesink.c<br>> ++++ b/ext/gl/gstglimagesink.c<br>> +@@ -585,6 +585,8 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink)<br>> + glimage_sink->handle_events = TRUE;<br>> + glimage_sink->ignore_alpha = TRUE;<br>> + glimage_sink->overlay_compositor = NULL;<br>> ++ glimage_sink->cropmeta = NULL;<br>> ++ glimage_sink->prev_cropmeta = NULL;<br>> +<br>> + glimage_sink->mview_output_mode = DEFAULT_MULTIVIEW_MODE;<br>> + glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS;<br>> +@@ -1039,6 +1041,12 @@ gst_glimage_sink_change_state (GstElement * element, GstStateChange transition)<br>> + gst_object_unref (glimage_sink->display);<br>> + glimage_sink->display = NULL;<br>> + }<br>> ++<br>> ++ glimage_sink->cropmeta = NULL;<br>> ++ if (glimage_sink->prev_cropmeta)<br>> ++ g_slice_free(GstVideoCropMeta, glimage_sink->prev_cropmeta);<br>> ++ glimage_sink->prev_cropmeta = NULL;<br>> ++<br>> + break;<br>> + default:<br>> + break;<br>> +@@ -1452,6 +1460,8 @@ gst_glimage_sink_show_frame (GstVideoSink * vsink, GstBuffer * buf)<br>> + GST_VIDEO_SINK_WIDTH (glimage_sink),<br>> + GST_VIDEO_SINK_HEIGHT (glimage_sink));<br>> +<br>> ++ glimage_sink->cropmeta = gst_buffer_get_video_crop_meta (buf);<br>> ++<br>> + /* Ask the underlying window to redraw its content */<br>> + if (!gst_glimage_sink_redisplay (glimage_sink))<br>> + goto redisplay_failed;<br>> +@@ -1638,7 +1648,7 @@ config_failed:<br>> + }<br>> +<br>> + /* *INDENT-OFF* */<br>> +-static const GLfloat vertices[] = {<br>> ++static GLfloat vertices[] = {<br>> + 1.0f, 1.0f, 0.0f, 1.0f, 0.0f,<br>> + -1.0f, 1.0f, 0.0f, 0.0f, 0.0f,<br>> + -1.0f, -1.0f, 0.0f, 0.0f, 1.0f,<br>> +@@ -1898,6 +1908,47 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)<br>> +<br>> + gst_gl_shader_use (gl_sink->redisplay_shader);<br>> +<br>> ++ if (gl_sink->cropmeta) {<br>> ++ gint width = GST_VIDEO_SINK_WIDTH (gl_sink);<br>> ++ gint height = GST_VIDEO_SINK_HEIGHT (gl_sink);<br>> ++<br>> ++ if (!gl_sink->prev_cropmeta){<br>> ++ /* Initialize the previous crop meta and set all memroy to zero */<br>> ++ gl_sink->prev_cropmeta = (GstVideoCropMeta *) g_slice_new0(GstVideoCropMeta);<br>> ++ }<br>> ++<br>> ++ /* If crop meta not equal to the previous, recalculate the vertices */<br>> ++ if (gl_sink->prev_cropmeta->x != gl_sink->cropmeta->x<br>> ++ || gl_sink->prev_cropmeta->y != gl_sink->cropmeta->y<br>> ++ || gl_sink->prev_cropmeta->width != gl_sink->cropmeta->width<br>> ++ || gl_sink->prev_cropmeta->height != gl_sink->cropmeta->height){<br>> ++<br>> ++ vertices[8] = (float)(gl_sink->cropmeta->x) / width;<br>> ++ vertices[9] = (float)(gl_sink->cropmeta->y) / height;<br>> ++<br>> ++ vertices[3] = (float)(gl_sink->cropmeta->width + gl_sink->cropmeta->x) / width;<br>> ++ vertices[4] = vertices[9];<br>> ++<br>> ++ vertices[13] = vertices[8];<br>> ++ vertices[14] = (float)(gl_sink->cropmeta->height + gl_sink->cropmeta->y) / height;<br>> ++<br>> ++ vertices[18] = vertices[3];<br>> ++ vertices[19] = vertices[14];<br>> ++<br>> ++ gl->BindBuffer (GL_ARRAY_BUFFER, gl_sink->vertex_buffer);<br>> ++ gl->BufferData (GL_ARRAY_BUFFER, 4 * 5 * sizeof (GLfloat), vertices,<br>> ++ GL_STATIC_DRAW);<br>> ++<br>> ++ gl->BindBuffer (GL_ARRAY_BUFFER, 0);<br>> ++<br>> ++ /* Store the previous crop meta */<br>> ++ gl_sink->prev_cropmeta->x = gl_sink->cropmeta->x;<br>> ++ gl_sink->prev_cropmeta->y = gl_sink->cropmeta->y;<br>> ++ gl_sink->prev_cropmeta->width = gl_sink->cropmeta->width;<br>> ++ gl_sink->prev_cropmeta->height = gl_sink->cropmeta->height;<br>> ++ }<br>> ++ }<br>> ++<br>> + if (gl->GenVertexArrays)<br>> + gl->BindVertexArray (gl_sink->vao);<br>> + else<br>> +diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h<br>> +index f7b3bfb..a26ca4b 100644<br>> +--- a/ext/gl/gstglimagesink.h<br>> ++++ b/ext/gl/gstglimagesink.h<br>> +@@ -102,6 +102,9 @@ struct _GstGLImageSink<br>> + guint window_width;<br>> + guint window_height;<br>> +<br>> ++ GstVideoCropMeta *cropmeta;<br>> ++ GstVideoCropMeta *prev_cropmeta;<br>> ++<br>> + GstVideoRectangle display_rect;<br>> +<br>> + GstGLShader *redisplay_shader;<br>> +diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c<br>> +index acaa329..0d36248 100644<br>> +--- a/gst-libs/gst/gl/gstglupload.c<br>> ++++ b/gst-libs/gst/gl/gstglupload.c<br>> +@@ -756,6 +756,7 @@ _physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **ou<br>> + {<br>> + struct PhyBufferUpload *phyBuffer = impl;<br>> + GstVideoInfo *info;<br>> ++ GstVideoCropMeta *incropmeta, *outcropmeta;<br>> + gint n_mem;<br>> +<br>> + info = &phyBuffer->upload->priv->out_info;<br>> +@@ -774,6 +775,15 @@ _physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **ou<br>> + gst_buffer_add_video_meta_full (*outbuf, 0,<br>> + GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),<br>> + GST_VIDEO_INFO_HEIGHT (info), n_mem, info->offset, info->stride);<br>> ++ /* add video crop meta to out buffer if need */<br>> ++ incropmeta = gst_buffer_get_video_crop_meta(buffer);<br>> ++ if(incropmeta){<br>> ++ outcropmeta = gst_buffer_add_video_crop_meta(*outbuf);<br>> ++ outcropmeta->x = incropmeta->x;<br>> ++ outcropmeta->y = incropmeta->y;<br>> ++ outcropmeta->width = incropmeta->width;<br>> ++ outcropmeta->height = incropmeta->height;<br>> ++ }<br>> +<br>> + return GST_GL_UPLOAD_DONE;<br>> + }<br>> +--<br>> +1.7.9.5<br>> +<br>> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> index 0728009..9ce22eb 100644<br>> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> @@ -12,6 +12,7 @@ PACKAGECONFIG_GL_mx6sl = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \<br>> <br>> IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch \<br>> file://0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch \<br>> + file://0003-glplugin-support-video-crop-for-glimagesink.patch \<br>> "<br>> <br>> SRC_URI_append_mx6 = "${IMX_PATCHES}"<br><br><br><br>------------------------------<br><br>Message: 5<br>Date: Tue, 29 Mar 2016 09:32:47 +0200<br>From: Carlos Rafael Giani <dv@pseudoterminal.org><br>To: Yuqing Zhu <b54851@freescale.com>, meta-freescale@yoctoproject.org<br>Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH v2 1/3]<br> gstreamer1.0-plugins-bad: Add directviv to glimagesink to improve<br> playback performance<br>Message-ID: <56FA2F9F.6050707@pseudoterminal.org><br>Content-Type: text/plain; charset=utf-8; format=flowed<br><br>Generally this patch seems OK. There are some places that need <br>clarification.<br><br><br>@@ -231,6 +233,18 @@ gst_gl_upload_element_prepare_output_buffer <br>(GstBaseTransform * bt,<br> return GST_FLOW_ERROR;<br> }<br><br>+ /* check if the output buffer's meta format equals to the caps format */<br>+ GstVideoMeta *vmeta = gst_buffer_get_video_meta(*outbuf);<br>+ gst_video_info_from_caps (&info, upload->out_caps);<br>+ if(vmeta->format != GST_VIDEO_INFO_FORMAT (&info))<br>+ {<br>+ caps = gst_caps_copy(upload->out_caps);<br>+ gst_caps_set_simple (caps, "format", G_TYPE_STRING,<br>+ gst_video_format_to_string (vmeta->format), NULL);<br>+ gst_caps_replace (&upload->out_caps, caps);<br>+ gst_base_transform_update_src_caps (upload, caps);<br>+ }<br>+<br><br>This is to ensure that the output format always corresponds to the <br>actual video frame's format? This is because the direct textures can <br>handle pixel format conversions automatically, right? But what if the <br>meta contains a format that is not supported by the direct texture? <br>(Y42B for example, which is not uncommon with USB webcams)<br><br><br>@@ -998,7 +1110,7 @@ gst_gl_upload_transform_caps (GstGLContext * <br>context, GstPadDirection direction,<br><br><br> if (filter) {<br>- result = gst_caps_intersect_full (filter, tmp, <br>GST_CAPS_INTERSECT_FIRST);<br>+ result = gst_caps_intersect_full (tmp, filter, <br>GST_CAPS_INTERSECT_FIRST);<br> gst_caps_unref (tmp);<br> } else {<br> result = tmp;<br><br>Why is this done?<br><br><br>@@ -896,6 +896,11 @@ gst_glimage_sink_query (GstBaseSink * bsink, <br>GstQuery * query)<br> res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);<br> break;<br> }<br>+ case GST_QUERY_ALLOCATION:<br>+ {<br>+ res = gst_glimage_sink_propose_allocation(bsink, query);<br>+ break;<br>+ }<br> default:<br> res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);<br> break;<br><br>This one is interesting. Without this, there will be a memory copy? <br>Seems counter intuitive for glimagesink to do this.<br><br>Also, I think a similar patch was being used in a separate project. I <br>will look it up. Perhaps these can be merged.<br><br><br>On 2016-02-02 15:01, Yuqing Zhu wrote:<br>> 1. Add a physical buffer uploader in glupload plugin and using viv direct<br>> texture to bind physical continious buffer with texture to avoid memory<br>> copy from videobuffer to texture to gain good performance.<br>><br>> 2. Reduce glimagesink load latency by override glimagesink ALLOCATION query to<br>> avoid memory copy.<br>><br>> Signed-off-by: Yuqing Zhu <b54851@freescale.com><br>> ---<br>> ...imagesink-to-improve-playback-performance.patch | 454 +++++++++++++++++++++<br>> .../gstreamer/gstreamer1.0-plugins-bad_%.bbappend | 9 +-<br>> 2 files changed, 460 insertions(+), 3 deletions(-)<br>> create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch<br>><br>> 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<br>> new file mode 100755<br>> index 0000000..2739355<br>> --- /dev/null<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch<br>> @@ -0,0 +1,454 @@<br>> +From 587db892fdaac18780c8024e5a976ea182f36ff4 Mon Sep 17 00:00:00 2001<br>> +From: Haihua Hu <b55597@freescale.com><br>> +Date: Tue, 13 Oct 2015 09:33:54 +0800<br>> +Subject: [PATCH 1/2] [glplugin] Add directviv to glimagesink to improve<br>> + playback performance<br>> +MIME-Version: 1.0<br>> +Content-Type: text/plain; charset=UTF-8<br>> +Content-Transfer-Encoding: 8bit<br>> +<br>> +1.Add a physical buffer uploader in glupload plugin and using viv direct<br>> + texture to bind physical continious buffer with texture to avoid memory<br>> + copy from videobuffer to texture to gain good performance.<br>> +2.Reduce glimagesink load latency by override glimagesink ALLOCATION query to<br>> + avoid memory copy.<br>> +<br>> +Upstream-Status: Inappropriate [i.MX specific]<br>> +<br>> +Signed-off-by: Haihua Hu <b55597@freescale.com><br>> +---<br>> + ext/gl/gstglimagesink.c | 5 ++<br>> + ext/gl/gstgluploadelement.c | 14 +++<br>> + gst-libs/gst/gl/Makefile.am | 2 +<br>> + gst-libs/gst/gl/gstglupload.c | 118 ++++++++++++++++++++++++-<br>> + gst-libs/gst/gl/gstglvivdirecttexture.c | 143 +++++++++++++++++++++++++++++++<br>> + gst-libs/gst/gl/gstglvivdirecttexture.h | 35 ++++++++<br>> + 6 files changed, 314 insertions(+), 3 deletions(-)<br>> + create mode 100644 gst-libs/gst/gl/gstglvivdirecttexture.c<br>> + create mode 100644 gst-libs/gst/gl/gstglvivdirecttexture.h<br>> +<br>> +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c<br>> +index f629df7..1e5dc05 100644<br>> +--- a/ext/gl/gstglimagesink.c<br>> ++++ b/ext/gl/gstglimagesink.c<br>> +@@ -896,6 +896,11 @@ gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query)<br>> + res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);<br>> + break;<br>> + }<br>> ++ case GST_QUERY_ALLOCATION:<br>> ++ {<br>> ++ res = gst_glimage_sink_propose_allocation(bsink, query);<br>> ++ break;<br>> ++ }<br>> + default:<br>> + res = GST_BASE_SINK_CLASS (parent_class)->query (bsink, query);<br>> + break;<br>> +diff --git a/ext/gl/gstgluploadelement.c b/ext/gl/gstgluploadelement.c<br>> +index 83ff24c..e74da3a 100644<br>> +--- a/ext/gl/gstgluploadelement.c<br>> ++++ b/ext/gl/gstgluploadelement.c<br>> +@@ -208,6 +208,8 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt,<br>> + GstGLUploadElement *upload = GST_GL_UPLOAD_ELEMENT (bt);<br>> + GstGLUploadReturn ret;<br>> + GstBaseTransformClass *bclass;<br>> ++ GstVideoInfo info;<br>> ++ GstCaps *caps;<br>> +<br>> + bclass = GST_BASE_TRANSFORM_GET_CLASS (bt);<br>> +<br>> +@@ -231,6 +233,18 @@ gst_gl_upload_element_prepare_output_buffer (GstBaseTransform * bt,<br>> + return GST_FLOW_ERROR;<br>> + }<br>> +<br>> ++ /* check if the output buffer's meta format equals to the caps format */<br>> ++ GstVideoMeta *vmeta = gst_buffer_get_video_meta(*outbuf);<br>> ++ gst_video_info_from_caps (&info, upload->out_caps);<br>> ++ if(vmeta->format != GST_VIDEO_INFO_FORMAT (&info))<br>> ++ {<br>> ++ caps = gst_caps_copy(upload->out_caps);<br>> ++ gst_caps_set_simple (caps, "format", G_TYPE_STRING,<br>> ++ gst_video_format_to_string (vmeta->format), NULL);<br>> ++ gst_caps_replace (&upload->out_caps, caps);<br>> ++ gst_base_transform_update_src_caps (upload, caps);<br>> ++ }<br>> ++<br>> + /* basetransform doesn't unref if they're the same */<br>> + if (buffer == *outbuf)<br>> + gst_buffer_unref (*outbuf);<br>> +diff --git a/gst-libs/gst/gl/Makefile.am b/gst-libs/gst/gl/Makefile.am<br>> +index 36f3bf7..402e37a 100644<br>> +--- a/gst-libs/gst/gl/Makefile.am<br>> ++++ b/gst-libs/gst/gl/Makefile.am<br>> +@@ -30,6 +30,7 @@ libgstgl_@GST_API_VERSION@_la_SOURCES = \<br>> + gstglsyncmeta.c \<br>> + gstglviewconvert.c \<br>> + gstgloverlaycompositor.c \<br>> ++ gstglvivdirecttexture.c \<br>> + utils/opengl_versions.h<br>> +<br>> + libgstgl_@GST_API_VERSION@includedir = $(includedir)/gstreamer-@GST_API_VERSION@/gst/gl<br>> +@@ -56,6 +57,7 @@ libgstgl_@GST_API_VERSION@include_HEADERS = \<br>> + gstglviewconvert.h \<br>> + gstgloverlaycompositor.h \<br>> + gstgl_fwd.h \<br>> ++ gstglvivdirecttexture.h \<br>> + gl.h<br>> +<br>> + libgstgl_@GST_API_VERSION@_la_LIBADD = \<br>> +diff --git a/gst-libs/gst/gl/gstglupload.c b/gst-libs/gst/gl/gstglupload.c<br>> +index 0addca1..acaa329 100644<br>> +--- a/gst-libs/gst/gl/gstglupload.c<br>> ++++ b/gst-libs/gst/gl/gstglupload.c<br>> +@@ -23,6 +23,7 @@<br>> + #endif<br>> +<br>> + #include <stdio.h><br>> ++#include <gst/gl/gstglvivdirecttexture.h><br>> +<br>> + #include "gl.h"<br>> + #include "gstglupload.h"<br>> +@@ -47,7 +48,7 @@<br>> + #define USING_GLES2(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 2, 0))<br>> + #define USING_GLES3(context) (gst_gl_context_check_gl_version (context, GST_GL_API_GLES2, 3, 0))<br>> +<br>> +-GST_DEBUG_CATEGORY_STATIC (gst_gl_upload_debug);<br>> ++GST_DEBUG_CATEGORY (gst_gl_upload_debug);<br>> + #define GST_CAT_DEFAULT gst_gl_upload_debug<br>> +<br>> + #define DEBUG_INIT \<br>> +@@ -698,6 +699,114 @@ static const UploadMethod _upload_meta_upload = {<br>> + &_upload_meta_upload_free<br>> + };<br>> +<br>> ++struct PhyBufferUpload<br>> ++{<br>> ++ GstGLUpload *upload;<br>> ++};<br>> ++<br>> ++static gpointer<br>> ++_physical_buffer_upload_new(GstGLUpload *upload)<br>> ++{<br>> ++ struct PhyBufferUpload *phybuffer = g_new0 (struct PhyBufferUpload, 1);<br>> ++<br>> ++ phybuffer->upload = upload;<br>> ++<br>> ++ return phybuffer;<br>> ++}<br>> ++<br>> ++static GstCaps *<br>> ++_physical_buffer_upload_transform_caps(GstGLContext *context,<br>> ++ GstPadDirection direction, GstCaps *caps)<br>> ++{<br>> ++ GstCaps *ret;<br>> ++<br>> ++ if (direction == GST_PAD_SINK) {<br>> ++ ret = _set_caps_features (caps, GST_CAPS_FEATURE_MEMORY_GL_MEMORY);<br>> ++ gst_caps_set_simple (ret, "format", G_TYPE_STRING, "RGBA", NULL);<br>> ++ } else {<br>> ++ ret = gst_caps_from_string (GST_VIDEO_CAPS_MAKE_WITH_FEATURES<br>> ++ (GST_CAPS_FEATURE_MEMORY_SYSTEM_MEMORY,GST_GL_DIRECTVIV_FORMAT));<br>> ++ }<br>> ++<br>> ++ return ret;<br>> ++}<br>> ++<br>> ++static gboolean<br>> ++_physical_buffer_upload_accept(gpointer impl, GstBuffer *buffer,<br>> ++ GstCaps *in_caps, GstCaps *out_caps)<br>> ++{<br>> ++ GstCapsFeatures *features;<br>> ++<br>> ++ features = gst_caps_get_features (out_caps, 0);<br>> ++ if (!gst_caps_features_contains (features, GST_CAPS_FEATURE_MEMORY_GL_MEMORY))<br>> ++ return FALSE;<br>> ++<br>> ++ return gst_is_physical_buffer(buffer);<br>> ++}<br>> ++<br>> ++static void<br>> ++_physical_buffer_upload_propose_allocation(gpointer impl, GstQuery *decide_query,<br>> ++ GstQuery *query)<br>> ++{<br>> ++ gst_query_add_allocation_meta (query, GST_VIDEO_META_API_TYPE, 0);<br>> ++}<br>> ++<br>> ++static GstGLUploadReturn<br>> ++_physical_buffer_upload_perform(gpointer impl, GstBuffer *buffer, GstBuffer **outbuf)<br>> ++{<br>> ++ struct PhyBufferUpload *phyBuffer = impl;<br>> ++ GstVideoInfo *info;<br>> ++ gint n_mem;<br>> ++<br>> ++ info = &phyBuffer->upload->priv->out_info;<br>> ++ n_mem = GST_VIDEO_INFO_N_PLANES (info);<br>> ++ GST_LOG_OBJECT (phyBuffer->upload, "Attempting viv direct upload");<br>> ++ *outbuf = gst_buffer_new ();<br>> ++ gst_gl_memory_setup_buffer (phyBuffer->upload->context,<br>> ++ NULL, info, NULL, *outbuf);<br>> ++<br>> ++ GstGLMemory *out_gl_mem =<br>> ++ (GstGLMemory *) gst_buffer_peek_memory (*outbuf, 0);<br>> ++<br>> ++ gst_gl_viv_direct_bind_gstbuffer(phyBuffer->upload->context, out_gl_mem->tex_id,<br>> ++ &phyBuffer->upload->priv->in_info, buffer);<br>> ++<br>> ++ gst_buffer_add_video_meta_full (*outbuf, 0,<br>> ++ GST_VIDEO_INFO_FORMAT (info), GST_VIDEO_INFO_WIDTH (info),<br>> ++ GST_VIDEO_INFO_HEIGHT (info), n_mem, info->offset, info->stride);<br>> ++<br>> ++ return GST_GL_UPLOAD_DONE;<br>> ++}<br>> ++<br>> ++static void<br>> ++_physical_buffer_upload_release(gpointer impl, GstBuffer *buffer)<br>> ++{<br>> ++}<br>> ++<br>> ++static void<br>> ++_physical_buffer_upload_free(gpointer impl)<br>> ++{<br>> ++ struct PhyBufferUpload *phyBuffer = impl;<br>> ++<br>> ++ g_free(phyBuffer);<br>> ++}<br>> ++<br>> ++static GstStaticCaps _physical_buffer_upload_caps =<br>> ++GST_STATIC_CAPS (GST_VIDEO_CAPS_MAKE (GST_GL_DIRECTVIV_FORMAT));<br>> ++<br>> ++static const UploadMethod _physical_buffer_upload = {<br>> ++ "Physical buffer",<br>> ++ 0,<br>> ++ &_physical_buffer_upload_caps,<br>> ++ &_physical_buffer_upload_new,<br>> ++ &_physical_buffer_upload_transform_caps,<br>> ++ &_physical_buffer_upload_accept,<br>> ++ &_physical_buffer_upload_propose_allocation,<br>> ++ &_physical_buffer_upload_perform,<br>> ++ &_physical_buffer_upload_release,<br>> ++ &_physical_buffer_upload_free<br>> ++};<br>> ++<br>> + struct RawUploadFrame<br>> + {<br>> + gint ref_count;<br>> +@@ -813,6 +922,7 @@ _raw_data_upload_perform (gpointer impl, GstBuffer * buffer,<br>> + struct RawUpload *raw = impl;<br>> + int i;<br>> + GstVideoInfo *in_info = &raw->upload->priv->in_info;<br>> ++<br>> + guint max_planes = GST_VIDEO_INFO_N_PLANES (in_info);<br>> +<br>> + /* Support stereo views for separated multiview mode */<br>> +@@ -870,7 +980,9 @@ static const UploadMethod *upload_methods[] = { &_gl_memory_upload,<br>> + #if GST_GL_HAVE_PLATFORM_EGL<br>> + &_egl_image_upload,<br>> + #endif<br>> +- &_upload_meta_upload, &_raw_data_upload<br>> ++ &_upload_meta_upload,<br>> ++ &_physical_buffer_upload,<br>> ++ &_raw_data_upload<br>> + };<br>> +<br>> + static GMutex upload_global_lock;<br>> +@@ -998,7 +1110,7 @@ gst_gl_upload_transform_caps (GstGLContext * context, GstPadDirection direction,<br>> +<br>> +<br>> + if (filter) {<br>> +- result = gst_caps_intersect_full (filter, tmp, GST_CAPS_INTERSECT_FIRST);<br>> ++ result = gst_caps_intersect_full (tmp, filter, GST_CAPS_INTERSECT_FIRST);<br>> + gst_caps_unref (tmp);<br>> + } else {<br>> + result = tmp;<br>> +diff --git a/gst-libs/gst/gl/gstglvivdirecttexture.c b/gst-libs/gst/gl/gstglvivdirecttexture.c<br>> +new file mode 100644<br>> +index 0000000..c19b617<br>> +--- /dev/null<br>> ++++ b/gst-libs/gst/gl/gstglvivdirecttexture.c<br>> +@@ -0,0 +1,143 @@<br>> ++/*<br>> ++ * GStreamer<br>> ++ * Copyright (c) 2015, Freescale Semiconductor, Inc.<br>> ++ *<br>> ++ * This library is free software; you can redistribute it and/or<br>> ++ * modify it under the terms of the GNU Library General Public<br>> ++ * License as published by the Free Software Foundation; either<br>> ++ * version 2 of the License, or (at your option) any later version.<br>> ++ *<br>> ++ * This library is distributed in the hope that it will be useful,<br>> ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>> ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br>> ++ * Library General Public License for more details.<br>> ++ *<br>> ++ * You should have received a copy of the GNU Library General Public<br>> ++ * License along with this library; if not, write to the<br>> ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,<br>> ++ * Boston, MA 02110-1301, USA.<br>> ++ */<br>> ++<br>> ++#ifdef HAVE_CONFIG_H<br>> ++#include "config.h"<br>> ++#endif<br>> ++<br>> ++#include "gl.h"<br>> ++<br>> ++GST_DEBUG_CATEGORY_EXTERN (gst_gl_upload_debug);<br>> ++#define GST_CAT_DEFAULT gst_gl_upload_debug<br>> ++<br>> ++typedef struct {<br>> ++ guint tex_id;<br>> ++ guint w;<br>> ++ guint h;<br>> ++ guint fmt;<br>> ++ void *vaddr;<br>> ++ guint paddr;<br>> ++ gboolean ret;<br>> ++} GstVivDirectTexture;<br>> ++<br>> ++gboolean<br>> ++gst_is_physical_buffer (GstBuffer *buffer)<br>> ++{<br>> ++<br>> ++ GstMemory *mem;<br>> ++<br>> ++ mem = gst_buffer_peek_memory (buffer, 0);<br>> ++ if (!mem->allocator)<br>> ++ return FALSE;<br>> ++<br>> ++ return g_type_check_instance_is_a (mem->allocator, g_type_from_name("GstAllocatorPhyMem"));<br>> ++}<br>> ++<br>> ++static void<br>> ++_do_viv_direct_tex_bind_mem (GstGLContext * context, GstVivDirectTexture * viv_tex)<br>> ++{<br>> ++ 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);<br>> ++ GST_DEBUG ("Physical memory buffer, vaddr: %p, paddr: %p", viv_tex->vaddr, viv_tex->paddr);<br>> ++<br>> ++ glBindTexture (GL_TEXTURE_2D, viv_tex->tex_id);<br>> ++ glTexDirectVIVMap (GL_TEXTURE_2D, viv_tex->w, viv_tex->h, viv_tex->fmt, &viv_tex->vaddr, &viv_tex->paddr);<br>> ++ glTexDirectInvalidateVIV (GL_TEXTURE_2D);<br>> ++ viv_tex->ret = TRUE;<br>> ++<br>> ++ return;<br>> ++}<br>> ++<br>> ++gboolean<br>> ++gst_gl_viv_direct_bind_gstbuffer (GstGLContext * context, guint tex_id, GstVideoInfo * info, GstBuffer * buffer)<br>> ++{<br>> ++ typedef struct {<br>> ++ guint8 *vaddr;<br>> ++ guint8 *paddr;<br>> ++ guint8 *caddr;<br>> ++ gsize size;<br>> ++ gpointer *user_data;<br>> ++ } PhyMemBlock;<br>> ++ //Note: structure PhyMemBlock is copied from gst1.0-fsl-plugin/libs/allocator/gstallocatorphymem.h<br>> ++<br>> ++ typedef struct {<br>> ++ GstMemory mem;<br>> ++ guint8 *vaddr;<br>> ++ guint8 *paddr;<br>> ++ PhyMemBlock block;<br>> ++ } GstMemoryPhy;<br>> ++ //Note: structure GstMemoryPhy is copied from gst1.0-fsl-plugin/libs/allocator/gstallocatorphymem.c<br>> ++<br>> ++ GstMemory *mem = gst_buffer_peek_memory (buffer, 0);<br>> ++ GstMemoryPhy *memphy = (GstMemoryPhy*) mem;<br>> ++ PhyMemBlock *memblk = &memphy->block;<br>> ++<br>> ++ GstVideoFormat fmt = GST_VIDEO_INFO_FORMAT (info);<br>> ++ gint width, height;<br>> ++ GstVideoMeta *vmeta = gst_buffer_get_video_meta (buffer);<br>> ++ if (vmeta && (fmt == GST_VIDEO_FORMAT_I420 || fmt == GST_VIDEO_FORMAT_NV12)) {<br>> ++ width = vmeta->stride[0];<br>> ++ height = vmeta->offset[1] / width;<br>> ++ }<br>> ++ else {<br>> ++ width = GST_VIDEO_INFO_WIDTH (info);<br>> ++ height = GST_VIDEO_INFO_HEIGHT (info);<br>> ++ }<br>> ++<br>> ++ guint viv_fmt;<br>> ++ switch (fmt) {<br>> ++ case GST_VIDEO_FORMAT_I420:<br>> ++ viv_fmt = GL_VIV_I420;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_YV12:<br>> ++ viv_fmt = GL_VIV_YV12;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_NV12:<br>> ++ viv_fmt = GL_VIV_NV12;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_NV21:<br>> ++ viv_fmt = GL_VIV_NV21;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_YUY2:<br>> ++ viv_fmt = GL_VIV_YUY2;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_UYVY:<br>> ++ viv_fmt = GL_VIV_UYVY;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_RGBA:<br>> ++ viv_fmt = GL_RGBA;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_BGRA:<br>> ++ viv_fmt = GL_BGRA_EXT;<br>> ++ break;<br>> ++ case GST_VIDEO_FORMAT_RGB16:<br>> ++ viv_fmt = GL_RGB565_OES;<br>> ++ break;<br>> ++ default:<br>> ++ GST_ERROR ("Not supported format %d for viv direct texture upload.", fmt);<br>> ++ viv_fmt = GL_NONE;<br>> ++ return FALSE;<br>> ++ }<br>> ++<br>> ++ GstVivDirectTexture viv_tex = {tex_id, width, height, viv_fmt, memblk->vaddr, memblk->paddr, FALSE};<br>> ++ gst_gl_context_thread_add (context, (GstGLContextThreadFunc) _do_viv_direct_tex_bind_mem, &viv_tex);<br>> ++<br>> ++ return viv_tex.ret;<br>> ++}<br>> ++<br>> +diff --git a/gst-libs/gst/gl/gstglvivdirecttexture.h b/gst-libs/gst/gl/gstglvivdirecttexture.h<br>> +new file mode 100644<br>> +index 0000000..fa88e1a<br>> +--- /dev/null<br>> ++++ b/gst-libs/gst/gl/gstglvivdirecttexture.h<br>> +@@ -0,0 +1,35 @@<br>> ++/*<br>> ++ * GStreamer<br>> ++ * Copyright (c) 2015, Freescale Semiconductor, Inc.<br>> ++ *<br>> ++ * This library is free software; you can redistribute it and/or<br>> ++ * modify it under the terms of the GNU Library General Public<br>> ++ * License as published by the Free Software Foundation; either<br>> ++ * version 2 of the License, or (at your option) any later version.<br>> ++ *<br>> ++ * This library is distributed in the hope that it will be useful,<br>> ++ * but WITHOUT ANY WARRANTY; without even the implied warranty of<br>> ++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU<br>> ++ * Library General Public License for more details.<br>> ++ *<br>> ++ * You should have received a copy of the GNU Library General Public<br>> ++ * License along with this library; if not, write to the<br>> ++ * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,<br>> ++ * Boston, MA 02110-1301, USA.<br>> ++ */<br>> ++<br>> ++#ifndef __GST_GL_VIVDIRECT_H__<br>> ++#define __GST_GL_VIVDIRECT_H__<br>> ++<br>> ++#include <gst/video/video.h><br>> ++#include <gst/gl/gstgl_fwd.h><br>> ++<br>> ++#define GST_GL_DIRECTVIV_FORMAT "{RGBA, I420, YV12, NV12, NV21, YUY2, UYVY, BGRA, RGB16}"<br>> ++G_BEGIN_DECLS<br>> ++<br>> ++gboolean gst_is_physical_buffer (GstBuffer *buffer);<br>> ++gboolean gst_gl_viv_direct_bind_gstbuffer (GstGLContext * context, guint tex_id, GstVideoInfo * info, GstBuffer * buffer);<br>> ++<br>> ++G_END_DECLS<br>> ++<br>> ++#endif /* __GST_GL_VIVDIRECT_H__ */<br>> +--<br>> +1.7.9.5<br>> +<br>> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> index 7e6f3ff..0728009 100644<br>> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_%.bbappend<br>> @@ -10,10 +10,13 @@ PACKAGECONFIG_GL_mx6sl = "${@bb.utils.contains('DISTRO_FEATURES', 'opengl', \<br>> base_contains('DISTRO_FEATURES', 'x11', \<br>> 'opengl', '', d), '', d)}"<br>> <br>> -SRC_URI_append_mx6 = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch"<br>> -SRC_URI_append_mx6ul = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch"<br>> -SRC_URI_append_mx7 = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch"<br>> +IMX_PATCHES = " file://0001-PATCH-install-gstaggregator-and-gstvideoaggregator-h.patch \<br>> + file://0002-glplugin-Add-directviv-to-glimagesink-to-improve-playback-performance.patch \<br>> +"<br>> <br>> +SRC_URI_append_mx6 = "${IMX_PATCHES}"<br>> +SRC_URI_append_mx6ul = "${IMX_PATCHES}"<br>> +SRC_URI_append_mx7 = "${IMX_PATCHES}"<br>> <br>> PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"<br>> PACKAGE_ARCH_mx6ul = "${MACHINE_SOCARCH}"<br><br><br><br>------------------------------<br><br>Message: 6<br>Date: Tue, 29 Mar 2016 10:07:42 -0300<br>From: "Otavio Salvador" <otavio.salvador@gmail.com><br>To: meta-freescale@yoctoproject.org<br>Subject: [meta-freescale] Updates to meta-fsl-arm (master) in<br> 2016-03-29<br>Message-ID: <56fa7e22.d0d7370a.37f92.ffffa290@mx.google.com><br><br>Hello,<br><br>I pushed following updates:<br><br>commit 4b243b7a91ba0243dfa192de582afd2a0d5ff744 (HEAD -> pending, yocto/master-next, yocto/master)<br>Author: Yuqing Zhu <b54851@freescale.com><br>Date: Fri Jan 29 17:41:55 2016 +0800<br><br> gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue.<br> <br> IMXCameraApp: When Enabled "save time to image" item, preview,<br> find the time can not display completely.<br> <br> As IPU need 8 pixels alignment, add one workaround in base text overlay<br> to generate 8 pixels alignment text video buffer. The side effect should<br> cause all text a little smaller.<br> <br> Signed-off-by: Yuqing Zhu <b54851@freescale.com><br> Signed-off-by: Otavio Salvador <otavio@ossystems.com.br><br><br>Regards,<br><br>--<br>Otavio Salvador O.S. Systems<br>http://www.ossystems.com.br http://code.ossystems.com.br<br>Mobile: +55 (53) 9981-7854 Mobile: +1 (347) 903-9750<br><br><br>------------------------------<br><br>-- <br>_______________________________________________<br>meta-freescale mailing list<br>meta-freescale@yoctoproject.org<br>https://lists.yoctoproject.org/listinfo/meta-freescale<br><br><br>End of meta-freescale Digest, Vol 41, Issue 22<br>**********************************************</div>