OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 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 |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // The VideoEncoder may redistribute bitrates over the temporal layers so a | 117 // The VideoEncoder may redistribute bitrates over the temporal layers so a |
118 // bitrate threshold of 100k and an estimate of 105k does not imply that we | 118 // bitrate threshold of 100k and an estimate of 105k does not imply that we |
119 // get 100k in one temporal layer and 5k in the other, just that the bitrate | 119 // get 100k in one temporal layer and 5k in the other, just that the bitrate |
120 // in the first temporal layer should not exceed 100k. | 120 // in the first temporal layer should not exceed 100k. |
121 // TODO(pbos): Apart from a special case for two-layer screencast these | 121 // TODO(pbos): Apart from a special case for two-layer screencast these |
122 // thresholds are not propagated to the VideoEncoder. To be implemented. | 122 // thresholds are not propagated to the VideoEncoder. To be implemented. |
123 std::vector<int> temporal_layer_thresholds_bps; | 123 std::vector<int> temporal_layer_thresholds_bps; |
124 }; | 124 }; |
125 | 125 |
126 struct VideoEncoderConfig { | 126 struct VideoEncoderConfig { |
| 127 public: |
127 enum class ContentType { | 128 enum class ContentType { |
128 kRealtimeVideo, | 129 kRealtimeVideo, |
129 kScreen, | 130 kScreen, |
130 }; | 131 }; |
131 | 132 |
| 133 VideoEncoderConfig& operator=(VideoEncoderConfig&&) = default; |
| 134 VideoEncoderConfig& operator=(const VideoEncoderConfig&) = delete; |
| 135 |
| 136 // Mostly used by tests. Avoid creating copies if you can. |
| 137 VideoEncoderConfig Copy() const { return VideoEncoderConfig(*this); } |
| 138 |
132 VideoEncoderConfig(); | 139 VideoEncoderConfig(); |
| 140 VideoEncoderConfig(VideoEncoderConfig&&) = default; |
133 ~VideoEncoderConfig(); | 141 ~VideoEncoderConfig(); |
134 std::string ToString() const; | 142 std::string ToString() const; |
135 | 143 |
136 std::vector<VideoStream> streams; | 144 std::vector<VideoStream> streams; |
137 std::vector<SpatialLayer> spatial_layers; | 145 std::vector<SpatialLayer> spatial_layers; |
138 ContentType content_type; | 146 ContentType content_type; |
139 void* encoder_specific_settings; | 147 void* encoder_specific_settings; |
140 | 148 |
141 // Padding will be used up to this bitrate regardless of the bitrate produced | 149 // Padding will be used up to this bitrate regardless of the bitrate produced |
142 // by the encoder. Padding above what's actually produced by the encoder helps | 150 // by the encoder. Padding above what's actually produced by the encoder helps |
143 // maintaining a higher bitrate estimate. Padding will however not be sent | 151 // maintaining a higher bitrate estimate. Padding will however not be sent |
144 // unless the estimated bandwidth indicates that the link can handle it. | 152 // unless the estimated bandwidth indicates that the link can handle it. |
145 int min_transmit_bitrate_bps; | 153 int min_transmit_bitrate_bps; |
146 bool expect_encode_from_texture; | 154 bool expect_encode_from_texture; |
| 155 |
| 156 private: |
| 157 // Access to the copy constructor is private to force use of the Copy() |
| 158 // method for those exceptional cases where we do use it. |
| 159 VideoEncoderConfig(const VideoEncoderConfig&) = default; |
147 }; | 160 }; |
148 | 161 |
149 // Controls the capacity of the packet buffer in NetEq. The capacity is the | 162 // Controls the capacity of the packet buffer in NetEq. The capacity is the |
150 // maximum number of packets that the buffer can contain. If the limit is | 163 // maximum number of packets that the buffer can contain. If the limit is |
151 // exceeded, the buffer will be flushed. The capacity does not affect the actual | 164 // exceeded, the buffer will be flushed. The capacity does not affect the actual |
152 // audio delay in the general case, since this is governed by the target buffer | 165 // audio delay in the general case, since this is governed by the target buffer |
153 // level (calculated from the jitter profile). It is only in the rare case of | 166 // level (calculated from the jitter profile). It is only in the rare case of |
154 // severe network freezes that a higher capacity will lead to a (transient) | 167 // severe network freezes that a higher capacity will lead to a (transient) |
155 // increase in audio delay. | 168 // increase in audio delay. |
156 struct NetEqCapacityConfig { | 169 struct NetEqCapacityConfig { |
(...skipping 14 matching lines...) Expand all Loading... |
171 struct VoicePacing { | 184 struct VoicePacing { |
172 VoicePacing() : enabled(false) {} | 185 VoicePacing() : enabled(false) {} |
173 explicit VoicePacing(bool value) : enabled(value) {} | 186 explicit VoicePacing(bool value) : enabled(value) {} |
174 static const ConfigOptionID identifier = ConfigOptionID::kVoicePacing; | 187 static const ConfigOptionID identifier = ConfigOptionID::kVoicePacing; |
175 bool enabled; | 188 bool enabled; |
176 }; | 189 }; |
177 | 190 |
178 } // namespace webrtc | 191 } // namespace webrtc |
179 | 192 |
180 #endif // WEBRTC_CONFIG_H_ | 193 #endif // WEBRTC_CONFIG_H_ |
OLD | NEW |