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;
|
||||
|
||||
pullMode = false;
|
||||
audioSource = new InputPrivate(this);
|
||||
audioSource = new AlsaInputPrivate(this);
|
||||
audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
|
||||
deviceState = QAudio::IdleState;
|
||||
@@ -725,7 +725,7 @@ bool QAlsaAudioInput::deviceReady()
|
||||
read(0, buffer_size);
|
||||
} else {
|
||||
// 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();
|
||||
}
|
||||
bytesAvailable = checkBytesReady();
|
||||
@@ -777,28 +777,28 @@ void QAlsaAudioInput::drain()
|
||||
snd_pcm_drain(handle);
|
||||
}
|
||||
|
||||
InputPrivate::InputPrivate(QAlsaAudioInput* audio)
|
||||
AlsaInputPrivate::AlsaInputPrivate(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);
|
||||
}
|
||||
|
||||
qint64 InputPrivate::writeData(const char* data, qint64 len)
|
||||
qint64 AlsaInputPrivate::writeData(const char* data, qint64 len)
|
||||
{
|
||||
Q_UNUSED(data)
|
||||
Q_UNUSED(len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void InputPrivate::trigger()
|
||||
void AlsaInputPrivate::trigger()
|
||||
{
|
||||
emit readyRead();
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
class InputPrivate;
|
||||
class AlsaInputPrivate;
|
||||
|
||||
class RingBuffer
|
||||
{
|
||||
@@ -157,12 +157,12 @@ private:
|
||||
qreal m_volume;
|
||||
};
|
||||
|
||||
class InputPrivate : public QIODevice
|
||||
class AlsaInputPrivate : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
InputPrivate(QAlsaAudioInput* audio);
|
||||
~InputPrivate();
|
||||
AlsaInputPrivate(QAlsaAudioInput* audio);
|
||||
~AlsaInputPrivate();
|
||||
|
||||
qint64 readData( char* data, qint64 len);
|
||||
qint64 writeData(const char* data, qint64 len);
|
||||
|
||||
@@ -247,7 +247,7 @@ QIODevice* QAlsaAudioOutput::start()
|
||||
|
||||
close();
|
||||
|
||||
audioSource = new OutputPrivate(this);
|
||||
audioSource = new AlsaOutputPrivate(this);
|
||||
audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered);
|
||||
pullMode = false;
|
||||
|
||||
@@ -785,14 +785,14 @@ void QAlsaAudioOutput::reset()
|
||||
stop();
|
||||
}
|
||||
|
||||
OutputPrivate::OutputPrivate(QAlsaAudioOutput* audio)
|
||||
AlsaOutputPrivate::AlsaOutputPrivate(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(len)
|
||||
@@ -800,7 +800,7 @@ qint64 OutputPrivate::readData( char* data, qint64 len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
qint64 OutputPrivate::writeData(const char* data, qint64 len)
|
||||
qint64 AlsaOutputPrivate::writeData(const char* data, qint64 len)
|
||||
{
|
||||
int retry = 0;
|
||||
qint64 written = 0;
|
||||
|
||||
@@ -62,7 +62,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class QAlsaAudioOutput : public QAbstractAudioOutput
|
||||
{
|
||||
friend class OutputPrivate;
|
||||
friend class AlsaOutputPrivate;
|
||||
Q_OBJECT
|
||||
public:
|
||||
QAlsaAudioOutput(const QByteArray &device);
|
||||
@@ -136,13 +136,13 @@ private:
|
||||
qreal m_volume;
|
||||
};
|
||||
|
||||
class OutputPrivate : public QIODevice
|
||||
class AlsaOutputPrivate : public QIODevice
|
||||
{
|
||||
friend class QAlsaAudioOutput;
|
||||
Q_OBJECT
|
||||
public:
|
||||
OutputPrivate(QAlsaAudioOutput* audio);
|
||||
~OutputPrivate();
|
||||
AlsaOutputPrivate(QAlsaAudioOutput* audio);
|
||||
~AlsaOutputPrivate();
|
||||
|
||||
qint64 readData( char* data, qint64 len);
|
||||
qint64 writeData(const char* data, qint64 len);
|
||||
|
||||
@@ -248,7 +248,7 @@ QIODevice *QPulseAudioInput::start()
|
||||
return Q_NULLPTR;
|
||||
|
||||
m_pullMode = false;
|
||||
m_audioSource = new InputPrivate(this);
|
||||
m_audioSource = new PulseInputPrivate(this);
|
||||
m_audioSource->open(QIODevice::ReadOnly | QIODevice::Unbuffered);
|
||||
|
||||
setState(QAudio::IdleState);
|
||||
@@ -661,7 +661,7 @@ bool QPulseAudioInput::deviceReady()
|
||||
} else {
|
||||
// emits readyRead() so user will call read() on QIODevice to get some audio data
|
||||
if (m_audioSource != 0) {
|
||||
InputPrivate *a = qobject_cast<InputPrivate*>(m_audioSource);
|
||||
PulseInputPrivate *a = qobject_cast<PulseInputPrivate*>(m_audioSource);
|
||||
a->trigger();
|
||||
}
|
||||
}
|
||||
@@ -701,24 +701,24 @@ void QPulseAudioInput::onPulseContextFailed()
|
||||
setState(QAudio::StoppedState);
|
||||
}
|
||||
|
||||
InputPrivate::InputPrivate(QPulseAudioInput *audio)
|
||||
PulseInputPrivate::PulseInputPrivate(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);
|
||||
}
|
||||
|
||||
qint64 InputPrivate::writeData(const char *data, qint64 len)
|
||||
qint64 PulseInputPrivate::writeData(const char *data, qint64 len)
|
||||
{
|
||||
Q_UNUSED(data)
|
||||
Q_UNUSED(len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
void InputPrivate::trigger()
|
||||
void PulseInputPrivate::trigger()
|
||||
{
|
||||
emit readyRead();
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
class InputPrivate;
|
||||
class PulseInputPrivate;
|
||||
|
||||
class QPulseAudioInput : public QAbstractAudioInput
|
||||
{
|
||||
@@ -138,12 +138,12 @@ private:
|
||||
pa_sample_spec m_spec;
|
||||
};
|
||||
|
||||
class InputPrivate : public QIODevice
|
||||
class PulseInputPrivate : public QIODevice
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
InputPrivate(QPulseAudioInput *audio);
|
||||
~InputPrivate() {};
|
||||
PulseInputPrivate(QPulseAudioInput *audio);
|
||||
~PulseInputPrivate() {};
|
||||
|
||||
qint64 readData(char *data, qint64 len);
|
||||
qint64 writeData(const char *data, qint64 len);
|
||||
|
||||
@@ -237,7 +237,7 @@ QIODevice *QPulseAudioOutput::start()
|
||||
if (!open())
|
||||
return Q_NULLPTR;
|
||||
|
||||
m_audioSource = new OutputPrivate(this);
|
||||
m_audioSource = new PulseOutputPrivate(this);
|
||||
m_audioSource->open(QIODevice::WriteOnly|QIODevice::Unbuffered);
|
||||
m_pullMode = false;
|
||||
|
||||
@@ -604,12 +604,12 @@ void QPulseAudioOutput::reset()
|
||||
stop();
|
||||
}
|
||||
|
||||
OutputPrivate::OutputPrivate(QPulseAudioOutput *audio)
|
||||
PulseOutputPrivate::PulseOutputPrivate(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(len)
|
||||
@@ -617,7 +617,7 @@ qint64 OutputPrivate::readData(char *data, qint64 len)
|
||||
return 0;
|
||||
}
|
||||
|
||||
qint64 OutputPrivate::writeData(const char *data, qint64 len)
|
||||
qint64 PulseOutputPrivate::writeData(const char *data, qint64 len)
|
||||
{
|
||||
int retry = 0;
|
||||
qint64 written = 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
|
||||
|
||||
class QPulseAudioOutput : public QAbstractAudioOutput
|
||||
{
|
||||
friend class OutputPrivate;
|
||||
friend class PulseOutputPrivate;
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
@@ -139,14 +139,14 @@ private:
|
||||
pa_sample_spec m_spec;
|
||||
};
|
||||
|
||||
class OutputPrivate : public QIODevice
|
||||
class PulseOutputPrivate : public QIODevice
|
||||
{
|
||||
friend class QPulseAudioOutput;
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
OutputPrivate(QPulseAudioOutput *audio);
|
||||
virtual ~OutputPrivate() {}
|
||||
PulseOutputPrivate(QPulseAudioOutput *audio);
|
||||
virtual ~PulseOutputPrivate() {}
|
||||
|
||||
protected:
|
||||
qint64 readData(char *data, qint64 len);
|
||||
|
||||
Reference in New Issue
Block a user