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
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 <common/qgst_p.h>
8#include <private/qplatformmediaintegration_p.h>
9
11
15 gstDevice{
16 d,
17 QGstDeviceHandle::NeedsRef,
18 }
19{
21 gst_device_get_display_name(gstDevice.get()),
22 };
23 description = name.toQString();
24
25 auto caps = QGstCaps(gst_device_get_caps(gstDevice.get()), QGstCaps::HasRef);
26 int size = caps.size();
27 for (int i = 0; i < size; ++i) {
28 auto c = caps.at(i);
29 if (c.name() == "audio/x-raw") {
30 auto rate = c["rate"].toIntRange();
31 if (rate) {
34 }
35 auto channels = c["channels"].toIntRange();
36 if (channels) {
37 minimumChannelCount = channels->min;
38 maximumChannelCount = channels->max;
39 }
40 supportedSampleFormats = c["format"].getSampleFormats();
41 }
42 }
43
50}
51
53 const QByteArray &gstreamerPipeline, QAudioDevice::Mode mode)
55 gstreamerPipeline,
56 mode,
57 }
58{
59}
60
62{
63 auto deviceInfo = std::make_unique<QGStreamerCustomAudioDeviceInfo>(gstreamerPipeline,
65
66 return deviceInfo.release()->create();
67}
68
70{
71 auto deviceInfo = std::make_unique<QGStreamerCustomAudioDeviceInfo>(gstreamerPipeline,
73
74 return deviceInfo.release()->create();
75}
76
IOBluetoothDevice * device
QAudioFormat preferredFormat
QList< QAudioFormat::SampleFormat > supportedSampleFormats
The QAudioDevice class provides an information about audio devices and their functionality.
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)
QGStreamerCustomAudioDeviceInfo(const QByteArray &gstreamerPipeline, QAudioDevice::Mode mode)
T value(qsizetype i) const
Definition qlist.h:664
Combined button and popup list for selecting options.
QAudioDevice qMakeCustomGStreamerAudioInput(const QByteArray &gstreamerPipeline)
QAudioDevice qMakeCustomGStreamerAudioOutput(const QByteArray &gstreamerPipeline)
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
GLuint name
const GLubyte * c
GLuint GLenum * rate
Type get() const noexcept
bool contains(const AT &t) const noexcept
Definition qlist.h:45