Fix: static linking on Linux with both PulseAudio and Alsa plugins
Fixed multiply defined symbols when linking statically with both PulseAudio and Alsa plugins enabled: The private classes In/OutputPrivate had identical names and have been renamed. Change-Id: I9415beeeed9fb0e14ead3f0ab906f343b3934341 Task-number: QTBUG-43514 Reviewed-by: Yoann Lopes <yoann.lopes@theqtcompany.com>
This commit is contained in:
committed by
Yoann Lopes
parent
61fd649861
commit
68dbc9ba02
@@ -244,7 +244,7 @@ QIODevice* QAlsaAudioInput::start()
|
|||||||
delete audioSource;
|
delete audioSource;
|
||||||
|
|
||||||
pullMode = false;
|
pullMode = false;
|
||||||
audioSource = new InputPrivate(this);
|
audioSource = new AlsaInputPrivate(this);
|
||||||
audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||||
|
|
||||||
deviceState = QAudio::IdleState;
|
deviceState = QAudio::IdleState;
|
||||||
@@ -725,7 +725,7 @@ bool QAlsaAudioInput::deviceReady()
|
|||||||
read(0, buffer_size);
|
read(0, buffer_size);
|
||||||
} else {
|
} else {
|
||||||
// emits readyRead() so user will call read() on QIODevice to get some audio data
|
// emits readyRead() so user will call read() on QIODevice to get some audio data
|
||||||
InputPrivate* a = qobject_cast<InputPrivate*>(audioSource);
|
AlsaInputPrivate* a = qobject_cast<AlsaInputPrivate*>(audioSource);
|
||||||
a->trigger();
|
a->trigger();
|
||||||
}
|
}
|
||||||
bytesAvailable = checkBytesReady();
|
bytesAvailable = checkBytesReady();
|
||||||
@@ -777,28 +777,28 @@ void QAlsaAudioInput::drain()
|
|||||||
snd_pcm_drain(handle);
|
snd_pcm_drain(handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputPrivate::InputPrivate(QAlsaAudioInput* audio)
|
AlsaInputPrivate::AlsaInputPrivate(QAlsaAudioInput* audio)
|
||||||
{
|
{
|
||||||
audioDevice = qobject_cast<QAlsaAudioInput*>(audio);
|
audioDevice = qobject_cast<QAlsaAudioInput*>(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputPrivate::~InputPrivate()
|
AlsaInputPrivate::~AlsaInputPrivate()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 InputPrivate::readData( char* data, qint64 len)
|
qint64 AlsaInputPrivate::readData( char* data, qint64 len)
|
||||||
{
|
{
|
||||||
return audioDevice->read(data,len);
|
return audioDevice->read(data,len);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 InputPrivate::writeData(const char* data, qint64 len)
|
qint64 AlsaInputPrivate::writeData(const char* data, qint64 len)
|
||||||
{
|
{
|
||||||
Q_UNUSED(data)
|
Q_UNUSED(data)
|
||||||
Q_UNUSED(len)
|
Q_UNUSED(len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputPrivate::trigger()
|
void AlsaInputPrivate::trigger()
|
||||||
{
|
{
|
||||||
emit readyRead();
|
emit readyRead();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
|
|
||||||
class InputPrivate;
|
class AlsaInputPrivate;
|
||||||
|
|
||||||
class RingBuffer
|
class RingBuffer
|
||||||
{
|
{
|
||||||
@@ -157,12 +157,12 @@ private:
|
|||||||
qreal m_volume;
|
qreal m_volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
class InputPrivate : public QIODevice
|
class AlsaInputPrivate : public QIODevice
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
InputPrivate(QAlsaAudioInput* audio);
|
AlsaInputPrivate(QAlsaAudioInput* audio);
|
||||||
~InputPrivate();
|
~AlsaInputPrivate();
|
||||||
|
|
||||||
qint64 readData( char* data, qint64 len);
|
qint64 readData( char* data, qint64 len);
|
||||||
qint64 writeData(const char* data, qint64 len);
|
qint64 writeData(const char* data, qint64 len);
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ QIODevice* QAlsaAudioOutput::start()
|
|||||||
|
|
||||||
close();
|
close();
|
||||||
|
|
||||||
audioSource = new OutputPrivate(this);
|
audioSource = new AlsaOutputPrivate(this);
|
||||||
audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered);
|
audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered);
|
||||||
pullMode = false;
|
pullMode = false;
|
||||||
|
|
||||||
@@ -785,14 +785,14 @@ void QAlsaAudioOutput::reset()
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPrivate::OutputPrivate(QAlsaAudioOutput* audio)
|
AlsaOutputPrivate::AlsaOutputPrivate(QAlsaAudioOutput* audio)
|
||||||
{
|
{
|
||||||
audioDevice = qobject_cast<QAlsaAudioOutput*>(audio);
|
audioDevice = qobject_cast<QAlsaAudioOutput*>(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPrivate::~OutputPrivate() {}
|
AlsaOutputPrivate::~AlsaOutputPrivate() {}
|
||||||
|
|
||||||
qint64 OutputPrivate::readData( char* data, qint64 len)
|
qint64 AlsaOutputPrivate::readData( char* data, qint64 len)
|
||||||
{
|
{
|
||||||
Q_UNUSED(data)
|
Q_UNUSED(data)
|
||||||
Q_UNUSED(len)
|
Q_UNUSED(len)
|
||||||
@@ -800,7 +800,7 @@ qint64 OutputPrivate::readData( char* data, qint64 len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 OutputPrivate::writeData(const char* data, qint64 len)
|
qint64 AlsaOutputPrivate::writeData(const char* data, qint64 len)
|
||||||
{
|
{
|
||||||
int retry = 0;
|
int retry = 0;
|
||||||
qint64 written = 0;
|
qint64 written = 0;
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QAlsaAudioOutput : public QAbstractAudioOutput
|
class QAlsaAudioOutput : public QAbstractAudioOutput
|
||||||
{
|
{
|
||||||
friend class OutputPrivate;
|
friend class AlsaOutputPrivate;
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
QAlsaAudioOutput(const QByteArray &device);
|
QAlsaAudioOutput(const QByteArray &device);
|
||||||
@@ -136,13 +136,13 @@ private:
|
|||||||
qreal m_volume;
|
qreal m_volume;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutputPrivate : public QIODevice
|
class AlsaOutputPrivate : public QIODevice
|
||||||
{
|
{
|
||||||
friend class QAlsaAudioOutput;
|
friend class QAlsaAudioOutput;
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
OutputPrivate(QAlsaAudioOutput* audio);
|
AlsaOutputPrivate(QAlsaAudioOutput* audio);
|
||||||
~OutputPrivate();
|
~AlsaOutputPrivate();
|
||||||
|
|
||||||
qint64 readData( char* data, qint64 len);
|
qint64 readData( char* data, qint64 len);
|
||||||
qint64 writeData(const char* data, qint64 len);
|
qint64 writeData(const char* data, qint64 len);
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ QIODevice *QPulseAudioInput::start()
|
|||||||
return Q_NULLPTR;
|
return Q_NULLPTR;
|
||||||
|
|
||||||
m_pullMode = false;
|
m_pullMode = false;
|
||||||
m_audioSource = new InputPrivate(this);
|
m_audioSource = new PulseInputPrivate(this);
|
||||||
m_audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
m_audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||||
|
|
||||||
setState(QAudio::IdleState);
|
setState(QAudio::IdleState);
|
||||||
@@ -661,7 +661,7 @@ bool QPulseAudioInput::deviceReady()
|
|||||||
} else {
|
} else {
|
||||||
// emits readyRead() so user will call read() on QIODevice to get some audio data
|
// emits readyRead() so user will call read() on QIODevice to get some audio data
|
||||||
if (m_audioSource != 0) {
|
if (m_audioSource != 0) {
|
||||||
InputPrivate *a = qobject_cast<InputPrivate*>(m_audioSource);
|
PulseInputPrivate *a = qobject_cast<PulseInputPrivate*>(m_audioSource);
|
||||||
a->trigger();
|
a->trigger();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -701,24 +701,24 @@ void QPulseAudioInput::onPulseContextFailed()
|
|||||||
setState(QAudio::StoppedState);
|
setState(QAudio::StoppedState);
|
||||||
}
|
}
|
||||||
|
|
||||||
InputPrivate::InputPrivate(QPulseAudioInput *audio)
|
PulseInputPrivate::PulseInputPrivate(QPulseAudioInput *audio)
|
||||||
{
|
{
|
||||||
m_audioDevice = qobject_cast<QPulseAudioInput*>(audio);
|
m_audioDevice = qobject_cast<QPulseAudioInput*>(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 InputPrivate::readData(char *data, qint64 len)
|
qint64 PulseInputPrivate::readData(char *data, qint64 len)
|
||||||
{
|
{
|
||||||
return m_audioDevice->read(data, len);
|
return m_audioDevice->read(data, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 InputPrivate::writeData(const char *data, qint64 len)
|
qint64 PulseInputPrivate::writeData(const char *data, qint64 len)
|
||||||
{
|
{
|
||||||
Q_UNUSED(data)
|
Q_UNUSED(data)
|
||||||
Q_UNUSED(len)
|
Q_UNUSED(len)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void InputPrivate::trigger()
|
void PulseInputPrivate::trigger()
|
||||||
{
|
{
|
||||||
emit readyRead();
|
emit readyRead();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -59,7 +59,7 @@
|
|||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
|
||||||
class InputPrivate;
|
class PulseInputPrivate;
|
||||||
|
|
||||||
class QPulseAudioInput : public QAbstractAudioInput
|
class QPulseAudioInput : public QAbstractAudioInput
|
||||||
{
|
{
|
||||||
@@ -138,12 +138,12 @@ private:
|
|||||||
pa_sample_spec m_spec;
|
pa_sample_spec m_spec;
|
||||||
};
|
};
|
||||||
|
|
||||||
class InputPrivate : public QIODevice
|
class PulseInputPrivate : public QIODevice
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
InputPrivate(QPulseAudioInput *audio);
|
PulseInputPrivate(QPulseAudioInput *audio);
|
||||||
~InputPrivate() {};
|
~PulseInputPrivate() {};
|
||||||
|
|
||||||
qint64 readData(char *data, qint64 len);
|
qint64 readData(char *data, qint64 len);
|
||||||
qint64 writeData(const char *data, qint64 len);
|
qint64 writeData(const char *data, qint64 len);
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ QIODevice *QPulseAudioOutput::start()
|
|||||||
if (!open())
|
if (!open())
|
||||||
return Q_NULLPTR;
|
return Q_NULLPTR;
|
||||||
|
|
||||||
m_audioSource = new OutputPrivate(this);
|
m_audioSource = new PulseOutputPrivate(this);
|
||||||
m_audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered);
|
m_audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered);
|
||||||
m_pullMode = false;
|
m_pullMode = false;
|
||||||
|
|
||||||
@@ -604,12 +604,12 @@ void QPulseAudioOutput::reset()
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
OutputPrivate::OutputPrivate(QPulseAudioOutput *audio)
|
PulseOutputPrivate::PulseOutputPrivate(QPulseAudioOutput *audio)
|
||||||
{
|
{
|
||||||
m_audioDevice = qobject_cast<QPulseAudioOutput*>(audio);
|
m_audioDevice = qobject_cast<QPulseAudioOutput*>(audio);
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 OutputPrivate::readData(char *data, qint64 len)
|
qint64 PulseOutputPrivate::readData(char *data, qint64 len)
|
||||||
{
|
{
|
||||||
Q_UNUSED(data)
|
Q_UNUSED(data)
|
||||||
Q_UNUSED(len)
|
Q_UNUSED(len)
|
||||||
@@ -617,7 +617,7 @@ qint64 OutputPrivate::readData(char *data, qint64 len)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
qint64 OutputPrivate::writeData(const char *data, qint64 len)
|
qint64 PulseOutputPrivate::writeData(const char *data, qint64 len)
|
||||||
{
|
{
|
||||||
int retry = 0;
|
int retry = 0;
|
||||||
qint64 written = 0;
|
qint64 written = 0;
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
|
|||||||
|
|
||||||
class QPulseAudioOutput : public QAbstractAudioOutput
|
class QPulseAudioOutput : public QAbstractAudioOutput
|
||||||
{
|
{
|
||||||
friend class OutputPrivate;
|
friend class PulseOutputPrivate;
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -139,14 +139,14 @@ private:
|
|||||||
pa_sample_spec m_spec;
|
pa_sample_spec m_spec;
|
||||||
};
|
};
|
||||||
|
|
||||||
class OutputPrivate : public QIODevice
|
class PulseOutputPrivate : public QIODevice
|
||||||
{
|
{
|
||||||
friend class QPulseAudioOutput;
|
friend class QPulseAudioOutput;
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
OutputPrivate(QPulseAudioOutput *audio);
|
PulseOutputPrivate(QPulseAudioOutput *audio);
|
||||||
virtual ~OutputPrivate() {}
|
virtual ~PulseOutputPrivate() {}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
qint64 readData(char *data, qint64 len);
|
qint64 readData(char *data, qint64 len);
|
||||||
|
|||||||
Reference in New Issue
Block a user