| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 185 | 185 |
| 186 VideoCodec codec; | 186 VideoCodec codec; |
| 187 webrtc::FecConfig fec; | 187 webrtc::FecConfig fec; |
| 188 int rtx_payload_type; | 188 int rtx_payload_type; |
| 189 }; | 189 }; |
| 190 | 190 |
| 191 struct ChangedSendParameters { | 191 struct ChangedSendParameters { |
| 192 // These optionals are unset if not changed. | 192 // These optionals are unset if not changed. |
| 193 rtc::Optional<VideoCodecSettings> codec; | 193 rtc::Optional<VideoCodecSettings> codec; |
| 194 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; | 194 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; |
| 195 rtc::Optional<int> max_bandwidth_bps; | 195 // The outer optional is unset if the bandwidth limit has not changed; |
| 196 // the inner optional indicates if a bandwidth limit is in effect. |
| 197 rtc::Optional<rtc::Optional<int>> max_bandwidth_bps; |
| 196 rtc::Optional<bool> conference_mode; | 198 rtc::Optional<bool> conference_mode; |
| 197 rtc::Optional<webrtc::RtcpMode> rtcp_mode; | 199 rtc::Optional<webrtc::RtcpMode> rtcp_mode; |
| 198 }; | 200 }; |
| 199 | 201 |
| 200 struct ChangedRecvParameters { | 202 struct ChangedRecvParameters { |
| 201 // These optionals are unset if not changed. | 203 // These optionals are unset if not changed. |
| 202 rtc::Optional<std::vector<VideoCodecSettings>> codec_settings; | 204 rtc::Optional<std::vector<VideoCodecSettings>> codec_settings; |
| 203 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; | 205 rtc::Optional<std::vector<webrtc::RtpExtension>> rtp_header_extensions; |
| 204 }; | 206 }; |
| 205 | 207 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 232 : public rtc::VideoSinkInterface<cricket::VideoFrame>, | 234 : public rtc::VideoSinkInterface<cricket::VideoFrame>, |
| 233 public webrtc::LoadObserver { | 235 public webrtc::LoadObserver { |
| 234 public: | 236 public: |
| 235 WebRtcVideoSendStream( | 237 WebRtcVideoSendStream( |
| 236 webrtc::Call* call, | 238 webrtc::Call* call, |
| 237 const StreamParams& sp, | 239 const StreamParams& sp, |
| 238 const webrtc::VideoSendStream::Config& config, | 240 const webrtc::VideoSendStream::Config& config, |
| 239 const VideoOptions& options, | 241 const VideoOptions& options, |
| 240 WebRtcVideoEncoderFactory* external_encoder_factory, | 242 WebRtcVideoEncoderFactory* external_encoder_factory, |
| 241 bool enable_cpu_overuse_detection, | 243 bool enable_cpu_overuse_detection, |
| 242 int max_bitrate_bps, | 244 rtc::Optional<int> max_bitrate_bps, |
| 243 const rtc::Optional<VideoCodecSettings>& codec_settings, | 245 const rtc::Optional<VideoCodecSettings>& codec_settings, |
| 244 const std::vector<webrtc::RtpExtension>& rtp_extensions, | 246 const std::vector<webrtc::RtpExtension>& rtp_extensions, |
| 245 const VideoSendParameters& send_params); | 247 const VideoSendParameters& send_params); |
| 246 virtual ~WebRtcVideoSendStream(); | 248 virtual ~WebRtcVideoSendStream(); |
| 247 | 249 |
| 248 void SetOptions(const VideoOptions& options); | 250 void SetOptions(const VideoOptions& options); |
| 249 // TODO(pbos): Move logic from SetOptions into this method. | 251 // TODO(pbos): Move logic from SetOptions into this method. |
| 250 void SetSendParameters(const ChangedSendParameters& send_params); | 252 void SetSendParameters(const ChangedSendParameters& send_params); |
| 251 bool SetRtpParameters(const webrtc::RtpParameters& parameters); | 253 bool SetRtpParameters(const webrtc::RtpParameters& parameters); |
| 252 webrtc::RtpParameters GetRtpParameters() const; | 254 webrtc::RtpParameters GetRtpParameters() const; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 267 | 269 |
| 268 private: | 270 private: |
| 269 // Parameters needed to reconstruct the underlying stream. | 271 // Parameters needed to reconstruct the underlying stream. |
| 270 // 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 |
| 271 // 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 |
| 272 // similar parameters depending on which options changed etc. | 274 // similar parameters depending on which options changed etc. |
| 273 struct VideoSendStreamParameters { | 275 struct VideoSendStreamParameters { |
| 274 VideoSendStreamParameters( | 276 VideoSendStreamParameters( |
| 275 const webrtc::VideoSendStream::Config& config, | 277 const webrtc::VideoSendStream::Config& config, |
| 276 const VideoOptions& options, | 278 const VideoOptions& options, |
| 277 int max_bitrate_bps, | 279 rtc::Optional<int> max_bitrate_bps, |
| 278 const rtc::Optional<VideoCodecSettings>& codec_settings); | 280 const rtc::Optional<VideoCodecSettings>& codec_settings); |
| 279 webrtc::VideoSendStream::Config config; | 281 webrtc::VideoSendStream::Config config; |
| 280 VideoOptions options; | 282 VideoOptions options; |
| 281 int max_bitrate_bps; | 283 rtc::Optional<int> max_bitrate_bps; |
| 282 bool conference_mode; | 284 bool conference_mode; |
| 283 rtc::Optional<VideoCodecSettings> codec_settings; | 285 rtc::Optional<VideoCodecSettings> codec_settings; |
| 284 // Sent resolutions + bitrates etc. by the underlying VideoSendStream, | 286 // Sent resolutions + bitrates etc. by the underlying VideoSendStream, |
| 285 // typically changes when setting a new resolution or reconfiguring | 287 // typically changes when setting a new resolution or reconfiguring |
| 286 // bitrates. | 288 // bitrates. |
| 287 webrtc::VideoEncoderConfig encoder_config; | 289 webrtc::VideoEncoderConfig encoder_config; |
| 288 }; | 290 }; |
| 289 | 291 |
| 290 struct AllocatedEncoder { | 292 struct AllocatedEncoder { |
| 291 AllocatedEncoder(webrtc::VideoEncoder* encoder, | 293 AllocatedEncoder(webrtc::VideoEncoder* encoder, |
| (...skipping 20 matching lines...) Expand all Loading... |
| 312 | 314 |
| 313 union VideoEncoderSettings { | 315 union VideoEncoderSettings { |
| 314 webrtc::VideoCodecH264 h264; | 316 webrtc::VideoCodecH264 h264; |
| 315 webrtc::VideoCodecVP8 vp8; | 317 webrtc::VideoCodecVP8 vp8; |
| 316 webrtc::VideoCodecVP9 vp9; | 318 webrtc::VideoCodecVP9 vp9; |
| 317 }; | 319 }; |
| 318 | 320 |
| 319 static std::vector<webrtc::VideoStream> CreateVideoStreams( | 321 static std::vector<webrtc::VideoStream> CreateVideoStreams( |
| 320 const VideoCodec& codec, | 322 const VideoCodec& codec, |
| 321 const VideoOptions& options, | 323 const VideoOptions& options, |
| 322 int max_bitrate_bps, | 324 rtc::Optional<int> max_bitrate_bps, |
| 323 size_t num_streams); | 325 size_t num_streams); |
| 324 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( | 326 static std::vector<webrtc::VideoStream> CreateSimulcastVideoStreams( |
| 325 const VideoCodec& codec, | 327 const VideoCodec& codec, |
| 326 const VideoOptions& options, | 328 const VideoOptions& options, |
| 327 int max_bitrate_bps, | 329 rtc::Optional<int> max_bitrate_bps, |
| 328 size_t num_streams); | 330 size_t num_streams); |
| 329 | 331 |
| 330 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) | 332 void* ConfigureVideoEncoderSettings(const VideoCodec& codec) |
| 331 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 333 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 332 | 334 |
| 333 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) | 335 AllocatedEncoder CreateVideoEncoder(const VideoCodec& codec) |
| 334 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 336 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 335 void DestroyVideoEncoder(AllocatedEncoder* encoder) | 337 void DestroyVideoEncoder(AllocatedEncoder* encoder) |
| 336 EXCLUSIVE_LOCKS_REQUIRED(lock_); | 338 EXCLUSIVE_LOCKS_REQUIRED(lock_); |
| 337 void SetCodec(const VideoCodecSettings& codec) | 339 void SetCodec(const VideoCodecSettings& codec) |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 // TODO(deadbeef): Don't duplicate information between | 528 // TODO(deadbeef): Don't duplicate information between |
| 527 // send_params/recv_params, rtp_extensions, options, etc. | 529 // send_params/recv_params, rtp_extensions, options, etc. |
| 528 VideoSendParameters send_params_; | 530 VideoSendParameters send_params_; |
| 529 VideoOptions default_send_options_; | 531 VideoOptions default_send_options_; |
| 530 VideoRecvParameters recv_params_; | 532 VideoRecvParameters recv_params_; |
| 531 }; | 533 }; |
| 532 | 534 |
| 533 } // namespace cricket | 535 } // namespace cricket |
| 534 | 536 |
| 535 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 537 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
| OLD | NEW |