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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 channel->SetRenderer(default_recv_ssrc_, default_renderer_); | 481 channel->SetRenderer(default_recv_ssrc_, default_renderer_); |
482 } | 482 } |
483 } | 483 } |
484 | 484 |
485 WebRtcVideoEngine2::WebRtcVideoEngine2() | 485 WebRtcVideoEngine2::WebRtcVideoEngine2() |
486 : initialized_(false), | 486 : initialized_(false), |
487 external_decoder_factory_(NULL), | 487 external_decoder_factory_(NULL), |
488 external_encoder_factory_(NULL) { | 488 external_encoder_factory_(NULL) { |
489 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; | 489 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; |
490 video_codecs_ = GetSupportedCodecs(); | 490 video_codecs_ = GetSupportedCodecs(); |
491 rtp_header_extensions_.push_back( | |
492 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, | |
493 kRtpTimestampOffsetHeaderExtensionDefaultId)); | |
494 rtp_header_extensions_.push_back( | |
495 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, | |
496 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); | |
497 rtp_header_extensions_.push_back( | |
498 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, | |
499 kRtpVideoRotationHeaderExtensionDefaultId)); | |
500 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { | |
501 rtp_header_extensions_.push_back(RtpHeaderExtension( | |
502 kRtpTransportSequenceNumberHeaderExtension, | |
503 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); | |
504 } | |
505 } | 491 } |
506 | 492 |
507 WebRtcVideoEngine2::~WebRtcVideoEngine2() { | 493 WebRtcVideoEngine2::~WebRtcVideoEngine2() { |
508 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; | 494 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; |
509 } | 495 } |
510 | 496 |
511 void WebRtcVideoEngine2::Init() { | 497 void WebRtcVideoEngine2::Init() { |
512 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; | 498 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; |
513 initialized_ = true; | 499 initialized_ = true; |
514 } | 500 } |
(...skipping 27 matching lines...) Expand all Loading... |
542 RTC_DCHECK(initialized_); | 528 RTC_DCHECK(initialized_); |
543 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); | 529 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); |
544 return new WebRtcVideoChannel2(call, options, video_codecs_, | 530 return new WebRtcVideoChannel2(call, options, video_codecs_, |
545 external_encoder_factory_, external_decoder_factory_); | 531 external_encoder_factory_, external_decoder_factory_); |
546 } | 532 } |
547 | 533 |
548 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { | 534 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { |
549 return video_codecs_; | 535 return video_codecs_; |
550 } | 536 } |
551 | 537 |
552 const std::vector<RtpHeaderExtension>& | 538 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { |
553 WebRtcVideoEngine2::rtp_header_extensions() const { | 539 RtpCapabilities capabilities; |
554 return rtp_header_extensions_; | 540 capabilities.header_extensions.push_back( |
| 541 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, |
| 542 kRtpTimestampOffsetHeaderExtensionDefaultId)); |
| 543 capabilities.header_extensions.push_back( |
| 544 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, |
| 545 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); |
| 546 capabilities.header_extensions.push_back( |
| 547 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, |
| 548 kRtpVideoRotationHeaderExtensionDefaultId)); |
| 549 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { |
| 550 capabilities.header_extensions.push_back(RtpHeaderExtension( |
| 551 kRtpTransportSequenceNumberHeaderExtension, |
| 552 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); |
| 553 } |
| 554 return capabilities; |
555 } | 555 } |
556 | 556 |
557 void WebRtcVideoEngine2::SetExternalDecoderFactory( | 557 void WebRtcVideoEngine2::SetExternalDecoderFactory( |
558 WebRtcVideoDecoderFactory* decoder_factory) { | 558 WebRtcVideoDecoderFactory* decoder_factory) { |
559 RTC_DCHECK(!initialized_); | 559 RTC_DCHECK(!initialized_); |
560 external_decoder_factory_ = decoder_factory; | 560 external_decoder_factory_ = decoder_factory; |
561 } | 561 } |
562 | 562 |
563 void WebRtcVideoEngine2::SetExternalEncoderFactory( | 563 void WebRtcVideoEngine2::SetExternalEncoderFactory( |
564 WebRtcVideoEncoderFactory* encoder_factory) { | 564 WebRtcVideoEncoderFactory* encoder_factory) { |
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2683 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2683 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2684 } | 2684 } |
2685 } | 2685 } |
2686 | 2686 |
2687 return video_codecs; | 2687 return video_codecs; |
2688 } | 2688 } |
2689 | 2689 |
2690 } // namespace cricket | 2690 } // namespace cricket |
2691 | 2691 |
2692 #endif // HAVE_WEBRTC_VIDEO | 2692 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |