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. |
22 // Config for use with screen cast when temporal layers are enabled. | 23 // Config for use with screen cast when temporal layers are enabled. |
23 struct ScreenshareLayerConfig { | 24 struct ScreenshareLayerConfig { |
24 public: | 25 public: |
25 ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate); | 26 ScreenshareLayerConfig(int tl0_bitrate, int tl1_bitrate); |
26 | 27 |
27 // Bitrates, for temporal layers 0 and 1. | 28 // Bitrates, for temporal layers 0 and 1. |
28 int tl0_bitrate_kbps; | 29 int tl0_bitrate_kbps; |
29 int tl1_bitrate_kbps; | 30 int tl1_bitrate_kbps; |
30 | 31 |
31 static ScreenshareLayerConfig GetDefault(); | 32 static ScreenshareLayerConfig GetDefault(); |
32 | 33 |
33 // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)", | 34 // Parse bitrate from group name on format "(tl0_bitrate)-(tl1_bitrate)", |
34 // eg. "100-1000" for the default rates. | 35 // eg. "100-1000" for the default rates. |
35 static bool FromFieldTrialGroup(const std::string& group, | 36 static bool FromFieldTrialGroup(const std::string& group, |
36 ScreenshareLayerConfig* config); | 37 ScreenshareLayerConfig* config); |
37 }; | 38 }; |
38 | 39 |
39 // TODO(pthatcher): Write unit tests just for these functions, | 40 // TODO(pthatcher): Write unit tests just for these functions, |
40 // independent of WebrtcVideoEngine. | 41 // independent of WebrtcVideoEngine. |
41 | 42 |
42 int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); | 43 int GetTotalMaxBitrateBps(const std::vector<webrtc::VideoStream>& streams); |
43 | 44 |
44 // Get the ssrcs of the SIM group from the stream params. | 45 // Get the ssrcs of the SIM group from the stream params. |
45 void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs); | 46 void GetSimulcastSsrcs(const StreamParams& sp, std::vector<uint32_t>* ssrcs); |
46 | 47 |
47 // Get simulcast settings. | 48 // Get simulcast settings. |
| 49 // TODO(sprang): Remove default parameter when it's not longer referenced. |
48 std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams, | 50 std::vector<webrtc::VideoStream> GetSimulcastConfig(size_t max_streams, |
49 int width, | 51 int width, |
50 int height, | 52 int height, |
51 int max_bitrate_bps, | 53 int max_bitrate_bps, |
52 int max_qp, | 54 int max_qp, |
53 int max_framerate); | 55 int max_framerate, |
| 56 bool is_screencast = false); |
| 57 |
| 58 bool UseSimulcastScreenshare(); |
54 | 59 |
55 } // namespace cricket | 60 } // namespace cricket |
56 | 61 |
57 #endif // WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ | 62 #endif // WEBRTC_MEDIA_ENGINE_SIMULCAST_H_ |
OLD | NEW |