Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qgstreamerintegration.cpp
Go to the documentation of this file.
1// Copyright (C) 2022 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
16#include <QtMultimedia/private/qplatformmediaplugin_p.h>
17
18#include <memory>
19
21
23{
26
27public:
30 {}
31
33 {
34 if (name == QLatin1String("gstreamer"))
35 return new QGstreamerIntegration;
36 return nullptr;
37 }
38};
39
41{
42 gst_init(nullptr, nullptr);
43 m_videoDevices = std::make_unique<QGstreamerVideoDevices>(this);
44 m_formatsInfo = new QGstreamerFormatInfo();
45}
46
48{
49 delete m_formatsInfo;
50}
51
53{
54 return m_formatsInfo;
55}
56
58{
59 return m_formatsInfo;
60}
61
63{
64 return QGstreamerAudioDecoder::create(decoder);
65}
66
68{
70}
71
73{
75}
76
78{
80}
81
83{
85}
86
88{
90}
91
93{
94 return new QGstreamerVideoSink(sink);
95}
96
98{
100}
101
103{
105}
106
108{
109 return m_videoDevices
110 ? static_cast<QGstreamerVideoDevices *>(m_videoDevices.get())->videoDevice(id)
111 : nullptr;
112}
113
115
116#include "qgstreamerintegration.moc"
QMediaPlayer player
Definition audio.cpp:205
The QAudioDecoder class implements decoding audio.
\qmltype AudioInput \instantiates QAudioInput
Definition qaudioinput.h:19
\qmltype AudioOutput \instantiates QAudioOutput
\inmodule QtCore
Definition qbytearray.h:57
The QCamera class provides interface for system camera devices.
Definition qcamera.h:28
static QMaybe< QPlatformAudioDecoder * > create(QAudioDecoder *parent)
static QMaybe< QPlatformAudioInput * > create(QAudioInput *parent)
static QMaybe< QPlatformAudioOutput * > create(QAudioOutput *parent)
static QMaybe< QPlatformCamera * > create(QCamera *camera)
static QMaybe< QPlatformImageCapture * > create(QImageCapture *parent)
QMaybe< QPlatformCamera * > createCamera(QCamera *) override
QMaybe< QPlatformVideoSink * > createVideoSink(QVideoSink *sink) override
QMaybe< QPlatformImageCapture * > createImageCapture(QImageCapture *) override
QMaybe< QPlatformMediaRecorder * > createRecorder(QMediaRecorder *) override
const QGstreamerFormatInfo * gstFormatsInfo() const
QMaybe< QPlatformAudioDecoder * > createAudioDecoder(QAudioDecoder *decoder) override
QMaybe< QPlatformMediaCaptureSession * > createCaptureSession() override
QPlatformMediaFormatInfo * formatInfo() override
GstDevice * videoDevice(const QByteArray &id) const
QMaybe< QPlatformAudioInput * > createAudioInput(QAudioInput *) override
QMaybe< QPlatformAudioOutput * > createAudioOutput(QAudioOutput *) override
QMaybe< QPlatformMediaPlayer * > createPlayer(QMediaPlayer *player) override
static QMaybe< QPlatformMediaCaptureSession * > create()
static QMaybe< QPlatformMediaPlayer * > create(QMediaPlayer *parent=nullptr)
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
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei GLenum GLboolean sink
#define QPlatformMediaPlugin_iid
QLatin1StringView QLatin1String
Definition qstringfwd.h:31
#define Q_OBJECT
#define Q_PLUGIN_METADATA(x)