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 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame^] | 16 | #include "call/video_config.h" |
| 17 | #include "rtc_base/basictypes.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 { |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 20 | struct StreamParams; |
| 21 | |
sprang | 429600d | 2017-01-26 06:12:26 -0800 | [diff] [blame] | 22 | // TODO(sprang): Remove this, as we're moving away from temporal layer mode. |
sprang@webrtc.org | 46d4d29 | 2014-12-23 15:19:35 +0000 | [diff] [blame] | 23 | // Config for use with screen cast when temporal layers are enabled. |
| 24 | struct ScreenshareLayerConfig { |
| 25 | public: |
| 26 | ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate); |
| 27 | |
| 28 | // Bitrates, for temporal layers 0 and 1. |
| 29 | int tl0_bitrate_kbps; |
| 30 | int tl1_bitrate_kbps; |
| 31 | |
| 32 | static ScreenshareLayerConfig GetDefault(); |
| 33 | |
| 34 | // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)", |
| 35 | // eg. "100-1000" for the default rates. |
| 36 | static bool FromFieldTrialGroup(const std::string& group, |
| 37 | ScreenshareLayerConfig* config); |
| 38 | }; |
| 39 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 40 | // TODO(pthatcher): Write unit tests just for these functions, |
| 41 | // independent of WebrtcVideoEngine. |
| 42 | |
pbos | be16f79 | 2015-10-16 12:49:39 -0700 | [diff] [blame] | 43 | int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 44 | |
| 45 | // Get the ssrcs of the SIM group from the stream params. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 46 | void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 47 | |
| 48 | // Get simulcast settings. |
sprang | 429600d | 2017-01-26 06:12:26 -0800 | [diff] [blame] | 49 | // TODO(sprang): Remove default parameter when it's not longer referenced. |
pbos | be16f79 | 2015-10-16 12:49:39 -0700 | [diff] [blame] | 50 | std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams, |
| 51 | int width, |
| 52 | int height, |
| 53 | int max_bitrate_bps, |
| 54 | int max_qp, |
sprang | 429600d | 2017-01-26 06:12:26 -0800 | [diff] [blame] | 55 | int max_framerate, |
| 56 | bool is_screencast = false); |
| 57 | |
| 58 | bool UseSimulcastScreenshare(); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 59 | |
| 60 | } // namespace cricket |
| 61 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame^] | 62 | #endif // MEDIA_ENGINE_SIMULCAST_H_ |