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 <limits.h> | 5 #include <limits.h> |
6 #include <stddef.h> | 6 #include <stddef.h> |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <climits> | 10 #include <climits> |
11 #include <cstdarg> | 11 #include <cstdarg> |
12 #include <cstdio> | 12 #include <cstdio> |
13 #include <deque> | 13 #include <deque> |
14 #include <map> | 14 #include <map> |
15 #include <memory> | 15 #include <memory> |
16 #include <string> | 16 #include <string> |
17 #include <utility> | 17 #include <utility> |
18 | 18 |
19 #include "base/at_exit.h" | 19 #include "base/at_exit.h" |
20 #include "base/command_line.h" | 20 #include "base/command_line.h" |
21 #include "base/logging.h" | 21 #include "base/logging.h" |
22 #include "base/memory/ref_counted.h" | 22 #include "base/memory/ref_counted.h" |
23 #include "base/message_loop/message_loop.h" | 23 #include "base/message_loop/message_loop.h" |
24 #include "base/run_loop.h" | 24 #include "base/run_loop.h" |
25 #include "base/synchronization/lock.h" | 25 #include "base/synchronization/lock.h" |
26 #include "base/synchronization/waitable_event.h" | 26 #include "base/synchronization/waitable_event.h" |
27 #include "base/threading/thread.h" | 27 #include "base/threading/thread.h" |
28 #include "base/time/default_tick_clock.h" | 28 #include "base/time/default_tick_clock.h" |
| 29 #include "base/timer/time.h" |
29 #include "base/timer/timer.h" | 30 #include "base/timer/timer.h" |
30 #include "media/audio/audio_io.h" | 31 #include "media/audio/audio_io.h" |
31 #include "media/audio/audio_manager.h" | 32 #include "media/audio/audio_manager.h" |
32 #include "media/audio/fake_audio_log_factory.h" | 33 #include "media/audio/fake_audio_log_factory.h" |
33 #include "media/base/audio_bus.h" | 34 #include "media/base/audio_bus.h" |
34 #include "media/base/audio_parameters.h" | 35 #include "media/base/audio_parameters.h" |
35 #include "media/base/channel_layout.h" | 36 #include "media/base/channel_layout.h" |
36 #include "media/base/video_frame.h" | 37 #include "media/base/video_frame.h" |
37 #include "media/cast/cast_config.h" | 38 #include "media/cast/cast_config.h" |
38 #include "media/cast/cast_environment.h" | 39 #include "media/cast/cast_environment.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 } | 318 } |
318 | 319 |
319 // End of InProcessReceiver finals. | 320 // End of InProcessReceiver finals. |
320 //////////////////////////////////////////////////////////////////// | 321 //////////////////////////////////////////////////////////////////// |
321 | 322 |
322 //////////////////////////////////////////////////////////////////// | 323 //////////////////////////////////////////////////////////////////// |
323 // AudioSourceCallback implementation. | 324 // AudioSourceCallback implementation. |
324 | 325 |
325 int OnMoreData(AudioBus* dest, | 326 int OnMoreData(AudioBus* dest, |
326 uint32_t total_bytes_delay, | 327 uint32_t total_bytes_delay, |
| 328 base::TimeDelta delay_timestamp, |
327 uint32_t frames_skipped) final { | 329 uint32_t frames_skipped) final { |
328 // Note: This method is being invoked by a separate thread unknown to us | 330 // Note: This method is being invoked by a separate thread unknown to us |
329 // (i.e., outside of CastEnvironment). | 331 // (i.e., outside of CastEnvironment). |
330 | 332 |
331 int samples_remaining = dest->frames(); | 333 int samples_remaining = dest->frames(); |
332 | 334 |
333 while (samples_remaining > 0) { | 335 while (samples_remaining > 0) { |
334 // Get next audio frame ready for playout. | 336 // Get next audio frame ready for playout. |
335 if (!currently_playing_audio_frame_.get()) { | 337 if (!currently_playing_audio_frame_.get()) { |
336 base::AutoLock auto_lock(audio_lock_); | 338 base::AutoLock auto_lock(audio_lock_); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
600 audio_config, | 602 audio_config, |
601 video_config, | 603 video_config, |
602 window_width, | 604 window_width, |
603 window_height); | 605 window_height); |
604 player.Start(); | 606 player.Start(); |
605 | 607 |
606 base::RunLoop().Run(); // Run forever (i.e., until SIGTERM). | 608 base::RunLoop().Run(); // Run forever (i.e., until SIGTERM). |
607 NOTREACHED(); | 609 NOTREACHED(); |
608 return 0; | 610 return 0; |
609 } | 611 } |
OLD | NEW |