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 CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ |
6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ | 6 #define CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ |
7 | 7 |
8 #include <list> | 8 #include <list> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Starts the local audio track. Called on the main render thread and | 59 // Starts the local audio track. Called on the main render thread and |
60 // should be called only once when audio track is created. | 60 // should be called only once when audio track is created. |
61 void Start(); | 61 void Start(); |
62 | 62 |
63 // Stops the local audio track. Called on the main render thread and | 63 // Stops the local audio track. Called on the main render thread and |
64 // should be called only once when audio track going away. | 64 // should be called only once when audio track going away. |
65 void Stop(); | 65 void Stop(); |
66 | 66 |
67 // Method called by the capturer to deliver the capture data. | 67 // Method called by the capturer to deliver the capture data. |
68 void Capture(media::AudioBus* audio_source, | 68 void Capture(const int16* audio_data, |
69 int audio_delay_milliseconds, | 69 int sample_rate, |
70 int volume, | 70 int number_of_channels, |
71 bool key_pressed); | 71 int number_of_frames); |
72 | 72 |
73 // Method called by the capturer to set the audio parameters used by source | 73 // Method called by the capturer to set the audio parameters used by source |
74 // of the capture data.. | 74 // of the capture data.. |
75 // Can be called on different user threads. | 75 // Can be called on different user threads. |
76 void SetCaptureFormat(const media::AudioParameters& params); | 76 void SetCaptureFormat(const media::AudioParameters& params); |
77 | 77 |
78 protected: | 78 protected: |
79 WebRtcLocalAudioTrack( | 79 WebRtcLocalAudioTrack( |
80 const std::string& label, | 80 const std::string& label, |
81 const scoped_refptr<WebRtcAudioCapturer>& capturer, | 81 const scoped_refptr<WebRtcAudioCapturer>& capturer, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 base::ThreadChecker thread_checker_; | 118 base::ThreadChecker thread_checker_; |
119 | 119 |
120 // Protects |params_| and |sinks_|. | 120 // Protects |params_| and |sinks_|. |
121 mutable base::Lock lock_; | 121 mutable base::Lock lock_; |
122 | 122 |
123 // A vector of WebRtc VoE channels that the capturer sends datat to. | 123 // A vector of WebRtc VoE channels that the capturer sends datat to. |
124 std::vector<int> voe_channels_; | 124 std::vector<int> voe_channels_; |
125 | 125 |
126 bool need_audio_processing_; | 126 bool need_audio_processing_; |
127 | 127 |
128 // Buffers used for temporary storage during capture callbacks. | 128 media::AudioParameters params_; |
129 // Allocated during initialization. | |
130 class ConfiguredBuffer; | |
131 scoped_refptr<ConfiguredBuffer> buffer_; | |
132 | 129 |
133 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioTrack); | 130 DISALLOW_COPY_AND_ASSIGN(WebRtcLocalAudioTrack); |
134 }; | 131 }; |
135 | 132 |
136 } // namespace content | 133 } // namespace content |
137 | 134 |
138 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ | 135 #endif // CONTENT_RENDERER_MEDIA_WEBRTC_LOCAL_AUDIO_TRACK_H_ |
OLD | NEW |