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
28#import <AVFoundation/AVFoundation.h>
29
31
32QT_BEGIN_NAMESPACE
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 QCFType<CVPixelBufferRef> copyPixelBufferFromLayer(size_t &width, size_t &height,
60 qint64 &startTime);
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 NSString *const AVF_STATUS_KEY
static NSString *const AVF_CURRENT_ITEM_DURATION_KEY
static void * AVFMediaPlayerObserverRateObservationContext
static void setURL(AVFMediaPlayerObserver *observer, const QUrl &url, const QString &mimeType=QString())
static NSString *const AVF_CURRENT_ITEM_KEY
static NSString *const AVF_PLAYABLE_KEY
static void * AVFMediaPlayerObserverBufferLikelyToKeepUpContext
static NSString *const AVF_RATE_KEY
static void * AVFMediaPlayerObserverCurrentItemDurationObservationContext
static void * AVFMediaPlayerObserverStatusObservationContext
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)
QMediaMetaData metaData() const override
void setVideoOutput(AVFVideoRendererControl *output)
void stop() override
float bufferProgress() const override
void processMediaLoadError(QMediaPlayer::Error errorCode)
void setMedia(const QUrl &content, QIODevice *stream) override
qint64 position() const override
void setPitchCompensation(bool enabled) 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
void processLoadStateChange(QMediaPlayer::PlaybackState newState)
QIODevice * mediaStream() const override
PitchCompensationAvailability pitchCompensationAvailability() const override
~AVFMediaPlayer() override
AVAsset * currentAssetHandle()
void processBufferStateChange(int bufferProgress)
void setSubtitleText(const QString &subtitle)
void setVideoRotation(QtVideo::Rotation)
void setLayer(CALayer *layer) override
void setVideoSink(AVFVideoSink *sink)
Q_FORWARD_DECLARE_OBJC_CLASS(NSObject)