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 #include <algorithm> | 5 #include <algorithm> |
6 #include <climits> | 6 #include <climits> |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <cstdio> | 8 #include <cstdio> |
9 #include <deque> | 9 #include <deque> |
10 #include <map> | 10 #include <map> |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 audio_playout_queue_.push_back( | 309 audio_playout_queue_.push_back( |
310 std::make_pair(playout_time, audio_frame.release())); | 310 std::make_pair(playout_time, audio_frame.release())); |
311 } | 311 } |
312 | 312 |
313 // End of InProcessReceiver finals. | 313 // End of InProcessReceiver finals. |
314 //////////////////////////////////////////////////////////////////// | 314 //////////////////////////////////////////////////////////////////// |
315 | 315 |
316 //////////////////////////////////////////////////////////////////// | 316 //////////////////////////////////////////////////////////////////// |
317 // AudioSourceCallback implementation. | 317 // AudioSourceCallback implementation. |
318 | 318 |
319 int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) final { | 319 int OnMoreData(AudioBus* dest, |
| 320 uint32_t total_bytes_delay, |
| 321 uint32_t frames_skipped) final { |
320 // Note: This method is being invoked by a separate thread unknown to us | 322 // Note: This method is being invoked by a separate thread unknown to us |
321 // (i.e., outside of CastEnvironment). | 323 // (i.e., outside of CastEnvironment). |
322 | 324 |
323 int samples_remaining = dest->frames(); | 325 int samples_remaining = dest->frames(); |
324 | 326 |
325 while (samples_remaining > 0) { | 327 while (samples_remaining > 0) { |
326 // Get next audio frame ready for playout. | 328 // Get next audio frame ready for playout. |
327 if (!currently_playing_audio_frame_.get()) { | 329 if (!currently_playing_audio_frame_.get()) { |
328 base::AutoLock auto_lock(audio_lock_); | 330 base::AutoLock auto_lock(audio_lock_); |
329 | 331 |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 audio_config, | 593 audio_config, |
592 video_config, | 594 video_config, |
593 window_width, | 595 window_width, |
594 window_height); | 596 window_height); |
595 player.Start(); | 597 player.Start(); |
596 | 598 |
597 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). | 599 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). |
598 NOTREACHED(); | 600 NOTREACHED(); |
599 return 0; | 601 return 0; |
600 } | 602 } |
OLD | NEW |