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

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

Issue 1487983002: 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 fixes. Loads of files updated due to interface changes. 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 #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 #include "base/single_thread_task_runner.h" 10 #include "base/single_thread_task_runner.h"
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 58
59 OutputDevice* FakeAudioRendererSink::GetOutputDevice() { 59 OutputDevice* FakeAudioRendererSink::GetOutputDevice() {
60 return output_device_.get(); 60 return output_device_.get();
61 } 61 }
62 62
63 bool FakeAudioRendererSink::Render(AudioBus* dest, int audio_delay_milliseconds, 63 bool FakeAudioRendererSink::Render(AudioBus* dest, int audio_delay_milliseconds,
64 int* frames_written) { 64 int* frames_written) {
65 if (state_ != kPlaying) 65 if (state_ != kPlaying)
66 return false; 66 return false;
67 67
68 *frames_written = callback_->Render(dest, audio_delay_milliseconds); 68 *frames_written = callback_->Render(dest, audio_delay_milliseconds, 0);
69 return true; 69 return true;
70 } 70 }
71 71
72 void FakeAudioRendererSink::OnRenderError() { 72 void FakeAudioRendererSink::OnRenderError() {
73 DCHECK_NE(state_, kUninitialized); 73 DCHECK_NE(state_, kUninitialized);
74 DCHECK_NE(state_, kStopped); 74 DCHECK_NE(state_, kStopped);
75 75
76 callback_->OnRenderError(); 76 callback_->OnRenderError();
77 } 77 }
78 78
79 void FakeAudioRendererSink::ChangeState(State new_state) { 79 void FakeAudioRendererSink::ChangeState(State new_state) {
80 static const char* kStateNames[] = { 80 static const char* kStateNames[] = {
81 "kUninitialized", 81 "kUninitialized",
82 "kInitialized", 82 "kInitialized",
83 "kStarted", 83 "kStarted",
84 "kPaused", 84 "kPaused",
85 "kPlaying", 85 "kPlaying",
86 "kStopped" 86 "kStopped"
87 }; 87 };
88 88
89 DVLOG(1) << __FUNCTION__ << " : " 89 DVLOG(1) << __FUNCTION__ << " : "
90 << kStateNames[state_] << " -> " << kStateNames[new_state]; 90 << kStateNames[state_] << " -> " << kStateNames[new_state];
91 state_ = new_state; 91 state_ = new_state;
92 } 92 }
93 93
94 } // namespace media 94 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698