1c1
< From 23b7b5890aeb270bdfe63d98b0dd17829b0942e2 Mon Sep 17 00:00:00 2001
---
> From 0e402d201a9cf8b7c8b927003a0d34b2ffb8e09f Mon Sep 17 00:00:00 2001
6c6
< Next step will be to move gst_egl_image_allocator_alloc_eglimage
---
> https://bugzilla.gnome.org/show_bug.cgi?id=706054
8,11c8,11
<  ext/eglgles/gsteglglessink.c |  266 +-----------------------------------------
<  gst-libs/gst/egl/egl.c       |  263 +++++++++++++++++++++++++++++++++++++++++
<  gst-libs/gst/egl/egl.h       |   41 +++++++
<  3 files changed, 307 insertions(+), 263 deletions(-)
---
>  ext/eglgles/gsteglglessink.c |  286 +++---------------------------------------
>  gst-libs/gst/egl/egl.c       |  238 +++++++++++++++++++++++++++++++++++
>  gst-libs/gst/egl/egl.h       |   37 ++++++
>  3 files changed, 292 insertions(+), 269 deletions(-)
14c14
< index a5aea43..e492313 100644
---
> index a5aea43..f96c329 100644
82c82,114
< @@ -317,191 +259,6 @@ gst_eglglessink_egl_image_buffer_pool_on_destroy (gpointer data)
---
> @@ -284,18 +226,25 @@ gst_eglglessink_egl_image_buffer_pool_send_blocking (GstBufferPool * bpool,
>    GstStructure *s = NULL;
>    const GValue *v = NULL;
>    GstBuffer *buffer = NULL;
> -  GstVideoFormat format = GST_VIDEO_FORMAT_UNKNOWN;
> -  gint width = 0;
> -  gint height = 0;
> +  GstStructure *config = NULL;
> +  GstCaps *caps = NULL;
> +  GstVideoInfo info;
>  
>    GstEGLImageBufferPool *pool = GST_EGL_IMAGE_BUFFER_POOL (bpool);
>    GstEglGlesSink *eglglessink = GST_EGLGLESSINK (data);
>  
> -  gst_egl_image_buffer_pool_get_video_infos (pool, &format, &width, &height);
> +  config = gst_buffer_pool_get_config (pool);
> +  gst_buffer_pool_config_get_params (config, &caps, NULL, NULL, NULL);
> +  gst_structure_free (config);
> +
> +  gst_video_info_init (&info);
> +  gst_video_info_from_caps (&info, caps);
>  
>    s = gst_structure_new ("eglglessink-allocate-eglimage",
> -      "format", GST_TYPE_VIDEO_FORMAT, format,
> -      "width", G_TYPE_INT, width, "height", G_TYPE_INT, height, NULL);
> +      "format", GST_TYPE_VIDEO_FORMAT, GST_VIDEO_INFO_FORMAT (&info),
> +      "width", G_TYPE_INT, GST_VIDEO_INFO_WIDTH (&info), "height", G_TYPE_INT,
> +      GST_VIDEO_INFO_HEIGHT (&info), NULL);
> +
>    query = gst_query_new_custom (GST_QUERY_CUSTOM, s);
>  
>    ret =
> @@ -317,191 +266,6 @@ gst_eglglessink_egl_image_buffer_pool_on_destroy (gpointer data)
274c306,314
< @@ -592,8 +349,9 @@ render_thread_func (GstEglGlesSink * eglglessink)
---
> @@ -583,6 +347,7 @@ render_thread_func (GstEglGlesSink * eglglessink)
>          GstVideoFormat format;
>          gint width, height;
>          GValue v = { 0, };
> +        GstAllocator *allocator = gst_egl_image_allocator_obtain ();
>  
>          if (!gst_structure_get_enum (s, "format", GST_TYPE_VIDEO_FORMAT,
>                  (gint *) & format)
> @@ -592,10 +357,11 @@ render_thread_func (GstEglGlesSink * eglglessink)
281,282c321
< +            (gst_egl_image_buffer_pool_get_allocator (GST_EGL_IMAGE_BUFFER_POOL
< +                (eglglessink->pool)), eglglessink->egl_context->display,
---
> +            (allocator, eglglessink->egl_context->display,
284a324
> +        gst_object_unref (allocator);
286c326,328
< @@ -2449,24 +2207,6 @@ gst_eglglessink_init (GstEglGlesSink * eglglessink)
---
>          g_value_set_pointer (&v, buffer);
>          gst_structure_set_value (s, "buffer", &v);
> @@ -2449,24 +2215,6 @@ gst_eglglessink_init (GstEglGlesSink * eglglessink)
312c354
< index 2f283ad..13f0a24 100644
---
> index 2f283ad..26268a3 100644
315c357
< @@ -384,3 +384,266 @@ gst_egl_display_get (GstEGLDisplay * display)
---
> @@ -384,3 +384,241 @@ gst_egl_display_get (GstEGLDisplay * display)
368,392d409
< +void
< +gst_egl_image_buffer_pool_get_video_infos (GstEGLImageBufferPool * pool,
< +    GstVideoFormat * format, gint * width, gint * height)
< +{
< +  g_return_if_fail (pool != NULL);
< +
< +  if (format)
< +    *format = pool->priv->info.finfo->format;
< +
< +  if (width)
< +    *width = pool->priv->info.width;
< +
< +  if (height)
< +    *height = pool->priv->info.height;
< +}
< +
< +/* TODO: will be removed after moving gst_egl_image_allocator_alloc_eglimage */
< +GstAllocator *
< +gst_egl_image_buffer_pool_get_allocator (GstEGLImageBufferPool * pool)
< +{
< +  g_return_val_if_fail (pool != NULL, NULL);
< +
< +  return pool->priv->allocator;
< +}
< +
583c600
< index 7187716..9ce4df0 100644
---
> index 7187716..c0d53cb 100644
586c603
< @@ -69,5 +69,46 @@ GstEGLDisplay *gst_egl_display_ref (GstEGLDisplay * display);
---
> @@ -69,5 +69,42 @@ GstEGLDisplay *gst_egl_display_ref (GstEGLDisplay * display);
626,629d642
< +void gst_egl_image_buffer_pool_get_video_infos (GstEGLImageBufferPool * pool, GstVideoFormat * format, gint * width, gint * height);
< +
< +/* TODO: will be removed after moving gst_egl_image_allocator_alloc_eglimage */
< +GstAllocator *gst_egl_image_buffer_pool_get_allocator (GstEGLImageBufferPool * pool);
