OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 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 | 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 | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
11 #ifndef WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ | 11 #ifndef WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |
12 #define WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ | 12 #define WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |
13 | 13 |
14 #include <vector> | 14 #include <vector> |
15 | 15 |
16 #include "webrtc/base/basictypes.h" | 16 #include "webrtc/base/basictypes.h" |
17 #include "webrtc/config.h" | 17 #include "webrtc/config.h" |
18 | 18 |
19 namespace cricket { | 19 namespace cricket { |
20 struct StreamParams; | 20 struct StreamParams; |
21 | 21 |
22 // TODO(sprang): Remove this, as we're moving away from temporal layer mode. | |
23 // Config for use with screen cast when temporal layers are enabled. | 22 // Config for use with screen cast when temporal layers are enabled. |
24 struct ScreenshareLayerConfig { | 23 struct ScreenshareLayerConfig { |
25 public: | 24 public: |
26 ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate); | 25 ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate); |
27 | 26 |
28 // Bitrates, for temporal layers 0 and 1. | 27 // Bitrates, for temporal layers 0 and 1. |
29 int tl0_bitrate_kbps; | 28 int tl0_bitrate_kbps; |
30 int tl1_bitrate_kbps; | 29 int tl1_bitrate_kbps; |
31 | 30 |
32 static ScreenshareLayerConfig GetDefault(); | 31 static ScreenshareLayerConfig GetDefault(); |
33 | 32 |
34 // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)", | 33 // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)", |
35 // eg. "100-1000" for the default rates. | 34 // eg. "100-1000" for the default rates. |
36 static bool FromFieldTrialGroup(const std::string& group, | 35 static bool FromFieldTrialGroup(const std::string& group, |
37 ScreenshareLayerConfig* config); | 36 ScreenshareLayerConfig* config); |
38 }; | 37 }; |
39 | 38 |
40 // TODO(pthatcher): Write unit tests just for these functions, | 39 // TODO(pthatcher): Write unit tests just for these functions, |
41 // independent of WebrtcVideoEngine. | 40 // independent of WebrtcVideoEngine. |
42 | 41 |
43 int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); | 42 int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); |
44 | 43 |
45 // Get the ssrcs of the SIM group from the stream params. | 44 // Get the ssrcs of the SIM group from the stream params. |
46 void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs); | 45 void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs); |
47 | 46 |
48 // Get simulcast settings. | 47 // Get simulcast settings. |
49 // TODO(sprang): Remove default parameter when it's not longer referenced. | |
50 std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams, | 48 std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams, |
51 int width, | 49 int width, |
52 int height, | 50 int height, |
53 int max_bitrate_bps, | 51 int max_bitrate_bps, |
54 int max_qp, | 52 int max_qp, |
55 int max_framerate, | 53 int max_framerate); |
56 bool is_screencast = false); | |
57 | |
58 bool UseSimulcastScreenshare(); | |
59 | 54 |
60 } // namespace cricket | 55 } // namespace cricket |
61 | 56 |
62 #endif // WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ | 57 #endif // WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |
OLD | NEW |