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
3 // found in the LICENSE file.
5 #include "base/logging.h"
6 #include "content/renderer/media/webrtc/webrtc_audio_sink_adapter.h"
7 #include "third_party/libjingle/source/talk/app/webrtc/mediastreaminterface.h"
11 WebRtcAudioSinkAdapter::WebRtcAudioSinkAdapter(
12 webrtc::AudioTrackSinkInterface
* sink
)
17 WebRtcAudioSinkAdapter::~WebRtcAudioSinkAdapter() {
20 bool WebRtcAudioSinkAdapter::IsEqual(
21 const webrtc::AudioTrackSinkInterface
* other
) const {
22 return (other
== sink_
);
25 void WebRtcAudioSinkAdapter::OnData(const int16
* audio_data
,
27 int number_of_channels
,
28 int number_of_frames
) {
29 sink_
->OnData(audio_data
, 16, sample_rate
, number_of_channels
,
33 void WebRtcAudioSinkAdapter::OnSetFormat(
34 const media::AudioParameters
& params
) {
35 // No need to forward the OnSetFormat() callback to
36 // webrtc::AudioTrackSinkInterface sink since the sink will handle the
37 // format change in OnData().
40 } // namespace content