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
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:
29
31 {
32 if (name == u"darwin")
33 return new QDarwinIntegration;
34 return nullptr;
35 }
36};
37
39{
40#if defined(Q_OS_MACOS) && QT_MACOS_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_11_0)
41 if (__builtin_available(macOS 11.0, *))
42 VTRegisterSupplementalVideoDecoderIfAvailable(kCMVideoCodecType_VP9);
43#endif
44}
45
50
55
56QMaybe<QPlatformAudioDecoder *> QDarwinIntegration::createAudioDecoder(QAudioDecoder *decoder)
57{
58 return new AVFAudioDecoder(decoder);
59}
60
61QMaybe<QPlatformMediaCaptureSession *> QDarwinIntegration::createCaptureSession()
62{
63 return new AVFCameraService;
64}
65
67{
68 return new AVFMediaPlayer(player);
69}
70
72{
73 return new AVFCamera(camera);
74}
75
77{
78 return new AVFMediaEncoder(recorder);
79}
80
82{
83 return new AVFImageCapture(imageCapture);
84}
85
87{
88 return new AVFVideoSink(sink);
89}
90
92
93#include "qdarwinintegration.moc"
QMediaPlayer player
Definition audio.cpp:213
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
QPlatformVideoDevices * createVideoDevices() override
QMaybe< QPlatformMediaRecorder * > createRecorder(QMediaRecorder *) override
QPlatformMediaFormatInfo * createFormatInfo() override
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
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
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
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)