1// Copyright (C) 2024 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 QHWVIDEOBUFFER_P_H
5#define QHWVIDEOBUFFER_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 "qabstractvideobuffer.h"
19#include "qvideoframe.h"
20
21#include <QtGui/qmatrix4x4.h>
22
23QT_BEGIN_NAMESPACE
24
25class QRhi;
26class QRhiTexture;
27
28class Q_MULTIMEDIA_EXPORT QVideoFrameTextures
29{
30public:
31 virtual ~QVideoFrameTextures();
32 virtual QRhiTexture *texture(uint plane) const = 0;
33};
34
35class Q_MULTIMEDIA_EXPORT QHwVideoBuffer : public QAbstractVideoBuffer
36{
37public:
38 QHwVideoBuffer(QVideoFrame::HandleType type, QRhi *rhi = nullptr);
39
40 ~QHwVideoBuffer() override;
41
42 QVideoFrame::HandleType handleType() const { return m_type; }
43 QRhi *rhi() const { return m_rhi; }
44
45 QVideoFrameFormat format() const override { return {}; }
46
47 virtual std::unique_ptr<QVideoFrameTextures> mapTextures(QRhi *) { return {}; }
48 virtual quint64 textureHandle(QRhi *, int /*plane*/) const { return 0; }
49 virtual QMatrix4x4 externalTextureMatrix() const { return {}; }
50
51protected:
52 QVideoFrame::HandleType m_type;
53 QRhi *m_rhi = nullptr;
54};
55
56QT_END_NAMESPACE
57
58#endif // QHWVIDEOBUFFER_P_H
59

source code of qtmultimedia/src/multimedia/video/qhwvideobuffer_p.h