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

Side by Side Diff: media/audio/clockless_audio_sink.cc

Issue 623263003: replace OVERRIDE and FINAL with override and final in media/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
« no previous file with comments | « media/audio/clockless_audio_sink.h ('k') | media/audio/cras/audio_manager_cras.h » ('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 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 "media/audio/clockless_audio_sink.h" 5 #include "media/audio/clockless_audio_sink.h"
6 6
7 #include "base/threading/simple_thread.h" 7 #include "base/threading/simple_thread.h"
8 #include "base/time/time.h" 8 #include "base/time/time.h"
9 #include "media/base/audio_renderer_sink.h" 9 #include "media/base/audio_renderer_sink.h"
10 10
(...skipping 17 matching lines...) Expand all
28 28
29 // Generate a signal to stop calling Render(). 29 // Generate a signal to stop calling Render().
30 base::TimeDelta Stop() { 30 base::TimeDelta Stop() {
31 stop_event_->Signal(); 31 stop_event_->Signal();
32 thread_->Join(); 32 thread_->Join();
33 return playback_time_; 33 return playback_time_;
34 } 34 }
35 35
36 private: 36 private:
37 // Call Render() repeatedly, keeping track of the rendering time. 37 // Call Render() repeatedly, keeping track of the rendering time.
38 virtual void Run() OVERRIDE { 38 virtual void Run() override {
39 base::TimeTicks start; 39 base::TimeTicks start;
40 while (!stop_event_->IsSignaled()) { 40 while (!stop_event_->IsSignaled()) {
41 int frames_received = callback_->Render(audio_bus_.get(), 0); 41 int frames_received = callback_->Render(audio_bus_.get(), 0);
42 if (frames_received <= 0) { 42 if (frames_received <= 0) {
43 // No data received, so let other threads run to provide data. 43 // No data received, so let other threads run to provide data.
44 base::PlatformThread::YieldCurrentThread(); 44 base::PlatformThread::YieldCurrentThread();
45 } else if (start.is_null()) { 45 } else if (start.is_null()) {
46 // First time we processed some audio, so record the starting time. 46 // First time we processed some audio, so record the starting time.
47 start = base::TimeTicks::HighResNow(); 47 start = base::TimeTicks::HighResNow();
48 } else { 48 } else {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 playing_ = false; 101 playing_ = false;
102 playback_time_ = thread_->Stop(); 102 playback_time_ = thread_->Stop();
103 } 103 }
104 104
105 bool ClocklessAudioSink::SetVolume(double volume) { 105 bool ClocklessAudioSink::SetVolume(double volume) {
106 // Audio is always muted. 106 // Audio is always muted.
107 return volume == 0.0; 107 return volume == 0.0;
108 } 108 }
109 109
110 } // namespace media 110 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/clockless_audio_sink.h ('k') | media/audio/cras/audio_manager_cras.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698