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

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: Improve AudioManager comment. 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
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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 // GetWorkerTaskRunner()).
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 GetWorkerTaskRunner()).
Guido Urdaneta 2016/09/05 13:15:53 Actually, the comment should say GetTaskRunner() i
Max Morin 2016/09/05 13:53:56 Done.
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

Powered by Google App Engine
This is Rietveld 408576698