Index: content/renderer/media/peer_connection_audio_sink_owner.cc |
diff --git a/content/renderer/media/peer_connection_audio_sink_owner.cc b/content/renderer/media/peer_connection_audio_sink_owner.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..84ff52b3bbb4ad007feef08fc0c7704f2463c02a |
--- /dev/null |
+++ b/content/renderer/media/peer_connection_audio_sink_owner.cc |
@@ -0,0 +1,66 @@ |
+// Copyright 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "content/renderer/media/peer_connection_audio_sink_owner.h" |
+ |
+#include "content/renderer/media/webrtc_audio_device_impl.h" |
+ |
+namespace content { |
+ |
+PeerConnectionAudioSinkOwner::PeerConnectionAudioSinkOwner( |
+ PeerConnectionAudioSink* sink) |
+ : delegate_(sink) { |
+} |
+ |
+int PeerConnectionAudioSinkOwner::OnData(const int16* audio_data, |
+ int sample_rate, |
+ int number_of_channels, |
+ int number_of_frames, |
+ const std::vector<int>& channels, |
+ int audio_delay_milliseconds, |
+ int current_volume, |
+ bool need_audio_processing, |
+ bool key_pressed) { |
+ base::AutoLock lock(lock_); |
+ if (delegate_) { |
+ return delegate_->OnData(audio_data, |
Alpha Left Google
2013/12/02 19:11:38
Please add a TODO or fix this. It is unclear wheth
no longer working on chromium
2013/12/03 11:45:45
Please see my previous comments, and I am not goin
|
+ sample_rate, |
+ number_of_channels, |
+ number_of_frames, |
+ channels, |
+ audio_delay_milliseconds, |
+ current_volume, |
+ need_audio_processing, |
+ key_pressed); |
+ } |
+ |
+ return 0; |
+} |
+ |
+void PeerConnectionAudioSinkOwner::OnSetFormat( |
+ const media::AudioParameters& params) { |
+ base::AutoLock lock(lock_); |
+ if (delegate_) |
+ delegate_->OnSetFormat(params); |
+} |
+ |
+void PeerConnectionAudioSinkOwner::Reset() { |
+ base::AutoLock lock(lock_); |
+ delegate_ = NULL; |
+} |
+ |
+bool PeerConnectionAudioSinkOwner::IsEqual( |
+ const MediaStreamAudioSink* other) const { |
+ DCHECK(other); |
+ return false; |
+} |
+ |
+bool PeerConnectionAudioSinkOwner::IsEqual( |
+ const PeerConnectionAudioSink* other) const { |
+ DCHECK(other); |
+ base::AutoLock lock(lock_); |
+ return (other == delegate_); |
+} |
+ |
+} // namespace content |