Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qgstvideobuffer_p.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QGSTVIDEOBUFFER_P_H
5#define QGSTVIDEOBUFFER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <private/qtmultimediaglobal_p.h>
19#include <private/qabstractvideobuffer_p.h>
20#include <QtCore/qvariant.h>
21
22#include <qgst_p.h>
23#include <gst/video/video.h>
24
28class QOpenGLContext;
29
30class Q_MULTIMEDIA_EXPORT QGstVideoBuffer : public QAbstractVideoBuffer
31{
32public:
33
34 QGstVideoBuffer(GstBuffer *buffer, const GstVideoInfo &info, QGstreamerVideoSink *sink,
36 QGstVideoBuffer(GstBuffer *buffer, const QVideoFrameFormat &format, const GstVideoInfo &info)
38 {}
40
41 GstBuffer *buffer() const { return m_buffer; }
42 QVideoFrame::MapMode mapMode() const override;
43
44 MapData map(QVideoFrame::MapMode mode) override;
45 void unmap() override;
46
47 virtual std::unique_ptr<QVideoFrameTextures> mapTextures(QRhi *) override;
48private:
50 QVideoFrameFormat m_frameFormat;
51 QRhi *m_rhi = nullptr;
52 mutable GstVideoInfo m_videoInfo;
53 mutable GstVideoFrame m_frame;
54 GstBuffer *m_buffer = nullptr;
56 Qt::HANDLE eglDisplay = nullptr;
57 QFunctionPointer eglImageTargetTexture2D = nullptr;
58};
59
61
62#endif
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
virtual void unmap()=0
Releases the memory mapped by the map() function.
virtual std::unique_ptr< QVideoFrameTextures > mapTextures(QRhi *)
virtual QVideoFrame::MapMode mapMode() const =0
MemoryFormat
Definition qgst_p.h:164
@ CpuMemory
Definition qgst_p.h:164
QGstVideoBuffer(GstBuffer *buffer, const QVideoFrameFormat &format, const GstVideoInfo &info)
GstBuffer * buffer() const
\inmodule QtGui
\inmodule QtGui
Definition qrhi.h:1767
The QVideoFrameFormat class specifies the stream format of a video presentation surface.
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition qvideoframe.h:36
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
void * HANDLE
GLenum mode
GLenum GLuint buffer
GLint GLsizei GLsizei GLenum format
GLsizei GLenum GLboolean sink
QFileInfo info(fileName)
[8]
QObject::connect nullptr