4#ifndef AVFVIDEOWINDOWCONTROL_H
5#define AVFVIDEOWINDOWCONTROL_H
18#include "private/qplatformvideosink_p.h"
20#include <QtCore/private/qcore_mac_p.h>
26#include <CoreVideo/CVBase.h>
27#include <CoreVideo/CVImageBuffer.h>
28#include <CoreVideo/CVPixelBuffer.h>
30#import "Metal/Metal.h"
31#import "MetalKit/MetalKit.h"
35class AVFVideoSinkInterface;
47 void setRhi(QRhi *rhi)
override;
55 QRhi *m_rhi =
nullptr;
67 virtual void setRhi(QRhi *);
68 virtual void setLayer(CALayer *layer);
78#if defined(Q_OS_MACOS)
80#elif defined(Q_OS_IOS)
84 void freeTextureCaches();
static MTLPixelFormat rhiTextureFormatToMetalFormat(QRhiTexture::Format f)
Q_FORWARD_DECLARE_OBJC_CLASS(CALayer)
Q_FORWARD_DECLARE_OBJC_CLASS(AVPlayerLayer)
Q_FORWARD_DECLARE_OBJC_CLASS(AVCaptureVideoPreviewLayer)
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)
virtual void setLayer(CALayer *layer)
QCFType< CVMetalTextureCacheRef > cvMetalTextureCache
NSDictionary * m_outputSettings
virtual void setOutputSettings()
virtual void setRhi(QRhi *)
virtual void reconfigure()=0
void setVideoSink(AVFVideoSink *sink)
void setRhi(QRhi *rhi) override
void setVideoSinkInterface(AVFVideoSinkInterface *interface)
void setNativeSize(QSize size)