Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(8)

Unified Diff: chromecast/media/cma/backend/alsa/stream_mixer_alsa.h

Issue 2341783004: [chromecast] Slew stream volume changes in StreamMixerAlsa. (Closed)
Patch Set: address comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
diff --git a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
index e189d1db2749209a1511c4b2bea9bd56c351985e..c7839ecda5ccdd0ed227498cbbe7d22b71a84038 100644
--- a/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
+++ b/chromecast/media/cma/backend/alsa/stream_mixer_alsa.h
@@ -64,10 +64,6 @@ class StreamMixerAlsa {
// positive.
virtual int input_samples_per_second() const = 0;
- // This number will be used to scale the stream before it is mixed. The
- // result must be in the range (0.0, 1.0].
- virtual float volume_multiplier() const = 0;
-
// Returns true if the stream is primary. Primary streams will be given
// precedence for sample rates and will dictate when data is polled.
virtual bool primary() const = 0;
@@ -93,6 +89,12 @@ class StreamMixerAlsa {
// MaxReadSize(), and |dest->frames()| shall be >= |frames|.
virtual void GetResampledData(::media::AudioBus* dest, int frames) = 0;
+ // Scale |frames| frames at |src| by the current volume (smoothing as
+ // needed). Add the scaled result to |dest|.
+ virtual void VolumeScaleAccumulate(const float* src,
+ int frames,
+ float* dest) = 0;
+
// This is called for every InputQueue when the mixer writes data to ALSA
// for any of its input streams.
virtual void AfterWriteFrames(

Powered by Google App Engine
This is Rietveld 408576698