blob: 29ecfde1d1dbb0e77cf93778e7e4804f75a36d52 [file] [log] [blame]
buildbot@webrtc.orga8530772014-12-10 09:01:18 +00001/*
kjellander1afca732016-02-07 20:46:45 -08002 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
buildbot@webrtc.orga8530772014-12-10 09:01:18 +00003 *
kjellander1afca732016-02-07 20:46:45 -08004 * 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.orga8530772014-12-10 09:01:18 +00009 */
jlmiller@webrtc.org5f93d0a2015-01-20 21:36:13 +000010
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020011#ifndef MEDIA_ENGINE_SIMULCAST_H_
12#define MEDIA_ENGINE_SIMULCAST_H_
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000013
14#include <vector>
15
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020016#include "call/video_config.h"
17#include "rtc_base/basictypes.h"
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000018
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000019namespace cricket {
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000020struct StreamParams;
21
sprang429600d2017-01-26 06:12:26 -080022// TODO(sprang): Remove this, as we're moving away from temporal layer mode.
sprang@webrtc.org46d4d292014-12-23 15:19:35 +000023// Config for use with screen cast when temporal layers are enabled.
24struct 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.orga8530772014-12-10 09:01:18 +000040// TODO(pthatcher): Write unit tests just for these functions,
41// independent of WebrtcVideoEngine.
42
pbosbe16f792015-10-16 12:49:39 -070043int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000044
45// Get the ssrcs of the SIM group from the stream params.
Peter Boström0c4e06b2015-10-07 12:23:21 +020046void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000047
48// Get simulcast settings.
sprang429600d2017-01-26 06:12:26 -080049// TODO(sprang): Remove default parameter when it's not longer referenced.
pbosbe16f792015-10-16 12:49:39 -070050std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams,
51 int width,
52 int height,
53 int max_bitrate_bps,
54 int max_qp,
sprang429600d2017-01-26 06:12:26 -080055 int max_framerate,
56 bool is_screencast = false);
57
58bool UseSimulcastScreenshare();
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000059
60} // namespace cricket
61
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020062#endif // MEDIA_ENGINE_SIMULCAST_H_