Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qgstreameraudiodevice.cpp
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
5
6#include <qgstutils_p.h>
7#include <private/qplatformmediaintegration_p.h>
8
10
13 gstDevice(d)
14{
16 gst_object_ref(gstDevice);
17
18 auto *n = gst_device_get_display_name(gstDevice);
20 g_free(n);
21
22 auto caps = QGstCaps(gst_device_get_caps(gstDevice),QGstCaps::HasRef);
23 int size = caps.size();
24 for (int i = 0; i < size; ++i) {
25 auto c = caps.at(i);
26 if (c.name() == "audio/x-raw") {
27 auto rate = c["rate"].toIntRange();
28 if (rate) {
31 }
32 auto channels = c["channels"].toIntRange();
33 if (channels) {
34 minimumChannelCount = channels->min;
35 maximumChannelCount = channels->max;
36 }
37 supportedSampleFormats = c["format"].getSampleFormats();
38 }
39 }
40
47}
48
50{
51 if (gstDevice)
52 gst_object_unref(gstDevice);
53}
54
IOBluetoothDevice * device
QAudioFormat preferredFormat
QList< QAudioFormat::SampleFormat > supportedSampleFormats
Mode
Describes the mode of this device.
constexpr void setSampleRate(int sampleRate) noexcept
Sets the sample rate to samplerate in Hertz.
SampleFormat
Qt will always expect and use samples in the endianness of the host platform.
constexpr void setSampleFormat(SampleFormat f) noexcept
Sets the sample format to format.
constexpr void setChannelCount(int channelCount) noexcept
Sets the channel count to channels.
\inmodule QtCore
Definition qbytearray.h:57
QGStreamerAudioDeviceInfo(GstDevice *gstDevice, const QByteArray &device, QAudioDevice::Mode mode)
@ HasRef
Definition qgst_p.h:163
T value(qsizetype i) const
Definition qlist.h:661
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition qstring.cpp:5857
Combined button and popup list for selecting options.
constexpr const T & qBound(const T &min, const T &val, const T &max)
Definition qminmax.h:44
GLenum mode
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLfloat GLfloat f
GLfloat n
const GLubyte * c
GLuint GLenum * rate
#define Q_ASSERT(cond)
Definition qrandom.cpp:47
bool contains(const AT &t) const noexcept
Definition qlist.h:44