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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Payload type used for RED packets. | 50 // Payload type used for RED packets. |
51 int red_payload_type; | 51 int red_payload_type; |
52 | 52 |
53 // RTX payload type for RED payload. | 53 // RTX payload type for RED payload. |
54 int red_rtx_payload_type; | 54 int red_rtx_payload_type; |
55 }; | 55 }; |
56 | 56 |
57 // Settings for FlexFEC forward error correction. | 57 // Settings for FlexFEC forward error correction. |
58 // Set the payload type to '-1' to disable. | 58 // Set the payload type to '-1' to disable. |
59 struct FlexfecConfig { | 59 struct FlexfecConfig { |
60 FlexfecConfig(); | 60 FlexfecConfig() |
61 ~FlexfecConfig(); | 61 : flexfec_payload_type(-1), flexfec_ssrc(0), protected_media_ssrcs() {} |
62 std::string ToString() const; | 62 std::string ToString() const; |
63 | 63 |
64 // Payload type of FlexFEC. | 64 // Payload type of FlexFEC. |
65 int flexfec_payload_type; | 65 int flexfec_payload_type; |
66 | 66 |
67 // SSRC of FlexFEC stream. | 67 // SSRC of FlexFEC stream. |
68 uint32_t flexfec_ssrc; | 68 uint32_t flexfec_ssrc; |
69 | 69 |
70 // Vector containing a single element, corresponding to the SSRC of the media | 70 // Vector containing a single element, corresponding to the SSRC of the media |
71 // stream being protected by this FlexFEC stream. The vector MUST have size 1. | 71 // stream being protected by this FlexFEC stream. The vector MUST have size 1. |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 public: | 156 public: |
157 // TODO(pbos): Remove FillEncoderSpecificSettings as soon as VideoCodec is | 157 // TODO(pbos): Remove FillEncoderSpecificSettings as soon as VideoCodec is |
158 // not in use and encoder implementations ask for codec-specific structs | 158 // not in use and encoder implementations ask for codec-specific structs |
159 // directly. | 159 // directly. |
160 void FillEncoderSpecificSettings(VideoCodec* codec_struct) const; | 160 void FillEncoderSpecificSettings(VideoCodec* codec_struct) const; |
161 | 161 |
162 virtual void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const; | 162 virtual void FillVideoCodecVp8(VideoCodecVP8* vp8_settings) const; |
163 virtual void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const; | 163 virtual void FillVideoCodecVp9(VideoCodecVP9* vp9_settings) const; |
164 virtual void FillVideoCodecH264(VideoCodecH264* h264_settings) const; | 164 virtual void FillVideoCodecH264(VideoCodecH264* h264_settings) const; |
165 private: | 165 private: |
166 ~EncoderSpecificSettings() override {} | 166 virtual ~EncoderSpecificSettings() {} |
167 friend class VideoEncoderConfig; | 167 friend class VideoEncoderConfig; |
168 }; | 168 }; |
169 | 169 |
170 class H264EncoderSpecificSettings : public EncoderSpecificSettings { | 170 class H264EncoderSpecificSettings : public EncoderSpecificSettings { |
171 public: | 171 public: |
172 explicit H264EncoderSpecificSettings(const VideoCodecH264& specifics); | 172 explicit H264EncoderSpecificSettings(const VideoCodecH264& specifics); |
173 void FillVideoCodecH264(VideoCodecH264* h264_settings) const override; | 173 void FillVideoCodecH264(VideoCodecH264* h264_settings) const override; |
174 | 174 |
175 private: | 175 private: |
176 VideoCodecH264 specifics_; | 176 VideoCodecH264 specifics_; |
(...skipping 27 matching lines...) Expand all Loading... |
204 // An implementation should return a std::vector<VideoStream> with the | 204 // An implementation should return a std::vector<VideoStream> with the |
205 // wanted VideoStream settings for the given video resolution. | 205 // wanted VideoStream settings for the given video resolution. |
206 // The size of the vector may not be larger than | 206 // The size of the vector may not be larger than |
207 // |encoder_config.number_of_streams|. | 207 // |encoder_config.number_of_streams|. |
208 virtual std::vector<VideoStream> CreateEncoderStreams( | 208 virtual std::vector<VideoStream> CreateEncoderStreams( |
209 int width, | 209 int width, |
210 int height, | 210 int height, |
211 const VideoEncoderConfig& encoder_config) = 0; | 211 const VideoEncoderConfig& encoder_config) = 0; |
212 | 212 |
213 protected: | 213 protected: |
214 ~VideoStreamFactoryInterface() override {} | 214 virtual ~VideoStreamFactoryInterface() {} |
215 }; | 215 }; |
216 | 216 |
217 VideoEncoderConfig& operator=(VideoEncoderConfig&&) = default; | 217 VideoEncoderConfig& operator=(VideoEncoderConfig&&) = default; |
218 VideoEncoderConfig& operator=(const VideoEncoderConfig&) = delete; | 218 VideoEncoderConfig& operator=(const VideoEncoderConfig&) = delete; |
219 | 219 |
220 // Mostly used by tests. Avoid creating copies if you can. | 220 // Mostly used by tests. Avoid creating copies if you can. |
221 VideoEncoderConfig Copy() const { return VideoEncoderConfig(*this); } | 221 VideoEncoderConfig Copy() const { return VideoEncoderConfig(*this); } |
222 | 222 |
223 VideoEncoderConfig(); | 223 VideoEncoderConfig(); |
224 VideoEncoderConfig(VideoEncoderConfig&&); | 224 VideoEncoderConfig(VideoEncoderConfig&&) = default; |
225 ~VideoEncoderConfig(); | 225 ~VideoEncoderConfig(); |
226 std::string ToString() const; | 226 std::string ToString() const; |
227 | 227 |
228 rtc::scoped_refptr<VideoStreamFactoryInterface> video_stream_factory; | 228 rtc::scoped_refptr<VideoStreamFactoryInterface> video_stream_factory; |
229 std::vector<SpatialLayer> spatial_layers; | 229 std::vector<SpatialLayer> spatial_layers; |
230 ContentType content_type; | 230 ContentType content_type; |
231 rtc::scoped_refptr<const EncoderSpecificSettings> encoder_specific_settings; | 231 rtc::scoped_refptr<const EncoderSpecificSettings> encoder_specific_settings; |
232 | 232 |
233 // Padding will be used up to this bitrate regardless of the bitrate produced | 233 // Padding will be used up to this bitrate regardless of the bitrate produced |
234 // by the encoder. Padding above what's actually produced by the encoder helps | 234 // by the encoder. Padding above what's actually produced by the encoder helps |
235 // maintaining a higher bitrate estimate. Padding will however not be sent | 235 // maintaining a higher bitrate estimate. Padding will however not be sent |
236 // unless the estimated bandwidth indicates that the link can handle it. | 236 // unless the estimated bandwidth indicates that the link can handle it. |
237 int min_transmit_bitrate_bps; | 237 int min_transmit_bitrate_bps; |
238 int max_bitrate_bps; | 238 int max_bitrate_bps; |
239 | 239 |
240 // Max number of encoded VideoStreams to produce. | 240 // Max number of encoded VideoStreams to produce. |
241 size_t number_of_streams; | 241 size_t number_of_streams; |
242 | 242 |
243 private: | 243 private: |
244 // Access to the copy constructor is private to force use of the Copy() | 244 // Access to the copy constructor is private to force use of the Copy() |
245 // method for those exceptional cases where we do use it. | 245 // method for those exceptional cases where we do use it. |
246 VideoEncoderConfig(const VideoEncoderConfig&); | 246 VideoEncoderConfig(const VideoEncoderConfig&) = default; |
247 }; | 247 }; |
248 | 248 |
249 struct VideoDecoderH264Settings { | 249 struct VideoDecoderH264Settings { |
250 std::string sprop_parameter_sets; | 250 std::string sprop_parameter_sets; |
251 }; | 251 }; |
252 | 252 |
253 class DecoderSpecificSettings { | 253 class DecoderSpecificSettings { |
254 public: | 254 public: |
255 DecoderSpecificSettings(); | 255 virtual ~DecoderSpecificSettings() {} |
256 virtual ~DecoderSpecificSettings(); | |
257 rtc::Optional<VideoDecoderH264Settings> h264_extra_settings; | 256 rtc::Optional<VideoDecoderH264Settings> h264_extra_settings; |
258 }; | 257 }; |
259 | 258 |
260 } // namespace webrtc | 259 } // namespace webrtc |
261 | 260 |
262 #endif // WEBRTC_CONFIG_H_ | 261 #endif // WEBRTC_CONFIG_H_ |
OLD | NEW |