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 |
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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
75 | 76 |
76 // Create a new AudioLog object for tracking the behavior for one or more | 77 // Create a new AudioLog object for tracking the behavior for one or more |
77 // instances of the given component. Each instance of an "owning" class must | 78 // instances of the given component. Each instance of an "owning" class must |
78 // create its own AudioLog. | 79 // create its own AudioLog. |
79 virtual scoped_ptr<AudioLog> CreateAudioLog(AudioComponent component) = 0; | 80 virtual scoped_ptr<AudioLog> CreateAudioLog(AudioComponent component) = 0; |
80 | 81 |
81 protected: | 82 protected: |
82 virtual ~AudioLogFactory() {} | 83 virtual ~AudioLogFactory() {} |
83 }; | 84 }; |
84 | 85 |
| 86 // Callback function used for writing to native WebRTC log from media. |
| 87 typedef void (*WebRtcLoggingCallback)(const std::string&); |
| 88 |
| 89 // Function that the embedder calls to set the callback. Must only be called |
| 90 // once. |
| 91 void InitWebRtcLoggingCallback(WebRtcLoggingCallback callback); |
| 92 |
| 93 // Function that media code calls to log. Forwards to callback function if set. |
| 94 void WebRtcLogMessage(const std::string& message); |
| 95 |
85 } // namespace media | 96 } // namespace media |
86 | 97 |
87 #endif // MEDIA_AUDIO_AUDIO_LOGGING_H_ | 98 #endif // MEDIA_AUDIO_AUDIO_LOGGING_H_ |
OLD | NEW |