4#ifndef AVFVIDEOBUFFER_H
5#define AVFVIDEOBUFFER_H
18#include <private/qhwvideobuffer_p.h>
19#include <private/qcore_mac_p.h>
21#include <QtCore/qobject.h>
22#include <QtCore/qmutex.h>
23#include <avfvideosink_p.h>
25#include <CoreVideo/CVImageBuffer.h>
27#import "Metal/Metal.h"
28#import "MetalKit/MetalKit.h"
32struct AVFMetalTexture;
39 MapData map(QVideoFrame::MapMode mode)
override;
49 QCFType<CVMetalTextureCacheRef> metalCache;
50 QCFType<CVImageBufferRef> m_buffer;
51 QCFType<CVMetalTextureRef> cvMetalTexture[3];
52#if defined(Q_OS_MACOS)
54#elif defined(Q_OS_IOS)
59 QVideoFrameFormat m_format;
static MTLPixelFormat rhiTextureFormatToMetalFormat(QRhiTexture::Format f)
MapData map(QVideoFrame::MapMode mode) override
Maps the planes of a video buffer to memory.
QVideoFrameFormat videoFormat() const
~AVFVideoBuffer() override
quint64 textureHandle(QRhi &, int plane) override
void unmap() override
Releases the memory mapped by the map() function.
AVFVideoBuffer(AVFVideoSinkInterface *sink, QCFType< CVImageBufferRef > buffer)