diff options
author | Thiago Santos <thiago.sousa.santos@collabora.com> | 2013-03-20 17:50:49 -0300 |
---|---|---|
committer | Thiago Santos <thiago.sousa.santos@collabora.com> | 2013-04-16 16:08:50 -0300 |
commit | daab2cf92c8a5538d2dd9741b9c79660d969d20e (patch) | |
tree | 0c083ccd75be266724520955667b71c23bce8958 | |
parent | c1b45df7b0f7fa664b9a2b5b1ac2ac4745626665 (diff) | |
download | gstreamer-plugins-bad-daab2cf92c8a5538d2dd9741b9c79660d969d20e.tar.gz |
eglglessink: eagl: add missing functions for window set/get
Adds functions to allow eglglessink to set and get the window
for eagl backend
-rw-r--r-- | ext/eglgles/gstegladaptation_eagl.m | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/ext/eglgles/gstegladaptation_eagl.m b/ext/eglgles/gstegladaptation_eagl.m index f1700c192..69d3f602d 100644 --- a/ext/eglgles/gstegladaptation_eagl.m +++ b/ext/eglgles/gstegladaptation_eagl.m @@ -54,6 +54,9 @@ struct _GstEaglContext EAGLContext *eagl_context; GLuint framebuffer; GLuint color_renderbuffer; + + UIView *window; + UIView *used_window; }; void @@ -154,7 +157,7 @@ gst_egl_adaptation_create_surface (GstEglAdaptationContext * ctx) GLint height; GLuint depthRenderbuffer; GLenum status; - CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[[UIView ctx->window] layer]; + CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[ctx->eaglctx->window layer]; /* Allocate framebuffer */ glGenFramebuffers(1, &framebuffer); @@ -194,7 +197,7 @@ gst_egl_adaptation_create_surface (GstEglAdaptationContext * ctx) gboolean _gst_egl_choose_config (GstEglAdaptationContext * ctx, gboolean try_only, gint * num_configs) { - CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[[UIView ctx->window] layer]; + CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[ctx->eaglctx->window layer]; NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, @@ -209,7 +212,7 @@ _gst_egl_choose_config (GstEglAdaptationContext * ctx, gboolean try_only, gint * void gst_egl_adaptation_query_buffer_preserved (GstEglAdaptationContext * ctx) { - CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[[UIView ctx->window] layer]; + CAEAGLLayer *eaglLayer = (CAEAGLLayer *)[ctx->eaglctx->window layer]; NSDictionary *dict = [eaglLayer drawableProperties]; ctx->buffer_preserved = FALSE; @@ -288,3 +291,20 @@ gst_egl_adaptation_context_swap_buffers (GstEglAdaptationContext * ctx) return TRUE; } +void +gst_egl_adaptation_context_set_window (GstEglAdaptationContext * ctx, guintptr window) +{ + ctx->eaglctx->window = window; +} + +void +gst_egl_adaptation_context_update_used_window (GstEglAdaptationContext * ctx) +{ + ctx->eaglctx->used_window = ctx->eaglctx->window; +} + +guintptr +gst_egl_adaptation_context_get_window (GstEglAdaptationContext * ctx) +{ + return ctx->eaglctx->window ? [ctx->eaglctx->window id] : 0; +} |