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

Side by Side Diff: media/audio/audio_manager.h

Issue 2313663002: Reland of Add groupid for media devices. Group audio devices. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix. 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 unified diff | Download patch
« no previous file with comments | « content/renderer/media/user_media_client_impl.cc ('k') | media/audio/audio_manager_base.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_ 5 #ifndef MEDIA_AUDIO_AUDIO_MANAGER_H_
6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_ 6 #define MEDIA_AUDIO_AUDIO_MANAGER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 // ideally must not be called from the UI thread or other time sensitive 116 // ideally must not be called from the UI thread or other time sensitive
117 // threads to avoid blocking the rest of the application. 117 // threads to avoid blocking the rest of the application.
118 virtual void ShowAudioInputSettings() = 0; 118 virtual void ShowAudioInputSettings() = 0;
119 119
120 // Appends a list of available input devices to |device_names|, 120 // Appends a list of available input devices to |device_names|,
121 // which must initially be empty. It is not guaranteed that all the 121 // which must initially be empty. It is not guaranteed that all the
122 // devices in the list support all formats and sample rates for 122 // devices in the list support all formats and sample rates for
123 // recording. 123 // recording.
124 // 124 //
125 // Not threadsafe; in production this should only be called from the 125 // Not threadsafe; in production this should only be called from the
126 // Audio worker thread (see GetWorkerTaskRunner()). 126 // Audio worker thread (see GetTaskRunner()).
127 virtual void GetAudioInputDeviceNames(AudioDeviceNames* device_names) = 0; 127 virtual void GetAudioInputDeviceNames(AudioDeviceNames* device_names) = 0;
128 128
129 // Appends a list of available output devices to |device_names|, 129 // Appends a list of available output devices to |device_names|,
130 // which must initially be empty. 130 // which must initially be empty.
131 // 131 //
132 // Not threadsafe; in production this should only be called from the 132 // Not threadsafe; in production this should only be called from the
133 // Audio worker thread (see GetWorkerTaskRunner()). 133 // Audio worker thread (see GetTaskRunner()).
134 virtual void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) = 0; 134 virtual void GetAudioOutputDeviceNames(AudioDeviceNames* device_names) = 0;
135 135
136 // Log callback used for sending log messages from a stream to the object 136 // Log callback used for sending log messages from a stream to the object
137 // that manages the stream. 137 // that manages the stream.
138 using LogCallback = base::Callback<void(const std::string&)>; 138 using LogCallback = base::Callback<void(const std::string&)>;
139 139
140 // Factory for all the supported stream formats. |params| defines parameters 140 // Factory for all the supported stream formats. |params| defines parameters
141 // of the audio stream to be created. 141 // of the audio stream to be created.
142 // 142 //
143 // |params.sample_per_packet| is the requested buffer allocation which the 143 // |params.sample_per_packet| is the requested buffer allocation which the
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 // version of this interface. 230 // version of this interface.
231 virtual AudioParameters GetInputStreamParameters( 231 virtual AudioParameters GetInputStreamParameters(
232 const std::string& device_id) = 0; 232 const std::string& device_id) = 0;
233 233
234 // Returns the device id of an output device that belongs to the same hardware 234 // Returns the device id of an output device that belongs to the same hardware
235 // as the specified input device. 235 // as the specified input device.
236 // If the hardware has only an input device (e.g. a webcam), the return value 236 // If the hardware has only an input device (e.g. a webcam), the return value
237 // will be empty (which the caller can then interpret to be the default output 237 // will be empty (which the caller can then interpret to be the default output
238 // device). Implementations that don't yet support this feature, must return 238 // device). Implementations that don't yet support this feature, must return
239 // an empty string. Must be called on the audio worker thread (see 239 // an empty string. Must be called on the audio worker thread (see
240 // GetWorkerTaskRunner()). 240 // GetTaskRunner()).
241 virtual std::string GetAssociatedOutputDeviceID( 241 virtual std::string GetAssociatedOutputDeviceID(
242 const std::string& input_device_id) = 0; 242 const std::string& input_device_id) = 0;
243 243
244 // These functions assign group ids to devices based on their device ids.
245 // The default implementation is an attempt to do this based on
246 // GetAssociatedOutputDeviceID. Must be called on the audio worker thread
247 // (see GetTaskRunner()).
248 virtual std::string GetGroupIDOutput(const std::string& output_device_id) = 0;
249 virtual std::string GetGroupIDInput(const std::string& input_device_id) = 0;
250
244 // Create a new AudioLog object for tracking the behavior for one or more 251 // Create a new AudioLog object for tracking the behavior for one or more
245 // instances of the given component. See AudioLogFactory for more details. 252 // instances of the given component. See AudioLogFactory for more details.
246 virtual std::unique_ptr<AudioLog> CreateAudioLog( 253 virtual std::unique_ptr<AudioLog> CreateAudioLog(
247 AudioLogFactory::AudioComponent component) = 0; 254 AudioLogFactory::AudioComponent component) = 0;
248 255
249 protected: 256 protected:
250 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner, 257 AudioManager(scoped_refptr<base::SingleThreadTaskRunner> task_runner,
251 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner); 258 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner);
252 virtual ~AudioManager(); 259 virtual ~AudioManager();
253 260
254 private: 261 private:
255 friend class base::DeleteHelper<AudioManager>; 262 friend class base::DeleteHelper<AudioManager>;
256 263
257 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; 264 scoped_refptr<base::SingleThreadTaskRunner> task_runner_;
258 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_; 265 scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_;
259 DISALLOW_COPY_AND_ASSIGN(AudioManager); 266 DISALLOW_COPY_AND_ASSIGN(AudioManager);
260 }; 267 };
261 268
262 } // namespace media 269 } // namespace media
263 270
264 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_ 271 #endif // MEDIA_AUDIO_AUDIO_MANAGER_H_
OLDNEW
« no previous file with comments | « content/renderer/media/user_media_client_impl.cc ('k') | media/audio/audio_manager_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698