Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / renderer / media / cast_receiver_audio_valve.cc
blobf67218830c294418c96e68422313eec076e6368c
1 // Copyright 2015 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 "chrome/renderer/media/cast_receiver_audio_valve.h"
7 CastReceiverAudioValve::CastReceiverAudioValve(
8 media::AudioCapturerSource::CaptureCallback* cb)
9 : cb_(cb) {
11 CastReceiverAudioValve::~CastReceiverAudioValve() {}
13 void CastReceiverAudioValve::Capture(const media::AudioBus* audio_source,
14 int audio_delay_milliseconds,
15 double volume,
16 bool key_pressed) {
17 base::AutoLock lock(lock_);
18 if (cb_) {
19 cb_->Capture(audio_source, audio_delay_milliseconds, volume, key_pressed);
23 void CastReceiverAudioValve::OnCaptureError() {
24 base::AutoLock lock(lock_);
25 if (cb_) {
26 cb_->OnCaptureError();
30 void CastReceiverAudioValve::Stop() {
31 base::AutoLock lock(lock_);
32 cb_ = nullptr;