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

Side by Side Diff: media/audio/alsa/alsa_output.cc

Issue 1538563002: 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: Code review fix. git cl format. Rebase. 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 // THREAD SAFETY 5 // THREAD SAFETY
6 // 6 //
7 // AlsaPcmOutputStream object is *not* thread-safe and should only be used 7 // AlsaPcmOutputStream object is *not* thread-safe and should only be used
8 // from the audio thread. We DCHECK on this assumption whenever we can. 8 // from the audio thread. We DCHECK on this assumption whenever we can.
9 // 9 //
10 // SEMANTICS OF Close() 10 // SEMANTICS OF Close()
(...skipping 763 matching lines...) Expand 10 before | Expand all | Expand 10 after
774 774
775 bool AlsaPcmOutputStream::IsOnAudioThread() const { 775 bool AlsaPcmOutputStream::IsOnAudioThread() const {
776 return message_loop_ && message_loop_ == base::MessageLoop::current(); 776 return message_loop_ && message_loop_ == base::MessageLoop::current();
777 } 777 }
778 778
779 int AlsaPcmOutputStream::RunDataCallback(AudioBus* audio_bus, 779 int AlsaPcmOutputStream::RunDataCallback(AudioBus* audio_bus,
780 uint32 total_bytes_delay) { 780 uint32 total_bytes_delay) {
781 TRACE_EVENT0("audio", "AlsaPcmOutputStream::RunDataCallback"); 781 TRACE_EVENT0("audio", "AlsaPcmOutputStream::RunDataCallback");
782 782
783 if (source_callback_) 783 if (source_callback_)
784 return source_callback_->OnMoreData(audio_bus, total_bytes_delay); 784 return source_callback_->OnMoreData(audio_bus, total_bytes_delay, 0);
785 785
786 return 0; 786 return 0;
787 } 787 }
788 788
789 void AlsaPcmOutputStream::RunErrorCallback(int code) { 789 void AlsaPcmOutputStream::RunErrorCallback(int code) {
790 if (source_callback_) 790 if (source_callback_)
791 source_callback_->OnError(this); 791 source_callback_->OnError(this);
792 } 792 }
793 793
794 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to 794 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to
795 // release ownership of the currently registered callback. 795 // release ownership of the currently registered callback.
796 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) { 796 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) {
797 DCHECK(IsOnAudioThread()); 797 DCHECK(IsOnAudioThread());
798 source_callback_ = callback; 798 source_callback_ = callback;
799 } 799 }
800 800
801 } // namespace media 801 } // namespace media
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_local_audio_renderer.cc ('k') | media/audio/alsa/alsa_output_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698