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/media_stream_audio_sink_owner.h"
7 #include "content/public/renderer/media_stream_audio_sink.h"
8 #include "media/audio/audio_parameters.h"
12 MediaStreamAudioSinkOwner::MediaStreamAudioSinkOwner(MediaStreamAudioSink
* sink
)
16 int MediaStreamAudioSinkOwner::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_
);
26 // TODO(xians): Investigate on the possibility of not calling out with the
29 delegate_
->OnData(audio_data
,
38 void MediaStreamAudioSinkOwner::OnSetFormat(
39 const media::AudioParameters
& params
) {
40 base::AutoLock
lock(lock_
);
42 delegate_
->OnSetFormat(params
);
45 void MediaStreamAudioSinkOwner::OnReadyStateChanged(
46 blink::WebMediaStreamSource::ReadyState state
) {
47 base::AutoLock
lock(lock_
);
49 delegate_
->OnReadyStateChanged(state
);
52 void MediaStreamAudioSinkOwner::Reset() {
53 base::AutoLock
lock(lock_
);
57 bool MediaStreamAudioSinkOwner::IsEqual(
58 const MediaStreamAudioSink
* other
) const {
60 base::AutoLock
lock(lock_
);
61 return (other
== delegate_
);
64 bool MediaStreamAudioSinkOwner::IsEqual(
65 const PeerConnectionAudioSink
* other
) const {
70 } // namespace content