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

Side by Side Diff: content/renderer/media/webrtc_audio_capturer_sink_owner.cc

Issue 90743004: Add generic interfaces for the sinks of the media stream audio track (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixed the nits. Created 7 years 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2013 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 #include "content/renderer/media/webrtc_audio_capturer_sink_owner.h"
6
7 namespace content {
8
9 WebRtcAudioCapturerSinkOwner::WebRtcAudioCapturerSinkOwner(
10 WebRtcAudioCapturerSink* sink)
11 : delegate_(sink) {
12 }
13
14 int WebRtcAudioCapturerSinkOwner::CaptureData(const std::vector<int>& channels,
15 const int16* audio_data,
16 int sample_rate,
17 int number_of_channels,
18 int number_of_frames,
19 int audio_delay_milliseconds,
20 int current_volume,
21 bool need_audio_processing,
22 bool key_pressed) {
23 base::AutoLock lock(lock_);
24 if (delegate_) {
25 return delegate_->CaptureData(channels,
26 audio_data,
27 sample_rate,
28 number_of_channels,
29 number_of_frames,
30 audio_delay_milliseconds,
31 current_volume,
32 need_audio_processing,
33 key_pressed);
34 }
35
36 return 0;
37 }
38
39 void WebRtcAudioCapturerSinkOwner::SetCaptureFormat(
40 const media::AudioParameters& params) {
41 base::AutoLock lock(lock_);
42 if (delegate_)
43 delegate_->SetCaptureFormat(params);
44 }
45
46 bool WebRtcAudioCapturerSinkOwner::IsEqual(
47 const WebRtcAudioCapturerSink* other) const {
48 base::AutoLock lock(lock_);
49 return (other == delegate_);
50 }
51
52 void WebRtcAudioCapturerSinkOwner::Reset() {
53 base::AutoLock lock(lock_);
54 delegate_ = NULL;
55 }
56
57 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/media/webrtc_audio_capturer_sink_owner.h ('k') | content/renderer/media/webrtc_audio_capturer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698