3 * Copyright (C) 2015 Matthew Waters <matthew@centricular.com>
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.
25 #include <gst/gl/gl.h>
27 #include <QOpenGLContext>
28 #include <QOpenGLFunctions>
30 typedef struct _QtGLVideoItemPrivate QtGLVideoItemPrivate;
32 class QtGLVideoItem : public QQuickItem, protected QOpenGLFunctions
39 void setDAR(gint, gint);
40 void getDAR(gint *, gint *);
41 void setForceAspectRatio(bool);
42 bool getForceAspectRatio();
44 /* private for C interface ... */
45 QtGLVideoItemPrivate *priv;
48 void handleWindowChanged(QQuickWindow * win);
49 void onSceneGraphInitialized();
50 void onSceneGraphInvalidated();
53 QSGNode * updatePaintNode (QSGNode * oldNode, UpdatePaintNodeData * updatePaintNodeData);
56 void setViewportSize(const QSize &size);
64 void qt_item_set_buffer (QtGLVideoItem * widget, GstBuffer * buffer);
65 gboolean qt_item_set_caps (QtGLVideoItem * widget, GstCaps * caps);
66 gboolean qt_item_init_winsys (QtGLVideoItem * widget);
67 GstGLContext * qt_item_get_qt_context (QtGLVideoItem * qt_item);
68 GstGLContext * qt_item_get_context (QtGLVideoItem * qt_item);
69 GstGLDisplay * qt_item_get_display (QtGLVideoItem * qt_item);
72 #endif /* __QT_ITEM_H__ */