QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
gstqsg6glnode.h
Go to the documentation of this file.
1/*
2 * GStreamer
3 * Copyright (C) 2022 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#pragma once
22
23#include <gst/gst.h>
24#include <gst/gl/gl.h>
25
26#include "gstqt6gl.h"
27#include <QtQuick/QQuickItem>
28#include <QtQuick/QSGTexture>
29#include <QtQuick/QSGTextureProvider>
30#include <QtQuick/QSGSimpleTextureNode>
31#include <QtGui/QOpenGLFunctions>
32
33class GstQSG6OpenGLNode : public QSGTextureProvider, public QSGSimpleTextureNode, protected QOpenGLFunctions
34{
35 Q_OBJECT
36
37public:
38 GstQSG6OpenGLNode(QQuickItem *item);
40
41 QSGTexture *texture() const override;
42
43 void setCaps(GstCaps *caps);
44 void setBuffer(GstBuffer *buffer);
45 GstBuffer *getBuffer();
46
48
49private:
50 QQuickWindow *window_;
51 GstBuffer * buffer_;
52 gboolean buffer_was_bound;
53 GstBuffer * sync_buffer_;
54 GstMemory * mem_;
55 QSGTexture *dummy_tex_;
56 GstVideoInfo v_info;
57 GstVideoFrame v_frame;
58};
QSGTexture * texture() const override
void setBuffer(GstBuffer *buffer)
GstBuffer * getBuffer()
void setCaps(GstCaps *caps)