henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 1 | /* |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 2 | * Copyright 2013 The WebRTC project authors. All Rights Reserved. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 3 | * |
kjellander | b24317b | 2016-02-10 15:54:43 | [diff] [blame] | 4 | * Use of this source code is governed by a BSD-style license |
| 5 | * that can be found in the LICENSE file in the root of the source |
| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 9 | */ |
| 10 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 11 | #include "pc/local_audio_source.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 12 | |
Steve Anton | 10542f2 | 2019-01-11 17:11:00 | [diff] [blame] | 13 | #include "rtc_base/ref_counted_object.h" |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 14 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 15 | using webrtc::MediaSourceInterface; |
| 16 | |
| 17 | namespace webrtc { |
| 18 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 19 | rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create( |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 20 | const cricket::AudioOptions* audio_options) { |
| 21 | rtc::scoped_refptr<LocalAudioSource> source( |
| 22 | new rtc::RefCountedObject<LocalAudioSource>()); |
deadbeef | 757146b | 2017-02-11 05:26:48 | [diff] [blame] | 23 | source->Initialize(audio_options); |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 24 | return source; |
| 25 | } |
| 26 | |
Yves Gerey | 665174f | 2018-06-19 13:03:05 | [diff] [blame] | 27 | void LocalAudioSource::Initialize(const cricket::AudioOptions* audio_options) { |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 28 | if (!audio_options) |
| 29 | return; |
| 30 | |
| 31 | options_ = *audio_options; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 32 | } |
| 33 | |
| 34 | } // namespace webrtc |