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

Side by Side Diff: content/browser/media/capture/web_contents_audio_muter.cc

Issue 2101303004: Pass delay and timestamp to AudioSourceCallback::OnMoreData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Pass target playout time to AudioSourceCallback::OnMoreData. Created 4 years, 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/browser/media/capture/web_contents_audio_muter.h" 5 #include "content/browser/media/capture/web_contents_audio_muter.h"
6 6
7 #include <set>
8
7 #include "base/bind.h" 9 #include "base/bind.h"
8 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
9 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/time/time.h"
10 #include "content/browser/media/capture/audio_mirroring_manager.h" 13 #include "content/browser/media/capture/audio_mirroring_manager.h"
11 #include "content/public/browser/browser_thread.h" 14 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/render_frame_host.h" 15 #include "content/public/browser/render_frame_host.h"
13 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
14 #include "media/audio/audio_io.h" 17 #include "media/audio/audio_io.h"
15 #include "media/audio/audio_manager.h" 18 #include "media/audio/audio_manager.h"
16 #include "media/audio/fake_audio_worker.h" 19 #include "media/audio/fake_audio_worker.h"
17 #include "media/base/bind_to_current_loop.h" 20 #include "media/base/bind_to_current_loop.h"
18 21
19 namespace content { 22 namespace content {
(...skipping 23 matching lines...) Expand all
43 } 46 }
44 void Stop() override { worker_.Stop(); } 47 void Stop() override { worker_.Stop(); }
45 void SetVolume(double volume) override {} 48 void SetVolume(double volume) override {}
46 void GetVolume(double* volume) override { *volume = 0; } 49 void GetVolume(double* volume) override { *volume = 0; }
47 void Close() override { delete this; } 50 void Close() override { delete this; }
48 51
49 private: 52 private:
50 ~AudioDiscarder() override {} 53 ~AudioDiscarder() override {}
51 54
52 void FetchAudioData(AudioSourceCallback* callback) { 55 void FetchAudioData(AudioSourceCallback* callback) {
53 callback->OnMoreData(audio_bus_.get(), 0, 0); 56 callback->OnMoreData(base::TimeTicks(), 0, audio_bus_.get());
chcunningham 2016/07/29 01:21:08 Should the be base::TimeTicks::Now()? I'm not fam
chcunningham 2016/07/29 01:24:12 Sorry, I didn't say "why" - when you look at how y
jameswest 2016/08/26 02:08:47 Done.
54 } 57 }
55 58
56 // Calls FetchAudioData() at regular intervals and discards the data. 59 // Calls FetchAudioData() at regular intervals and discards the data.
57 media::FakeAudioWorker worker_; 60 media::FakeAudioWorker worker_;
58 std::unique_ptr<media::AudioBus> audio_bus_; 61 std::unique_ptr<media::AudioBus> audio_bus_;
59 62
60 DISALLOW_COPY_AND_ASSIGN(AudioDiscarder); 63 DISALLOW_COPY_AND_ASSIGN(AudioDiscarder);
61 }; 64 };
62 65
63 } // namespace 66 } // namespace
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 return; 154 return;
152 is_muting_ = false; 155 is_muting_ = false;
153 BrowserThread::PostTask( 156 BrowserThread::PostTask(
154 BrowserThread::IO, FROM_HERE, 157 BrowserThread::IO, FROM_HERE,
155 base::Bind(&AudioMirroringManager::StopMirroring, 158 base::Bind(&AudioMirroringManager::StopMirroring,
156 base::Unretained(AudioMirroringManager::GetInstance()), 159 base::Unretained(AudioMirroringManager::GetInstance()),
157 base::RetainedRef(destination_))); 160 base::RetainedRef(destination_)));
158 } 161 }
159 162
160 } // namespace content 163 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698