Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
avfvideobuffer_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 AVFVIDEOBUFFER_H
5#define AVFVIDEOBUFFER_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 <QtMultimedia/qvideoframe.h>
19#include <private/qabstractvideobuffer_p.h>
20#include <private/qcore_mac_p.h>
21
22#include <QtCore/qobject.h>
23#include <QtCore/qmutex.h>
24#include <avfvideosink_p.h>
25
26#include <CoreVideo/CVImageBuffer.h>
27
28#import "Metal/Metal.h"
29#import "MetalKit/MetalKit.h"
30
32
33struct AVFMetalTexture;
35{
36public:
39
40 QVideoFrame::MapMode mapMode() const { return m_mode; }
42 void unmap();
43
44 virtual quint64 textureHandle(QRhi *, int plane) const;
45
46 QVideoFrameFormat videoFormat() const { return m_format; }
47
48private:
49 AVFVideoSinkInterface *sink = nullptr;
50
51 mutable CVMetalTextureRef cvMetalTexture[3] = {};
52 mutable QCFType<CVMetalTextureCacheRef> metalCache;
53#if defined(Q_OS_MACOS)
54 mutable CVOpenGLTextureRef cvOpenGLTexture = nullptr;
55#elif defined(Q_OS_IOS)
56 mutable CVOpenGLESTextureRef cvOpenGLESTexture = nullptr;
57#endif
58
59 CVImageBufferRef m_buffer = nullptr;
61 QVideoFrameFormat m_format;
62};
63
65
66#endif
void unmap()
Releases the memory mapped by the map() function.
QVideoFrameFormat videoFormat() const
AVFVideoBuffer(AVFVideoSinkInterface *sink, CVImageBufferRef buffer)
virtual quint64 textureHandle(QRhi *, int plane) const
Returns a texture handle to the data buffer.
QVideoFrame::MapMode mapMode() const
The QAbstractVideoBuffer class is an abstraction for video data. \inmodule QtMultimedia.
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
Definition qrhi.h:1804
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:37
QMap< QString, QString > map
[6]
Combined button and popup list for selecting options.
GLenum mode
GLenum GLuint buffer
GLsizei GLenum GLboolean sink
unsigned long long quint64
Definition qtypes.h:61