All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gstreamer1.0-vaapi: Fix playback breaking bug
@ 2017-04-26  7:01 Jussi Kukkonen
  0 siblings, 0 replies; only message in thread
From: Jussi Kukkonen @ 2017-04-26  7:01 UTC (permalink / raw)
  To: openembedded-core

gstreamer-vaapi fails to play files with specific frame sizes
because of buffer allocation issues. Fix is a backport.

Fixes [YOCTO #11311].

Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
---
 ...ideobufferpool-create-allocator-if-needed.patch | 61 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-vaapi_1.10.4.bb         |  2 +
 2 files changed, 63 insertions(+)
 create mode 100644 meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch b/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch
new file mode 100644
index 0000000..f666adc
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer-vaapi/vaapivideobufferpool-create-allocator-if-needed.patch
@@ -0,0 +1,61 @@
+Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
+Upstream-Status: Backport [commit 59a731be6b in '1.10' branch]
+
+
+From 02a6002c3a80b3a5301c0943b1a1518bbdf439fc Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?=
+ <vjaquez@igalia.com>
+Date: Fri, 21 Apr 2017 19:07:18 +0200
+Subject: [PATCH] vaapivideobufferpool: create allocator if needed
+
+Backport to branch 1.10
+
+Sometimes a video decoder could set different buffer pool
+configurations, because their frame size changes. In this case we
+did not reconfigure the allocator.
+
+This patch enables this use case, creating a new allocator inside
+the VAAPI buffer pool if the caps changed, if it is not dmabuf-based.
+If so, it is just reconfigured, since it doesn't have a surface pool.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=781577
+---
+ gst/vaapi/gstvaapivideobufferpool.c | 21 +++++++++++++++++++++
+ 1 file changed, 21 insertions(+)
+
+diff --git a/gst/vaapi/gstvaapivideobufferpool.c b/gst/vaapi/gstvaapivideobufferpool.c
+index a3b9223f..9a50614b 100644
+--- a/gst/vaapi/gstvaapivideobufferpool.c
++++ b/gst/vaapi/gstvaapivideobufferpool.c
+@@ -159,6 +159,27 @@ gst_vaapi_video_buffer_pool_set_config (GstBufferPool * pool,
+     gst_object_replace ((GstObject **) & priv->allocator, NULL);
+   priv->video_info = new_vip;
+ 
++  {
++    guint surface_alloc_flags;
++    gboolean vinfo_changed = FALSE;
++
++    if (allocator) {
++      const GstVideoInfo *alloc_vinfo =
++          gst_allocator_get_vaapi_video_info (allocator, &surface_alloc_flags);
++      vinfo_changed = gst_video_info_changed (alloc_vinfo, &new_vip);
++    }
++
++    if (vinfo_changed && allocator && priv->use_dmabuf_memory) {
++      gst_allocator_set_vaapi_video_info (allocator, &new_vip,
++          surface_alloc_flags);
++    } else if (!priv->use_dmabuf_memory && (vinfo_changed || !allocator)) {
++      /* let's destroy the other allocator and create a new one */
++      allocator = gst_vaapi_video_allocator_new (priv->display, &new_vip,
++          surface_alloc_flags);
++      gst_buffer_pool_config_set_allocator (config, allocator, NULL);
++    }
++  }
++
+   if (!gst_buffer_pool_config_has_option (config,
+           GST_BUFFER_POOL_OPTION_VAAPI_VIDEO_META))
+     goto error_no_vaapi_video_meta_option;
+-- 
+2.11.0
+
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
index c4a884d..44c66de 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-vaapi_1.10.4.bb
@@ -2,4 +2,6 @@ require gstreamer1.0-vaapi.inc
 SRC_URI[md5sum] = "318af17f906637570b61dd7be9b5581d"
 SRC_URI[sha256sum] = "03e690621594d9f9495d86c7dac8b8590b3a150462770ed070dc76f66a70de75"
 
+SRC_URI += "file://vaapivideobufferpool-create-allocator-if-needed.patch"
+
 DEPENDS += "gstreamer1.0 gstreamer1.0-plugins-base gstreamer1.0-plugins-bad"
-- 
2.1.4



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-04-26  7:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-04-26  7:01 [PATCH] gstreamer1.0-vaapi: Fix playback breaking bug Jussi Kukkonen

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.