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

Unified Diff: media/base/audio_renderer_mixer.h

Issue 2067863003: Mixing audio with different latency requirements (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Unit tests, cleanup Created 4 years, 6 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: media/base/audio_renderer_mixer.h
diff --git a/media/base/audio_renderer_mixer.h b/media/base/audio_renderer_mixer.h
index 68f7aec1e2a72972704d3d71753d81802187a137..1d5afb475ce2f591d0ba0f6c205222ed55036af1 100644
--- a/media/base/audio_renderer_mixer.h
+++ b/media/base/audio_renderer_mixer.h
@@ -27,7 +27,8 @@ class MEDIA_EXPORT AudioRendererMixer
: NON_EXPORTED_BASE(public AudioRendererSink::RenderCallback) {
public:
AudioRendererMixer(const AudioParameters& output_params,
- scoped_refptr<AudioRendererSink> sink);
+ scoped_refptr<AudioRendererSink> sink,
+ const std::string& uma_histogram);
~AudioRendererMixer() override;
// Add or remove a mixer input from mixing; called by AudioRendererMixerInput.
@@ -48,7 +49,11 @@ class MEDIA_EXPORT AudioRendererMixer
OutputDeviceInfo GetOutputDeviceInfo();
+ AudioParameters GetOutputParamsForTesting() { return output_params_; };
tommi (sloooow) - chröme 2016/06/28 14:14:54 nit: const&
o1ka 2016/06/29 10:11:26 Done.
+
private:
+ class UMAMaxValueTracker;
+
// Maps input sample rate to the dedicated converter.
using AudioConvertersMap =
std::map<int, std::unique_ptr<LoopbackAudioConverter>>;
@@ -91,6 +96,10 @@ class MEDIA_EXPORT AudioRendererMixer
base::TimeTicks last_play_time_;
bool playing_;
+ // Tracks the maximum number of simultaneous mixer inputs and logs it into
+ // UMA histogram upon the destruction.
+ std::unique_ptr<UMAMaxValueTracker> input_count_tracker_;
+
DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer);
};

Powered by Google App Engine
This is Rietveld 408576698