3 * Copyright (C) 2016 Freescale Semiconductor, Inc. All rights reserved.
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.
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.
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.
21 #ifndef __QT_WINDOW_H__
22 #define __QT_WINDOW_H__
25 #include <gst/gl/gl.h>
28 #include <QtQuick/QQuickWindow>
29 #include <QtGui/QOpenGLContext>
30 #include <QtGui/QOpenGLFunctions>
32 typedef struct _QtGLWindowPrivate QtGLWindowPrivate;
34 class InitQtGLContext;
36 class QtGLWindow : public QQuickWindow, protected QOpenGLFunctions
40 QtGLWindow (QWindow * parent = NULL, QQuickWindow *source = NULL);
42 bool getGeometry (int * width, int * height);
44 /* private for C interface ... */
45 QtGLWindowPrivate *priv;
48 void beforeRendering ();
49 void afterRendering ();
50 void onSceneGraphInitialized ();
51 void onSceneGraphInvalidated ();
55 friend class InitQtGLContext;
56 QQuickWindow * source;
57 QScopedPointer<QOpenGLFramebufferObject> fbo;
62 gboolean qt_window_set_buffer (QtGLWindow * qt_window, GstBuffer * buffer);
63 gboolean qt_window_set_caps (QtGLWindow * qt_window, GstCaps * caps);
64 GstGLContext * qt_window_get_qt_context (QtGLWindow * qt_window);
65 GstGLDisplay * qt_window_get_display (QtGLWindow * qt_window);
66 gboolean qt_window_is_scenegraph_initialized (QtGLWindow * qt_window);
67 void qt_window_use_default_fbo (QtGLWindow * qt_window, gboolean useDefaultFbo);
70 #endif /* __QT_WINDOW_H__ */