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

Unified Diff: media/audio/audio_manager_base.h

Issue 2503693002: Tracks all open input streams in AudioManagerBase. (Closed)
Patch Set: fixes compile error on windows Created 4 years, 1 month 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 | « no previous file | media/audio/audio_manager_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_manager_base.h
diff --git a/media/audio/audio_manager_base.h b/media/audio/audio_manager_base.h
index f8f5260be68ced768966c28b313166d0aa4ff89b..b56d9dc631fe38c868cace4822b27b7ed01908fc 100644
--- a/media/audio/audio_manager_base.h
+++ b/media/audio/audio_manager_base.h
@@ -7,6 +7,7 @@
#include <memory>
#include <string>
+#include <unordered_set>
#include <utility>
#include "base/compiler_specific.h"
@@ -97,7 +98,9 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
std::string GetGroupIDInput(const std::string& input_device_id) override;
// Get number of input or output streams.
- int input_stream_count() const { return num_input_streams_; }
+ int input_stream_count() const {
+ return static_cast<int>(input_streams_.size());
+ }
int output_stream_count() const { return num_output_streams_; }
protected:
@@ -154,12 +157,12 @@ class MEDIA_EXPORT AudioManagerBase : public AudioManager {
// Number of currently open output streams.
int num_output_streams_;
- // Number of currently open input streams.
- int num_input_streams_;
-
// Track output state change listeners.
base::ObserverList<AudioDeviceListener> output_listeners_;
+ // Contains currently open input streams.
+ std::unordered_set<AudioInputStream*> input_streams_;
+
// Map of cached AudioOutputDispatcher instances. Must only be touched
// from the audio thread (no locking).
AudioOutputDispatchers output_dispatchers_;
« no previous file with comments | « no previous file | media/audio/audio_manager_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698