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 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
370 // Note: Only logging underruns after the first frame has been received. | 370 // Note: Only logging underruns after the first frame has been received. |
371 LOG_IF(WARNING, currently_playing_audio_frame_start_ != -1) | 371 LOG_IF(WARNING, currently_playing_audio_frame_start_ != -1) |
372 << "Audio: Playback underrun of " << samples_remaining << " samples!"; | 372 << "Audio: Playback underrun of " << samples_remaining << " samples!"; |
373 dest->ZeroFramesPartial(dest->frames() - samples_remaining, | 373 dest->ZeroFramesPartial(dest->frames() - samples_remaining, |
374 samples_remaining); | 374 samples_remaining); |
375 } | 375 } |
376 | 376 |
377 return dest->frames(); | 377 return dest->frames(); |
378 } | 378 } |
379 | 379 |
380 virtual int OnMoreIOData(AudioBus* source, | |
381 AudioBus* dest, | |
382 AudioBuffersState buffers_state) OVERRIDE { | |
383 return OnMoreData(dest, buffers_state); | |
384 } | |
385 | |
386 virtual void OnError(AudioOutputStream* stream) OVERRIDE { | 380 virtual void OnError(AudioOutputStream* stream) OVERRIDE { |
387 LOG(ERROR) << "AudioOutputStream reports an error. " | 381 LOG(ERROR) << "AudioOutputStream reports an error. " |
388 << "Playback is unlikely to continue."; | 382 << "Playback is unlikely to continue."; |
389 } | 383 } |
390 | 384 |
391 // End of AudioSourceCallback implementation. | 385 // End of AudioSourceCallback implementation. |
392 //////////////////////////////////////////////////////////////////// | 386 //////////////////////////////////////////////////////////////////// |
393 | 387 |
394 void ScheduleVideoPlayout() { | 388 void ScheduleVideoPlayout() { |
395 DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN)); | 389 DCHECK(cast_env()->CurrentlyOn(CastEnvironment::MAIN)); |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 audio_config, | 576 audio_config, |
583 video_config, | 577 video_config, |
584 window_width, | 578 window_width, |
585 window_height); | 579 window_height); |
586 player.Start(); | 580 player.Start(); |
587 | 581 |
588 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). | 582 base::MessageLoop().Run(); // Run forever (i.e., until SIGTERM). |
589 NOTREACHED(); | 583 NOTREACHED(); |
590 return 0; | 584 return 0; |
591 } | 585 } |
OLD | NEW |