Updating trunk VERSION from 2139.0 to 2140.0
[chromium-blink-merge.git] / content / renderer / media / webrtc / webrtc_audio_sink_adapter.cc
blob593f4d9577775e376ab7ec14bdf25755533b4484
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"
9 namespace content {
11 WebRtcAudioSinkAdapter::WebRtcAudioSinkAdapter(
12 webrtc::AudioTrackSinkInterface* sink)
13 : sink_(sink) {
14 DCHECK(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,
26 int sample_rate,
27 int number_of_channels,
28 int number_of_frames) {
29 sink_->OnData(audio_data, 16, sample_rate, number_of_channels,
30 number_of_frames);
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