2014-12-10 09:01:18 +00:00
|
|
|
/*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Copyright (c) 2014 The WebRTC project authors. All Rights Reserved.
|
2014-12-10 09:01:18 +00:00
|
|
|
*
|
2016-02-07 20:46:45 -08:00
|
|
|
* Use of this source code is governed by a BSD-style license
|
|
|
|
|
* that can be found in the LICENSE file in the root of the source
|
|
|
|
|
* tree. An additional intellectual property rights grant can be found
|
|
|
|
|
* in the file PATENTS. All contributing project authors may
|
|
|
|
|
* be found in the AUTHORS file in the root of the source tree.
|
2014-12-10 09:01:18 +00:00
|
|
|
*/
|
2015-01-20 21:36:13 +00:00
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#ifndef MEDIA_ENGINE_SIMULCAST_H_
|
|
|
|
|
#define MEDIA_ENGINE_SIMULCAST_H_
|
2014-12-10 09:01:18 +00:00
|
|
|
|
2018-11-28 16:47:49 +01:00
|
|
|
#include <stddef.h>
|
2019-07-05 19:08:33 +02:00
|
|
|
|
2014-12-10 09:01:18 +00:00
|
|
|
#include <vector>
|
|
|
|
|
|
2018-05-18 11:37:23 +02:00
|
|
|
#include "api/video_codecs/video_encoder_config.h"
|
2014-12-10 09:01:18 +00:00
|
|
|
|
|
|
|
|
namespace cricket {
|
2014-12-23 15:19:35 +00:00
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
// Gets the total maximum bitrate for the |streams|.
|
2015-10-16 12:49:39 -07:00
|
|
|
int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
|
2014-12-10 09:01:18 +00:00
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
// Adds any bitrate of |max_bitrate_bps| that is above the total maximum bitrate
|
|
|
|
|
// for the |layers| to the highest quality layer.
|
|
|
|
|
void BoostMaxSimulcastLayer(int max_bitrate_bps,
|
|
|
|
|
std::vector<webrtc::VideoStream>* layers);
|
|
|
|
|
|
2019-01-29 14:26:48 +01:00
|
|
|
// Round size to nearest simulcast-friendly size
|
|
|
|
|
int NormalizeSimulcastSize(int size, size_t simulcast_layers);
|
|
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
// Gets simulcast settings.
|
2018-06-21 16:16:38 +02:00
|
|
|
std::vector<webrtc::VideoStream> GetSimulcastConfig(
|
|
|
|
|
size_t max_layers,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
double bitrate_priority,
|
|
|
|
|
int max_qp,
|
2019-07-10 16:57:57 +02:00
|
|
|
bool is_screenshare_with_conference_mode,
|
2018-06-21 16:16:38 +02:00
|
|
|
bool temporal_layers_supported = true);
|
2018-02-07 08:50:36 -08:00
|
|
|
|
|
|
|
|
// Gets the simulcast config layers for a non-screensharing case.
|
|
|
|
|
std::vector<webrtc::VideoStream> GetNormalSimulcastLayers(
|
|
|
|
|
size_t max_layers,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
double bitrate_priority,
|
|
|
|
|
int max_qp,
|
2019-10-30 13:01:46 +01:00
|
|
|
bool temporal_layers_supported,
|
|
|
|
|
bool base_heavy_tl3_rate_alloc);
|
2018-02-07 08:50:36 -08:00
|
|
|
|
2018-06-18 17:51:32 +02:00
|
|
|
// Gets simulcast config layers for screenshare settings.
|
2018-02-07 08:50:36 -08:00
|
|
|
std::vector<webrtc::VideoStream> GetScreenshareLayers(
|
|
|
|
|
size_t max_layers,
|
|
|
|
|
int width,
|
|
|
|
|
int height,
|
|
|
|
|
double bitrate_priority,
|
|
|
|
|
int max_qp,
|
2019-10-30 13:01:46 +01:00
|
|
|
bool temporal_layers_supported,
|
|
|
|
|
bool base_heavy_tl3_rate_alloc);
|
2018-08-22 09:26:51 +02:00
|
|
|
|
2014-12-10 09:01:18 +00:00
|
|
|
} // namespace cricket
|
|
|
|
|
|
2017-09-15 06:47:31 +02:00
|
|
|
#endif // MEDIA_ENGINE_SIMULCAST_H_
|