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

Side by Side Diff: media/audio/null_audio_sink.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
« no previous file with comments | « media/audio/mock_audio_source_callback.h ('k') | media/audio/pulse/pulse_output.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 #include "media/audio/null_audio_sink.h" 5 #include "media/audio/null_audio_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/single_thread_task_runner.h" 9 #include "base/single_thread_task_runner.h"
10 #include "media/audio/fake_audio_worker.h" 10 #include "media/audio/fake_audio_worker.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 return volume == 0.0; 75 return volume == 0.0;
76 } 76 }
77 77
78 OutputDevice* NullAudioSink::GetOutputDevice() { 78 OutputDevice* NullAudioSink::GetOutputDevice() {
79 return nullptr; 79 return nullptr;
80 } 80 }
81 81
82 void NullAudioSink::CallRender() { 82 void NullAudioSink::CallRender() {
83 DCHECK(task_runner_->BelongsToCurrentThread()); 83 DCHECK(task_runner_->BelongsToCurrentThread());
84 84
85 int frames_received = callback_->Render(audio_bus_.get(), 0); 85 int frames_received = callback_->Render(audio_bus_.get(), 0, 0);
86 if (!audio_hash_ || frames_received <= 0) 86 if (!audio_hash_ || frames_received <= 0)
87 return; 87 return;
88 88
89 audio_hash_->Update(audio_bus_.get(), frames_received); 89 audio_hash_->Update(audio_bus_.get(), frames_received);
90 } 90 }
91 91
92 void NullAudioSink::StartAudioHashForTesting() { 92 void NullAudioSink::StartAudioHashForTesting() {
93 DCHECK(!initialized_); 93 DCHECK(!initialized_);
94 audio_hash_.reset(new AudioHash()); 94 audio_hash_.reset(new AudioHash());
95 } 95 }
96 96
97 std::string NullAudioSink::GetAudioHashForTesting() { 97 std::string NullAudioSink::GetAudioHashForTesting() {
98 return audio_hash_ ? audio_hash_->ToString() : std::string(); 98 return audio_hash_ ? audio_hash_->ToString() : std::string();
99 } 99 }
100 100
101 } // namespace media 101 } // namespace media
OLDNEW
« no previous file with comments | « media/audio/mock_audio_source_callback.h ('k') | media/audio/pulse/pulse_output.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698