| 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, | 319 int OnMoreData(AudioBus* dest, uint32 total_bytes_delay) final { |
| 320 uint32_t total_bytes_delay, | |
| 321 uint32_t frames_skipped) final { | |
| 322 // Note: This method is being invoked by a separate thread unknown to us | 320 // Note: This method is being invoked by a separate thread unknown to us |
| 323 // (i.e., outside of CastEnvironment). | 321 // (i.e., outside of CastEnvironment). |
| 324 | 322 |
| 325 int samples_remaining = dest->frames(); | 323 int samples_remaining = dest->frames(); |
| 326 | 324 |
| 327 while (samples_remaining > 0) { | 325 while (samples_remaining > 0) { |
| 328 // Get next audio frame ready for playout. | 326 // Get next audio frame ready for playout. |
| 329 if (!currently_playing_audio_frame_.get()) { | 327 if (!currently_playing_audio_frame_.get()) { |
| 330 base::AutoLock auto_lock(audio_lock_); | 328 base::AutoLock auto_lock(audio_lock_); |
| 331 | 329 |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 593 audio_config, | 591 audio_config, |
| 594 video_config, | 592 video_config, |
| 595 window_width, | 593 window_width, |
| 596 window_height); | 594 window_height); |
| 597 player.Start(); | 595 player.Start(); |
| 598 | 596 |
| 599 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). | 597 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). |
| 600 NOTREACHED(); | 598 NOTREACHED(); |
| 601 return 0; | 599 return 0; |
| 602 } | 600 } |
| OLD | NEW |