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

Side by Side Diff: content/renderer/media/media_stream_audio_sink_owner.cc

Issue 1966043006: Revert of MediaStream audio: Refactor 3 separate "glue" implementations into one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "content/renderer/media/media_stream_audio_sink_owner.h"
6
7 #include "content/public/renderer/media_stream_audio_sink.h"
8 #include "media/base/audio_parameters.h"
9
10 namespace content {
11
12 MediaStreamAudioSinkOwner::MediaStreamAudioSinkOwner(MediaStreamAudioSink* sink)
13 : delegate_(sink) {
14 }
15
16 void MediaStreamAudioSinkOwner::OnData(const media::AudioBus& audio_bus,
17 base::TimeTicks estimated_capture_time) {
18 base::AutoLock lock(lock_);
19 if (delegate_)
20 delegate_->OnData(audio_bus, estimated_capture_time);
21 }
22
23 void MediaStreamAudioSinkOwner::OnSetFormat(
24 const media::AudioParameters& params) {
25 base::AutoLock lock(lock_);
26 if (delegate_)
27 delegate_->OnSetFormat(params);
28 }
29
30 void MediaStreamAudioSinkOwner::OnReadyStateChanged(
31 blink::WebMediaStreamSource::ReadyState state) {
32 base::AutoLock lock(lock_);
33 if (delegate_)
34 delegate_->OnReadyStateChanged(state);
35 }
36
37 void MediaStreamAudioSinkOwner::Reset() {
38 base::AutoLock lock(lock_);
39 delegate_ = NULL;
40 }
41
42 bool MediaStreamAudioSinkOwner::IsEqual(
43 const MediaStreamAudioSink* other) const {
44 DCHECK(other);
45 base::AutoLock lock(lock_);
46 return (other == delegate_);
47 }
48
49 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/media_stream_audio_sink_owner.h ('k') | content/renderer/media/media_stream_audio_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698