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 | |
kjellander@webrtc.org | 5ad1297 | 2016-02-12 06:39:40 +0100 | [diff] [blame] | 11 | #ifndef WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |
| 12 | #define WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 13 | |
| 14 | #include <vector> |
| 15 | |
| 16 | #include "webrtc/base/basictypes.h" |
| 17 | #include "webrtc/config.h" |
| 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@webrtc.org | 46d4d29 | 2014-12-23 15:19:35 +0000 | [diff] [blame] | 22 | // Config for use with screen cast when temporal layers are enabled. |
| 23 | struct ScreenshareLayerConfig { |
| 24 | public: |
| 25 | ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate); |
| 26 | |
| 27 | // Bitrates, for temporal layers 0 and 1. |
| 28 | int tl0_bitrate_kbps; |
| 29 | int tl1_bitrate_kbps; |
| 30 | |
| 31 | static ScreenshareLayerConfig GetDefault(); |
| 32 | |
| 33 | // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)", |
| 34 | // eg. "100-1000" for the default rates. |
| 35 | static bool FromFieldTrialGroup(const std::string& group, |
| 36 | ScreenshareLayerConfig* config); |
| 37 | }; |
| 38 | |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 39 | // TODO(pthatcher): Write unit tests just for these functions, |
| 40 | // independent of WebrtcVideoEngine. |
| 41 | |
pbos | be16f79 | 2015-10-16 12:49:39 -0700 | [diff] [blame] | 42 | int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 43 | |
| 44 | // Get the ssrcs of the SIM group from the stream params. |
Peter Boström | 0c4e06b | 2015-10-07 12:23:21 +0200 | [diff] [blame] | 45 | void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 46 | |
| 47 | // Get simulcast settings. |
pbos | be16f79 | 2015-10-16 12:49:39 -0700 | [diff] [blame] | 48 | std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams, |
| 49 | int width, |
| 50 | int height, |
| 51 | int max_bitrate_bps, |
| 52 | int max_qp, |
sprang | 44303ea | 2017-01-18 05:19:13 -0800 | [diff] [blame] | 53 | int max_framerate); |
buildbot@webrtc.org | a853077 | 2014-12-10 09:01:18 +0000 | [diff] [blame] | 54 | |
| 55 | } // namespace cricket |
| 56 | |
kjellander@webrtc.org | 5ad1297 | 2016-02-12 06:39:40 +0100 | [diff] [blame] | 57 | #endif // WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |