blob: 1660873e8b451a018ddc78faea52f072606a1848 [file] [log] [blame]
Danil Chapovalov4844c5f2019-04-10 12:10:101/*
2 * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved.
3 *
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.
9 */
10#include "media/engine/webrtc_media_engine_defaults.h"
11
12#include "api/audio_codecs/builtin_audio_decoder_factory.h"
13#include "api/audio_codecs/builtin_audio_encoder_factory.h"
14#include "api/task_queue/default_task_queue_factory.h"
15#include "api/video/builtin_video_bitrate_allocator_factory.h"
16#include "api/video_codecs/builtin_video_decoder_factory.h"
17#include "api/video_codecs/builtin_video_encoder_factory.h"
18#include "modules/audio_processing/include/audio_processing.h"
19#include "rtc_base/checks.h"
20
21namespace webrtc {
22
23void SetMediaEngineDefaults(cricket::MediaEngineDependencies* deps) {
24 RTC_DCHECK(deps);
25 if (deps->task_queue_factory == nullptr) {
26 static TaskQueueFactory* const task_queue_factory =
27 CreateDefaultTaskQueueFactory().release();
28 deps->task_queue_factory = task_queue_factory;
29 }
30 if (deps->audio_encoder_factory == nullptr)
31 deps->audio_encoder_factory = CreateBuiltinAudioEncoderFactory();
32 if (deps->audio_decoder_factory == nullptr)
33 deps->audio_decoder_factory = CreateBuiltinAudioDecoderFactory();
34 if (deps->audio_processing == nullptr)
35 deps->audio_processing = AudioProcessingBuilder().Create();
36
37 if (deps->video_encoder_factory == nullptr)
38 deps->video_encoder_factory = CreateBuiltinVideoEncoderFactory();
39 if (deps->video_decoder_factory == nullptr)
40 deps->video_decoder_factory = CreateBuiltinVideoDecoderFactory();
Danil Chapovalov4844c5f2019-04-10 12:10:1041}
42
43} // namespace webrtc