OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2012 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 // Periodcally called function that ensures that frames are pulled and pushed | 220 // Periodcally called function that ensures that frames are pulled and pushed |
221 // periodically if enabled/started. | 221 // periodically if enabled/started. |
222 void ProcessFrameP(); | 222 void ProcessFrameP(); |
223 // Pulls frames from the registered webrtc::AudioTransport. | 223 // Pulls frames from the registered webrtc::AudioTransport. |
224 void ReceiveFrameP(); | 224 void ReceiveFrameP(); |
225 // Pushes frames to the registered webrtc::AudioTransport. | 225 // Pushes frames to the registered webrtc::AudioTransport. |
226 void SendFrameP(); | 226 void SendFrameP(); |
227 | 227 |
228 // The time in milliseconds when Process() was last called or 0 if no call | 228 // The time in milliseconds when Process() was last called or 0 if no call |
229 // has been made. | 229 // has been made. |
230 uint32_t last_process_time_ms_; | 230 int64_t last_process_time_ms_; |
231 | 231 |
232 // Callback for playout and recording. | 232 // Callback for playout and recording. |
233 webrtc::AudioTransport* audio_callback_; | 233 webrtc::AudioTransport* audio_callback_; |
234 | 234 |
235 bool recording_; // True when audio is being pushed from the instance. | 235 bool recording_; // True when audio is being pushed from the instance. |
236 bool playing_; // True when audio is being pulled by the instance. | 236 bool playing_; // True when audio is being pulled by the instance. |
237 | 237 |
238 bool play_is_initialized_; // True when the instance is ready to pull audio. | 238 bool play_is_initialized_; // True when the instance is ready to pull audio. |
239 bool rec_is_initialized_; // True when the instance is ready to push audio. | 239 bool rec_is_initialized_; // True when the instance is ready to push audio. |
240 | 240 |
241 // Input to and output from RecordedDataIsAvailable(..) makes it possible to | 241 // Input to and output from RecordedDataIsAvailable(..) makes it possible to |
242 // modify the current mic level. The implementation does not care about the | 242 // modify the current mic level. The implementation does not care about the |
243 // mic level so it just feeds back what it receives. | 243 // mic level so it just feeds back what it receives. |
244 uint32_t current_mic_level_; | 244 uint32_t current_mic_level_; |
245 | 245 |
246 // next_frame_time_ is updated in a non-drifting manner to indicate the next | 246 // next_frame_time_ is updated in a non-drifting manner to indicate the next |
247 // wall clock time the next frame should be generated and received. started_ | 247 // wall clock time the next frame should be generated and received. started_ |
248 // ensures that next_frame_time_ can be initialized properly on first call. | 248 // ensures that next_frame_time_ can be initialized properly on first call. |
249 bool started_; | 249 bool started_; |
250 uint32_t next_frame_time_; | 250 int64_t next_frame_time_; |
251 | 251 |
252 std::unique_ptr<rtc::Thread> process_thread_; | 252 std::unique_ptr<rtc::Thread> process_thread_; |
253 | 253 |
254 // Buffer for storing samples received from the webrtc::AudioTransport. | 254 // Buffer for storing samples received from the webrtc::AudioTransport. |
255 char rec_buffer_[kNumberSamples * kNumberBytesPerSample]; | 255 char rec_buffer_[kNumberSamples * kNumberBytesPerSample]; |
256 // Buffer for samples to send to the webrtc::AudioTransport. | 256 // Buffer for samples to send to the webrtc::AudioTransport. |
257 char send_buffer_[kNumberSamples * kNumberBytesPerSample]; | 257 char send_buffer_[kNumberSamples * kNumberBytesPerSample]; |
258 | 258 |
259 // Counter of frames received that have samples of high enough amplitude to | 259 // Counter of frames received that have samples of high enough amplitude to |
260 // indicate that the frames are not faked somewhere in the audio pipeline | 260 // indicate that the frames are not faked somewhere in the audio pipeline |
261 // (e.g. by a jitter buffer). | 261 // (e.g. by a jitter buffer). |
262 int frames_received_; | 262 int frames_received_; |
263 | 263 |
264 // Protects variables that are accessed from process_thread_ and | 264 // Protects variables that are accessed from process_thread_ and |
265 // the main thread. | 265 // the main thread. |
266 rtc::CriticalSection crit_; | 266 rtc::CriticalSection crit_; |
267 // Protects |audio_callback_| that is accessed from process_thread_ and | 267 // Protects |audio_callback_| that is accessed from process_thread_ and |
268 // the main thread. | 268 // the main thread. |
269 rtc::CriticalSection crit_callback_; | 269 rtc::CriticalSection crit_callback_; |
270 }; | 270 }; |
271 | 271 |
272 #endif // WEBRTC_API_TEST_FAKEAUDIOCAPTUREMODULE_H_ | 272 #endif // WEBRTC_API_TEST_FAKEAUDIOCAPTUREMODULE_H_ |
OLD | NEW |