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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 | 11 |
12 namespace media { | 12 namespace media { |
13 class AudioParameters; | 13 class AudioParameters; |
14 | 14 |
15 // AudioLog logs state information about an active audio component. Each method | 15 // AudioLog logs state information about an active audio component. Each method |
16 // takes a |component_id| along with method specific information. Its methods | 16 // takes a |component_id| along with method specific information. Its methods |
17 // are safe to call from any thread. | 17 // are safe to call from any thread. |
18 class AudioLog { | 18 class AudioLog { |
19 public: | 19 public: |
20 virtual ~AudioLog() {} | 20 virtual ~AudioLog() {} |
21 | 21 |
22 // Called when an audio component is created. |params| are the parameters of | 22 // Called when an audio component is created. |params| are the parameters of |
23 // the created stream. |input_device_id| and |output_device_id| are the | 23 // the created stream. |device_id| is the id of the audio device opened by |
24 // respective device ids for input and output. Either one or both may be | 24 // the created stream. |
25 // specified. | |
26 virtual void OnCreated(int component_id, | 25 virtual void OnCreated(int component_id, |
27 const media::AudioParameters& params, | 26 const media::AudioParameters& params, |
28 const std::string& input_device_id, | 27 const std::string& device_id) = 0; |
29 const std::string& output_device_id) = 0; | |
30 | 28 |
31 // Called when an audio component is started, generally this is synonymous | 29 // Called when an audio component is started, generally this is synonymous |
32 // with "playing." | 30 // with "playing." |
33 virtual void OnStarted(int component_id) = 0; | 31 virtual void OnStarted(int component_id) = 0; |
34 | 32 |
35 // Called when an audio component is stopped, generally this is synonymous | 33 // Called when an audio component is stopped, generally this is synonymous |
36 // with "paused." | 34 // with "paused." |
37 virtual void OnStopped(int component_id) = 0; | 35 virtual void OnStopped(int component_id) = 0; |
38 | 36 |
39 // Called when an audio component is closed, generally this is synonymous | 37 // Called when an audio component is closed, generally this is synonymous |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 // create its own AudioLog. | 73 // create its own AudioLog. |
76 virtual scoped_ptr<AudioLog> CreateAudioLog(AudioComponent component) = 0; | 74 virtual scoped_ptr<AudioLog> CreateAudioLog(AudioComponent component) = 0; |
77 | 75 |
78 protected: | 76 protected: |
79 virtual ~AudioLogFactory() {} | 77 virtual ~AudioLogFactory() {} |
80 }; | 78 }; |
81 | 79 |
82 } // namespace media | 80 } // namespace media |
83 | 81 |
84 #endif // MEDIA_AUDIO_AUDIO_LOGGING_H_ | 82 #endif // MEDIA_AUDIO_AUDIO_LOGGING_H_ |
OLD | NEW |