07b2b148573caf9ae679ff1ef158b789cc979d3d
[platform/upstream/gstreamer.git] / gst-libs / gst / gl / cocoa / gstgl_cocoa_private.h
1 /*
2  * GStreamer
3  * Copyright (C) 2012 Matthew Waters <ystreet00@gmail.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_COCOA_PRIVATE_H__
22 #define __GST_GL_COCOA_PRIVATE_H__
23
24 #include <gst/gst.h>
25
26 #include <Cocoa/Cocoa.h>
27
28 #include "gstglwindow_cocoa.h"
29 #include "gstglcontext_cocoa.h"
30
31 G_BEGIN_DECLS
32
33 @interface AppThreadPerformer : NSObject {
34   GstGLWindowCocoa *m_cocoa;
35   GstGLWindowCB m_callback;
36   GstGLWindowResizeCB m_callback2;
37   gpointer m_data;
38   gint m_width;
39   gint m_height;
40 }
41 - (id) init: (GstGLWindowCocoa *)window;
42 - (id) initWithCallback:(GstGLWindowCocoa *)window callback:(GstGLWindowCB)callback userData:(gpointer) data;
43 - (id) initWithSize: (GstGLWindowCocoa *)window callback:(GstGLWindowResizeCB)callback userData:(gpointer)data toSize:(NSSize)size;
44 - (id) initWithAll: (GstGLWindowCocoa *)window callback:(GstGLWindowCB)callback userData:(gpointer) data;
45 - (void) updateWindow;
46 - (void) sendToApp;
47 - (void) setWindow;
48 - (void) stopApp;
49 - (void) closeWindow;
50 @end
51
52 struct _GstGLContextCocoaPrivate
53 {
54   NSOpenGLContext *gl_context;
55   NSOpenGLContext *external_gl_context;
56   NSRect rect;
57 };
58
59
60 /* =============================================================*/
61 /*                                                              */
62 /*                  GstGLNSOpenGLView declaration               */
63 /*                                                              */
64 /* =============================================================*/
65
66 @interface GstGLNSOpenGLView: NSOpenGLView {
67   GstGLWindowCocoa *m_cocoa;
68   gint m_resizeCount;
69 }
70 - (id) initWithFrame:(GstGLWindowCocoa *)window rect:(NSRect)contentRect
71     pixelFormat:(NSOpenGLPixelFormat *)fmt;
72 @end
73
74 gboolean gst_gl_window_cocoa_create_window (GstGLWindowCocoa *window_cocoa);
75
76 G_END_DECLS
77
78 #endif /* __GST_GL_COCOA_PRIVATE_H__ */