blob: a2d27ed7b21119cf1070258bf41aa5b90e5ec234 [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
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000046// Get simulcast settings.
sprang429600d2017-01-26 06:12:26 -080047// TODO(sprang): Remove default parameter when it's not longer referenced.
pbosbe16f792015-10-16 12:49:39 -070048std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams,
49 int width,
50 int height,
51 int max_bitrate_bps,
Seth Hampson24722b32017-12-22 09:36:42 -080052 double bitrate_priority,
pbosbe16f792015-10-16 12:49:39 -070053 int max_qp,
sprang429600d2017-01-26 06:12:26 -080054 int max_framerate,
55 bool is_screencast = false);
56
57bool UseSimulcastScreenshare();
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000058
59} // namespace cricket
60
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020061#endif // MEDIA_ENGINE_SIMULCAST_H_