Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_LOGGING_H_ | 5 #ifndef MEDIA_AUDIO_AUDIO_LOGGING_H_ |
| 6 #define MEDIA_AUDIO_AUDIO_LOGGING_H_ | 6 #define MEDIA_AUDIO_AUDIO_LOGGING_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 | 11 |
| 12 namespace media { | 12 namespace media { |
| 13 | |
| 13 class AudioParameters; | 14 class AudioParameters; |
| 14 | 15 |
| 15 // AudioLog logs state information about an active audio component. Each method | 16 // AudioLog logs state information about an active audio component. Each method |
| 16 // takes a |component_id| along with method specific information. Its methods | 17 // takes a |component_id| along with method specific information. Its methods |
| 17 // are safe to call from any thread. | 18 // are safe to call from any thread. |
| 18 class AudioLog { | 19 class AudioLog { |
| 19 public: | 20 public: |
| 20 virtual ~AudioLog() {} | 21 virtual ~AudioLog() {} |
| 21 | 22 |
| 22 // Called when an audio component is created. |params| are the parameters of | 23 // Called when an audio component is created. |params| are the parameters of |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 41 // Called when an audio component encounters an error. | 42 // Called when an audio component encounters an error. |
| 42 virtual void OnError(int component_id) = 0; | 43 virtual void OnError(int component_id) = 0; |
| 43 | 44 |
| 44 // Called when an audio component changes volume. |volume| is the new volume. | 45 // Called when an audio component changes volume. |volume| is the new volume. |
| 45 virtual void OnSetVolume(int component_id, double volume) = 0; | 46 virtual void OnSetVolume(int component_id, double volume) = 0; |
| 46 | 47 |
| 47 // Called when an audio component switches output device. |device_id| is the | 48 // Called when an audio component switches output device. |device_id| is the |
| 48 // new audio output device. | 49 // new audio output device. |
| 49 virtual void OnSwitchOutputDevice(int component_id, | 50 virtual void OnSwitchOutputDevice(int component_id, |
| 50 const std::string& device_id) = 0; | 51 const std::string& device_id) = 0; |
| 52 | |
| 53 // Stats reporting. | |
| 54 virtual void OnStatistics(int component_id, | |
|
DaleCurtis
2016/05/19 20:34:37
It seems this should just be OnStatistics(componen
Henrik Grunell
2016/05/23 17:13:54
I did consider just using a string (and call it On
| |
| 55 const std::string& name, | |
| 56 int value) = 0; | |
| 51 }; | 57 }; |
| 52 | 58 |
| 53 // AudioLogFactory dispenses AudioLog instances to owning classes for tracking | 59 // AudioLogFactory dispenses AudioLog instances to owning classes for tracking |
| 54 // AudioComponent behavior. All AudioComponents have the concept of an owning | 60 // AudioComponent behavior. All AudioComponents have the concept of an owning |
| 55 // class: | 61 // class: |
| 56 // | 62 // |
| 57 // - AudioInputRendererHost for AudioInputController | 63 // - AudioInputRendererHost for AudioInputController |
| 58 // - AudioRendererHost for AudioOutputController | 64 // - AudioRendererHost for AudioOutputController |
| 59 // - AudioOutputDispatcherImpl for AudioOutputStream | 65 // - AudioOutputDispatcherImpl for AudioOutputStream |
| 60 // | 66 // |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 79 virtual std::unique_ptr<AudioLog> CreateAudioLog( | 85 virtual std::unique_ptr<AudioLog> CreateAudioLog( |
| 80 AudioComponent component) = 0; | 86 AudioComponent component) = 0; |
| 81 | 87 |
| 82 protected: | 88 protected: |
| 83 virtual ~AudioLogFactory() {} | 89 virtual ~AudioLogFactory() {} |
| 84 }; | 90 }; |
| 85 | 91 |
| 86 } // namespace media | 92 } // namespace media |
| 87 | 93 |
| 88 #endif // MEDIA_AUDIO_AUDIO_LOGGING_H_ | 94 #endif // MEDIA_AUDIO_AUDIO_LOGGING_H_ |
| OLD | NEW |