All of lore.kernel.org
 help / color / mirror / Atom feed
* [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
@ 2016-10-11 10:49 Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 1/4] gstreamer1.0-plugins-bad: Support video rotation by using transform matrix Yuqing Zhu
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Yuqing Zhu @ 2016-10-11 10:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Yuqing Zhu

-Support video rotation by using transform matrix

-Fix wrong attribute list type for EGL 1.5

-Fix horizontal/vertical flip matrizes

-Fix glimagesink cannot show frame when connect to qmlglsrc

Yuqing Zhu (4):
  gstreamer1.0-plugins-bad: Support video rotation by using transform
    matrix
  gstreamer1.0-plugins-bad: Fix wrong attribute list type for EGL 1.5
  gstreamer1.0-plugins-bad: Fix horizontal/vertical flip matrizes
  gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when
    connect to qmlglsrc

 ...-glplugin-glimagesink-support-video-rotat.patch | 574 +++++++++++++++++++++
 ...Buf-Wrong-attribute-list-type-for-EGL-1.5.patch | 194 +++++++
 ...ink-Fix-horizontal-vertical-flip-matrizes.patch |  44 ++
 ...x-glimagesink-cannot-show-frame-when-conn.patch |  71 +++
 .../gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb    |   4 +
 5 files changed, 887 insertions(+)
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-glplugin-glimagesink-support-video-rotat.patch
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch

-- 
1.9.1



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

* [poky][PATCH 1/4] gstreamer1.0-plugins-bad: Support video rotation by using transform matrix
  2016-10-11 10:49 [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Yuqing Zhu
@ 2016-10-11 10:49 ` Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 2/4] gstreamer1.0-plugins-bad: Fix wrong attribute list type for EGL 1.5 Yuqing Zhu
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Yuqing Zhu @ 2016-10-11 10:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Yuqing Zhu

Add "rotate-method" to glimagesink and apply transform matrix
to vertex coordinate to control rotation.

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 ...-glplugin-glimagesink-support-video-rotat.patch | 574 +++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb    |   1 +
 2 files changed, 575 insertions(+)
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-glplugin-glimagesink-support-video-rotat.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-glplugin-glimagesink-support-video-rotat.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-glplugin-glimagesink-support-video-rotat.patch
new file mode 100755
index 0000000..b00782c
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0010-glplugin-glimagesink-support-video-rotat.patch
@@ -0,0 +1,574 @@
+From 31c18b0796b433c5a3cfda90960dd394b16f8f1e Mon Sep 17 00:00:00 2001
+From: Haihua Hu <jared.hu@nxp.com>
+Date: Mon, 9 May 2016 20:26:51 +0800
+Subject: [PATCH] [MMFMWK-7151] [glplugin] glimagesink: support video rotation
+ using transform matrix
+
+Add "rotate-method" to glimagesink and apply transform matrix
+to vertex coordinate to control rotation.
+
+Upstream-Status: Backport[1.9.1]
+
+https://bugzilla.gnome.org/show_bug.cgi?id=765795
+
+Signed-off-by: Haihua Hu <jared.hu@nxp.com>
+---
+ ext/gl/gstglimagesink.c              | 266 ++++++++++++++++++++++++++++++++---
+ ext/gl/gstglimagesink.h              |  18 +++
+ gst-libs/gst/gl/gstglshaderstrings.c |  11 ++
+ gst-libs/gst/gl/gstglshaderstrings.h |   1 +
+ gst-libs/gst/gl/gstglutils.c         |  60 ++++++++
+ gst-libs/gst/gl/gstglutils.h         |   5 +
+ 6 files changed, 344 insertions(+), 17 deletions(-)
+
+diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
+index 185577f..fb60468 100644
+--- a/ext/gl/gstglimagesink.c
++++ b/ext/gl/gstglimagesink.c
+@@ -120,6 +120,7 @@ G_DEFINE_TYPE (GstGLImageSinkBin, gst_gl_image_sink_bin, GST_TYPE_GL_SINK_BIN);
+ enum
+ {
+   PROP_BIN_0,
++  PROP_BIN_ROTATE_METHOD,
+   PROP_BIN_FORCE_ASPECT_RATIO,
+   PROP_BIN_PIXEL_ASPECT_RATIO,
+   PROP_BIN_HANDLE_EVENTS,
+@@ -181,6 +182,39 @@ _on_client_draw (GstGLImageSink * sink, GstGLContext * context,
+   return ret;
+ }
+ 
++#define DEFAULT_ROTATE_METHOD GST_GL_ROTATE_METHOD_IDENTITY
++
++#define GST_TYPE_GL_ROTATE_METHOD (gst_gl_rotate_method_get_type())
++
++static const GEnumValue rotate_methods[] = {
++  {GST_GL_ROTATE_METHOD_IDENTITY, "Identity (no rotation)", "none"},
++  {GST_GL_ROTATE_METHOD_90R, "Rotate clockwise 90 degrees", "clockwise"},
++  {GST_GL_ROTATE_METHOD_180, "Rotate 180 degrees", "rotate-180"},
++  {GST_GL_ROTATE_METHOD_90L, "Rotate counter-clockwise 90 degrees",
++      "counterclockwise"},
++  {GST_GL_ROTATE_METHOD_FLIP_HORIZ, "Flip horizontally", "horizontal-flip"},
++  {GST_GL_ROTATE_METHOD_FLIP_VERT, "Flip vertically", "vertical-flip"},
++  {GST_GL_ROTATE_METHOD_FLIP_UL_LR,
++      "Flip across upper left/lower right diagonal", "upper-left-diagonal"},
++  {GST_GL_ROTATE_METHOD_FLIP_UR_LL,
++      "Flip across upper right/lower left diagonal", "upper-right-diagonal"},
++  {GST_GL_ROTATE_METHOD_AUTO,
++      "Select rotate method based on image-orientation tag", "automatic"},
++  {0, NULL, NULL},
++};
++
++static GType
++gst_gl_rotate_method_get_type (void)
++{
++  static GType rotate_method_type = 0;
++
++  if (!rotate_method_type) {
++    rotate_method_type = g_enum_register_static ("GstGLRotateMethod",
++        rotate_methods);
++  }
++  return rotate_method_type;
++}
++
+ static void
+ gst_gl_image_sink_bin_init (GstGLImageSinkBin * self)
+ {
+@@ -203,6 +237,12 @@ gst_gl_image_sink_bin_class_init (GstGLImageSinkBinClass * klass)
+   gobject_class->set_property = gst_gl_image_sink_bin_set_property;
+ 
+   /* gl sink */
++  g_object_class_install_property (gobject_class, PROP_BIN_ROTATE_METHOD,
++      g_param_spec_enum ("rotate-method",
++          "rotate method",
++          "rotate method",
++          GST_TYPE_GL_ROTATE_METHOD, DEFAULT_ROTATE_METHOD,
++          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+   g_object_class_install_property (gobject_class, PROP_BIN_FORCE_ASPECT_RATIO,
+       g_param_spec_boolean ("force-aspect-ratio",
+           "Force aspect ratio",
+@@ -291,6 +331,7 @@ static void gst_glimage_sink_set_property (GObject * object, guint prop_id,
+ static void gst_glimage_sink_get_property (GObject * object, guint prop_id,
+     GValue * value, GParamSpec * param_spec);
+ 
++static gboolean gst_glimage_sink_event (GstBaseSink *sink, GstEvent * event);
+ static gboolean gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query);
+ static void gst_glimage_sink_set_context (GstElement * element,
+     GstContext * context);
+@@ -347,6 +388,7 @@ enum
+ {
+   ARG_0,
+   ARG_DISPLAY,
++  PROP_ROTATE_METHOD,
+   PROP_FORCE_ASPECT_RATIO,
+   PROP_PIXEL_ASPECT_RATIO,
+   PROP_CONTEXT,
+@@ -404,6 +446,128 @@ _display_size_to_stream_size (GstGLImageSink * gl_sink, gdouble x,
+   GST_TRACE ("transform %fx%f into %fx%f", x, y, *stream_x, *stream_y);
+ }
+ 
++/* rotate 90 */
++static const gfloat clockwise_matrix[] = {
++   0.0f, -1.0f,  0.0,  0.0f,
++   1.0f,  0.0f,  0.0,  0.0f,
++   0.0f,  0.0f,  1.0,  0.0f,
++   0.0f,  0.0f,  0.0,  1.0f,
++};
++
++/* rotate 180 */
++static const gfloat clockwise_180_matrix[] = {
++  -1.0f,  0.0f,  0.0,  0.0f,
++   0.0f, -1.0f,	 0.0,  0.0f,
++   0.0f,  0.0f,  1.0,  0.0f,
++   0.0f,  0.0f,  0.0,  1.0f,
++};
++
++/* rotate 270 */
++static const gfloat counterclockwise_matrix[] = {
++   0.0f,  1.0f,  0.0,  0.0f,
++  -1.0f,  0.0f,  0.0,  0.0f,
++   0.0f,  0.0f,  1.0,  0.0f,
++   0.0f,  0.0f,  0.0,  1.0f,
++};
++
++/* horizontal-flip */
++static const gfloat horizontal_flip_matrix[] = {
++  1.0f, 0.0f, 0.0f, 0.0f,
++  0.0f, -1.0f, 0.0f, 0.0f,
++  0.0f, 0.0f, 1.0f, 0.0f,
++  0.0f, 0.0f, 0.0f, 1.0f,
++};
++
++/* vertical-flip */
++static const gfloat vertical_flip_matrix[] = {
++  -1.0f, 0.0f, 0.0f, 0.0f,
++  0.0f, 1.0f, 0.0f, 0.0f,
++  0.0f, 0.0f, 1.0f, 0.0f,
++  0.0f, 0.0f, 0.0f, 1.0f,
++};
++
++/* upper-left-diagonal */
++static const gfloat upper_left_matrix[] = {
++  0.0f, 1.0f, 0.0f, 0.0f,
++  1.0f, 0.0f, 0.0f, 0.0f,
++  0.0f, 0.0f, 1.0f, 0.0f,
++  0.0f, 0.0f, 0.0f, 1.0f,
++};
++
++/* upper-right-diagonal */
++static const gfloat upper_right_matrix[] = {
++  0.0f, -1.0f, 0.0f, 0.0f,
++  -1.0f, 0.0f, 0.0f, 0.0f,
++  0.0f, 0.0f, 1.0f, 0.0f,
++  0.0f, 0.0f, 0.0f, 1.0f,
++};
++
++static void
++gst_glimage_sink_set_rotate_method(GstGLImageSink *gl_sink,
++    GstGLRotateMethod method, gboolean from_tag)
++{
++  GstGLRotateMethod tag_method;
++  GST_GLIMAGE_SINK_LOCK (gl_sink);
++  if (from_tag)
++    tag_method = method;
++  else
++    gl_sink->rotate_method = method;
++
++  if (gl_sink->rotate_method == GST_GL_ROTATE_METHOD_AUTO)
++    method = tag_method;
++  else
++    method = gl_sink->rotate_method;
++
++  if (method != gl_sink->current_rotate_method)
++  {
++    GST_DEBUG_OBJECT (gl_sink, "Changing method from %s to %s",
++      rotate_methods[gl_sink->current_rotate_method].value_nick,
++      rotate_methods[method].value_nick);
++
++    switch (method)
++    {
++      case GST_GL_ROTATE_METHOD_IDENTITY:
++        gl_sink->transform_matrix = NULL;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_90R:
++        gl_sink->transform_matrix = clockwise_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_180:
++        gl_sink->transform_matrix = clockwise_180_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_90L:
++        gl_sink->transform_matrix = counterclockwise_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_FLIP_HORIZ:
++        gl_sink->transform_matrix = horizontal_flip_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_FLIP_VERT:
++        gl_sink->transform_matrix = vertical_flip_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_FLIP_UL_LR:
++        gl_sink->transform_matrix = upper_left_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      case GST_GL_ROTATE_METHOD_FLIP_UR_LL:
++        gl_sink->transform_matrix = upper_right_matrix;
++        gl_sink->output_mode_changed = TRUE;
++        break;
++      default:
++	g_assert_not_reached();
++        break;
++    }
++
++    gl_sink->current_rotate_method = method;
++  }
++  GST_GLIMAGE_SINK_UNLOCK (gl_sink);
++}
++
+ static void
+ gst_glimage_sink_navigation_send_event (GstNavigation * navigation, GstStructure
+     * structure)
+@@ -485,6 +649,13 @@ gst_glimage_sink_class_init (GstGLImageSinkClass * klass)
+   gobject_class->set_property = gst_glimage_sink_set_property;
+   gobject_class->get_property = gst_glimage_sink_get_property;
+ 
++  g_object_class_install_property (gobject_class, PROP_ROTATE_METHOD,
++      g_param_spec_enum ("rotate-method",
++          "rotate method",
++          "rotate method",
++          GST_TYPE_GL_ROTATE_METHOD, DEFAULT_ROTATE_METHOD,
++          G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
++
+   g_object_class_install_property (gobject_class, PROP_FORCE_ASPECT_RATIO,
+       g_param_spec_boolean ("force-aspect-ratio", "Force aspect ratio",
+           "When enabled, scaling will respect original aspect ratio",
+@@ -577,6 +748,7 @@ gst_glimage_sink_class_init (GstGLImageSinkClass * klass)
+ 
+   gstelement_class->change_state = gst_glimage_sink_change_state;
+   gstelement_class->set_context = gst_glimage_sink_set_context;
++  gstbasesink_class->event = gst_glimage_sink_event;
+   gstbasesink_class->query = GST_DEBUG_FUNCPTR (gst_glimage_sink_query);
+   gstbasesink_class->set_caps = gst_glimage_sink_set_caps;
+   gstbasesink_class->get_caps = gst_glimage_sink_get_caps;
+@@ -610,6 +782,9 @@ gst_glimage_sink_init (GstGLImageSink * glimage_sink)
+   glimage_sink->mview_output_flags = DEFAULT_MULTIVIEW_FLAGS;
+   glimage_sink->mview_downmix_mode = DEFAULT_MULTIVIEW_DOWNMIX;
+ 
++  glimage_sink->current_rotate_method = DEFAULT_ROTATE_METHOD;
++  glimage_sink->transform_matrix = NULL; 
++
+   g_mutex_init (&glimage_sink->drawing_lock);
+ }
+ 
+@@ -624,6 +799,9 @@ gst_glimage_sink_set_property (GObject * object, guint prop_id,
+   glimage_sink = GST_GLIMAGE_SINK (object);
+ 
+   switch (prop_id) {
++    case PROP_ROTATE_METHOD:
++      gst_glimage_sink_set_rotate_method (glimage_sink, g_value_get_enum (value), FALSE);
++      break;
+     case PROP_FORCE_ASPECT_RATIO:
+     {
+       glimage_sink->keep_aspect_ratio = g_value_get_boolean (value);
+@@ -691,6 +869,9 @@ gst_glimage_sink_get_property (GObject * object, guint prop_id,
+   glimage_sink = GST_GLIMAGE_SINK (object);
+ 
+   switch (prop_id) {
++    case PROP_ROTATE_METHOD:
++      g_value_set_enum (value, glimage_sink->current_rotate_method);
++      break;
+     case PROP_FORCE_ASPECT_RATIO:
+       g_value_set_boolean (value, glimage_sink->keep_aspect_ratio);
+       break;
+@@ -848,6 +1029,50 @@ context_error:
+ }
+ 
+ static gboolean
++gst_glimage_sink_event (GstBaseSink *sink, GstEvent * event)
++{
++  GstGLImageSink *gl_sink =  GST_GLIMAGE_SINK (sink);
++  GstTagList *taglist;
++  gchar *orientation;
++  gboolean ret;
++
++  GST_DEBUG_OBJECT (gl_sink, "handling %s event", GST_EVENT_TYPE_NAME (event));
++
++  switch (GST_EVENT_TYPE (event)) {
++    case GST_EVENT_TAG:
++      gst_event_parse_tag (event, &taglist);
++
++      if (gst_tag_list_get_string (taglist, "image-orientation", &orientation)) {
++        if (!g_strcmp0 ("rotate-0", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_IDENTITY, TRUE);
++        else if (!g_strcmp0 ("rotate-90", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_90R, TRUE);
++        else if (!g_strcmp0 ("rotate-180", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_180, TRUE);
++        else if (!g_strcmp0 ("rotate-270", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_90L, TRUE);
++        else if (!g_strcmp0 ("flip-rotate-0", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_HORIZ, TRUE);
++        else if (!g_strcmp0 ("flip-rotate-90", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_UR_LL, TRUE);
++        else if (!g_strcmp0 ("flip-rotate-180", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_VERT, TRUE);
++        else if (!g_strcmp0 ("flip-rotate-270", orientation))
++          gst_glimage_sink_set_rotate_method (gl_sink, GST_GL_ROTATE_METHOD_FLIP_UL_LR, TRUE);
++
++        g_free (orientation);
++      }
++      break;
++    default:
++      break;
++  }
++
++  ret = GST_BASE_SINK_CLASS (parent_class)->event (sink, event);
++
++  return ret;
++}
++
++static gboolean
+ gst_glimage_sink_query (GstBaseSink * bsink, GstQuery * query)
+ {
+   GstGLImageSink *glimage_sink = GST_GLIMAGE_SINK (bsink);
+@@ -1817,7 +2042,10 @@ gst_glimage_sink_thread_init_redisplay (GstGLImageSink * gl_sink)
+         GST_GLSL_PROFILE_ES | GST_GLSL_PROFILE_COMPATIBILITY,
+         gst_gl_shader_string_fragment_external_oes_default);
+   } else {
+-    vert_stage = gst_glsl_stage_new_default_vertex (gl_sink->context);
++    vert_stage = gst_glsl_stage_new_with_string (gl_sink->context,
++        GL_VERTEX_SHADER, GST_GLSL_VERSION_NONE,
++        GST_GLSL_PROFILE_ES | GST_GLSL_PROFILE_COMPATIBILITY,
++        gst_gl_shader_string_vertex_mat4_vertex_transform);
+     frag_stage = gst_glsl_stage_new_default_fragment (gl_sink->context);
+   }
+   if (!vert_stage || !frag_stage) {
+@@ -1943,8 +2171,16 @@ gst_glimage_sink_on_resize (GstGLImageSink * gl_sink, gint width, gint height)
+ 
+       src.x = 0;
+       src.y = 0;
+-      src.w = GST_VIDEO_SINK_WIDTH (gl_sink);
+-      src.h = GST_VIDEO_SINK_HEIGHT (gl_sink);
++      if (gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_90R
++          || gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_90L
++          || gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_FLIP_UL_LR
++          || gl_sink->current_rotate_method == GST_GL_ROTATE_METHOD_FLIP_UR_LL) {
++        src.h = GST_VIDEO_SINK_WIDTH (gl_sink);
++        src.w = GST_VIDEO_SINK_HEIGHT (gl_sink);
++      } else {
++        src.w = GST_VIDEO_SINK_WIDTH (gl_sink);
++        src.h = GST_VIDEO_SINK_HEIGHT (gl_sink);
++      }
+ 
+       dst.x = 0;
+       dst.y = 0;
+@@ -1974,13 +2210,6 @@ gst_glimage_sink_on_resize (GstGLImageSink * gl_sink, gint width, gint height)
+   GST_GLIMAGE_SINK_UNLOCK (gl_sink);
+ }
+ 
+-static const gfloat identity_matrix[] = {
+-  1.0f, 0.0f, 0.0, 0.0f,
+-  0.0f, 1.0f, 0.0, 0.0f,
+-  0.0f, 0.0f, 1.0, 0.0f,
+-  0.0f, 0.0f, 0.0, 1.0f,
+-};
+-
+ static void
+ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
+ {
+@@ -2109,18 +2338,21 @@ gst_glimage_sink_on_draw (GstGLImageSink * gl_sink)
+     gl->ActiveTexture (GL_TEXTURE0);
+     gl->BindTexture (gl_target, gl_sink->redisplay_texture);
+     gst_gl_shader_set_uniform_1i (gl_sink->redisplay_shader, "tex", 0);
+-    if (gl_sink->texture_target == GST_GL_TEXTURE_TARGET_EXTERNAL_OES) {
++    {
+       GstVideoAffineTransformationMeta *af_meta;
++      gfloat matrix[16];
+ 
+       af_meta =
+           gst_buffer_get_video_affine_transformation_meta
+           (gl_sink->stored_buffer[0]);
+-      if (af_meta)
+-        gst_gl_shader_set_uniform_matrix_4fv (gl_sink->redisplay_shader,
+-            "u_transformation", 1, FALSE, af_meta->matrix);
+-      else
+-        gst_gl_shader_set_uniform_matrix_4fv (gl_sink->redisplay_shader,
+-            "u_transformation", 1, FALSE, identity_matrix);
++
++      gst_gl_get_affine_transformation_meta_as_ndc (af_meta, matrix);
++
++      if (gl_sink->transform_matrix)
++        gst_gl_multiply_matrix4 (gl_sink->transform_matrix, matrix, matrix);
++
++      gst_gl_shader_set_uniform_matrix_4fv (gl_sink->redisplay_shader,
++          "u_transformation", 1, FALSE, matrix);
+     }
+ 
+     gl->DrawElements (GL_TRIANGLES, 6, GL_UNSIGNED_SHORT, 0);
+diff --git a/ext/gl/gstglimagesink.h b/ext/gl/gstglimagesink.h
+index f9a052a..cb0f4a6 100644
+--- a/ext/gl/gstglimagesink.h
++++ b/ext/gl/gstglimagesink.h
+@@ -44,6 +44,19 @@ GST_DEBUG_CATEGORY_EXTERN (gst_debug_glimage_sink);
+ #define GST_IS_GLIMAGE_SINK_CLASS(klass) \
+     (G_TYPE_CHECK_CLASS_TYPE((klass),GST_TYPE_GLIMAGE_SINK))
+ 
++typedef enum
++{
++  GST_GL_ROTATE_METHOD_IDENTITY,
++  GST_GL_ROTATE_METHOD_90R,
++  GST_GL_ROTATE_METHOD_180,
++  GST_GL_ROTATE_METHOD_90L,
++  GST_GL_ROTATE_METHOD_FLIP_HORIZ,
++  GST_GL_ROTATE_METHOD_FLIP_VERT,
++  GST_GL_ROTATE_METHOD_FLIP_UL_LR,
++  GST_GL_ROTATE_METHOD_FLIP_UR_LL,
++  GST_GL_ROTATE_METHOD_AUTO
++}GstGLRotateMethod;
++
+ typedef struct _GstGLImageSink GstGLImageSink;
+ typedef struct _GstGLImageSinkClass GstGLImageSinkClass;
+ 
+@@ -102,6 +115,11 @@ struct _GstGLImageSink
+     GstGLSyncMeta *stored_sync_meta;
+     GLuint redisplay_texture;
+ 
++    /* current video flip method */
++    GstGLRotateMethod current_rotate_method;
++    GstGLRotateMethod rotate_method;
++    const gfloat *transform_matrix;
++
+     /* protected with drawing_lock */
+     gboolean window_resized;
+     guint window_width;
+diff --git a/gst-libs/gst/gl/gstglshaderstrings.c b/gst-libs/gst/gl/gstglshaderstrings.c
+index 729be6f..10186f1 100644
+--- a/gst-libs/gst/gl/gstglshaderstrings.c
++++ b/gst-libs/gst/gl/gstglshaderstrings.c
+@@ -35,6 +35,17 @@ const gchar *gst_gl_shader_string_vertex_default =
+     "   v_texcoord = a_texcoord;\n"
+     "}\n";
+ 
++const gchar *gst_gl_shader_string_vertex_mat4_vertex_transform =
++    "uniform mat4 u_transformation;\n"
++    "attribute vec4 a_position;\n"
++    "attribute vec2 a_texcoord;\n"
++    "varying vec2 v_texcoord;\n"
++    "void main()\n"
++    "{\n"
++    "   gl_Position = u_transformation * a_position;\n"
++    "   v_texcoord = a_texcoord;\n"
++    "}\n";
++
+ const gchar *gst_gl_shader_string_vertex_mat4_texture_transform =
+     "uniform mat4 u_transformation;\n"
+     "attribute vec4 a_position;\n"
+diff --git a/gst-libs/gst/gl/gstglshaderstrings.h b/gst-libs/gst/gl/gstglshaderstrings.h
+index 49ea8de..f9a13c8 100644
+--- a/gst-libs/gst/gl/gstglshaderstrings.h
++++ b/gst-libs/gst/gl/gstglshaderstrings.h
+@@ -28,6 +28,7 @@ G_BEGIN_DECLS
+ extern const gchar *gst_gl_shader_string_vertex_default;
+ extern const gchar *gst_gl_shader_string_fragment_default;
+ 
++extern const gchar *gst_gl_shader_string_vertex_mat4_vertex_transform;
+ extern const gchar *gst_gl_shader_string_vertex_mat4_texture_transform;
+ extern const gchar *gst_gl_shader_string_fragment_external_oes_default;
+ 
+diff --git a/gst-libs/gst/gl/gstglutils.c b/gst-libs/gst/gl/gstglutils.c
+index e2e04e4..a38772f 100644
+--- a/gst-libs/gst/gl/gstglutils.c
++++ b/gst-libs/gst/gl/gstglutils.c
+@@ -1067,3 +1067,63 @@ gst_gl_value_set_texture_target_from_mask (GValue * value,
+     return ret;
+   }
+ }
++
++static const gfloat identity_matrix[] = {
++  1.0f, 0.0f, 0.0, 0.0f,
++  0.0f, 1.0f, 0.0, 0.0f,
++  0.0f, 0.0f, 1.0, 0.0f,
++  0.0f, 0.0f, 0.0, 1.0f,
++};
++
++static const gfloat from_ndc_matrix[] = {
++  0.5f, 0.0f, 0.0, 0.5f,
++  0.0f, 0.5f, 0.0, 0.5f,
++  0.0f, 0.0f, 0.5, 0.5f,
++  0.0f, 0.0f, 0.0, 1.0f,
++};
++
++static const gfloat to_ndc_matrix[] = {
++  2.0f, 0.0f, 0.0, -1.0f,
++  0.0f, 2.0f, 0.0, -1.0f,
++  0.0f, 0.0f, 2.0, -1.0f,
++  0.0f, 0.0f, 0.0, 1.0f,
++};
++
++void
++gst_gl_multiply_matrix4 (const gfloat * a, const gfloat * b, gfloat * result)
++{
++  int i, j, k;
++  gfloat tmp[16] = { 0.0f };
++
++  if (!a || !b || !result)
++    return;
++
++  for (i = 0; i < 4; i++) {
++    for (j = 0; j < 4; j++) {
++      for (k = 0; k < 4; k++) {
++        tmp[i + (j * 4)] += a[i + (k * 4)] * b[k + (j * 4)];
++      }
++    }
++  }
++
++  for (i = 0; i < 16; i++)
++    result[i] = tmp[i];
++}
++
++void
++gst_gl_get_affine_transformation_meta_as_ndc (GstVideoAffineTransformationMeta *
++    meta, gfloat * matrix)
++{
++  if (!meta) {
++    int i;
++
++    for (i = 0; i < 16; i++) {
++      matrix[i] = identity_matrix[i];
++    }
++  } else {
++    gfloat tmp[16] = { 0.0f };
++
++    gst_gl_multiply_matrix4 (from_ndc_matrix, meta->matrix, tmp);
++    gst_gl_multiply_matrix4 (tmp, to_ndc_matrix, matrix);
++  }
++}
+diff --git a/gst-libs/gst/gl/gstglutils.h b/gst-libs/gst/gl/gstglutils.h
+index 1c5ab12..fc12801 100644
+--- a/gst-libs/gst/gl/gstglutils.h
++++ b/gst-libs/gst/gl/gstglutils.h
+@@ -24,6 +24,7 @@
+ #include <gst/video/video.h>
+ 
+ #include <gst/gl/gstgl_fwd.h>
++#include <gst/video/gstvideoaffinetransformationmeta.h>
+ 
+ G_BEGIN_DECLS
+ 
+@@ -116,6 +117,10 @@ gboolean gst_gl_value_set_texture_target_from_mask (GValue * value,
+ gboolean gst_gl_value_set_texture_target (GValue * value, GstGLTextureTarget target);
+ GstGLTextureTarget gst_gl_value_get_texture_target_mask (const GValue * value);
+ 
++void gst_gl_multiply_matrix4 (const gfloat * a, const gfloat * b, gfloat * result);
++void gst_gl_get_affine_transformation_meta_as_ndc (GstVideoAffineTransformationMeta *
++    meta, gfloat * matrix);
++
+ G_END_DECLS
+ 
+ #endif /* __GST_GL_UTILS_H__ */
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
index 108f4db..358c5d1 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
@@ -19,6 +19,7 @@ SRC_URI = " \
     file://0006-glcolorconvert-GLES3-deprecates-texture2D-and-it-doe.patch \
     file://0008-gl-implement-GstGLMemoryEGL.patch \
     file://0009-glimagesink-Downrank-to-marginal.patch \
+    file://0010-glplugin-glimagesink-support-video-rotat.patch \
 "
 SRC_URI[md5sum] = "955281a43e98c5464563fa049e0a0911"
 SRC_URI[sha256sum] = "7899fcb18e6a1af2888b19c90213af018a57d741c6e72ec56b133bc73ec8509b"
-- 
1.9.1



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

* [poky][PATCH 2/4] gstreamer1.0-plugins-bad: Fix wrong attribute list type for EGL 1.5
  2016-10-11 10:49 [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 1/4] gstreamer1.0-plugins-bad: Support video rotation by using transform matrix Yuqing Zhu
@ 2016-10-11 10:49 ` Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 3/4] gstreamer1.0-plugins-bad: Fix horizontal/vertical flip matrizes Yuqing Zhu
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 13+ messages in thread
From: Yuqing Zhu @ 2016-10-11 10:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Yuqing Zhu

For EGL 1.5 spec, the attribute list type should be EGLAttrib.

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 ...Buf-Wrong-attribute-list-type-for-EGL-1.5.patch | 194 +++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb    |   1 +
 2 files changed, 195 insertions(+)
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch
new file mode 100755
index 0000000..8e97cc0
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch
@@ -0,0 +1,194 @@
+From b390dc7aee52f87a0841740092bca19d6e48881f Mon Sep 17 00:00:00 2001
+From: Song Bing <bing.song@nxp.com>
+Date: Wed, 13 Jul 2016 17:15:44 +0800
+Subject: [PATCH] EGL_DMA_Buf: Wrong attribute list type for EGL 1.5
+
+For EGL 1.5 spec, the attribute list type should be EGLAttrib.
+
+Upstream-Status: Backport [1.9.2]
+https://bugzilla.gnome.org/show_bug.cgi?id=768602
+---
+ gst-libs/gst/gl/egl/gsteglimagememory.c |   78 ++++++++++++++++++++-----------
+ gst-libs/gst/gl/egl/gstglcontext_egl.c  |   20 ++++----
+ gst-libs/gst/gl/egl/gstglcontext_egl.h  |    3 ++
+ 3 files changed, 66 insertions(+), 35 deletions(-)
+
+diff --git a/gst-libs/gst/gl/egl/gsteglimagememory.c b/gst-libs/gst/gl/egl/gsteglimagememory.c
+index 46098b5..6c5ae47 100644
+--- a/gst-libs/gst/gl/egl/gsteglimagememory.c
++++ b/gst-libs/gst/gl/egl/gsteglimagememory.c
+@@ -432,6 +432,9 @@ gst_egl_image_memory_from_dmabuf (GstGLContext * context,
+   gint fourcc;
+   gint atti = 0;
+   EGLint attribs[13];
++#ifdef EGL_VERSION_1_5
++  EGLAttrib attribs_1_5[13];
++#endif
+   EGLImageKHR img = EGL_NO_IMAGE_KHR;
+ 
+   allocator = gst_egl_image_allocator_obtain ();
+@@ -442,32 +445,55 @@ gst_egl_image_memory_from_dmabuf (GstGLContext * context,
+       GST_VIDEO_INFO_COMP_WIDTH (in_info, plane),
+       GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane));
+ 
+-  attribs[atti++] = EGL_WIDTH;
+-  attribs[atti++] = GST_VIDEO_INFO_COMP_WIDTH (in_info, plane);
+-  attribs[atti++] = EGL_HEIGHT;
+-  attribs[atti++] = GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane);
+-
+-  attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
+-  attribs[atti++] = fourcc;
+-
+-  attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
+-  attribs[atti++] = dmabuf;
+-
+-  attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
+-  attribs[atti++] = offset;
+-  attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
+-  attribs[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane);
+-
+-  attribs[atti] = EGL_NONE;
+-
+-  for (int i = 0; i < atti; i++)
+-    GST_LOG ("attr %i: %08X", i, attribs[i]);
+-
+-  g_assert (atti == 12);
+-
+-  img = ctx_egl->eglCreateImage (ctx_egl->egl_display, EGL_NO_CONTEXT,
+-      EGL_LINUX_DMA_BUF_EXT, NULL, attribs);
+-
++#ifdef EGL_VERSION_1_5
++  if (GST_GL_CHECK_GL_VERSION (ctx_egl->egl_major, ctx_egl->egl_minor, 1, 5)) {
++    attribs_1_5[atti++] = EGL_WIDTH;
++    attribs_1_5[atti++] = GST_VIDEO_INFO_COMP_WIDTH (in_info, plane);
++    attribs_1_5[atti++] = EGL_HEIGHT;
++    attribs_1_5[atti++] = GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane);
++    attribs_1_5[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
++    attribs_1_5[atti++] = fourcc;
++    attribs_1_5[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
++    attribs_1_5[atti++] = dmabuf;
++    attribs_1_5[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
++    attribs_1_5[atti++] = offset;
++    attribs_1_5[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
++    attribs_1_5[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane);
++    attribs_1_5[atti] = EGL_NONE;
++
++    for (int i = 0; i < atti; i++)
++      GST_LOG ("attr %i: %" G_GINTPTR_FORMAT, i, attribs_1_5[i]);
++
++    g_assert (atti == 12);
++
++    img = ctx_egl->eglCreateImage (ctx_egl->egl_display, EGL_NO_CONTEXT,
++        EGL_LINUX_DMA_BUF_EXT, NULL, attribs_1_5);
++
++  } else
++#endif
++  {
++    attribs[atti++] = EGL_WIDTH;
++    attribs[atti++] = GST_VIDEO_INFO_COMP_WIDTH (in_info, plane);
++    attribs[atti++] = EGL_HEIGHT;
++    attribs[atti++] = GST_VIDEO_INFO_COMP_HEIGHT (in_info, plane);
++    attribs[atti++] = EGL_LINUX_DRM_FOURCC_EXT;
++    attribs[atti++] = fourcc;
++    attribs[atti++] = EGL_DMA_BUF_PLANE0_FD_EXT;
++    attribs[atti++] = dmabuf;
++    attribs[atti++] = EGL_DMA_BUF_PLANE0_OFFSET_EXT;
++    attribs[atti++] = offset;
++    attribs[atti++] = EGL_DMA_BUF_PLANE0_PITCH_EXT;
++    attribs[atti++] = GST_VIDEO_INFO_PLANE_STRIDE (in_info, plane);
++    attribs[atti] = EGL_NONE;
++
++    for (int i = 0; i < atti; i++)
++      GST_LOG ("attr %i: %08X", i, attribs[i]);
++
++    g_assert (atti == 12);
++
++    img = ctx_egl->eglCreateImage (ctx_egl->egl_display, EGL_NO_CONTEXT,
++        EGL_LINUX_DMA_BUF_EXT, NULL, attribs);
++  }
+   if (!img) {
+     GST_WARNING_OBJECT (allocator, "eglCreateImage failed: %s",
+         gst_gl_context_egl_get_error_string (eglGetError ()));
+diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.c b/gst-libs/gst/gl/egl/gstglcontext_egl.c
+index ceafdf3..df6ba3f 100644
+--- a/gst-libs/gst/gl/egl/gstglcontext_egl.c
++++ b/gst-libs/gst/gl/egl/gstglcontext_egl.c
+@@ -309,8 +309,8 @@ gst_gl_context_egl_create_context (GstGLContext * context,
+   GstGLContextEGL *egl;
+   GstGLWindow *window = NULL;
+   EGLNativeWindowType window_handle = (EGLNativeWindowType) 0;
+-  EGLint majorVersion;
+-  EGLint minorVersion;
++  EGLint egl_major;
++  EGLint egl_minor;
+   gboolean need_surface = TRUE;
+   guintptr external_gl_context = 0;
+   GstGLDisplay *display;
+@@ -363,8 +363,8 @@ gst_gl_context_egl_create_context (GstGLContext * context,
+   }
+   gst_object_unref (display);
+ 
+-  if (eglInitialize (egl->egl_display, &majorVersion, &minorVersion)) {
+-    GST_INFO ("egl initialized, version: %d.%d", majorVersion, minorVersion);
++  if (eglInitialize (egl->egl_display, &egl_major, &egl_minor)) {
++    GST_INFO ("egl initialized, version: %d.%d", egl_major, egl_minor);
+   } else {
+     g_set_error (error, GST_GL_CONTEXT_ERROR,
+         GST_GL_CONTEXT_ERROR_RESOURCE_UNAVAILABLE,
+@@ -380,16 +380,16 @@ gst_gl_context_egl_create_context (GstGLContext * context,
+     gint i;
+ 
+     /* egl + opengl only available with EGL 1.4+ */
+-    if (majorVersion == 1 && minorVersion <= 3) {
++    if (egl_major == 1 && egl_minor <= 3) {
+       if ((gl_api & ~GST_GL_API_OPENGL) == GST_GL_API_NONE) {
+         g_set_error (error, GST_GL_CONTEXT_ERROR, GST_GL_CONTEXT_ERROR_OLD_LIBS,
+             "EGL version (%i.%i) too old for OpenGL support, (needed at least 1.4)",
+-            majorVersion, minorVersion);
++            egl_major, egl_minor);
+         goto failure;
+       } else {
+         GST_WARNING
+             ("EGL version (%i.%i) too old for OpenGL support, (needed at least 1.4)",
+-            majorVersion, minorVersion);
++            egl_major, egl_minor);
+         if (gl_api & GST_GL_API_GLES2) {
+           goto try_gles2;
+         } else {
+@@ -599,7 +599,7 @@ gst_gl_context_egl_create_context (GstGLContext * context,
+   }
+ 
+   /* EGLImage functions */
+-  if (GST_GL_CHECK_GL_VERSION (majorVersion, minorVersion, 1, 5)) {
++  if (GST_GL_CHECK_GL_VERSION (egl_major, egl_minor, 1, 5)) {
+     egl->eglCreateImage = gst_gl_context_get_proc_address (context,
+         "eglCreateImage");
+     egl->eglDestroyImage = gst_gl_context_get_proc_address (context,
+@@ -614,7 +614,9 @@ gst_gl_context_egl_create_context (GstGLContext * context,
+     egl->eglCreateImage = NULL;
+     egl->eglDestroyImage = NULL;
+   }
+-
++  egl->egl_major = egl_major;
++  egl->egl_minor = egl_minor;
++ 
+   if (window)
+     gst_object_unref (window);
+ 
+diff --git a/gst-libs/gst/gl/egl/gstglcontext_egl.h b/gst-libs/gst/gl/egl/gstglcontext_egl.h
+index 90abb03..4a72ddf 100644
+--- a/gst-libs/gst/gl/egl/gstglcontext_egl.h
++++ b/gst-libs/gst/gl/egl/gstglcontext_egl.h
+@@ -46,6 +46,9 @@ struct _GstGLContextEGL {
+   EGLSurface egl_surface;
+   EGLConfig  egl_config;
+ 
++  gint egl_major;
++  gint egl_minor;
++
+   GstGLAPI gl_api;
+ 
+   const gchar *egl_exts;
+-- 
+1.7.9.5
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
index 358c5d1..3b57db9 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
@@ -20,6 +20,7 @@ SRC_URI = " \
     file://0008-gl-implement-GstGLMemoryEGL.patch \
     file://0009-glimagesink-Downrank-to-marginal.patch \
     file://0010-glplugin-glimagesink-support-video-rotat.patch \
+    file://0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch \
 "
 SRC_URI[md5sum] = "955281a43e98c5464563fa049e0a0911"
 SRC_URI[sha256sum] = "7899fcb18e6a1af2888b19c90213af018a57d741c6e72ec56b133bc73ec8509b"
-- 
1.9.1



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

* [poky][PATCH 3/4] gstreamer1.0-plugins-bad: Fix horizontal/vertical flip matrizes
  2016-10-11 10:49 [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 1/4] gstreamer1.0-plugins-bad: Support video rotation by using transform matrix Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 2/4] gstreamer1.0-plugins-bad: Fix wrong attribute list type for EGL 1.5 Yuqing Zhu
@ 2016-10-11 10:49 ` Yuqing Zhu
  2016-10-11 10:49 ` [poky][PATCH 4/4] gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when connect to qmlglsrc Yuqing Zhu
  2016-10-11 12:26 ` [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Burton, Ross
  4 siblings, 0 replies; 13+ messages in thread
From: Yuqing Zhu @ 2016-10-11 10:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Yuqing Zhu

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 ...ink-Fix-horizontal-vertical-flip-matrizes.patch | 44 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb    |  1 +
 2 files changed, 45 insertions(+)
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch
new file mode 100755
index 0000000..701eaef
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch
@@ -0,0 +1,44 @@
+From 99937ea5854b6182333b9cf578db726748665ae7 Mon Sep 17 00:00:00 2001
+From: Haihua Hu <jared.hu@nxp.com>
+Date: Mon, 1 Aug 2016 14:12:35 +0800
+Subject: [PATCH 1/6] glimagesink: Fix horizontal/vertical flip matrizes
+
+They were swapped.
+
+Upstream-Status: Backport [1.9.2]
+
+https://bugzilla.gnome.org/show_bug.cgi?id=769371
+
+Signed-off-by: Haihua Hu <jared.hu@nxp.com>
+---
+ ext/gl/gstglimagesink.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
+index fb60468..cd3147d 100644
+--- a/ext/gl/gstglimagesink.c
++++ b/ext/gl/gstglimagesink.c
+@@ -472,16 +472,16 @@ static const gfloat counterclockwise_matrix[] = {
+ 
+ /* horizontal-flip */
+ static const gfloat horizontal_flip_matrix[] = {
+-  1.0f, 0.0f, 0.0f, 0.0f,
+-  0.0f, -1.0f, 0.0f, 0.0f,
++  -1.0f, 0.0f, 0.0f, 0.0f,
++  0.0f, 1.0f, 0.0f, 0.0f,
+   0.0f, 0.0f, 1.0f, 0.0f,
+   0.0f, 0.0f, 0.0f, 1.0f,
+ };
+ 
+ /* vertical-flip */
+ static const gfloat vertical_flip_matrix[] = {
+-  -1.0f, 0.0f, 0.0f, 0.0f,
+-  0.0f, 1.0f, 0.0f, 0.0f,
++  1.0f, 0.0f, 0.0f, 0.0f,
++  0.0f, -1.0f, 0.0f, 0.0f,
+   0.0f, 0.0f, 1.0f, 0.0f,
+   0.0f, 0.0f, 0.0f, 1.0f,
+ };
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
index 3b57db9..2bde0a6 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
@@ -21,6 +21,7 @@ SRC_URI = " \
     file://0009-glimagesink-Downrank-to-marginal.patch \
     file://0010-glplugin-glimagesink-support-video-rotat.patch \
     file://0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch \
+    file://0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch \
 "
 SRC_URI[md5sum] = "955281a43e98c5464563fa049e0a0911"
 SRC_URI[sha256sum] = "7899fcb18e6a1af2888b19c90213af018a57d741c6e72ec56b133bc73ec8509b"
-- 
1.9.1



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

* [poky][PATCH 4/4] gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when connect to qmlglsrc
  2016-10-11 10:49 [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Yuqing Zhu
                   ` (2 preceding siblings ...)
  2016-10-11 10:49 ` [poky][PATCH 3/4] gstreamer1.0-plugins-bad: Fix horizontal/vertical flip matrizes Yuqing Zhu
@ 2016-10-11 10:49 ` Yuqing Zhu
  2016-10-17 23:45   ` Khem Raj
  2016-10-11 12:26 ` [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Burton, Ross
  4 siblings, 1 reply; 13+ messages in thread
From: Yuqing Zhu @ 2016-10-11 10:49 UTC (permalink / raw)
  To: openembedded-core; +Cc: Yuqing Zhu

1.When connect to qmlglsrc, x11 event loop will be replace by qt event loop
  which will cause the window cannot receive event from xserver, such as resize.

2.Also advertise support for the affine transformation meta in the allocation
  query.

Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
---
 ...x-glimagesink-cannot-show-frame-when-conn.patch | 71 ++++++++++++++++++++++
 .../gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb    |  1 +
 2 files changed, 72 insertions(+)
 create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch

diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch
new file mode 100755
index 0000000..eb79c5a
--- /dev/null
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch
@@ -0,0 +1,71 @@
+From 139e50acd70b8ce0e220d7d7433ccfe43a6b1fd8 Mon Sep 17 00:00:00 2001
+From: Haihua Hu <jared.hu@nxp.com>
+Date: Wed, 27 Jul 2016 10:55:01 +0800
+Subject: [PATCH 5/6] glwindow: Fix glimagesink cannot show frame when connect
+ to qmlglsrc
+
+1.When connect to qmlglsrc, x11 event loop will be replace by qt event loop
+  which will cause the window cannot receive event from xserver, such as resize
+2.Also advertise support for the affine transformation meta in the allocation
+  query.
+
+Upstream-Status: Backport [1.9.2]
+
+https://bugzilla.gnome.org/show_bug.cgi?id=768160
+
+Signed-off-by: Haihua Hu <jared.hu@nxp.com>
+---
+ ext/gl/gstglimagesink.c               |  2 ++
+ gst-libs/gst/gl/x11/gstglwindow_x11.c | 14 +++++++++-----
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
+index cd3147d..d81fcfb 100644
+--- a/ext/gl/gstglimagesink.c
++++ b/ext/gl/gstglimagesink.c
+@@ -1957,6 +1957,8 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
+ 
+   gst_query_add_allocation_meta (query,
+       GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, allocation_meta);
++  gst_query_add_allocation_meta (query,
++      GST_VIDEO_AFFINE_TRANSFORMATION_META_API_TYPE, 0);
+ 
+   if (allocation_meta)
+     gst_structure_free (allocation_meta);
+diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c
+index 67160f6..bc7b9c0 100644
+--- a/gst-libs/gst/gl/x11/gstglwindow_x11.c
++++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c
+@@ -399,6 +399,7 @@ draw_cb (gpointer data)
+   GstGLWindow *window = GST_GL_WINDOW (window_x11);
+ 
+   if (gst_gl_window_is_running (window)) {
++    guint width, height;
+     XWindowAttributes attr;
+ 
+     XGetWindowAttributes (window_x11->device, window_x11->internal_win_id,
+@@ -422,13 +423,16 @@ draw_cb (gpointer data)
+       }
+     }
+ 
+-    if (window_x11->allow_extra_expose_events) {
+-      if (window->queue_resize) {
+-        guint width, height;
++    gst_gl_window_get_surface_dimensions (window, &width, &height);
++    if (attr.width != width || attr.height != height) {
++      width = attr.width;
++      height = attr.height;
++      gst_gl_window_queue_resize (window);
++    }
+ 
+-        gst_gl_window_get_surface_dimensions (window, &width, &height);
++    if (window_x11->allow_extra_expose_events) {
++      if (window->queue_resize)
+         gst_gl_window_resize (window, width, height);
+-      }
+ 
+       if (window->draw) {
+         GstGLContext *context = gst_gl_window_get_context (window);
+-- 
+1.9.1
+
diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
index 2bde0a6..55ffce9 100644
--- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
+++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
@@ -22,6 +22,7 @@ SRC_URI = " \
     file://0010-glplugin-glimagesink-support-video-rotat.patch \
     file://0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch \
     file://0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch \
+    file://0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch \
 "
 SRC_URI[md5sum] = "955281a43e98c5464563fa049e0a0911"
 SRC_URI[sha256sum] = "7899fcb18e6a1af2888b19c90213af018a57d741c6e72ec56b133bc73ec8509b"
-- 
1.9.1



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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-11 10:49 [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Yuqing Zhu
                   ` (3 preceding siblings ...)
  2016-10-11 10:49 ` [poky][PATCH 4/4] gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when connect to qmlglsrc Yuqing Zhu
@ 2016-10-11 12:26 ` Burton, Ross
  2016-10-13  9:07   ` Carol Zhu
  4 siblings, 1 reply; 13+ messages in thread
From: Burton, Ross @ 2016-10-11 12:26 UTC (permalink / raw)
  To: Yuqing Zhu; +Cc: OE-core

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

On 11 October 2016 at 11:49, Yuqing Zhu <carol.zhu@nxp.com> wrote:

> -Support video rotation by using transform matrix
>
> -Fix wrong attribute list type for EGL 1.5
>
> -Fix horizontal/vertical flip matrizes
>
> -Fix glimagesink cannot show frame when connect to qmlglsrc
>

We're about to roll RC1 of 2.2, so I think these will have to wait until
2.3 opens for patches.

Ross

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

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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-11 12:26 ` [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Burton, Ross
@ 2016-10-13  9:07   ` Carol Zhu
  2016-10-13 10:35     ` Burton, Ross
  0 siblings, 1 reply; 13+ messages in thread
From: Carol Zhu @ 2016-10-13  9:07 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

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

Hi Ross,

      These gstreamer patches are bug fixing and all backported from higher version, so the risk is low.
      Is that ok to integrate them into morty?


B.R.
Carol

From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: Tuesday, October 11, 2016 8:26 PM
To: Carol Zhu <carol.zhu@nxp.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3


On 11 October 2016 at 11:49, Yuqing Zhu <carol.zhu@nxp.com<mailto:carol.zhu@nxp.com>> wrote:
-Support video rotation by using transform matrix

-Fix wrong attribute list type for EGL 1.5

-Fix horizontal/vertical flip matrizes

-Fix glimagesink cannot show frame when connect to qmlglsrc

We're about to roll RC1 of 2.2, so I think these will have to wait until 2.3 opens for patches.

Ross

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

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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-13  9:07   ` Carol Zhu
@ 2016-10-13 10:35     ` Burton, Ross
  2016-10-14  3:22       ` Carol Zhu
  0 siblings, 1 reply; 13+ messages in thread
From: Burton, Ross @ 2016-10-13 10:35 UTC (permalink / raw)
  To: Carol Zhu; +Cc: OE-core

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

On 13 October 2016 at 10:07, Carol Zhu <carol.zhu@nxp.com> wrote:

>       These gstreamer patches are bug fixing and all backported from
> higher version, so the risk is low.
>
>       Is that ok to integrate them into morty?
>
>
Once they've been proven in master and if the morty maintainer agrees, yes.

Ross

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

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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-13 10:35     ` Burton, Ross
@ 2016-10-14  3:22       ` Carol Zhu
  2016-10-14  7:35         ` Jussi Kukkonen
  0 siblings, 1 reply; 13+ messages in thread
From: Carol Zhu @ 2016-10-14  3:22 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

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

Hi Ross,

      So could we try integrating them to master branch and proving them firstly?
      If they are all ok, then we can try next.
      They won’t block the RC1 of 2.2.



B.B

From: Burton, Ross [mailto:ross.burton@intel.com]
Sent: Thursday, October 13, 2016 6:36 PM
To: Carol Zhu <carol.zhu@nxp.com>
Cc: OE-core <openembedded-core@lists.openembedded.org>
Subject: Re: [OE-core] [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3


On 13 October 2016 at 10:07, Carol Zhu <carol.zhu@nxp.com<mailto:carol.zhu@nxp.com>> wrote:
      These gstreamer patches are bug fixing and all backported from higher version, so the risk is low.
      Is that ok to integrate them into morty?

Once they've been proven in master and if the morty maintainer agrees, yes.

Ross

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

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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-14  3:22       ` Carol Zhu
@ 2016-10-14  7:35         ` Jussi Kukkonen
  2016-10-14  9:54           ` Khem Raj
  0 siblings, 1 reply; 13+ messages in thread
From: Jussi Kukkonen @ 2016-10-14  7:35 UTC (permalink / raw)
  To: Carol Zhu; +Cc: OE-core

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

On 14 October 2016 at 06:22, Carol Zhu <carol.zhu@nxp.com> wrote:

> Hi Ross,
>
>
>
>       So could we try integrating them to master branch and proving them
> firstly?
>
>       If they are all ok, then we can try next.
>
>       They won’t block the RC1 of 2.2.
>


That would be the way to go, although GStreamer 1.10 release may have
already happened by the time oe-core master opens again: in that case the
appropriate thing would be to upgrade the recipes in master to 1.10.

Jussi





>
>
>
>
> B.B
>
>
>
> *From:* Burton, Ross [mailto:ross.burton@intel.com]
> *Sent:* Thursday, October 13, 2016 6:36 PM
> *To:* Carol Zhu <carol.zhu@nxp.com>
> *Cc:* OE-core <openembedded-core@lists.openembedded.org>
> *Subject:* Re: [OE-core] [poky][PATCH 0/4] Add patches for
> gstreamer1.0-plugins-bad V1.8.3
>
>
>
>
>
> On 13 October 2016 at 10:07, Carol Zhu <carol.zhu@nxp.com> wrote:
>
>       These gstreamer patches are bug fixing and all backported from
> higher version, so the risk is low.
>
>       Is that ok to integrate them into morty?
>
>
> Once they've been proven in master and if the morty maintainer agrees, yes.
>
>
>
> Ross
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>
>

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

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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-14  7:35         ` Jussi Kukkonen
@ 2016-10-14  9:54           ` Khem Raj
  2016-10-14 10:22             ` Otavio Salvador
  0 siblings, 1 reply; 13+ messages in thread
From: Khem Raj @ 2016-10-14  9:54 UTC (permalink / raw)
  To: Jussi Kukkonen; +Cc: Carol Zhu, OE-core

On Fri, Oct 14, 2016 at 9:35 AM, Jussi Kukkonen
<jussi.kukkonen@intel.com> wrote:
>
>
> On 14 October 2016 at 06:22, Carol Zhu <carol.zhu@nxp.com> wrote:
>>
>> Hi Ross,
>>
>>
>>
>>       So could we try integrating them to master branch and proving them
>> firstly?
>>
>>       If they are all ok, then we can try next.
>>
>>       They won’t block the RC1 of 2.2.
>
>
>
> That would be the way to go, although GStreamer 1.10 release may have
> already happened by the time oe-core master opens again: in that case the
> appropriate thing would be to upgrade the recipes in master to 1.10.

We can serialize the upgrade and get these patches in before upgrade.

>
> Jussi
>
>
>
>
>>
>>
>>
>>
>>
>> B.B
>>
>>
>>
>> From: Burton, Ross [mailto:ross.burton@intel.com]
>> Sent: Thursday, October 13, 2016 6:36 PM
>> To: Carol Zhu <carol.zhu@nxp.com>
>> Cc: OE-core <openembedded-core@lists.openembedded.org>
>> Subject: Re: [OE-core] [poky][PATCH 0/4] Add patches for
>> gstreamer1.0-plugins-bad V1.8.3
>>
>>
>>
>>
>>
>> On 13 October 2016 at 10:07, Carol Zhu <carol.zhu@nxp.com> wrote:
>>
>>       These gstreamer patches are bug fixing and all backported from
>> higher version, so the risk is low.
>>
>>       Is that ok to integrate them into morty?
>>
>>
>> Once they've been proven in master and if the morty maintainer agrees,
>> yes.
>>
>>
>>
>> Ross
>>
>>
>> --
>> _______________________________________________
>> Openembedded-core mailing list
>> Openembedded-core@lists.openembedded.org
>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>
>
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


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

* Re: [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3
  2016-10-14  9:54           ` Khem Raj
@ 2016-10-14 10:22             ` Otavio Salvador
  0 siblings, 0 replies; 13+ messages in thread
From: Otavio Salvador @ 2016-10-14 10:22 UTC (permalink / raw)
  To: Khem Raj; +Cc: Carol Zhu, OE-core

On Fri, Oct 14, 2016 at 6:54 AM, Khem Raj <raj.khem@gmail.com> wrote:
> On Fri, Oct 14, 2016 at 9:35 AM, Jussi Kukkonen
> <jussi.kukkonen@intel.com> wrote:
>>
>>
>> On 14 October 2016 at 06:22, Carol Zhu <carol.zhu@nxp.com> wrote:
>>>
>>> Hi Ross,
>>>
>>>
>>>
>>>       So could we try integrating them to master branch and proving them
>>> firstly?
>>>
>>>       If they are all ok, then we can try next.
>>>
>>>       They won’t block the RC1 of 2.2.
>>
>>
>>
>> That would be the way to go, although GStreamer 1.10 release may have
>> already happened by the time oe-core master opens again: in that case the
>> appropriate thing would be to upgrade the recipes in master to 1.10.
>
> We can serialize the upgrade and get these patches in before upgrade.

Agreed as Carol already did the patches work.


-- 
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] 13+ messages in thread

* Re: [poky][PATCH 4/4] gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when connect to qmlglsrc
  2016-10-11 10:49 ` [poky][PATCH 4/4] gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when connect to qmlglsrc Yuqing Zhu
@ 2016-10-17 23:45   ` Khem Raj
  0 siblings, 0 replies; 13+ messages in thread
From: Khem Raj @ 2016-10-17 23:45 UTC (permalink / raw)
  To: Yuqing Zhu; +Cc: openembedded-core

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

this series looks ok to me

> On Oct 11, 2016, at 3:49 AM, Yuqing Zhu <carol.zhu@nxp.com> wrote:
> 
> 1.When connect to qmlglsrc, x11 event loop will be replace by qt event loop
>  which will cause the window cannot receive event from xserver, such as resize.
> 
> 2.Also advertise support for the affine transformation meta in the allocation
>  query.
> 
> Signed-off-by: Yuqing Zhu <carol.zhu@nxp.com>
> ---
> ...x-glimagesink-cannot-show-frame-when-conn.patch | 71 ++++++++++++++++++++++
> .../gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb    |  1 +
> 2 files changed, 72 insertions(+)
> create mode 100755 meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch
> 
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch
> new file mode 100755
> index 0000000..eb79c5a
> --- /dev/null
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad/0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch
> @@ -0,0 +1,71 @@
> +From 139e50acd70b8ce0e220d7d7433ccfe43a6b1fd8 Mon Sep 17 00:00:00 2001
> +From: Haihua Hu <jared.hu@nxp.com>
> +Date: Wed, 27 Jul 2016 10:55:01 +0800
> +Subject: [PATCH 5/6] glwindow: Fix glimagesink cannot show frame when connect
> + to qmlglsrc
> +
> +1.When connect to qmlglsrc, x11 event loop will be replace by qt event loop
> +  which will cause the window cannot receive event from xserver, such as resize
> +2.Also advertise support for the affine transformation meta in the allocation
> +  query.
> +
> +Upstream-Status: Backport [1.9.2]
> +
> +https://bugzilla.gnome.org/show_bug.cgi?id=768160
> +
> +Signed-off-by: Haihua Hu <jared.hu@nxp.com>
> +---
> + ext/gl/gstglimagesink.c               |  2 ++
> + gst-libs/gst/gl/x11/gstglwindow_x11.c | 14 +++++++++-----
> + 2 files changed, 11 insertions(+), 5 deletions(-)
> +
> +diff --git a/ext/gl/gstglimagesink.c b/ext/gl/gstglimagesink.c
> +index cd3147d..d81fcfb 100644
> +--- a/ext/gl/gstglimagesink.c
> ++++ b/ext/gl/gstglimagesink.c
> +@@ -1957,6 +1957,8 @@ gst_glimage_sink_propose_allocation (GstBaseSink * bsink, GstQuery * query)
> +
> +   gst_query_add_allocation_meta (query,
> +       GST_VIDEO_OVERLAY_COMPOSITION_META_API_TYPE, allocation_meta);
> ++  gst_query_add_allocation_meta (query,
> ++      GST_VIDEO_AFFINE_TRANSFORMATION_META_API_TYPE, 0);
> +
> +   if (allocation_meta)
> +     gst_structure_free (allocation_meta);
> +diff --git a/gst-libs/gst/gl/x11/gstglwindow_x11.c b/gst-libs/gst/gl/x11/gstglwindow_x11.c
> +index 67160f6..bc7b9c0 100644
> +--- a/gst-libs/gst/gl/x11/gstglwindow_x11.c
> ++++ b/gst-libs/gst/gl/x11/gstglwindow_x11.c
> +@@ -399,6 +399,7 @@ draw_cb (gpointer data)
> +   GstGLWindow *window = GST_GL_WINDOW (window_x11);
> +
> +   if (gst_gl_window_is_running (window)) {
> ++    guint width, height;
> +     XWindowAttributes attr;
> +
> +     XGetWindowAttributes (window_x11->device, window_x11->internal_win_id,
> +@@ -422,13 +423,16 @@ draw_cb (gpointer data)
> +       }
> +     }
> +
> +-    if (window_x11->allow_extra_expose_events) {
> +-      if (window->queue_resize) {
> +-        guint width, height;
> ++    gst_gl_window_get_surface_dimensions (window, &width, &height);
> ++    if (attr.width != width || attr.height != height) {
> ++      width = attr.width;
> ++      height = attr.height;
> ++      gst_gl_window_queue_resize (window);
> ++    }
> +
> +-        gst_gl_window_get_surface_dimensions (window, &width, &height);
> ++    if (window_x11->allow_extra_expose_events) {
> ++      if (window->queue_resize)
> +         gst_gl_window_resize (window, width, height);
> +-      }
> +
> +       if (window->draw) {
> +         GstGLContext *context = gst_gl_window_get_context (window);
> +--
> +1.9.1
> +
> diff --git a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
> index 2bde0a6..55ffce9 100644
> --- a/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
> +++ b/meta/recipes-multimedia/gstreamer/gstreamer1.0-plugins-bad_1.8.3.bb
> @@ -22,6 +22,7 @@ SRC_URI = " \
>     file://0010-glplugin-glimagesink-support-video-rotat.patch \
>     file://0011-EGL_DMA_Buf-Wrong-attribute-list-type-for-EGL-1.5.patch \
>     file://0012-glimagesink-Fix-horizontal-vertical-flip-matrizes.patch \
> +    file://0013-glwindow-Fix-glimagesink-cannot-show-frame-when-conn.patch \
> "
> SRC_URI[md5sum] = "955281a43e98c5464563fa049e0a0911"
> SRC_URI[sha256sum] = "7899fcb18e6a1af2888b19c90213af018a57d741c6e72ec56b133bc73ec8509b"
> --
> 1.9.1
> 
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 211 bytes --]

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

end of thread, other threads:[~2016-10-17 23:45 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-11 10:49 [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Yuqing Zhu
2016-10-11 10:49 ` [poky][PATCH 1/4] gstreamer1.0-plugins-bad: Support video rotation by using transform matrix Yuqing Zhu
2016-10-11 10:49 ` [poky][PATCH 2/4] gstreamer1.0-plugins-bad: Fix wrong attribute list type for EGL 1.5 Yuqing Zhu
2016-10-11 10:49 ` [poky][PATCH 3/4] gstreamer1.0-plugins-bad: Fix horizontal/vertical flip matrizes Yuqing Zhu
2016-10-11 10:49 ` [poky][PATCH 4/4] gstreamer1.0-plugins-bad: Fix glimagesink cannot show frame when connect to qmlglsrc Yuqing Zhu
2016-10-17 23:45   ` Khem Raj
2016-10-11 12:26 ` [poky][PATCH 0/4] Add patches for gstreamer1.0-plugins-bad V1.8.3 Burton, Ross
2016-10-13  9:07   ` Carol Zhu
2016-10-13 10:35     ` Burton, Ross
2016-10-14  3:22       ` Carol Zhu
2016-10-14  7:35         ` Jussi Kukkonen
2016-10-14  9:54           ` Khem Raj
2016-10-14 10:22             ` 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.