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
avfvideorenderercontrol_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 AVFVIDEORENDERERCONTROL_H
5#define AVFVIDEORENDERERCONTROL_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 <QtCore/QObject>
19#include <QtCore/QMutex>
20#include <QtCore/QSize>
21
22#include <avfvideosink_p.h>
23
24#include <CoreVideo/CVBase.h>
25#include <CoreVideo/CVPixelBuffer.h>
26
28Q_FORWARD_DECLARE_OBJC_CLASS(AVPlayerItemVideoOutput);
29Q_FORWARD_DECLARE_OBJC_CLASS(AVPlayerItemLegibleOutput);
31
33
34class AVFDisplayLink;
35
37{
39public:
40 explicit AVFVideoRendererControl(QObject *parent = nullptr);
42
43 // AVFVideoSinkInterface
44 void reconfigure() override;
45 void setLayer(CALayer *layer) override;
46
48 void setVideoMirrored(bool mirrored);
49
50 void setSubtitleText(const QString &subtitle)
51 {
52 m_sink->setSubtitleText(subtitle);
53 }
54private Q_SLOTS:
55 void updateVideoFrame(const CVTimeStamp &ts);
56
57private:
58 AVPlayerLayer *playerLayer() const { return static_cast<AVPlayerLayer *>(m_layer); }
59 CVPixelBufferRef copyPixelBufferFromLayer(size_t& width, size_t& height);
60
61 QMutex m_mutex;
62 AVFDisplayLink *m_displayLink = nullptr;
63 AVPlayerItemVideoOutput *m_videoOutput = nullptr;
64 AVPlayerItemLegibleOutput *m_subtitleOutput = nullptr;
65 SubtitleDelegate *m_subtitleDelegate = nullptr;
67 bool m_mirrored = false;
68};
69
71
72#endif // AVFVIDEORENDERERCONTROL_H
void setSubtitleText(const QString &subtitle)
void setVideoRotation(QtVideo::Rotation)
void setLayer(CALayer *layer) override
AVFVideoRendererControl(QObject *parent=nullptr)
AVFVideoSink * m_sink
\inmodule QtCore
Definition qmutex.h:281
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
void setSubtitleText(const QString &subtitleText)
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
Combined button and popup list for selecting options.
#define Q_FORWARD_DECLARE_OBJC_CLASS(classname)
EGLOutputLayerEXT layer
GLint GLsizei GLsizei height
GLint GLsizei width
#define Q_OBJECT
#define Q_SLOTS