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

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

Issue 16103007: Privitize WaitTillDataReady() and DataReady(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Gotta catch'em all! Created 7 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « media/audio/audio_output_resampler.cc ('k') | media/audio/pulse/pulse_input.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 } 737 }
738 738
739 bool AlsaPcmOutputStream::IsOnAudioThread() const { 739 bool AlsaPcmOutputStream::IsOnAudioThread() const {
740 return message_loop_ && message_loop_ == base::MessageLoop::current(); 740 return message_loop_ && message_loop_ == base::MessageLoop::current();
741 } 741 }
742 742
743 int AlsaPcmOutputStream::RunDataCallback(AudioBus* audio_bus, 743 int AlsaPcmOutputStream::RunDataCallback(AudioBus* audio_bus,
744 AudioBuffersState buffers_state) { 744 AudioBuffersState buffers_state) {
745 TRACE_EVENT0("audio", "AlsaPcmOutputStream::RunDataCallback"); 745 TRACE_EVENT0("audio", "AlsaPcmOutputStream::RunDataCallback");
746 746
747 if (source_callback_) { 747 if (source_callback_)
748 source_callback_->WaitTillDataReady();
749 return source_callback_->OnMoreData(audio_bus, buffers_state); 748 return source_callback_->OnMoreData(audio_bus, buffers_state);
750 }
751 749
752 return 0; 750 return 0;
753 } 751 }
754 752
755 void AlsaPcmOutputStream::RunErrorCallback(int code) { 753 void AlsaPcmOutputStream::RunErrorCallback(int code) {
756 if (source_callback_) 754 if (source_callback_)
757 source_callback_->OnError(this); 755 source_callback_->OnError(this);
758 } 756 }
759 757
760 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to 758 // Changes the AudioSourceCallback to proxy calls to. Pass in NULL to
761 // release ownership of the currently registered callback. 759 // release ownership of the currently registered callback.
762 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) { 760 void AlsaPcmOutputStream::set_source_callback(AudioSourceCallback* callback) {
763 DCHECK(IsOnAudioThread()); 761 DCHECK(IsOnAudioThread());
764 source_callback_ = callback; 762 source_callback_ = callback;
765 } 763 }
766 764
767 } // namespace media 765 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/audio_output_resampler.cc ('k') | media/audio/pulse/pulse_input.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698