Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1156)

Unified Diff: content/renderer/media/media_stream_audio_sink_owner.cc

Issue 1966043006: Revert of MediaStream audio: Refactor 3 separate "glue" implementations into one. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/renderer/media/media_stream_audio_sink_owner.cc
diff --git a/content/renderer/media/media_stream_audio_sink_owner.cc b/content/renderer/media/media_stream_audio_sink_owner.cc
new file mode 100644
index 0000000000000000000000000000000000000000..cee6a1d2a56ca50aeec384ee34fbb3537e42d3fa
--- /dev/null
+++ b/content/renderer/media/media_stream_audio_sink_owner.cc
@@ -0,0 +1,49 @@
+// 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/media_stream_audio_sink_owner.h"
+
+#include "content/public/renderer/media_stream_audio_sink.h"
+#include "media/base/audio_parameters.h"
+
+namespace content {
+
+MediaStreamAudioSinkOwner::MediaStreamAudioSinkOwner(MediaStreamAudioSink* sink)
+ : delegate_(sink) {
+}
+
+void MediaStreamAudioSinkOwner::OnData(const media::AudioBus& audio_bus,
+ base::TimeTicks estimated_capture_time) {
+ base::AutoLock lock(lock_);
+ if (delegate_)
+ delegate_->OnData(audio_bus, estimated_capture_time);
+}
+
+void MediaStreamAudioSinkOwner::OnSetFormat(
+ const media::AudioParameters& params) {
+ base::AutoLock lock(lock_);
+ if (delegate_)
+ delegate_->OnSetFormat(params);
+}
+
+void MediaStreamAudioSinkOwner::OnReadyStateChanged(
+ blink::WebMediaStreamSource::ReadyState state) {
+ base::AutoLock lock(lock_);
+ if (delegate_)
+ delegate_->OnReadyStateChanged(state);
+}
+
+void MediaStreamAudioSinkOwner::Reset() {
+ base::AutoLock lock(lock_);
+ delegate_ = NULL;
+}
+
+bool MediaStreamAudioSinkOwner::IsEqual(
+ const MediaStreamAudioSink* other) const {
+ DCHECK(other);
+ base::AutoLock lock(lock_);
+ return (other == delegate_);
+}
+
+} // namespace content
« no previous file with comments | « content/renderer/media/media_stream_audio_sink_owner.h ('k') | content/renderer/media/media_stream_audio_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698