summaryrefslogtreecommitdiffstats
path: root/src/plugins/pulseaudio/qaudioinput_pulse.h
diff options
context:
space:
mode:
authorYoann Lopes <yoann.lopes@theqtcompany.com>2016-02-05 14:07:20 +0100
committerYoann Lopes <yoann.lopes@theqtcompany.com>2016-03-16 12:04:33 +0000
commitb17e0cd5dd28b93b1ea567c676f0e183acb6dd7c (patch)
tree4ad693212afdc479429eb5d609af9d078cc6baae /src/plugins/pulseaudio/qaudioinput_pulse.h
parent399ec97f101f8bc4917139bf658bb08fd5316811 (diff)
PulseAudio: change the way volume is applied.
We used to change the PulseAudio sink input volume. Doing so had some potential unwanted side effects depending on the PulseAudio server configuration. When flat volumes were enabled, it would affect the global system volume. It could also affect the volume of other streams having the same audio role. Volumes in Qt Multimedia are supposed to be relative to the application volume and should not affect anything else than the object on which it was changed. To guarantee that, PulseAudio volume APIs are not used anymore. Instead, software-based volume attenuation is applied on the audio samples before being passed to PulseAudio. Applies to QSoundEffect, QAudioOutput and QAudioInput. Task-number: QTBUG-40823 Task-number: QTBUG-49461 Change-Id: I690716976bda8fe666969ca2cbdf6d8d0b419733 Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
Diffstat (limited to 'src/plugins/pulseaudio/qaudioinput_pulse.h')
-rw-r--r--src/plugins/pulseaudio/qaudioinput_pulse.h8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/plugins/pulseaudio/qaudioinput_pulse.h b/src/plugins/pulseaudio/qaudioinput_pulse.h
index 7b898c480..c130f8cac 100644
--- a/src/plugins/pulseaudio/qaudioinput_pulse.h
+++ b/src/plugins/pulseaudio/qaudioinput_pulse.h
@@ -100,8 +100,6 @@ public:
QAudio::Error m_errorState;
QAudio::State m_deviceState;
qreal m_volume;
- bool m_customVolumeRequired;
- pa_cvolume m_chVolume;
private slots:
void userFeed();
@@ -112,13 +110,11 @@ private:
void setState(QAudio::State state);
void setError(QAudio::Error error);
+ void applyVolume(const void *src, void *dest, int len);
+
int checkBytesReady();
bool open();
void close();
- void setPulseVolume();
-
- static void sourceInfoCallback(pa_context *c, const pa_source_info *i, int eol, void *userdata);
- static void inputVolumeCallback(pa_context *context, int success, void *userdata);
bool m_pullMode;
bool m_opened;