Loading include/media/MmapStreamCallback.h +2 −5 Original line number Diff line number Diff line Loading @@ -37,12 +37,9 @@ class MmapStreamCallback : public virtual RefBase { /** * The volume to be applied to the use case specified when opening the stream has changed * \param[in] channels a channel mask containing all channels the volume should be applied to. * \param[in] values the volume values to be applied to each channel. The size of the vector * should correspond to the channel count retrieved with * audio_channel_count_from_in_mask() or audio_channel_count_from_out_mask() * \param[in] volume the new target volume */ virtual void onVolumeChanged(audio_channel_mask_t channels, Vector<float> values) = 0; virtual void onVolumeChanged(float volume) = 0; /** * The device the stream is routed to/from has changed Loading services/audioflinger/Threads.cpp +1 −11 Original line number Diff line number Diff line Loading @@ -10218,20 +10218,10 @@ void AudioFlinger::MmapPlaybackThread::processVolume_l() } else { sp<MmapStreamCallback> callback = mCallback.promote(); if (callback != 0) { int channelCount; if (isOutput()) { channelCount = audio_channel_count_from_out_mask(mChannelMask); } else { channelCount = audio_channel_count_from_in_mask(mChannelMask); } Vector<float> values; for (int i = 0; i < channelCount; i++) { values.add(volume); } mHalVolFloat = volume; // SW volume control worked, so update value. mNoCallbackWarningCount = 0; mLock.unlock(); callback->onVolumeChanged(mChannelMask, values); callback->onVolumeChanged(volume); mLock.lock(); } else { if (mNoCallbackWarningCount < kMaxNoCallbackWarnings) { Loading services/oboeservice/AAudioServiceEndpointMMAP.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -362,12 +362,8 @@ void AAudioServiceEndpointMMAP::onTearDown(audio_port_handle_t portHandle) { asyncTask.detach(); } void AAudioServiceEndpointMMAP::onVolumeChanged(audio_channel_mask_t channels, android::Vector<float> values) { // TODO Do we really need a different volume for each channel? // We get called with an array filled with a single value! float volume = values[0]; ALOGD("%s() volume[0] = %f", __func__, volume); void AAudioServiceEndpointMMAP::onVolumeChanged(float volume) { ALOGD("%s() volume = %f", __func__, volume); std::lock_guard<std::mutex> lock(mLockStreams); for(const auto& stream : mRegisteredStreams) { stream->onVolumeChanged(volume); Loading services/oboeservice/AAudioServiceEndpointMMAP.h +1 −2 Original line number Diff line number Diff line Loading @@ -77,8 +77,7 @@ public: // -------------- Callback functions for MmapStreamCallback --------------------- void onTearDown(audio_port_handle_t portHandle) override; void onVolumeChanged(audio_channel_mask_t channels, android::Vector<float> values) override; void onVolumeChanged(float volume) override; void onRoutingChanged(audio_port_handle_t portHandle) override; // ------------------------------------------------------------------------------ Loading Loading
include/media/MmapStreamCallback.h +2 −5 Original line number Diff line number Diff line Loading @@ -37,12 +37,9 @@ class MmapStreamCallback : public virtual RefBase { /** * The volume to be applied to the use case specified when opening the stream has changed * \param[in] channels a channel mask containing all channels the volume should be applied to. * \param[in] values the volume values to be applied to each channel. The size of the vector * should correspond to the channel count retrieved with * audio_channel_count_from_in_mask() or audio_channel_count_from_out_mask() * \param[in] volume the new target volume */ virtual void onVolumeChanged(audio_channel_mask_t channels, Vector<float> values) = 0; virtual void onVolumeChanged(float volume) = 0; /** * The device the stream is routed to/from has changed Loading
services/audioflinger/Threads.cpp +1 −11 Original line number Diff line number Diff line Loading @@ -10218,20 +10218,10 @@ void AudioFlinger::MmapPlaybackThread::processVolume_l() } else { sp<MmapStreamCallback> callback = mCallback.promote(); if (callback != 0) { int channelCount; if (isOutput()) { channelCount = audio_channel_count_from_out_mask(mChannelMask); } else { channelCount = audio_channel_count_from_in_mask(mChannelMask); } Vector<float> values; for (int i = 0; i < channelCount; i++) { values.add(volume); } mHalVolFloat = volume; // SW volume control worked, so update value. mNoCallbackWarningCount = 0; mLock.unlock(); callback->onVolumeChanged(mChannelMask, values); callback->onVolumeChanged(volume); mLock.lock(); } else { if (mNoCallbackWarningCount < kMaxNoCallbackWarnings) { Loading
services/oboeservice/AAudioServiceEndpointMMAP.cpp +2 −6 Original line number Diff line number Diff line Loading @@ -362,12 +362,8 @@ void AAudioServiceEndpointMMAP::onTearDown(audio_port_handle_t portHandle) { asyncTask.detach(); } void AAudioServiceEndpointMMAP::onVolumeChanged(audio_channel_mask_t channels, android::Vector<float> values) { // TODO Do we really need a different volume for each channel? // We get called with an array filled with a single value! float volume = values[0]; ALOGD("%s() volume[0] = %f", __func__, volume); void AAudioServiceEndpointMMAP::onVolumeChanged(float volume) { ALOGD("%s() volume = %f", __func__, volume); std::lock_guard<std::mutex> lock(mLockStreams); for(const auto& stream : mRegisteredStreams) { stream->onVolumeChanged(volume); Loading
services/oboeservice/AAudioServiceEndpointMMAP.h +1 −2 Original line number Diff line number Diff line Loading @@ -77,8 +77,7 @@ public: // -------------- Callback functions for MmapStreamCallback --------------------- void onTearDown(audio_port_handle_t portHandle) override; void onVolumeChanged(audio_channel_mask_t channels, android::Vector<float> values) override; void onVolumeChanged(float volume) override; void onRoutingChanged(audio_port_handle_t portHandle) override; // ------------------------------------------------------------------------------ Loading