Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
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.h>
19#include <QtCore/qmutex.h>
20#include <QtCore/qsize.h>
21#include <QtCore/private/qcore_mac_p.h>
22
23#include <avfvideosink_p.h>
24
25#include <CoreVideo/CVBase.h>
26#include <CoreVideo/CVPixelBuffer.h>
27
32
33QT_BEGIN_NAMESPACE
34
35class AVFDisplayLink;
36
38{
40public:
41 explicit AVFVideoRendererControl(QObject *parent = nullptr);
43
44 // AVFVideoSinkInterface
45 void reconfigure() override;
46 void setLayer(CALayer *layer) override;
47
49 void setVideoMirrored(bool mirrored);
50
51 void setSubtitleText(const QString &subtitle)
52 {
53 m_sink->setSubtitleText(subtitle);
54 }
55private Q_SLOTS:
56 void updateVideoFrame(const CVTimeStamp &ts);
57
58private:
59 AVPlayerLayer *playerLayer() const { return static_cast<AVPlayerLayer *>(m_layer); }
60 QCFType<CVPixelBufferRef> copyPixelBufferFromLayer(size_t &width, size_t &height);
61
62 QMutex m_mutex;
63 AVFDisplayLink *m_displayLink = nullptr;
64 AVPlayerItemVideoOutput *m_videoOutput = nullptr;
65 AVPlayerItemLegibleOutput *m_subtitleOutput = nullptr;
66 SubtitleDelegate *m_subtitleDelegate = nullptr;
67 QtVideo::Rotation m_rotation = QtVideo::Rotation::None;
68 bool m_mirrored = false;
69};
70
71QT_END_NAMESPACE
72
73#endif // AVFVIDEORENDERERCONTROL_H
static void * AVFMediaPlayerObserverCurrentItemObservationContext
static NSString *const AVF_BUFFER_LIKELY_KEEP_UP_KEY
static void * AVFMediaPlayerObserverPresentationSizeContext
static void * AVFMediaPlayerObserverTracksContext
static QT_USE_NAMESPACE NSString *const AVF_TRACKS_KEY
static NSString *const AVF_STATUS_KEY
static NSString *const AVF_CURRENT_ITEM_DURATION_KEY
static void setURL(AVFMediaPlayerObserver *observer, const QByteArray &url, const QString &mimeType=QString())
static void * AVFMediaPlayerObserverRateObservationContext
static NSString *const AVF_CURRENT_ITEM_KEY
static NSString *const AVF_PLAYABLE_KEY
static void * AVFMediaPlayerObserverBufferLikelyToKeepUpContext
static NSString *const AVF_RATE_KEY
static void setStreamURL(AVFMediaPlayerObserver *observer, const QByteArray &url)
static void * AVFMediaPlayerObserverCurrentItemDurationObservationContext
static void * AVFMediaPlayerObserverStatusObservationContext
Q_FORWARD_DECLARE_OBJC_CLASS(AVFMediaPlayerObserver)
Q_FORWARD_DECLARE_OBJC_CLASS(SubtitleDelegate)
Q_FORWARD_DECLARE_OBJC_CLASS(AVPlayerItemLegibleOutput)
Q_FORWARD_DECLARE_OBJC_CLASS(AVPlayerItemVideoOutput)
qint64 duration() const override
void setVolume(float volume)
void processLoadStateChange()
void setPosition(qint64 pos) override
void setVideoSink(QVideoSink *sink) override
QMediaTimeRange availablePlaybackRanges() const override
void nativeSizeChanged(QSize size)
bool isAudioAvailable() const override
QMediaMetaData metaData() const override
void setVideoOutput(AVFVideoRendererControl *output)
void stop() override
float bufferProgress() const override
void setMedia(const QUrl &content, QIODevice *stream) override
qint64 position() const override
void setPitchCompensation(bool enabled) override
QMediaPlayer::PlaybackState state() const override
void setMuted(bool muted)
void pause() override
void play() override
void processDurationChange(qint64 duration)
QUrl media() const override
bool pitchCompensation() const override
void processLoadStateFailure()
void updateAudioOutputDevice()
qreal playbackRate() const override
QMediaPlayer::MediaStatus mediaStatus() const override
void processLoadStateChange(QMediaPlayer::PlaybackState newState)
QIODevice * mediaStream() const override
PitchCompensationAvailability pitchCompensationAvailability() const override
~AVFMediaPlayer() override
AVAsset * currentAssetHandle()
bool isVideoAvailable() const override
bool isSeekable() const override
void processBufferStateChange(int bufferProgress)
void setSubtitleText(const QString &subtitle)
void setVideoRotation(QtVideo::Rotation)
void setLayer(CALayer *layer) override
AVFVideoSink * m_sink
void setVideoSink(AVFVideoSink *sink)
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject)