blob: 1eaed6ea4a2958a3aa0ff756edf4e32c89abc83e [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
Niels Möller0a8f4352018-05-18 11:37:23 +020016#include "api/video_codecs/video_encoder_config.h"
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000017
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000018namespace cricket {
sprang@webrtc.org46d4d292014-12-23 15:19:35 +000019
Åsa Persson55659812018-06-18 17:51:32 +020020// Gets the total maximum bitrate for the |streams|.
pbosbe16f792015-10-16 12:49:39 -070021int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000022
Åsa Persson55659812018-06-18 17:51:32 +020023// Adds any bitrate of |max_bitrate_bps| that is above the total maximum bitrate
24// for the |layers| to the highest quality layer.
25void BoostMaxSimulcastLayer(int max_bitrate_bps,
26 std::vector<webrtc::VideoStream>* layers);
27
28// Gets simulcast settings.
Åsa Perssonced5cfd2018-08-10 16:16:43 +020029// TODO(asapersson): Remove max_bitrate_bps and max_framerate.
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +020030std::vector<webrtc::VideoStream> GetSimulcastConfig(
31 size_t max_layers,
32 int width,
33 int height,
34 int /*max_bitrate_bps*/,
35 double bitrate_priority,
36 int max_qp,
Åsa Perssonced5cfd2018-08-10 16:16:43 +020037 int /*max_framerate*/,
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +020038 bool is_screenshare,
39 bool temporal_layers_supported = true);
sprang429600d2017-01-26 06:12:26 -080040
Seth Hampson1370e302018-02-07 08:50:36 -080041// Gets the simulcast config layers for a non-screensharing case.
42std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
43 size_t max_layers,
44 int width,
45 int height,
Seth Hampson1370e302018-02-07 08:50:36 -080046 double bitrate_priority,
47 int max_qp,
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +020048 bool temporal_layers_supported = true);
Seth Hampson1370e302018-02-07 08:50:36 -080049
Åsa Persson55659812018-06-18 17:51:32 +020050// Gets simulcast config layers for screenshare settings.
Seth Hampson1370e302018-02-07 08:50:36 -080051std::vector<webrtc::VideoStream> GetScreenshareLayers(
52 size_t max_layers,
53 int width,
54 int height,
Seth Hampson1370e302018-02-07 08:50:36 -080055 double bitrate_priority,
56 int max_qp,
Sergio Garcia Murillo43800f92018-06-21 16:16:38 +020057 bool temporal_layers_supported = true);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000058} // namespace cricket
59
Mirko Bonadei92ea95e2017-09-15 06:47:31 +020060#endif // MEDIA_ENGINE_SIMULCAST_H_