1 /* 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. 3 * 4 * 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. 9 */ 10 11 #ifndef MEDIA_ENGINE_SIMULCAST_H_ 12 #define MEDIA_ENGINE_SIMULCAST_H_ 13 14 #include <stddef.h> 15 16 #include <vector> 17 18 #include "api/units/data_rate.h" 19 #include "api/video_codecs/video_encoder_config.h" 20 21 namespace cricket { 22 23 // Gets the total maximum bitrate for the |streams|. 24 webrtc::DataRate GetTotalMaxBitrate( 25 const std::vector<webrtc::VideoStream>& streams); 26 27 // Adds any bitrate of |max_bitrate| that is above the total maximum bitrate for 28 // the |layers| to the highest quality layer. 29 void BoostMaxSimulcastLayer(webrtc::DataRate max_bitrate, 30 std::vector<webrtc::VideoStream>* layers); 31 32 // Round size to nearest simulcast-friendly size 33 int NormalizeSimulcastSize(int size, size_t simulcast_layers); 34 35 // Gets simulcast settings. 36 std::vector<webrtc::VideoStream> GetSimulcastConfig( 37 size_t min_layers, 38 size_t max_layers, 39 int width, 40 int height, 41 double bitrate_priority, 42 int max_qp, 43 bool is_screenshare_with_conference_mode, 44 bool temporal_layers_supported); 45 46 // Gets the simulcast config layers for a non-screensharing case. 47 std::vector<webrtc::VideoStream> GetNormalSimulcastLayers( 48 size_t max_layers, 49 int width, 50 int height, 51 double bitrate_priority, 52 int max_qp, 53 bool temporal_layers_supported, 54 bool base_heavy_tl3_rate_alloc); 55 56 // Gets simulcast config layers for screenshare settings. 57 std::vector<webrtc::VideoStream> GetScreenshareLayers( 58 size_t max_layers, 59 int width, 60 int height, 61 double bitrate_priority, 62 int max_qp, 63 bool temporal_layers_supported, 64 bool base_heavy_tl3_rate_alloc); 65 66 } // namespace cricket 67 68 #endif // MEDIA_ENGINE_SIMULCAST_H_ 69