Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(27)

Side by Side Diff: media/cast/test/receiver.cc

Issue 1538463002: Revert of Forward the number of skipped frames by the OS in audio playout. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « media/blink/webaudiosourceprovider_impl_unittest.cc ('k') | media/cast/test/utility/audio_utility.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698