summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2013-09-18 22:24:07 +0200
committerSebastian Dröge <slomo@circular-chaos.org>2013-09-18 23:09:05 +0200
commit14f2c30686b21ad4effc0466c1936f9f125778fc (patch)
tree0cfdea1dd5bb1020f6069f194ddb7413160026e5
parentb92791d1020ff294c358ebc75bbb95e8b9c43417 (diff)
downloadgstreamer-plugins-bad-14f2c30686b21ad4effc0466c1936f9f125778fc.tar.gz
egl: Update for new GstContext API
-rw-r--r--gst-libs/gst/egl/egl.c19
-rw-r--r--gst-libs/gst/egl/egl.h3
2 files changed, 14 insertions, 8 deletions
diff --git a/gst-libs/gst/egl/egl.c b/gst-libs/gst/egl/egl.c
index 0b0ebcc24..2f283ada1 100644
--- a/gst-libs/gst/egl/egl.c
+++ b/gst-libs/gst/egl/egl.c
@@ -37,6 +37,7 @@
#define EGL_EGLEXT_PROTOTYPES
#include <gst/egl/egl.h>
+#include <string.h>
#if defined (USE_EGL_RPI) && defined(__GNUC__)
#pragma GCC reset_options
@@ -304,14 +305,17 @@ gst_egl_image_allocator_wrap (GstAllocator * allocator,
return GST_MEMORY_CAST (mem);
}
-void
-gst_context_set_egl_display (GstContext * context, GstEGLDisplay * display)
+GstContext *
+gst_context_new_egl_display (GstEGLDisplay * display, gboolean persistent)
{
+ GstContext *context;
GstStructure *s;
+ context = gst_context_new (GST_EGL_DISPLAY_CONTEXT_TYPE, persistent);
s = gst_context_writable_structure (context);
- gst_structure_set (s, GST_EGL_DISPLAY_CONTEXT_TYPE, GST_TYPE_EGL_DISPLAY,
- display, NULL);
+ gst_structure_set (s, "display", GST_TYPE_EGL_DISPLAY, display, NULL);
+
+ return context;
}
gboolean
@@ -319,9 +323,12 @@ gst_context_get_egl_display (GstContext * context, GstEGLDisplay ** display)
{
const GstStructure *s;
+ g_return_val_if_fail (GST_IS_CONTEXT (context), FALSE);
+ g_return_val_if_fail (strcmp (gst_context_get_context_type (context),
+ GST_EGL_DISPLAY_CONTEXT_TYPE) == 0, FALSE);
+
s = gst_context_get_structure (context);
- return gst_structure_get (s, GST_EGL_DISPLAY_CONTEXT_TYPE,
- GST_TYPE_EGL_DISPLAY, display, NULL);
+ return gst_structure_get (s, "display", GST_TYPE_EGL_DISPLAY, display, NULL);
}
struct _GstEGLDisplay
diff --git a/gst-libs/gst/egl/egl.h b/gst-libs/gst/egl/egl.h
index ebc623322..718771617 100644
--- a/gst-libs/gst/egl/egl.h
+++ b/gst-libs/gst/egl/egl.h
@@ -56,8 +56,7 @@ GstMemory *gst_egl_image_allocator_wrap (GstAllocator * allocator,
GDestroyNotify user_data_destroy);
#define GST_EGL_DISPLAY_CONTEXT_TYPE "gst.egl.EGLDisplay"
-void gst_context_set_egl_display (GstContext * context,
- GstEGLDisplay * display);
+GstContext * gst_context_new_egl_display (GstEGLDisplay * display, gboolean persistent);
gboolean gst_context_get_egl_display (GstContext * context,
GstEGLDisplay ** display);