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

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

Issue 2060833002: Implementation of 'AudioContext.getOutputTimestamp' method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added implementation for ALSA. Created 4 years, 5 months 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 <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>
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
317 } 317 }
318 318
319 // End of InProcessReceiver finals. 319 // End of InProcessReceiver finals.
320 //////////////////////////////////////////////////////////////////// 320 ////////////////////////////////////////////////////////////////////
321 321
322 //////////////////////////////////////////////////////////////////// 322 ////////////////////////////////////////////////////////////////////
323 // AudioSourceCallback implementation. 323 // AudioSourceCallback implementation.
324 324
325 int OnMoreData(AudioBus* dest, 325 int OnMoreData(AudioBus* dest,
326 uint32_t total_bytes_delay, 326 uint32_t total_bytes_delay,
327 uint32_t frames_skipped) final { 327 uint32_t frames_skipped,
328 const AudioTimestamp& timestamp) final {
328 // Note: This method is being invoked by a separate thread unknown to us 329 // Note: This method is being invoked by a separate thread unknown to us
329 // (i.e., outside of CastEnvironment). 330 // (i.e., outside of CastEnvironment).
330 331
331 int samples_remaining = dest->frames(); 332 int samples_remaining = dest->frames();
332 333
333 while (samples_remaining > 0) { 334 while (samples_remaining > 0) {
334 // Get next audio frame ready for playout. 335 // Get next audio frame ready for playout.
335 if (!currently_playing_audio_frame_.get()) { 336 if (!currently_playing_audio_frame_.get()) {
336 base::AutoLock auto_lock(audio_lock_); 337 base::AutoLock auto_lock(audio_lock_);
337 338
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 audio_config, 601 audio_config,
601 video_config, 602 video_config,
602 window_width, 603 window_width,
603 window_height); 604 window_height);
604 player.Start(); 605 player.Start();
605 606
606 base::RunLoop().Run(); // Run forever (i.e., until SIGTERM). 607 base::RunLoop().Run(); // Run forever (i.e., until SIGTERM).
607 NOTREACHED(); 608 NOTREACHED();
608 return 0; 609 return 0;
609 } 610 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698