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_WINDOW_WIN32_H__ 22 #define __GST_GL_WINDOW_WIN32_H__ 23 24 #include <gst/gl/gl.h> 25 26 #undef UNICODE 27 #include <windows.h> 28 #define UNICODE 29 30 G_BEGIN_DECLS 31 32 #define GST_TYPE_GL_WINDOW_WIN32 (gst_gl_window_win32_get_type()) 33 #define GST_GL_WINDOW_WIN32(o) (G_TYPE_CHECK_INSTANCE_CAST((o), GST_TYPE_GL_WINDOW_WIN32, GstGLWindowWin32)) 34 #define GST_GL_WINDOW_WIN32_CLASS(k) (G_TYPE_CHECK_CLASS((k), GST_TYPE_GL_WINDOW_WIN32, GstGLWindowWin32Class)) 35 #define GST_IS_GL_WINDOW_WIN32(o) (G_TYPE_CHECK_INSTANCE_TYPE((o), GST_TYPE_GL_WINDOW_WIN32)) 36 #define GST_IS_GL_WINDOW_WIN32_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE((k), GST_TYPE_GL_WINDOW_WIN32)) 37 #define GST_GL_WINDOW_WIN32_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), GST_TYPE_GL_WINDOW_WIN32, GstGLWindowWin32Class)) 38 39 typedef struct _GstGLWindowWin32 GstGLWindowWin32; 40 typedef struct _GstGLWindowWin32Private GstGLWindowWin32Private; 41 typedef struct _GstGLWindowWin32Class GstGLWindowWin32Class; 42 43 struct _GstGLWindowWin32 { 44 /*< private >*/ 45 GstGLWindow parent; 46 47 HWND internal_win_id; 48 HWND parent_win_id; 49 HDC device; 50 gboolean is_closed; 51 gboolean visible; 52 53 GSource *msg_source; 54 55 /*< private >*/ 56 GstGLWindowWin32Private *priv; 57 58 gpointer _reserved[GST_PADDING]; 59 }; 60 61 struct _GstGLWindowWin32Class { 62 /*< private >*/ 63 GstGLWindowClass parent_class; 64 65 gboolean (*choose_format) (GstGLWindowWin32 *window); 66 gboolean (*create_context) (GstGLWindowWin32 *window, GstGLAPI gl_api, 67 guintptr external_gl_context, GError ** error); 68 gboolean (*share_context) (GstGLWindowWin32 *window, guintptr external_gl_context); 69 void (*swap_buffers) (GstGLWindowWin32 *window); 70 gboolean (*activate) (GstGLWindowWin32 *window, gboolean activate); 71 void (*destroy_context) (GstGLWindowWin32 *window); 72 guintptr (*get_gl_context) (GstGLWindowWin32 *window); 73 74 /*< private >*/ 75 gpointer _reserved[GST_PADDING_LARGE]; 76 }; 77 78 GType gst_gl_window_win32_get_type (void); 79 80 GstGLWindowWin32 * gst_gl_window_win32_new (GstGLDisplay * display); 81 82 gboolean gst_gl_window_win32_create_window (GstGLWindowWin32 * window_win32, GError ** error); 83 84 G_END_DECLS 85 86 #endif /* __GST_GL_WINDOW_WIN32_H__ */ 87