19 m_muted = m_input->
muted;
20 m_volume = m_input->
volume;
70 int toAppend =
qMin(
len, m_bufferSize - m_pcm.
size());
74 if (m_pcm.
size() == m_bufferSize)
85 if (std::exchange(m_src,
nullptr))
88 m_src = std::make_unique<QAudioSource>(m_device, m_format);
96 m_src->setVolume(m_muted ? 0. : m_volume);
118 m_processed += m_bufferSize;
125 bool m_muted =
false;
126 bool m_running =
false;
129 std::unique_ptr<QAudioSource> m_src;
141 qRegisterMetaType<QAudioBuffer>();
143 inputThread = std::make_unique<QThread>();
144 audioIO = std::make_unique<QFFmpeg::AudioSourceIO>(
this);
145 audioIO->moveToThread(inputThread.get());
146 inputThread->start();
157 audioIO->setDevice(
device);
162 audioIO->setMuted(
muted);
167 audioIO->setVolume(
volume);
172 audioIO->setFrameSize(
s);
177 audioIO->setRunning(
b);
182 return audioIO->bufferSize();
187#include "moc_qffmpegaudioinput_p.cpp"
189#include "qffmpegaudioinput.moc"
IOBluetoothDevice * device
The QAudioDevice class provides an information about audio devices and their functionality.
QAudioFormat preferredFormat() const
Returns the default audio format settings for this device.
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
void clear()
Clears the contents of the byte array and makes it null.
QByteArray & append(char c)
This is an overloaded member function, provided for convenience. It differs from the above function o...
void setVolume(float vol)
void setMuted(bool muted)
void setDevice(const QAudioDevice &device)
void setFrameSize(int frameSize)
qint64 writeData(const char *data, qint64 len) override
Writes up to maxSize bytes from data to the device.
qint64 readData(char *, qint64) override
Reads up to maxSize bytes from the device into data, and returns the number of bytes read or -1 if an...
AudioSourceIO(QFFmpegAudioInput *audioInput)
~AudioSourceIO() override=default
\inmodule QtCore \reentrant
virtual bool open(QIODeviceBase::OpenMode mode)
Opens the device and sets its OpenMode to mode.
Combined button and popup list for selecting options.
constexpr const T & qMin(const T &a, const T &b)
GLboolean GLboolean GLboolean b
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
static constexpr QSize frameSize(const T &frame)
QVideoFrameFormat::PixelFormat fmt