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

Side by Side Diff: chrome/renderer/media/cast_receiver_audio_valve.h

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, 9 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 unified diff | Download patch
« no previous file with comments | « chrome/renderer/media/DEPS ('k') | chrome/renderer/media/cast_receiver_audio_valve.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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.
4
5 #ifndef CHROME_RENDERER_MEDIA_CAST_RECEIVER_AUDIO_VALVE_H_
6 #define CHROME_RENDERER_MEDIA_CAST_RECEIVER_AUDIO_VALVE_H_
7
8 #include "base/synchronization/lock.h"
9 #include "media/base/audio_capturer_source.h"
10
11 namespace media {
12 class AudioBus;
13 }
14
15 // Forwards calls to |cb| until Stop is called.
16 // Thread-safe.
17 // All functions may block depending on contention.
18 class CastReceiverAudioValve :
19 public media::AudioCapturerSource::CaptureCallback,
20 public base::RefCountedThreadSafe<CastReceiverAudioValve> {
21 public:
22 explicit CastReceiverAudioValve(
23 media::AudioCapturerSource::CaptureCallback* cb);
24
25 // AudioCapturerSource::CaptureCallback implementation.
26 void Capture(const media::AudioBus* audio_source,
27 int audio_delay_milliseconds,
28 double volume,
29 bool key_pressed) override;
30 void OnCaptureError() override;
31
32 // When this returns, no more calls will be forwarded to |cb|.
33 void Stop();
34
35 private:
36 friend class base::RefCountedThreadSafe<CastReceiverAudioValve>;
37 ~CastReceiverAudioValve() override;
38 media::AudioCapturerSource::CaptureCallback* cb_;
39 base::Lock lock_;
40 };
41
42 #endif // CHROME_RENDERER_MEDIA_CAST_RECEIVER_AUDIO_VALVE_H_
OLDNEW
« no previous file with comments | « chrome/renderer/media/DEPS ('k') | chrome/renderer/media/cast_receiver_audio_valve.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698