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 | |
Harald Alvestrand | f0d5caf | 2025-04-07 09:08:51 | [diff] [blame] | 13 | #include "api/audio_options.h" |
| 14 | #include "api/make_ref_counted.h" |
| 15 | #include "api/media_stream_interface.h" |
| 16 | #include "api/scoped_refptr.h" |
| 17 | |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 18 | using webrtc::MediaSourceInterface; |
| 19 | |
| 20 | namespace webrtc { |
| 21 | |
buildbot@webrtc.org | d4e598d | 2014-07-29 17:36:52 | [diff] [blame] | 22 | rtc::scoped_refptr<LocalAudioSource> LocalAudioSource::Create( |
Evan Shrubsole | 945e517 | 2025-04-08 14:11:45 | [diff] [blame^] | 23 | const AudioOptions* audio_options) { |
Tommi | 87f7090 | 2021-04-27 12:43:08 | [diff] [blame] | 24 | auto source = rtc::make_ref_counted<LocalAudioSource>(); |
deadbeef | 757146b | 2017-02-11 05:26:48 | [diff] [blame] | 25 | source->Initialize(audio_options); |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 26 | return source; |
| 27 | } |
| 28 | |
Evan Shrubsole | 945e517 | 2025-04-08 14:11:45 | [diff] [blame^] | 29 | void LocalAudioSource::Initialize(const AudioOptions* audio_options) { |
hta | a2a49d9 | 2016-03-04 10:51:39 | [diff] [blame] | 30 | if (!audio_options) |
| 31 | return; |
| 32 | |
| 33 | options_ = *audio_options; |
henrike@webrtc.org | 28e2075 | 2013-07-10 00:45:36 | [diff] [blame] | 34 | } |
| 35 | |
| 36 | } // namespace webrtc |