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