blob: 7a988099d7ee0cf34902b86f71429d20c8c16fea [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
Niels Möller0a8f4352018-05-18 11:37:23 +020017#include "api/video_codecs/video_encoder_config.h"
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000018
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000019namespace cricket {
sprang@webrtc.org46d4d292014-12-23 15:19:35 +000020
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000021// TODO(pthatcher): Write unit tests just for these functions,
22// independent of WebrtcVideoEngine.
23
pbosbe16f792015-10-16 12:49:39 -070024int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000025
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000026// Get simulcast settings.
Seth Hampson1370e302018-02-07 08:50:36 -080027std::vector<webrtc::VideoStream> GetSimulcastConfig(
28 size_t max_layers,
29 int width,
30 int height,
31 int max_bitrate_bps,
32 double bitrate_priority,
33 int max_qp,
34 int max_framerate,
Rasmus Brandt6cdd5462018-06-08 09:04:47 +020035 bool is_screenshare);
sprang429600d2017-01-26 06:12:26 -080036
Seth Hampson1370e302018-02-07 08:50:36 -080037// Gets the simulcast config layers for a non-screensharing case.
38std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
39 size_t max_layers,
40 int width,
41 int height,
42 int max_bitrate_bps,
43 double bitrate_priority,
44 int max_qp,
45 int max_framerate);
46
47// Get simulcast config layers for screenshare settings.
48std::vector<webrtc::VideoStream> GetScreenshareLayers(
49 size_t max_layers,
50 int width,
51 int height,
52 int max_bitrate_bps,
53 double bitrate_priority,
54 int max_qp,
55 int max_framerate,
56 bool screenshare_simulcast_enabled);
57
58bool ScreenshareSimulcastFieldTrialEnabled();
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_