buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 1 | /* |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [diff] [blame] | 2 | * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 3 | * |
kjellander | 1afca73 | 2016-02-07 20:46:45 -0800 | [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. |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 9 | */ |
jlmiller@webrtc.org | 5f93d0a | 2015-01-20 21:36:13 +0000 | [diff] [blame] | 10 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 11 | #ifndef MEDIA_ENGINE_SIMULCAST_H_ |
| 12 | #define MEDIA_ENGINE_SIMULCAST_H_ |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 13 | |
Yves Gerey | 3e70781 | 2018-11-28 16:47:49 +0100 | [diff] [blame] | 14 | #include <stddef.h> |
Jonas Olsson | a4d8737 | 2019-07-05 19:08:33 +0200 | [diff] [blame] | 15 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 16 | #include <vector> |
| 17 | |
Niels Möller | 0a8f435 | 2018-05-18 11:37:23 +0200 | [diff] [blame] | 18 | #include "api/video_codecs/video_encoder_config.h" |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 19 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 20 | namespace cricket { |
sprang@webrtc.org | 46d4d29 | 2014-12-23 15:19:35 +0000 | [diff] [blame] | 21 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 22 | // Gets the total maximum bitrate for the |streams|. |
pbos | be16f79 | 2015-10-16 12:49:39 -0700 | [diff] [blame] | 23 | int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 24 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 25 | // Adds any bitrate of |max_bitrate_bps| that is above the total maximum bitrate |
| 26 | // for the |layers| to the highest quality layer. |
| 27 | void BoostMaxSimulcastLayer(int max_bitrate_bps, |
| 28 | std::vector<webrtc::VideoStream>* layers); |
| 29 | |
Florent Castelli | c1a0bcb | 2019-01-29 14:26:48 +0100 | [diff] [blame] | 30 | // Round size to nearest simulcast-friendly size |
| 31 | int NormalizeSimulcastSize(int size, size_t simulcast_layers); |
| 32 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 33 | // Gets simulcast settings. |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 34 | std::vector<webrtc::VideoStream> GetSimulcastConfig( |
| 35 | size_t max_layers, |
| 36 | int width, |
| 37 | int height, |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 38 | double bitrate_priority, |
| 39 | int max_qp, |
Florent Castelli | 66b3860 | 2019-07-10 16:57:57 +0200 | [diff] [blame] | 40 | bool is_screenshare_with_conference_mode, |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 41 | bool temporal_layers_supported = true); |
sprang | 429600d | 2017-01-26 06:12:26 -0800 | [diff] [blame] | 42 | |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 43 | // Gets the simulcast config layers for a non-screensharing case. |
| 44 | std::vector<webrtc::VideoStream> GetNormalSimulcastLayers( |
| 45 | size_t max_layers, |
| 46 | int width, |
| 47 | int height, |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 48 | double bitrate_priority, |
| 49 | int max_qp, |
Rasmus Brandt | 2b9317a | 2019-10-30 13:01:46 +0100 | [diff] [blame] | 50 | bool temporal_layers_supported, |
| 51 | bool base_heavy_tl3_rate_alloc); |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 52 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 53 | // Gets simulcast config layers for screenshare settings. |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 54 | std::vector<webrtc::VideoStream> GetScreenshareLayers( |
| 55 | size_t max_layers, |
| 56 | int width, |
| 57 | int height, |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 58 | double bitrate_priority, |
| 59 | int max_qp, |
Rasmus Brandt | 2b9317a | 2019-10-30 13:01:46 +0100 | [diff] [blame] | 60 | bool temporal_layers_supported, |
| 61 | bool base_heavy_tl3_rate_alloc); |
Ilya Nikolaevskiy | 3df1d5d | 2018-08-22 09:26:51 +0200 | [diff] [blame] | 62 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 63 | } // namespace cricket |
| 64 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 65 | #endif // MEDIA_ENGINE_SIMULCAST_H_ |