Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qffmpegvideobuffer_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QFFMPEGVIDEOBUFFER_P_H
5#define QFFMPEGVIDEOBUFFER_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 <qvideoframe.h>
21#include <QtCore/qvariant.h>
22
23#include "qffmpeg_p.h"
24#include "qffmpeghwaccel_p.h"
25
27
29{
30public:
32
35
36 QVideoFrame::MapMode mapMode() const override;
38 void unmap() override;
39
40 virtual std::unique_ptr<QVideoFrameTextures> mapTextures(QRhi *) override;
41 virtual quint64 textureHandle(int plane) const override;
42
44 QSize size() const;
45
46 static QVideoFrameFormat::PixelFormat toQtPixelFormat(AVPixelFormat avPixelFormat, bool *needsConversion = nullptr);
48
49 void convertSWFrame();
50
51 AVFrame *getHWFrame() const { return hwFrame.get(); }
52
54
58
59 float maxNits();
60
61private:
63 AVFrame *frame = nullptr;
64 AVFrameUPtr hwFrame;
65 AVFrameUPtr swFrame;
66 QFFmpeg::TextureConverter textureConverter;
68 std::unique_ptr<QFFmpeg::TextureSet> textures;
69};
70
72
73#endif
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
QVideoFrameFormat::PixelFormat pixelFormat() const
QVideoFrameFormat::ColorSpace colorSpace() const
void unmap() override
Releases the memory mapped by the map() function.
QVideoFrameFormat::ColorTransfer colorTransfer() const
QFFmpeg::AVFrameUPtr AVFrameUPtr
void setTextureConverter(const QFFmpeg::TextureConverter &converter)
virtual std::unique_ptr< QVideoFrameTextures > mapTextures(QRhi *) override
virtual quint64 textureHandle(int plane) const override
Returns a texture handle to the data buffer.
static AVPixelFormat toAVPixelFormat(QVideoFrameFormat::PixelFormat pixelFormat)
QVideoFrameFormat::ColorRange colorRange() const
AVFrame * getHWFrame() const
static QVideoFrameFormat::PixelFormat toQtPixelFormat(AVPixelFormat avPixelFormat, bool *needsConversion=nullptr)
~QFFmpegVideoBuffer() override
QVideoFrame::MapMode mapMode() const override
\inmodule QtGui
Definition qrhi.h:1767
\inmodule QtCore
Definition qsize.h:25
ColorSpace
Enumerates the color space of video frames.
ColorTransfer
\value ColorTransfer_Unknown The color transfer function is unknown.
PixelFormat
Enumerates video data types.
ColorRange
Describes the color range used by the video data.
MapMode
Enumerates how a video buffer's data is mapped to system memory.
Definition qvideoframe.h:36
QMap< QString, QString > map
[6]
std::unique_ptr< AVFrame, AVDeleter< decltype(&av_frame_free), &av_frame_free > > AVFrameUPtr
Definition qffmpeg_p.h:117
Combined button and popup list for selecting options.
GLenum mode
GLuint const GLuint GLuint const GLuint * textures
unsigned long long quint64
Definition qtypes.h:56