blob: 84f8c31a898bb2e66c56ef29df6efee23dc2c933 [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
Steve Antone78bcb92017-10-31 09:53:08 -070014#include <string>
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000015#include <vector>
16
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020017#include "call/video_config.h"
18#include "rtc_base/basictypes.h"
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000019
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000020namespace cricket {
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000021struct StreamParams;
22
sprang429600d2017-01-26 06:12:26 -080023// TODO(sprang): Remove this, as we're moving away from temporal layer mode.
sprang@webrtc.org46d4d292014-12-23 15:19:35 +000024// Config for use with screen cast when temporal layers are enabled.
25struct ScreenshareLayerConfig {
26 public:
27 ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate);
28
29 // Bitrates, for temporal layers 0 and 1.
30 int tl0_bitrate_kbps;
31 int tl1_bitrate_kbps;
32
33 static ScreenshareLayerConfig GetDefault();
34
35 // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)",
36 // eg. "100-1000" for the default rates.
37 static bool FromFieldTrialGroup(const std::string& group,
38 ScreenshareLayerConfig* config);
39};
40
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000041// TODO(pthatcher): Write unit tests just for these functions,
42// independent of WebrtcVideoEngine.
43
pbosbe16f792015-10-16 12:49:39 -070044int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000045
46// Get the ssrcs of the SIM group from the stream params.
Peter Boström0c4e06b2015-10-07 12:23:21 +020047void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000048
49// Get simulcast settings.
sprang429600d2017-01-26 06:12:26 -080050// TODO(sprang): Remove default parameter when it's not longer referenced.
pbosbe16f792015-10-16 12:49:39 -070051std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams,
52 int width,
53 int height,
54 int max_bitrate_bps,
55 int max_qp,
sprang429600d2017-01-26 06:12:26 -080056 int max_framerate,
57 bool is_screencast = false);
58
59bool UseSimulcastScreenshare();
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000060
61} // namespace cricket
62
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020063#endif // MEDIA_ENGINE_SIMULCAST_H_