blob: e979f9c86776e2b9edbe746bd6d95823dbc923d8 [file] [log] [blame]
Erik Språng08127a92016-11-16 16:41:30 +01001/*
2 * Copyright (c) 2016 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
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INITIALIZER_H_
12#define MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INITIALIZER_H_
Erik Språng08127a92016-11-16 16:41:30 +010013
14#include <memory>
15#include <string>
16#include <vector>
17
Niels Möller0a8f4352018-05-18 11:37:23 +020018#include "api/video_codecs/video_encoder_config.h"
Erik Språng08127a92016-11-16 16:41:30 +010019
20namespace webrtc {
21
Erik Språng08127a92016-11-16 16:41:30 +010022class VideoBitrateAllocator;
23class VideoCodec;
Erik Språng08127a92016-11-16 16:41:30 +010024
25class VideoCodecInitializer {
26 public:
Niels Möllerb46d1b82018-04-06 13:07:01 +020027 // Takes a VideoEncoderConfig and the VideoStream configuration and
28 // translates them into the old school VideoCodec type.
Erik Språng08127a92016-11-16 16:41:30 +010029 // It also creates a VideoBitrateAllocator instance, suitable for the codec
30 // type used. For instance, VP8 will create an allocator than can handle
31 // simulcast and temporal layering.
32 // GetBitrateAllocator is called implicitly from here, no need to call again.
Jiawei Ouc2ebe212018-11-08 10:02:56 -080033 static bool SetupCodec(const VideoEncoderConfig& config,
34 const std::vector<VideoStream>& streams,
35 VideoCodec* codec);
Erik Språng08127a92016-11-16 16:41:30 +010036
37 private:
38 static VideoCodec VideoEncoderConfigToVideoCodec(
39 const VideoEncoderConfig& config,
Niels Möllerf1338562018-04-26 09:51:47 +020040 const std::vector<VideoStream>& streams);
Erik Språng08127a92016-11-16 16:41:30 +010041};
42
43} // namespace webrtc
44
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020045#endif // MODULES_VIDEO_CODING_INCLUDE_VIDEO_CODEC_INITIALIZER_H_