blob: 875edd9928614d579f218b5a3895b71d9980c6a8 [file] [log] [blame]
Niels Möller213618e2018-07-24 09:29:58 +02001/*
2 * Copyright (c) 2018 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
11#include "api/video/video_stream_encoder_create.h"
12
Karl Wibergc2342032018-08-08 11:39:52 +020013#include "absl/memory/memory.h"
Sebastian Jansson74682c12019-03-01 11:50:20 +010014#include "api/task_queue/global_task_queue_factory.h"
Yves Gerey3e707812018-11-28 16:47:49 +010015#include "video/overuse_frame_detector.h"
Niels Möller213618e2018-07-24 09:29:58 +020016#include "video/video_stream_encoder.h"
17
18namespace webrtc {
19std::unique_ptr<VideoStreamEncoderInterface> CreateVideoStreamEncoder(
20 uint32_t number_of_cores,
21 VideoStreamEncoderObserver* encoder_stats_observer,
Niels Möller412d1852019-01-02 09:42:54 +010022 const VideoStreamEncoderSettings& settings) {
Sebastian Jansson572c60f2019-03-04 18:30:41 +010023 return CreateVideoStreamEncoder(Clock::GetRealTimeClock(),
24 &GlobalTaskQueueFactory(), number_of_cores,
Sebastian Jansson74682c12019-03-01 11:50:20 +010025 encoder_stats_observer, settings);
26}
27
28std::unique_ptr<VideoStreamEncoderInterface> CreateVideoStreamEncoder(
Sebastian Jansson572c60f2019-03-04 18:30:41 +010029 Clock* clock,
Sebastian Jansson74682c12019-03-01 11:50:20 +010030 TaskQueueFactory* task_queue_factory,
31 uint32_t number_of_cores,
32 VideoStreamEncoderObserver* encoder_stats_observer,
33 const VideoStreamEncoderSettings& settings) {
Karl Wibergc2342032018-08-08 11:39:52 +020034 return absl::make_unique<VideoStreamEncoder>(
Sebastian Jansson572c60f2019-03-04 18:30:41 +010035 clock, number_of_cores, encoder_stats_observer, settings,
Sebastian Jansson74682c12019-03-01 11:50:20 +010036 absl::make_unique<OveruseFrameDetector>(encoder_stats_observer),
37 task_queue_factory);
Niels Möller213618e2018-07-24 09:29:58 +020038}
Sebastian Jansson74682c12019-03-01 11:50:20 +010039
Niels Möller213618e2018-07-24 09:29:58 +020040} // namespace webrtc