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

Unified Diff: chrome/renderer/media/cast_receiver_audio_valve.cc

Issue 883293005: Cast: Basic cast_receiver API for chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: removed extra BUILD.gn line Created 5 years, 10 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
« no previous file with comments | « chrome/renderer/media/cast_receiver_audio_valve.h ('k') | chrome/renderer/media/cast_receiver_session.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/media/cast_receiver_audio_valve.cc
diff --git a/chrome/renderer/media/cast_receiver_audio_valve.cc b/chrome/renderer/media/cast_receiver_audio_valve.cc
new file mode 100644
index 0000000000000000000000000000000000000000..f67218830c294418c96e68422313eec076e6368c
--- /dev/null
+++ b/chrome/renderer/media/cast_receiver_audio_valve.cc
@@ -0,0 +1,33 @@
+// Copyright 2015 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 "chrome/renderer/media/cast_receiver_audio_valve.h"
+
+CastReceiverAudioValve::CastReceiverAudioValve(
+ media::AudioCapturerSource::CaptureCallback* cb)
+ : cb_(cb) {
+}
+CastReceiverAudioValve::~CastReceiverAudioValve() {}
+
+void CastReceiverAudioValve::Capture(const media::AudioBus* audio_source,
+ int audio_delay_milliseconds,
+ double volume,
+ bool key_pressed) {
+ base::AutoLock lock(lock_);
+ if (cb_) {
+ cb_->Capture(audio_source, audio_delay_milliseconds, volume, key_pressed);
+ }
+}
+
+void CastReceiverAudioValve::OnCaptureError() {
+ base::AutoLock lock(lock_);
+ if (cb_) {
+ cb_->OnCaptureError();
+ }
+}
+
+void CastReceiverAudioValve::Stop() {
+ base::AutoLock lock(lock_);
+ cb_ = nullptr;
+}
« no previous file with comments | « chrome/renderer/media/cast_receiver_audio_valve.h ('k') | chrome/renderer/media/cast_receiver_session.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698