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
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
17
18#include <QtCore/qloggingcategory.h>
19
21
24
30
36
37Q_LOGGING_CATEGORY(lcGstreamer, "qt.multimedia.gstreamer")
38
41{
42 gst_init(nullptr, nullptr);
43 qCDebug(lcGstreamer) << "Using gstreamer version: " << gst_version_string();
44
45 if constexpr (!GST_CHECK_VERSION(1, 22, 0)) {
46 GstRegistry* reg = gst_registry_get();
47 const auto pluginNames = {
48 "vaapidecodebin",
49 "vaapih264dec",
50 "vaapih264enc",
51 "vaapih265dec",
52 "vaapijpegdec",
53 "vaapijpegenc",
54 "vaapimpeg2dec",
55 "vaapipostproc",
56 "vaapisink",
57 "vaapivp8dec",
58 "vaapivp9dec"
59 };
60
61 for (auto name : pluginNames) {
62 QGstPluginFeatureHandle pluginFeature {
63 gst_registry_lookup_feature(reg, name),
65 };
66 if (pluginFeature) {
67 gst_plugin_feature_set_rank(pluginFeature.get(), GST_RANK_PRIMARY - 1);
68 }
69 }
70 }
71}
72
77
82
87
88QMaybe<QPlatformAudioDecoder *> QGstreamerIntegration::createAudioDecoder(QAudioDecoder *decoder)
89{
90 return QGstreamerAudioDecoder::create(decoder);
91}
92
93QMaybe<QPlatformMediaCaptureSession *> QGstreamerIntegration::createCaptureSession()
94{
96}
97
102
104{
106}
107
109{
111}
112
117
119{
120 return new QGstreamerVideoSink(sink);
121}
122
124{
126}
127
129{
131}
132
134{
135 const auto devices = videoDevices();
136 return devices ? static_cast<QGstreamerVideoDevices *>(devices)->videoDevice(id) : nullptr;
137}
138
143
QMediaPlayer player
Definition audio.cpp:213
The QAudioDecoder class implements decoding audio.
The QAudioDevice class provides an information about audio devices and their functionality.
\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
QAudioDevice makeCustomGStreamerAudioInput(const QByteArray &gstreamerPipeline) override
QAudioDevice makeCustomGStreamerAudioOutput(const QByteArray &gstreamerPipeline) override
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)
QPlatformVideoDevices * createVideoDevices() override
QPlatformMediaFormatInfo * createFormatInfo() override
QMaybe< QPlatformCamera * > createCamera(QCamera *) override
QMaybe< QPlatformVideoSink * > createVideoSink(QVideoSink *sink) override
QGStreamerPlatformSpecificInterfaceImplementation m_platformSpecificImplementation
QMaybe< QPlatformImageCapture * > createImageCapture(QImageCapture *) override
QAbstractPlatformSpecificInterface * platformSpecificInterface() override
QMaybe< QPlatformMediaRecorder * > createRecorder(QMediaRecorder *) override
QMaybe< QPlatformAudioDecoder * > createAudioDecoder(QAudioDecoder *decoder) override
QMaybe< QPlatformMediaCaptureSession * > createCaptureSession() override
QMaybe< QPlatformAudioInput * > createAudioInput(QAudioInput *) override
const QGstreamerFormatInfo * gstFormatsInfo()
QMaybe< QPlatformAudioOutput * > createAudioOutput(QAudioOutput *) override
GstDevice * videoDevice(const QByteArray &id)
QMaybe< QPlatformMediaPlayer * > createPlayer(QMediaPlayer *player) override
static QMaybe< QPlatformMediaCaptureSession * > create()
static QMaybe< QPlatformMediaPlayer * > create(QMediaPlayer *parent=nullptr)
\inmodule QtMultimedia
The QMediaPlayer class allows the playing of a media files.
\inmodule QtMultimedia
const QPlatformMediaFormatInfo * formatInfo()
QPlatformVideoDevices * videoDevices()
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.
EGLDeviceEXT * devices
QAudioDevice qMakeCustomGStreamerAudioInput(const QByteArray &gstreamerPipeline)
QAudioDevice qMakeCustomGStreamerAudioOutput(const QByteArray &gstreamerPipeline)
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLuint name
GLdouble GLdouble GLdouble GLdouble q
Definition qopenglext.h:259
GLsizei GLenum GLboolean sink