Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
avfvideosink_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
AVFVIDEOWINDOWCONTROL_H
5
#
define
AVFVIDEOWINDOWCONTROL_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
/
private
/
qplatformvideosink_p
.
h
>
19
20
#
include
<
QtCore
/
private
/
qcore_mac_p
.
h
>
21
22
#
include
<
CoreVideo
/
CVBase
.
h
>
23
#
include
<
CoreVideo
/
CVImageBuffer
.
h
>
24
#
include
<
CoreVideo
/
CVPixelBuffer
.
h
>
25
26
#
import
<
AVFoundation
/
AVFoundation
.
h
>
27
#
import
<
Metal
/
Metal
.
h
>
28
29
QT_BEGIN_NAMESPACE
30
31
class
AVFVideoSinkInterface;
32
33
class
AVFVideoSink
:
public
QRhiVideoSink
34
{
35
Q_OBJECT
36
37
public
:
38
explicit
AVFVideoSink
(
QVideoSink
*
parent
=
nullptr
);
39
~
AVFVideoSink
()
override
;
40
41
// QPlatformVideoSink interface
42
public
:
43
void
setNativeSize
(QSize size);
44
45
void
setVideoSinkInterface
(
AVFVideoSinkInterface
*interface);
46
47
private
:
48
AVFVideoSinkInterface
*m_interface =
nullptr
;
49
};
50
51
class
AVFVideoSinkInterface
52
{
53
public
:
54
~
AVFVideoSinkInterface
();
55
56
void
setVideoSink
(
AVFVideoSink
*sink);
57
58
59
virtual
void
reconfigure
() = 0;
60
virtual
void
setRhi
(QRhi *);
61
virtual
void
setLayer
(CALayer *layer);
62
virtual
void
setOutputSettings
();
63
64
QRhi
*
rhi
()
const
{
return
m_rhi; }
65
66
void
updateLayerBounds
();
67
void
nativeSizeChanged
() {
updateLayerBounds
(
)
; }
68
QSize
nativeSize
()
const
{
return
m_sink
?
m_sink
->nativeSize() : QSize(); }
69
70
QCFType
<
CVMetalTextureCacheRef
>
cvMetalTextureCache
;
71
#
if
defined
(
Q_OS_MACOS
)
72
QCFType
<
CVOpenGLTextureCacheRef
>
cvOpenGLTextureCache
;
73
#
elif
defined
(
Q_OS_IOS
)
74
QCFType
<
CVOpenGLESTextureCacheRef
>
cvOpenGLESTextureCache
;
75
#
endif
76
private
:
77
void
freeTextureCaches();
78
79
protected
:
80
81
AVFVideoSink
*
m_sink
=
nullptr
;
82
QRhi
*
m_rhi
=
nullptr
;
83
CALayer
*
m_layer
=
nullptr
;
84
NSDictionary
*
m_outputSettings
=
nullptr
;
85
};
86
87
88
QT_END_NAMESPACE
89
90
#
endif
// AVFVIDEOWINDOWCONTROL_H
rhiTextureFormatToMetalFormat
static MTLPixelFormat rhiTextureFormatToMetalFormat(QRhiTexture::Format f)
Definition
avfvideobuffer.mm:84
AVFVideoBuffer
Definition
avfvideobuffer_p.h:33
AVFVideoBuffer::map
MapData map(QVideoFrame::MapMode mode) override
Maps the planes of a video buffer to memory.
Definition
avfvideobuffer.mm:41
AVFVideoBuffer::videoFormat
QVideoFrameFormat videoFormat() const
Definition
avfvideobuffer_p.h:43
AVFVideoBuffer::~AVFVideoBuffer
~AVFVideoBuffer() override
Definition
avfvideobuffer.mm:36
AVFVideoBuffer::textureHandle
quint64 textureHandle(QRhi &, int plane) override
Definition
avfvideobuffer.mm:115
AVFVideoBuffer::unmap
void unmap() override
Releases the memory mapped by the map() function.
Definition
avfvideobuffer.mm:74
AVFVideoBuffer::AVFVideoBuffer
AVFVideoBuffer(AVFVideoSinkInterface *sink, QCFType< CVImageBufferRef > buffer)
Definition
avfvideobuffer.mm:22
AVFVideoSinkInterface
Definition
avfvideosink_p.h:52
AVFVideoSinkInterface::setLayer
virtual void setLayer(CALayer *layer)
Definition
avfvideosink.mm:150
AVFVideoSinkInterface::cvMetalTextureCache
QCFType< CVMetalTextureCacheRef > cvMetalTextureCache
Definition
avfvideosink_p.h:70
AVFVideoSinkInterface::m_outputSettings
NSDictionary * m_outputSettings
Definition
avfvideosink_p.h:84
AVFVideoSinkInterface::setOutputSettings
virtual void setOutputSettings()
Definition
avfvideosink.mm:165
AVFVideoSinkInterface::setRhi
virtual void setRhi(QRhi *)
Definition
avfvideosink.mm:88
AVFVideoSinkInterface::nativeSizeChanged
void nativeSizeChanged()
Definition
avfvideosink_p.h:67
AVFVideoSinkInterface::~AVFVideoSinkInterface
~AVFVideoSinkInterface()
Definition
avfvideosink.mm:53
AVFVideoSinkInterface::reconfigure
virtual void reconfigure()=0
AVFVideoSinkInterface::rhi
QRhi * rhi() const
Definition
avfvideosink_p.h:64
AVFVideoSinkInterface::m_rhi
QRhi * m_rhi
Definition
avfvideosink_p.h:82
AVFVideoSinkInterface::m_sink
AVFVideoSink * m_sink
Definition
avfvideosink_p.h:81
AVFVideoSinkInterface::updateLayerBounds
void updateLayerBounds()
Definition
avfvideosink.mm:207
AVFVideoSinkInterface::m_layer
CALayer * m_layer
Definition
avfvideosink_p.h:83
AVFVideoSinkInterface::setVideoSink
void setVideoSink(AVFVideoSink *sink)
Definition
avfvideosink.mm:72
AVFVideoSinkInterface::nativeSize
QSize nativeSize() const
Definition
avfvideosink_p.h:68
AVFVideoSink
Definition
avfvideosink_p.h:34
AVFVideoSink::~AVFVideoSink
~AVFVideoSink() override
AVFVideoSink::setVideoSinkInterface
void setVideoSinkInterface(AVFVideoSinkInterface *interface)
Definition
avfvideosink.mm:43
AVFVideoSink::setNativeSize
void setNativeSize(QSize size)
Definition
avfvideosink.mm:34
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtmultimedia
src
plugins
multimedia
darwin
avfvideosink_p.h
Generated on
for Qt by
1.18.0