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

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: android test fix 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
« no previous file with comments | « media/base/audio_latency_unittest.cc ('k') | media/base/audio_renderer_mixer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/audio_renderer_mixer.h
diff --git a/media/base/audio_renderer_mixer.h b/media/base/audio_renderer_mixer.h
index bdffef24b6e63a9ec239b8012cdf6dc95b4ca594..1d432d40623b34caecb9952087ea35ceffb5cee5 100644
--- a/media/base/audio_renderer_mixer.h
+++ b/media/base/audio_renderer_mixer.h
@@ -26,8 +26,11 @@ namespace media {
class MEDIA_EXPORT AudioRendererMixer
: NON_EXPORTED_BASE(public AudioRendererSink::RenderCallback) {
public:
+ typedef base::Callback<void(int)> UmaLogCallback;
+
AudioRendererMixer(const AudioParameters& output_params,
- scoped_refptr<AudioRendererSink> sink);
+ scoped_refptr<AudioRendererSink> sink,
+ const UmaLogCallback& log_callback);
~AudioRendererMixer() override;
// Add or remove a mixer input from mixing; called by AudioRendererMixerInput.
@@ -51,7 +54,11 @@ class MEDIA_EXPORT AudioRendererMixer
// Returns true if called on rendering thread, otherwise false.
bool CurrentThreadIsRenderingThread();
+ const AudioParameters& GetOutputParamsForTesting() { return output_params_; };
+
private:
+ class UMAMaxValueTracker;
+
// Maps input sample rate to the dedicated converter.
using AudioConvertersMap =
std::map<int, std::unique_ptr<LoopbackAudioConverter>>;
@@ -94,6 +101,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);
};
« no previous file with comments | « media/base/audio_latency_unittest.cc ('k') | media/base/audio_renderer_mixer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698