blob: 20be4c487e443f5b20bc0e051d2931817590ca84 [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
kjellander@webrtc.org5ad12972016-02-12 06:39:40 +010011#ifndef WEBRTC_MEDIA_ENGINE_SIMULCAST_H_
12#define WEBRTC_MEDIA_ENGINE_SIMULCAST_H_
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000013
14#include <vector>
15
16#include "webrtc/base/basictypes.h"
17#include "webrtc/config.h"
18
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000019namespace cricket {
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000020struct StreamParams;
21
sprang@webrtc.org46d4d292014-12-23 15:19:35 +000022// Config for use with screen cast when temporal layers are enabled.
23struct ScreenshareLayerConfig {
24 public:
25 ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate);
26
27 // Bitrates, for temporal layers 0 and 1.
28 int tl0_bitrate_kbps;
29 int tl1_bitrate_kbps;
30
31 static ScreenshareLayerConfig GetDefault();
32
33 // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)",
34 // eg. "100-1000" for the default rates.
35 static bool FromFieldTrialGroup(const std::string& group,
36 ScreenshareLayerConfig* config);
37};
38
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000039// TODO(pthatcher): Write unit tests just for these functions,
40// independent of WebrtcVideoEngine.
41
pbosbe16f792015-10-16 12:49:39 -070042int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000043
44// Get the ssrcs of the SIM group from the stream params.
Peter Boström0c4e06b2015-10-07 12:23:21 +020045void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000046
47// Get simulcast settings.
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,
52 int max_qp,
53 int max_framerate);
buildbot@webrtc.orga8530772014-12-10 09:01:18 +000054
55} // namespace cricket
56
kjellander@webrtc.org5ad12972016-02-12 06:39:40 +010057#endif // WEBRTC_MEDIA_ENGINE_SIMULCAST_H_