Chromium Code Reviews| OLD | NEW |
|---|---|
| (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/audio/audio_parameters.h" | |
| 9 | |
| 10 namespace content { | |
| 11 | |
| 12 MediaStreamAudioSinkOwner::MediaStreamAudioSinkOwner( | |
| 13 MediaStreamAudioSink* sink) | |
| 14 : delegate_(sink) { | |
| 15 } | |
| 16 | |
| 17 int MediaStreamAudioSinkOwner::OnData(const int16* audio_data, | |
| 18 int sample_rate, | |
| 19 int number_of_channels, | |
| 20 int number_of_frames, | |
| 21 const std::vector<int>& channels, | |
| 22 int audio_delay_milliseconds, | |
| 23 int current_volume, | |
| 24 bool need_audio_processing, | |
| 25 bool key_pressed) { | |
| 26 base::AutoLock lock(lock_); | |
| 27 if (delegate_) { | |
| 28 delegate_->OnData(audio_data, | |
|
tommi (sloooow) - chröme
2013/11/29 13:00:20
what about the return value from delegate_->OnData
no longer working on chromium
2013/11/29 15:02:04
It is a virtual void OnData(const int16* audio_dat
| |
| 29 sample_rate, | |
| 30 number_of_channels, | |
| 31 number_of_frames); | |
| 32 } | |
| 33 | |
| 34 return 0; | |
| 35 } | |
| 36 | |
| 37 void MediaStreamAudioSinkOwner::OnSetFormat( | |
|
tommi (sloooow) - chröme
2013/11/29 13:00:20
which methods do we expect to be called from the c
no longer working on chromium
2013/11/29 15:02:04
OnSetFormat and OnData are called on the same thre
| |
| 38 const media::AudioParameters& params) { | |
| 39 base::AutoLock lock(lock_); | |
| 40 if (delegate_) | |
| 41 delegate_->OnSetFormat(params); | |
| 42 } | |
| 43 | |
| 44 void MediaStreamAudioSinkOwner::Reset() { | |
| 45 base::AutoLock lock(lock_); | |
| 46 delegate_ = NULL; | |
| 47 } | |
| 48 | |
| 49 bool MediaStreamAudioSinkOwner::IsEqual( | |
| 50 const MediaStreamAudioSink* other) const { | |
| 51 DCHECK(other); | |
|
tommi (sloooow) - chröme
2013/11/29 13:00:20
The reason for having this DCHECK doesn't apply no
no longer working on chromium
2013/11/29 15:02:04
why? the caller should make sure other should not
| |
| 52 base::AutoLock lock(lock_); | |
| 53 return (other == delegate_); | |
| 54 } | |
| 55 | |
| 56 } // namespace content | |
| OLD | NEW |