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.
5 #include "content/renderer/media/peer_connection_audio_sink_owner.h"
7 #include "content/renderer/media/webrtc_audio_device_impl.h"
11 PeerConnectionAudioSinkOwner::PeerConnectionAudioSinkOwner(
12 PeerConnectionAudioSink
* sink
)
16 int PeerConnectionAudioSinkOwner::OnData(const int16
* audio_data
,
18 int number_of_channels
,
20 const std::vector
<int>& channels
,
21 int audio_delay_milliseconds
,
23 bool need_audio_processing
,
25 base::AutoLock
lock(lock_
);
27 return delegate_
->OnData(audio_data
,
32 audio_delay_milliseconds
,
34 need_audio_processing
,
41 void PeerConnectionAudioSinkOwner::OnSetFormat(
42 const media::AudioParameters
& params
) {
43 base::AutoLock
lock(lock_
);
45 delegate_
->OnSetFormat(params
);
48 void PeerConnectionAudioSinkOwner::OnReadyStateChanged(
49 blink::WebMediaStreamSource::ReadyState state
) {
50 // Not forwarded at the moment.
53 void PeerConnectionAudioSinkOwner::Reset() {
54 base::AutoLock
lock(lock_
);
58 bool PeerConnectionAudioSinkOwner::IsEqual(
59 const MediaStreamAudioSink
* other
) const {
64 bool PeerConnectionAudioSinkOwner::IsEqual(
65 const PeerConnectionAudioSink
* other
) const {
67 base::AutoLock
lock(lock_
);
68 return (other
== delegate_
);
71 } // namespace content