All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6
@ 2016-01-18  9:33 Yuqing Zhu
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only Yuqing Zhu
                   ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Yuqing Zhu @ 2016-01-18  9:33 UTC (permalink / raw)
  To: meta-freescale

Make memory copy when video buffer's memory is read only.

Don't set async of custom text-sink to false.

Fix IMXCameraApp image time cannot display issue.


Yuqing Zhu (3):
  gstreamer1.0-plugins-base: Make memory copy when video buffer's     
    memory is ready only
  gstreamer1.0-plugins-base: Don't set async of custom text-sink to
    false
  gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display
    issue.

 ...rlay-make-memory-copy-when-video-buffer-s.patch | 80 ++++++++++++++++++++++
 ...-don-t-set-async-of-custom-text-sink-to-f.patch | 34 +++++++++
 ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 ++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  9 ++-
 4 files changed, 179 insertions(+), 2 deletions(-)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch

-- 
1.9.1



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only
  2016-01-18  9:33 [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Yuqing Zhu
@ 2016-01-18  9:34 ` Yuqing Zhu
  2016-01-18 14:15   ` Carlos Rafael Giani
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false Yuqing Zhu
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 10+ messages in thread
From: Yuqing Zhu @ 2016-01-18  9:34 UTC (permalink / raw)
  To: meta-freescale

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.

Signed-off-by: Yuqing Zhu <b54851@freescale.com>
---
 ...rlay-make-memory-copy-when-video-buffer-s.patch | 80 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  7 +-
 2 files changed, 85 insertions(+), 2 deletions(-)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
new file mode 100755
index 0000000..eaff00f
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
@@ -0,0 +1,80 @@
+From 0092d07195aa5d950bc10dfb05bd9547f67028a3 Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@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.
+
+Upstream-Status: Inappropriate [i.MX specific]
+
+Signed-off-by: Mingke Wang <mingke.wang@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 ff4d77b..3e72175 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
@@ -1,7 +1,10 @@
 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-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
+"
+SRC_URI_append_mx6 = "${IMX_PATCHES}"
+SRC_URI_append_mx7 = "${IMX_PATCHES}"
 
 PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
 PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false
  2016-01-18  9:33 [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Yuqing Zhu
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only Yuqing Zhu
@ 2016-01-18  9:34 ` Yuqing Zhu
  2016-01-18 14:16   ` Carlos Rafael Giani
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 3/3] gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue Yuqing Zhu
  2016-01-18 12:17 ` [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Otavio Salvador
  3 siblings, 1 reply; 10+ messages in thread
From: Yuqing Zhu @ 2016-01-18  9:34 UTC (permalink / raw)
  To: meta-freescale

Set async to false lead to A/V sync problem when seeking.
The preroll need use GAP event instead of set async to false.

Signed-off-by: Yuqing Zhu <b54851@freescale.com>
---
 ...-don-t-set-async-of-custom-text-sink-to-f.patch | 34 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  1 +
 2 files changed, 35 insertions(+)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
new file mode 100755
index 0000000..61dad2f
--- /dev/null
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
@@ -0,0 +1,34 @@
+From a4672257ddc8f72d528091d20aa2242293adc17a Mon Sep 17 00:00:00 2001
+From: Mingke Wang <mingke.wang@freescale.com>
+Date: Thu, 19 Mar 2015 14:15:25 +0800
+Subject: [PATCH 2/9] gstplaysink: don't set async of custom text-sink to false
+
+set async to false lead to A/V sync problem when seeking.
+the preroll need use GAP event instead of set async to false.
+
+Upstream-Status: Inappropriate [i.MX specific]
+
+Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
+---
+ gst/playback/gstplaysink.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+ mode change 100644 => 100755 gst/playback/gstplaysink.c
+
+diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
+old mode 100644
+new mode 100755
+index aa43111..e670934
+--- a/gst/playback/gstplaysink.c
++++ b/gst/playback/gstplaysink.c
+@@ -2431,7 +2431,7 @@ gen_text_chain (GstPlaySink * playsink)
+           G_TYPE_BOOLEAN);
+       if (elem) {
+         /* make sure the sparse subtitles don't participate in the preroll */
+-        g_object_set (elem, "async", FALSE, NULL);
++        //g_object_set (elem, "async", FALSE, NULL);
+         GST_DEBUG_OBJECT (playsink, "adding custom text sink");
+         gst_bin_add (bin, chain->sink);
+         /* NOTE streamsynchronizer needs streams decoupled */
+-- 
+1.9.1
+
diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
index 3e72175..cf50918 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-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
+                file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \
 "
 SRC_URI_append_mx6 = "${IMX_PATCHES}"
 SRC_URI_append_mx7 = "${IMX_PATCHES}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [meta-fsl-arm][PATCH 3/3] gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue.
  2016-01-18  9:33 [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Yuqing Zhu
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only Yuqing Zhu
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false Yuqing Zhu
@ 2016-01-18  9:34 ` Yuqing Zhu
  2016-01-18 14:20   ` Carlos Rafael Giani
  2016-01-18 12:17 ` [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Otavio Salvador
  3 siblings, 1 reply; 10+ messages in thread
From: Yuqing Zhu @ 2016-01-18  9:34 UTC (permalink / raw)
  To: meta-freescale

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@freescale.com>
---
 ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  1 +
 2 files changed, 59 insertions(+)
 create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch

diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-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/0003-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@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@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 cf50918..a31a2c4 100644
--- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
+++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
@@ -3,6 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
 IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \
                 file://0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
                 file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \
+                file://0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \
 "
 SRC_URI_append_mx6 = "${IMX_PATCHES}"
 SRC_URI_append_mx7 = "${IMX_PATCHES}"
-- 
1.9.1



^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6
  2016-01-18  9:33 [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Yuqing Zhu
                   ` (2 preceding siblings ...)
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 3/3] gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue Yuqing Zhu
@ 2016-01-18 12:17 ` Otavio Salvador
  3 siblings, 0 replies; 10+ messages in thread
From: Otavio Salvador @ 2016-01-18 12:17 UTC (permalink / raw)
  To: Yuqing Zhu, Carlos Rafael Giani; +Cc: meta-freescale

On Mon, Jan 18, 2016 at 7:33 AM, Yuqing Zhu <b54851@freescale.com> wrote:
> Make memory copy when video buffer's memory is read only.
>
> Don't set async of custom text-sink to false.
>
> Fix IMXCameraApp image time cannot display issue.

Carlos, please review those patches.

-- 
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


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only Yuqing Zhu
@ 2016-01-18 14:15   ` Carlos Rafael Giani
       [not found]     ` <AM4PR04MB16351B03FE384E783CD1F740E9C20@AM4PR04MB1635.eurprd04.prod.outlook.com>
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Rafael Giani @ 2016-01-18 14:15 UTC (permalink / raw)
  To: meta-freescale

Why is this flagged as i.MX specific? Nothing in this patch refers to 
i.MX details such as IPU, VPU etc.

Also, the patch commit message needs a reference to a GStreamer bugzilla 
entry.

On 01/18/2016 10:34 AM, Yuqing Zhu wrote:
> 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.
>
> Signed-off-by: Yuqing Zhu <b54851@freescale.com>
> ---
>   ...rlay-make-memory-copy-when-video-buffer-s.patch | 80 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  7 +-
>   2 files changed, 85 insertions(+), 2 deletions(-)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
> new file mode 100755
> index 0000000..eaff00f
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch
> @@ -0,0 +1,80 @@
> +From 0092d07195aa5d950bc10dfb05bd9547f67028a3 Mon Sep 17 00:00:00 2001
> +From: Mingke Wang <mingke.wang@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.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Mingke Wang <mingke.wang@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 ff4d77b..3e72175 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> @@ -1,7 +1,10 @@
>   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-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
> +"
> +SRC_URI_append_mx6 = "${IMX_PATCHES}"
> +SRC_URI_append_mx7 = "${IMX_PATCHES}"
>   
>   PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
>   PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}"



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false Yuqing Zhu
@ 2016-01-18 14:16   ` Carlos Rafael Giani
  2016-01-18 14:21     ` Richard Röjfors
  0 siblings, 1 reply; 10+ messages in thread
From: Carlos Rafael Giani @ 2016-01-18 14:16 UTC (permalink / raw)
  To: meta-freescale

Here my question too is: why is this flagged as i.MX specific? Nothing 
in this patch refers to i.MX details such as IPU, VPU..

And you also need a link to a GStreamer bugzilla entry in the commit 
message of this patch.

On 01/18/2016 10:34 AM, Yuqing Zhu wrote:
> Set async to false lead to A/V sync problem when seeking.
> The preroll need use GAP event instead of set async to false.
>
> Signed-off-by: Yuqing Zhu <b54851@freescale.com>
> ---
>   ...-don-t-set-async-of-custom-text-sink-to-f.patch | 34 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  1 +
>   2 files changed, 35 insertions(+)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
> new file mode 100755
> index 0000000..61dad2f
> --- /dev/null
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch
> @@ -0,0 +1,34 @@
> +From a4672257ddc8f72d528091d20aa2242293adc17a Mon Sep 17 00:00:00 2001
> +From: Mingke Wang <mingke.wang@freescale.com>
> +Date: Thu, 19 Mar 2015 14:15:25 +0800
> +Subject: [PATCH 2/9] gstplaysink: don't set async of custom text-sink to false
> +
> +set async to false lead to A/V sync problem when seeking.
> +the preroll need use GAP event instead of set async to false.
> +
> +Upstream-Status: Inappropriate [i.MX specific]
> +
> +Signed-off-by: Mingke Wang <mingke.wang@freescale.com>
> +---
> + gst/playback/gstplaysink.c | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> + mode change 100644 => 100755 gst/playback/gstplaysink.c
> +
> +diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c
> +old mode 100644
> +new mode 100755
> +index aa43111..e670934
> +--- a/gst/playback/gstplaysink.c
> ++++ b/gst/playback/gstplaysink.c
> +@@ -2431,7 +2431,7 @@ gen_text_chain (GstPlaySink * playsink)
> +           G_TYPE_BOOLEAN);
> +       if (elem) {
> +         /* make sure the sparse subtitles don't participate in the preroll */
> +-        g_object_set (elem, "async", FALSE, NULL);
> ++        //g_object_set (elem, "async", FALSE, NULL);
> +         GST_DEBUG_OBJECT (playsink, "adding custom text sink");
> +         gst_bin_add (bin, chain->sink);
> +         /* NOTE streamsynchronizer needs streams decoupled */
> +--
> +1.9.1
> +
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> index 3e72175..cf50918 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-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
> +                file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \
>   "
>   SRC_URI_append_mx6 = "${IMX_PATCHES}"
>   SRC_URI_append_mx7 = "${IMX_PATCHES}"



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-fsl-arm][PATCH 3/3] gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue.
  2016-01-18  9:34 ` [meta-fsl-arm][PATCH 3/3] gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue Yuqing Zhu
@ 2016-01-18 14:20   ` Carlos Rafael Giani
  0 siblings, 0 replies; 10+ messages in thread
From: Carlos Rafael Giani @ 2016-01-18 14:20 UTC (permalink / raw)
  To: meta-freescale

This *is* a good example of something truly i.MX specific. As a 
workaround, the patch is acceptable.

I'd still submit this to GStreamer bugzilla so this can be turned into 
something upstreamable. I am thinking of an additional set of element 
properties, like "alignment-x" "alignment-y". This way, GStreamer 1.8 
could have this feature, and would not need a patch like this. In 
general, more video related elements should have options for defining 
alignment, I think. It is worth discussing with the GStreamer developers.

On 01/18/2016 10:34 AM, 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@freescale.com>
> ---
>   ...-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch | 58 ++++++++++++++++++++++
>   .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  1 +
>   2 files changed, 59 insertions(+)
>   create mode 100755 recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch
>
> diff --git a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0003-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/0003-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@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@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 cf50918..a31a2c4 100644
> --- a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
> @@ -3,6 +3,7 @@ FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
>   IMX_PATCHES = " file://gstplaybin-remove-flag-deinterlace.patch \
>                   file://0001-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \
>                   file://0002-gstplaysink-don-t-set-async-of-custom-text-sink-to-f.patch \
> +                file://0003-MMFMWK-7030-Linux_MX6QP_ARD-IMXCameraApp-When-Enable.patch \
>   "
>   SRC_URI_append_mx6 = "${IMX_PATCHES}"
>   SRC_URI_append_mx7 = "${IMX_PATCHES}"



^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false
  2016-01-18 14:16   ` Carlos Rafael Giani
@ 2016-01-18 14:21     ` Richard Röjfors
  0 siblings, 0 replies; 10+ messages in thread
From: Richard Röjfors @ 2016-01-18 14:21 UTC (permalink / raw)
  To: Carlos Rafael Giani; +Cc: meta-freescale

On Mon, Jan 18, 2016 at 3:16 PM, Carlos Rafael Giani
<dv@pseudoterminal.org> wrote:
> Here my question too is: why is this flagged as i.MX specific? Nothing in
> this patch refers to i.MX details such as IPU, VPU..
>
> And you also need a link to a GStreamer bugzilla entry in the commit message
> of this patch.

I agree, and what possible side effects of none NXP plugins might this cause?

--Richard


^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only
       [not found]     ` <AM4PR04MB16351B03FE384E783CD1F740E9C20@AM4PR04MB1635.eurprd04.prod.outlook.com>
@ 2016-01-20 13:30       ` Carlos Rafael Giani
  0 siblings, 0 replies; 10+ messages in thread
From: Carlos Rafael Giani @ 2016-01-20 13:30 UTC (permalink / raw)
  To: Yuqing Zhu, meta-freescale

[-- Attachment #1: Type: text/plain, Size: 7424 bytes --]

I suppose this is caused by the elements in gst1.0-fsl-plugins creating 
buffers with read-only GstMemory blocks, right?
Any reason why they are read only? I know these correspond to VPU 
framebuffers, but I do not see a reason why you want to prevent 
read-write access.
With read write access, it is theoretically possible that some element 
like textoverlay writes into it.
Without this access (and with your patch), it would then copy the entire 
buffer instead, which is not faster.
So, what other reasons are there?

On 01/20/2016 06:26 AM, Yuqing Zhu wrote:
> Hi Carlos,
>    
>        Here is the bugzilla entry: https://bugzilla.gnome.org/show_bug.cgi?id=747495
>        This bug is hardware specific, so we flag this patch as i.MX specific.
>
>
>
> B.R.
> Yuqing Zhu
>
> -----Original Message-----
> From: meta-freescale-bounces@yoctoproject.org [mailto:meta-freescale-bounces@yoctoproject.org] On Behalf Of Carlos Rafael Giani
> Sent: Monday, January 18, 2016 10:16 PM
> To: meta-freescale@yoctoproject.org
> Subject: Re: [meta-freescale] [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only
>
> Why is this flagged as i.MX specific? Nothing in this patch refers to i.MX details such as IPU, VPU etc.
>
> Also, the patch commit message needs a reference to a GStreamer bugzilla entry.
>
> On 01/18/2016 10:34 AM, Yuqing Zhu wrote:
>> 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.
>>
>> Signed-off-by: Yuqing Zhu <b54851@freescale.com>
>> ---
>>    ...rlay-make-memory-copy-when-video-buffer-s.patch | 80 ++++++++++++++++++++++
>>    .../gstreamer/gstreamer1.0-plugins-base_%.bbappend |  7 +-
>>    2 files changed, 85 insertions(+), 2 deletions(-)
>>    create mode 100755
>> recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetextov
>> erlay-make-memory-copy-when-video-buffer-s.patch
>>
>> diff --git
>> a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetext
>> overlay-make-memory-copy-when-video-buffer-s.patch
>> b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-basetext
>> overlay-make-memory-copy-when-video-buffer-s.patch
>> new file mode 100755
>> index 0000000..eaff00f
>> --- /dev/null
>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base/0001-base
>> +++ textoverlay-make-memory-copy-when-video-buffer-s.patch
>> @@ -0,0 +1,80 @@
>> +From 0092d07195aa5d950bc10dfb05bd9547f67028a3 Mon Sep 17 00:00:00
>> +2001
>> +From: Mingke Wang <mingke.wang@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.
>> +
>> +Upstream-Status: Inappropriate [i.MX specific]
>> +
>> +Signed-off-by: Mingke Wang <mingke.wang@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 ff4d77b..3e72175 100644
>> ---
>> a/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappend
>> +++ b/recipes-multimedia/gstreamer/gstreamer1.0-plugins-base_%.bbappen
>> +++ d
>> @@ -1,7 +1,10 @@
>>    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-basetextoverlay-make-memory-copy-when-video-buffer-s.patch \ "
>> +SRC_URI_append_mx6 = "${IMX_PATCHES}"
>> +SRC_URI_append_mx7 = "${IMX_PATCHES}"
>>    
>>    PACKAGE_ARCH_mx6 = "${MACHINE_SOCARCH}"
>>    PACKAGE_ARCH_mx7 = "${MACHINE_SOCARCH}"
> --
> _______________________________________________
> meta-freescale mailing list
> meta-freescale@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/meta-freescale


[-- Attachment #2: Type: text/html, Size: 8969 bytes --]

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-01-20 13:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-18  9:33 [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Yuqing Zhu
2016-01-18  9:34 ` [meta-fsl-arm][PATCH 1/3] gstreamer1.0-plugins-base: Make memory copy when video buffer's memory is read only Yuqing Zhu
2016-01-18 14:15   ` Carlos Rafael Giani
     [not found]     ` <AM4PR04MB16351B03FE384E783CD1F740E9C20@AM4PR04MB1635.eurprd04.prod.outlook.com>
2016-01-20 13:30       ` Carlos Rafael Giani
2016-01-18  9:34 ` [meta-fsl-arm][PATCH 2/3] gstreamer1.0-plugins-base: Don't set async of custom text-sink to false Yuqing Zhu
2016-01-18 14:16   ` Carlos Rafael Giani
2016-01-18 14:21     ` Richard Röjfors
2016-01-18  9:34 ` [meta-fsl-arm][PATCH 3/3] gstreamer1.0-plugins-base: Fix IMXCameraApp image time cannot display issue Yuqing Zhu
2016-01-18 14:20   ` Carlos Rafael Giani
2016-01-18 12:17 ` [meta-fsl-arm][PATCH 0/3] Add patches for gstreamer1.0-plugins-base 1.6 Otavio Salvador

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.