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 | |
| 14 | #include <vector> |
| 15 | |
Niels Möller | 0a8f435 | 2018-05-18 11:37:23 +0200 | [diff] [blame] | 16 | #include "api/video_codecs/video_encoder_config.h" |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 17 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 18 | namespace cricket { |
sprang@webrtc.org | 46d4d29 | 2014-12-23 15:19:35 +0000 | [diff] [blame] | 19 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 20 | // Gets the total maximum bitrate for the |streams|. |
pbos | be16f79 | 2015-10-16 12:49:39 -0700 | [diff] [blame] | 21 | int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 22 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 23 | // Adds any bitrate of |max_bitrate_bps| that is above the total maximum bitrate |
| 24 | // for the |layers| to the highest quality layer. |
| 25 | void BoostMaxSimulcastLayer(int max_bitrate_bps, |
| 26 | std::vector<webrtc::VideoStream>* layers); |
| 27 | |
| 28 | // Gets simulcast settings. |
Åsa Persson | 8c1bf95 | 2018-09-13 10:42:19 +0200 | [diff] [blame^] | 29 | // TODO(asapersson): Remove max_bitrate_bps and max_framerate. |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 30 | std::vector<webrtc::VideoStream> GetSimulcastConfig( |
| 31 | size_t max_layers, |
| 32 | int width, |
| 33 | int height, |
| 34 | int /*max_bitrate_bps*/, |
| 35 | double bitrate_priority, |
| 36 | int max_qp, |
Åsa Persson | 8c1bf95 | 2018-09-13 10:42:19 +0200 | [diff] [blame^] | 37 | int /*max_framerate*/, |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 38 | bool is_screenshare, |
| 39 | bool temporal_layers_supported = true); |
sprang | 429600d | 2017-01-26 06:12:26 -0800 | [diff] [blame] | 40 | |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 41 | // Gets the simulcast config layers for a non-screensharing case. |
| 42 | std::vector<webrtc::VideoStream> GetNormalSimulcastLayers( |
| 43 | size_t max_layers, |
| 44 | int width, |
| 45 | int height, |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 46 | double bitrate_priority, |
| 47 | int max_qp, |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 48 | bool temporal_layers_supported = true); |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 49 | |
Åsa Persson | 5565981 | 2018-06-18 17:51:32 +0200 | [diff] [blame] | 50 | // Gets simulcast config layers for screenshare settings. |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 51 | std::vector<webrtc::VideoStream> GetScreenshareLayers( |
| 52 | size_t max_layers, |
| 53 | int width, |
| 54 | int height, |
Seth Hampson | 1370e30 | 2018-02-07 08:50:36 -0800 | [diff] [blame] | 55 | double bitrate_priority, |
| 56 | int max_qp, |
Ilya Nikolaevskiy | 3df1d5d | 2018-08-22 09:26:51 +0200 | [diff] [blame] | 57 | bool screenshare_simulcast_enabled, |
Sergio Garcia Murillo | 43800f9 | 2018-06-21 16:16:38 +0200 | [diff] [blame] | 58 | bool temporal_layers_supported = true); |
Ilya Nikolaevskiy | 3df1d5d | 2018-08-22 09:26:51 +0200 | [diff] [blame] | 59 | |
| 60 | bool ScreenshareSimulcastFieldTrialEnabled(); |
| 61 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 62 | } // namespace cricket |
| 63 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 64 | #endif // MEDIA_ENGINE_SIMULCAST_H_ |