Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qdarwinintegration.mm
Go to the documentation of this file.
1// Copyright (C) 2021 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
5#include <avfmediaplayer_p.h>
7#include <avfcamera_p.h>
8#include <avfimagecapture_p.h>
9#include <avfmediaencoder_p.h>
11#include <avfvideosink_p.h>
12#include <avfaudiodecoder_p.h>
13#include <VideoToolbox/VideoToolbox.h>
14#include <qdebug.h>
15#include <private/qplatformmediaplugin_p.h>
16#include <qavfcamerabase_p.h>
17
19
21{
24
25public:
28 {}
29
31 {
32 if (name == QLatin1String("darwin"))
33 return new QDarwinIntegration;
34 return nullptr;
35 }
36};
37
38
40{
41#if defined(Q_OS_MACOS) && QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_11_0)
42 if (__builtin_available(macOS 11.0, *))
43 VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9);
44#endif
45 m_videoDevices = std::make_unique<QAVFVideoDevices>(this);
46}
47
49{
50 delete m_formatInfo;
51}
52
54{
55 if (!m_formatInfo)
57 return m_formatInfo;
58}
59
61{
62 return new AVFAudioDecoder(decoder);
63}
64
66{
67 return new AVFCameraService;
68}
69
71{
72 return new AVFMediaPlayer(player);
73}
74
76{
77 return new AVFCamera(camera);
78}
79
81{
82 return new AVFMediaEncoder(recorder);
83}
84
86{
87 return new AVFImageCapture(imageCapture);
88}
89
91{
92 return new AVFVideoSink(sink);
93}
94
96
97#include "qdarwinintegration.moc"
QMediaPlayer player
Definition audio.cpp:205
The QAudioDecoder class implements decoding audio.
The QCamera class provides interface for system camera devices.
Definition qcamera.h:28
QMaybe< QPlatformImageCapture * > createImageCapture(QImageCapture *) override
QMaybe< QPlatformMediaPlayer * > createPlayer(QMediaPlayer *player) override
QMaybe< QPlatformMediaRecorder * > createRecorder(QMediaRecorder *) override
QPlatformMediaFormatInfo * formatInfo() override
QPlatformMediaFormatInfo * m_formatInfo
QMaybe< QPlatformAudioDecoder * > createAudioDecoder(QAudioDecoder *) override
QMaybe< QPlatformCamera * > createCamera(QCamera *camera) override
QMaybe< QPlatformMediaCaptureSession * > createCaptureSession() override
QMaybe< QPlatformVideoSink * > createVideoSink(QVideoSink *) override
QPlatformMediaIntegration * create(const QString &name) override
\inmodule QtMultimedia
The QMediaPlayer class allows the playing of a media files.
\inmodule QtMultimedia
std::unique_ptr< QPlatformVideoDevices > m_videoDevices
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:127
The QVideoSink class represents a generic sink for video data.
Definition qvideosink.h:22
QMediaRecorder * recorder
Definition camera.cpp:20
QCamera * camera
Definition camera.cpp:19
QImageCapture * imageCapture
Definition camera.cpp:21
Combined button and popup list for selecting options.
GLuint name
GLsizei GLenum GLboolean sink
#define QPlatformMediaPlugin_iid
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)