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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 // rtc::VideoSinkInterface<cricket::VideoFrame>. | 415 // rtc::VideoSinkInterface<cricket::VideoFrame>. |
416 class WebRtcVideoReceiveStream | 416 class WebRtcVideoReceiveStream |
417 : public rtc::VideoSinkInterface<webrtc::VideoFrame> { | 417 : public rtc::VideoSinkInterface<webrtc::VideoFrame> { |
418 public: | 418 public: |
419 WebRtcVideoReceiveStream( | 419 WebRtcVideoReceiveStream( |
420 webrtc::Call* call, | 420 webrtc::Call* call, |
421 const StreamParams& sp, | 421 const StreamParams& sp, |
422 const webrtc::VideoReceiveStream::Config& config, | 422 const webrtc::VideoReceiveStream::Config& config, |
423 WebRtcVideoDecoderFactory* external_decoder_factory, | 423 WebRtcVideoDecoderFactory* external_decoder_factory, |
424 bool default_stream, | 424 bool default_stream, |
425 const std::vector<VideoCodecSettings>& recv_codecs); | 425 const std::vector<VideoCodecSettings>& recv_codecs, |
| 426 bool red_disabled_by_remote_side); |
426 ~WebRtcVideoReceiveStream(); | 427 ~WebRtcVideoReceiveStream(); |
427 | 428 |
428 const std::vector<uint32_t>& GetSsrcs() const; | 429 const std::vector<uint32_t>& GetSsrcs() const; |
429 | 430 |
430 void SetLocalSsrc(uint32_t local_ssrc); | 431 void SetLocalSsrc(uint32_t local_ssrc); |
431 // TODO(deadbeef): Move these feedback parameters into the recv parameters. | 432 // TODO(deadbeef): Move these feedback parameters into the recv parameters. |
432 void SetFeedbackParameters(bool nack_enabled, | 433 void SetFeedbackParameters(bool nack_enabled, |
433 bool remb_enabled, | 434 bool remb_enabled, |
434 bool transport_cc_enabled, | 435 bool transport_cc_enabled, |
435 webrtc::RtcpMode rtcp_mode); | 436 webrtc::RtcpMode rtcp_mode); |
436 void SetRecvParameters(const ChangedRecvParameters& recv_params); | 437 void SetRecvParameters(const ChangedRecvParameters& recv_params); |
437 | 438 |
438 void OnFrame(const webrtc::VideoFrame& frame) override; | 439 void OnFrame(const webrtc::VideoFrame& frame) override; |
439 bool IsDefaultStream() const; | 440 bool IsDefaultStream() const; |
440 | 441 |
441 void SetSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink); | 442 void SetSink(rtc::VideoSinkInterface<cricket::VideoFrame>* sink); |
442 | 443 |
443 VideoReceiverInfo GetVideoReceiverInfo(); | 444 VideoReceiverInfo GetVideoReceiverInfo(); |
444 | 445 |
| 446 // Used to disable RED/FEC when the remote description doesn't contain those |
| 447 // codecs. This is needed to be able to work around an RTX bug which is only |
| 448 // happening if the remote side doesn't send RED, but the local side is |
| 449 // configured to receive RED. |
| 450 // TODO(holmer): Remove this after a couple of Chrome versions, M53-54 |
| 451 // time frame. |
| 452 void SetFecDisabledRemotely(bool disable); |
| 453 |
445 private: | 454 private: |
446 struct AllocatedDecoder { | 455 struct AllocatedDecoder { |
447 AllocatedDecoder(webrtc::VideoDecoder* decoder, | 456 AllocatedDecoder(webrtc::VideoDecoder* decoder, |
448 webrtc::VideoCodecType type, | 457 webrtc::VideoCodecType type, |
449 bool external); | 458 bool external); |
450 webrtc::VideoDecoder* decoder; | 459 webrtc::VideoDecoder* decoder; |
451 // Decoder wrapped into a fallback decoder to permit software fallback. | 460 // Decoder wrapped into a fallback decoder to permit software fallback. |
452 webrtc::VideoDecoder* external_decoder; | 461 webrtc::VideoDecoder* external_decoder; |
453 webrtc::VideoCodecType type; | 462 webrtc::VideoCodecType type; |
454 bool external; | 463 bool external; |
(...skipping 10 matching lines...) Expand all Loading... |
465 | 474 |
466 std::string GetCodecNameFromPayloadType(int payload_type); | 475 std::string GetCodecNameFromPayloadType(int payload_type); |
467 | 476 |
468 webrtc::Call* const call_; | 477 webrtc::Call* const call_; |
469 const std::vector<uint32_t> ssrcs_; | 478 const std::vector<uint32_t> ssrcs_; |
470 const std::vector<SsrcGroup> ssrc_groups_; | 479 const std::vector<SsrcGroup> ssrc_groups_; |
471 | 480 |
472 webrtc::VideoReceiveStream* stream_; | 481 webrtc::VideoReceiveStream* stream_; |
473 const bool default_stream_; | 482 const bool default_stream_; |
474 webrtc::VideoReceiveStream::Config config_; | 483 webrtc::VideoReceiveStream::Config config_; |
| 484 bool red_disabled_by_remote_side_; |
475 | 485 |
476 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 486 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
477 std::vector<AllocatedDecoder> allocated_decoders_; | 487 std::vector<AllocatedDecoder> allocated_decoders_; |
478 | 488 |
479 rtc::CriticalSection sink_lock_; | 489 rtc::CriticalSection sink_lock_; |
480 rtc::VideoSinkInterface<cricket::VideoFrame>* sink_ GUARDED_BY(sink_lock_); | 490 rtc::VideoSinkInterface<cricket::VideoFrame>* sink_ GUARDED_BY(sink_lock_); |
481 int last_width_ GUARDED_BY(sink_lock_); | 491 int last_width_ GUARDED_BY(sink_lock_); |
482 int last_height_ GUARDED_BY(sink_lock_); | 492 int last_height_ GUARDED_BY(sink_lock_); |
483 // Expands remote RTP timestamps to int64_t to be able to estimate how long | 493 // Expands remote RTP timestamps to int64_t to be able to estimate how long |
484 // the stream has been running. | 494 // the stream has been running. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 WebRtcVideoEncoderFactory* const external_encoder_factory_; | 545 WebRtcVideoEncoderFactory* const external_encoder_factory_; |
536 WebRtcVideoDecoderFactory* const external_decoder_factory_; | 546 WebRtcVideoDecoderFactory* const external_decoder_factory_; |
537 std::vector<VideoCodecSettings> recv_codecs_; | 547 std::vector<VideoCodecSettings> recv_codecs_; |
538 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; | 548 std::vector<webrtc::RtpExtension> recv_rtp_extensions_; |
539 webrtc::Call::Config::BitrateConfig bitrate_config_; | 549 webrtc::Call::Config::BitrateConfig bitrate_config_; |
540 // TODO(deadbeef): Don't duplicate information between | 550 // TODO(deadbeef): Don't duplicate information between |
541 // send_params/recv_params, rtp_extensions, options, etc. | 551 // send_params/recv_params, rtp_extensions, options, etc. |
542 VideoSendParameters send_params_; | 552 VideoSendParameters send_params_; |
543 VideoOptions default_send_options_; | 553 VideoOptions default_send_options_; |
544 VideoRecvParameters recv_params_; | 554 VideoRecvParameters recv_params_; |
| 555 bool red_disabled_by_remote_side_; |
545 }; | 556 }; |
546 | 557 |
547 } // namespace cricket | 558 } // namespace cricket |
548 | 559 |
549 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ | 560 #endif // WEBRTC_MEDIA_ENGINE_WEBRTCVIDEOENGINE2_H_ |
OLD | NEW |