OLD | NEW |
1 /* | 1 /* |
2 * libjingle | 2 * libjingle |
3 * Copyright 2014 Google Inc. | 3 * Copyright 2014 Google Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions are met: | 6 * modification, are permitted provided that the following conditions are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright notice, | 8 * 1. Redistributions of source code must retain the above copyright notice, |
9 * this list of conditions and the following disclaimer. | 9 * this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright notice, | 10 * 2. Redistributions in binary form must reproduce the above copyright notice, |
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
549 channel->SetRenderer(default_recv_ssrc_, default_renderer_); | 549 channel->SetRenderer(default_recv_ssrc_, default_renderer_); |
550 } | 550 } |
551 } | 551 } |
552 | 552 |
553 WebRtcVideoEngine2::WebRtcVideoEngine2() | 553 WebRtcVideoEngine2::WebRtcVideoEngine2() |
554 : initialized_(false), | 554 : initialized_(false), |
555 external_decoder_factory_(NULL), | 555 external_decoder_factory_(NULL), |
556 external_encoder_factory_(NULL) { | 556 external_encoder_factory_(NULL) { |
557 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; | 557 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; |
558 video_codecs_ = GetSupportedCodecs(); | 558 video_codecs_ = GetSupportedCodecs(); |
559 rtp_header_extensions_.push_back( | |
560 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, | |
561 kRtpTimestampOffsetHeaderExtensionDefaultId)); | |
562 rtp_header_extensions_.push_back( | |
563 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, | |
564 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); | |
565 rtp_header_extensions_.push_back( | |
566 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, | |
567 kRtpVideoRotationHeaderExtensionDefaultId)); | |
568 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { | |
569 rtp_header_extensions_.push_back(RtpHeaderExtension( | |
570 kRtpTransportSequenceNumberHeaderExtension, | |
571 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); | |
572 } | |
573 } | 559 } |
574 | 560 |
575 WebRtcVideoEngine2::~WebRtcVideoEngine2() { | 561 WebRtcVideoEngine2::~WebRtcVideoEngine2() { |
576 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; | 562 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; |
577 } | 563 } |
578 | 564 |
579 void WebRtcVideoEngine2::Init() { | 565 void WebRtcVideoEngine2::Init() { |
580 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; | 566 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; |
581 initialized_ = true; | 567 initialized_ = true; |
582 } | 568 } |
(...skipping 27 matching lines...) Expand all Loading... |
610 RTC_DCHECK(initialized_); | 596 RTC_DCHECK(initialized_); |
611 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); | 597 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); |
612 return new WebRtcVideoChannel2(call, options, video_codecs_, | 598 return new WebRtcVideoChannel2(call, options, video_codecs_, |
613 external_encoder_factory_, external_decoder_factory_); | 599 external_encoder_factory_, external_decoder_factory_); |
614 } | 600 } |
615 | 601 |
616 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { | 602 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { |
617 return video_codecs_; | 603 return video_codecs_; |
618 } | 604 } |
619 | 605 |
620 const std::vector<RtpHeaderExtension>& | 606 std::vector<RtpHeaderExtension> |
621 WebRtcVideoEngine2::rtp_header_extensions() const { | 607 WebRtcVideoEngine2::SupportedRtpHeaderExtensions() const { |
622 return rtp_header_extensions_; | 608 std::vector<RtpHeaderExtension> rtp_header_extensions; |
| 609 rtp_header_extensions.push_back( |
| 610 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, |
| 611 kRtpTimestampOffsetHeaderExtensionDefaultId)); |
| 612 rtp_header_extensions.push_back( |
| 613 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, |
| 614 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); |
| 615 rtp_header_extensions.push_back( |
| 616 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, |
| 617 kRtpVideoRotationHeaderExtensionDefaultId)); |
| 618 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { |
| 619 rtp_header_extensions.push_back(RtpHeaderExtension( |
| 620 kRtpTransportSequenceNumberHeaderExtension, |
| 621 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); |
| 622 } |
| 623 return rtp_header_extensions; |
623 } | 624 } |
624 | 625 |
625 void WebRtcVideoEngine2::SetExternalDecoderFactory( | 626 void WebRtcVideoEngine2::SetExternalDecoderFactory( |
626 WebRtcVideoDecoderFactory* decoder_factory) { | 627 WebRtcVideoDecoderFactory* decoder_factory) { |
627 RTC_DCHECK(!initialized_); | 628 RTC_DCHECK(!initialized_); |
628 external_decoder_factory_ = decoder_factory; | 629 external_decoder_factory_ = decoder_factory; |
629 } | 630 } |
630 | 631 |
631 void WebRtcVideoEngine2::SetExternalEncoderFactory( | 632 void WebRtcVideoEngine2::SetExternalEncoderFactory( |
632 WebRtcVideoEncoderFactory* encoder_factory) { | 633 WebRtcVideoEncoderFactory* encoder_factory) { |
(...skipping 2123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2756 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2757 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2757 } | 2758 } |
2758 } | 2759 } |
2759 | 2760 |
2760 return video_codecs; | 2761 return video_codecs; |
2761 } | 2762 } |
2762 | 2763 |
2763 } // namespace cricket | 2764 } // namespace cricket |
2764 | 2765 |
2765 #endif // HAVE_WEBRTC_VIDEO | 2766 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |