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

Side by Side Diff: media/base/fake_audio_renderer_sink.cc

Issue 2517503003: Reland: Make more media APIs aware of |delay| and |delay_timestamp| (Closed)
Patch Set: Comments from chcunningham@ and Dale Created 4 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
« no previous file with comments | « media/base/fake_audio_renderer_sink.h ('k') | media/base/silent_sink_suspender.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/base/fake_audio_renderer_sink.h" 5 #include "media/base/fake_audio_renderer_sink.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/location.h" 8 #include "base/location.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 10
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 OutputDeviceInfo FakeAudioRendererSink::GetOutputDeviceInfo() { 68 OutputDeviceInfo FakeAudioRendererSink::GetOutputDeviceInfo() {
69 return output_device_info_; 69 return output_device_info_;
70 } 70 }
71 71
72 bool FakeAudioRendererSink::CurrentThreadIsRenderingThread() { 72 bool FakeAudioRendererSink::CurrentThreadIsRenderingThread() {
73 NOTIMPLEMENTED(); 73 NOTIMPLEMENTED();
74 return false; 74 return false;
75 } 75 }
76 76
77 bool FakeAudioRendererSink::Render(AudioBus* dest, 77 bool FakeAudioRendererSink::Render(AudioBus* dest,
78 uint32_t frames_delayed, 78 base::TimeDelta delay,
79 int* frames_written) { 79 int* frames_written) {
80 if (state_ != kPlaying) 80 if (state_ != kPlaying)
81 return false; 81 return false;
82 82
83 *frames_written = callback_->Render(dest, frames_delayed, 0); 83 *frames_written = callback_->Render(delay, base::TimeTicks::Now(), 0, dest);
84 return true; 84 return true;
85 } 85 }
86 86
87 void FakeAudioRendererSink::OnRenderError() { 87 void FakeAudioRendererSink::OnRenderError() {
88 DCHECK_NE(state_, kUninitialized); 88 DCHECK_NE(state_, kUninitialized);
89 DCHECK_NE(state_, kStopped); 89 DCHECK_NE(state_, kStopped);
90 90
91 callback_->OnRenderError(); 91 callback_->OnRenderError();
92 } 92 }
93 93
94 void FakeAudioRendererSink::ChangeState(State new_state) { 94 void FakeAudioRendererSink::ChangeState(State new_state) {
95 static const char* kStateNames[] = { 95 static const char* kStateNames[] = {
96 "kUninitialized", 96 "kUninitialized",
97 "kInitialized", 97 "kInitialized",
98 "kStarted", 98 "kStarted",
99 "kPaused", 99 "kPaused",
100 "kPlaying", 100 "kPlaying",
101 "kStopped" 101 "kStopped"
102 }; 102 };
103 103
104 DVLOG(1) << __FUNCTION__ << " : " 104 DVLOG(1) << __FUNCTION__ << " : "
105 << kStateNames[state_] << " -> " << kStateNames[new_state]; 105 << kStateNames[state_] << " -> " << kStateNames[new_state];
106 state_ = new_state; 106 state_ = new_state;
107 } 107 }
108 108
109 } // namespace media 109 } // namespace media
OLDNEW
« no previous file with comments | « media/base/fake_audio_renderer_sink.h ('k') | media/base/silent_sink_suspender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698