1 /*
2  * GStreamer
3  * Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
4  *
5  * This library is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Library General Public
7  * License as published by the Free Software Foundation; either
8  * version 2 of the License, or (at your option) any later version.
9  *
10  * This library is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13  * Library General Public License for more details.
14  *
15  * You should have received a copy of the GNU Library General Public
16  * License along with this library; if not, write to the
17  * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 #ifndef __GST_GL_CA_OPENGL_LAYER__
22 #define __GST_GL_CA_OPENGL_LAYER__
23 
24 #include <gst/gst.h>
25 #include <gst/gl/gl.h>
26 #include <Cocoa/Cocoa.h>
27 
28 G_BEGIN_DECLS
29 
30 @interface GstGLCAOpenGLLayer : CAOpenGLLayer {
31 @public
32   GstGLContext *gst_gl_context;
33   CGLContextObj gl_context;
34 
35 @private
36   GstGLContext *draw_context;
37   CGRect last_bounds;
38   gint expected_dims[4];
39 
40   GstGLWindowCB draw_cb;
41   gpointer draw_data;
42   GDestroyNotify draw_notify;
43 
44   GstGLWindowResizeCB resize_cb;
45   gpointer resize_data;
46   GDestroyNotify resize_notify;
47 
48   gint can_draw;
49   gboolean queue_resize;
50 }
51 - (void) setDrawCallback:(GstGLWindowCB)cb data:(gpointer)a notify:(GDestroyNotify)notify;
52 - (void) setResizeCallback:(GstGLWindowResizeCB)cb data:(gpointer)a notify:(GDestroyNotify)notify;
53 - (void) queueResize;
54 - (id) initWithGstGLContext: (GstGLContext *)context;
55 @end
56 
57 G_END_DECLS
58 
59 #endif /* __GST_GL_CA_OPENGL_LAYER__ */
60