Chromium Code Reviews| 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 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 184 | 184 |
| 185 VideoCodec codec; | 185 VideoCodec codec; |
| 186 webrtc::FecConfig fec; | 186 webrtc::FecConfig fec; |
| 187 int rtx_payload_type; | 187 int rtx_payload_type; |
| 188 }; | 188 }; |
| 189 | 189 |
| 190 struct ChangedSendParameters { | 190 struct ChangedSendParameters { |
| 191 // These optionals are unset if not changed. | 191 // These optionals are unset if not changed. |
| 192 rtc::Optional<VideoCodecSettings> codec; | 192 rtc::Optional<VideoCodecSettings> codec; |
| 193 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; | 193 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; |
| 194 rtc::Optional<int> max_bandwidth_bps; | 194 rtc::Optional<rtc::Optional<int>> max_bandwidth_bps; |
|
stefan-webrtc
2016/03/18 08:28:40
What is an optional optional? This looks super wei
skvlad
2016/03/18 18:01:52
As Peter said, this structure represents the diff
pthatcher1
2016/03/21 17:41:13
I think that would make it less clear about what's
Taylor Brandstetter
2016/03/29 02:26:58
I think just a comment above this line explaining
skvlad
2016/03/30 19:40:44
Done.
| |
| 195 rtc::Optional<bool> conference_mode; | 195 rtc::Optional<bool> conference_mode; |
| 196 rtc::Optional<webrtc::RtcpMode> rtcp_mode; | 196 rtc::Optional<webrtc::RtcpMode> rtcp_mode; |
| 197 }; | 197 }; |
| 198 | 198 |
| 199 struct ChangedRecvParameters { | 199 struct ChangedRecvParameters { |
| 200 // These optionals are unset if not changed. | 200 // These optionals are unset if not changed. |
| 201 rtc::Optional<std::vector<VideoCodecSettings>> codec_settings; | 201 rtc::Optional<std::vector<VideoCodecSettings>> codec_settings; |
| 202 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; | 202 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; |
| 203 rtc::Optional<webrtc::RtcpMode> rtcp_mode; | 203 rtc::Optional<webrtc::RtcpMode> rtcp_mode; |
| 204 }; | 204 }; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 232 : public rtc::VideoSinkInterface<cricket::VideoFrame>, | 232 : public rtc::VideoSinkInterface<cricket::VideoFrame>, |
| 233 public webrtc::LoadObserver { | 233 public webrtc::LoadObserver { |
| 234 public: | 234 public: |
| 235 WebRtcVideoSendStream( | 235 WebRtcVideoSendStream( |
| 236 webrtc::Call* call, | 236 webrtc::Call* call, |
| 237 const StreamParams& sp, | 237 const StreamParams& sp, |
| 238 const webrtc::VideoSendStream::Config& config, | 238 const webrtc::VideoSendStream::Config& config, |
| 239 const VideoOptions& options, | 239 const VideoOptions& options, |
| 240 WebRtcVideoEncoderFactory* external_encoder_factory, | 240 WebRtcVideoEncoderFactory* external_encoder_factory, |
| 241 bool enable_cpu_overuse_detection, | 241 bool enable_cpu_overuse_detection, |
| 242 int max_bitrate_bps, | 242 rtc::Optional<int> max_bitrate_bps, |
| 243 const rtc::Optional<VideoCodecSettings>& codec_settings, | 243 const rtc::Optional<VideoCodecSettings>& codec_settings, |
| 244 const std::vector<webrtc::RtpExtension>& rtp_extensions, | 244 const std::vector<webrtc::RtpExtension>& rtp_extensions, |
| 245 const VideoSendParameters& send_params); | 245 const VideoSendParameters& send_params); |
| 246 virtual ~WebRtcVideoSendStream(); | 246 virtual ~WebRtcVideoSendStream(); |
| 247 | 247 |
| 248 void SetOptions(const VideoOptions& options); | 248 void SetOptions(const VideoOptions& options); |
| 249 // TODO(pbos): Move logic from SetOptions into this method. | 249 // TODO(pbos): Move logic from SetOptions into this method. |
| 250 void SetSendParameters(const ChangedSendParameters& send_params); | 250 void SetSendParameters(const ChangedSendParameters& send_params); |
| 251 bool SetRtpParameters(const webrtc::RtpParameters& parameters); | 251 bool SetRtpParameters(const webrtc::RtpParameters& parameters); |
| 252 | 252 |
| (...skipping 16 matching lines...) Expand all Loading... | |
| 269 | 269 |
| 270 private: | 270 private: |
| 271 // Parameters needed to reconstruct the underlying stream. | 271 // Parameters needed to reconstruct the underlying stream. |
| 272 // webrtc::VideoSendStream doesn't support setting a lot of options on the | 272 // webrtc::VideoSendStream doesn't support setting a lot of options on the |
| 273 // fly, so when those need to be changed we tear down and reconstruct with | 273 // fly, so when those need to be changed we tear down and reconstruct with |
| 274 // similar parameters depending on which options changed etc. | 274 // similar parameters depending on which options changed etc. |
| 275 struct VideoSendStreamParameters { | 275 struct VideoSendStreamParameters { |
| 276 VideoSendStreamParameters( | 276 VideoSendStreamParameters( |
| 277 const webrtc::VideoSendStream::Config& config, | 277 const webrtc::VideoSendStream::Config& config, |
| 278 const VideoOptions& options, | 278 const VideoOptions& options, |
| 279 int max_bitrate_bps, | 279 rtc::Optional<int> max_bitrate_bps, |
| 280 const rtc::Optional<VideoCodecSettings>& codec_settings); | 280 const rtc::Optional<VideoCodecSettings>& codec_settings); |
| 281 webrtc::VideoSendStream::Config config; | 281 webrtc::VideoSendStream::Config config; |
| 282 VideoOptions options; | 282 VideoOptions options; |
| 283 int max_bitrate_bps; | 283 rtc::Optional<int> max_bitrate_bps; |
| 284 bool conference_mode; | 284 bool conference_mode; |
| 285 rtc::Optional<VideoCodecSettings> codec_settings; | 285 rtc::Optional<VideoCodecSettings> codec_settings; |
| 286 // Sent resolutions + bitrates etc. by the underlying VideoSendStream, | 286 // Sent resolutions + bitrates etc. by the underlying VideoSendStream, |
| 287 // typically changes when setting a new resolution or reconfiguring | 287 // typically changes when setting a new resolution or reconfiguring |
| 288 // bitrates. | 288 // bitrates. |
| 289 webrtc::VideoEncoderConfig encoder_config; | 289 webrtc::VideoEncoderConfig encoder_config; |
| 290 }; | 290 }; |
| 291 | 291 |
| 292 struct AllocatedEncoder { | 292 struct AllocatedEncoder { |
| 293 AllocatedEncoder(webrtc::VideoEncoder* encoder, | 293 AllocatedEncoder(webrtc::VideoEncoder* encoder, |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 314 | 314 |
| 315 union VideoEncoderSettings { | 315 union VideoEncoderSettings { |
| 316 webrtc::VideoCodecH264 h264; | 316 webrtc::VideoCodecH264 h264; |
| 317 webrtc::VideoCodecVP8 vp8; | 317 webrtc::VideoCodecVP8 vp8; |
| 318 webrtc::VideoCodecVP9 vp9; | 318 webrtc::VideoCodecVP9 vp9; |
| 319 }; | 319 }; |
| 320 | 320 |
| 321 static std::vector<webrtc::VideoStream> CreateVideoStreams( | 321 static std::vector<webrtc::VideoStream> CreateVideoStreams( |
| 322 const VideoCodec& codec, | 322 const VideoCodec& codec, |
| 323 const VideoOptions& options, | 323 const VideoOptions& options, |
| 324 int max_bitrate_bps, | 324 rtc::Optional<int> max_bitrate_bps, |
| 325 size_t num_streams); | 325 size_t num_streams); |
| 326 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( | 326 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( |
| 327 const VideoCodec& codec, | 327 const VideoCodec& codec, |
| 328 const VideoOptions& options, | 328 const VideoOptions& options, |
| 329 int max_bitrate_bps, | 329 rtc::Optional<int> max_bitrate_bps, |
| 330 size_t num_streams); | 330 size_t num_streams); |
| 331 | 331 |
| 332 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) | 332 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) |
| 333 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 333 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 334 | 334 |
| 335 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) | 335 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) |
| 336 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 336 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 337 void DestroyVideoEncoder(AllocatedEncoder* encoder) | 337 void DestroyVideoEncoder(AllocatedEncoder* encoder) |
| 338 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 338 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 339 void SetCodec(const VideoCodecSettings& codec) | 339 void SetCodec(const VideoCodecSettings& codec) |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 531 // TODO(deadbeef): Don't duplicate information between | 531 // TODO(deadbeef): Don't duplicate information between |
| 532 // send_params/recv_params, rtp_extensions, options, etc. | 532 // send_params/recv_params, rtp_extensions, options, etc. |
| 533 VideoSendParameters send_params_; | 533 VideoSendParameters send_params_; |
| 534 VideoOptions default_send_options_; | 534 VideoOptions default_send_options_; |
| 535 VideoRecvParameters recv_params_; | 535 VideoRecvParameters recv_params_; |
| 536 }; | 536 }; |
| 537 | 537 |
| 538 } // namespace cricket | 538 } // namespace cricket |
| 539 | 539 |
| 540 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 540 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| OLD | NEW |