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 |
pbos-webrtc
2015/12/04 14:18:24
clang-format this fits on one line
stefan-webrtc
2015/12/04 14:32:09
Done.
| |
553 WebRtcVideoEngine2::rtp_header_extensions() const { | 539 WebRtcVideoEngine2::GetCapabilities() const { |
554 return rtp_header_extensions_; | 540 RtpCapabilities capabilities; |
541 capabilities.header_extensions.push_back( | |
542 RtpHeaderExtension(kRtpTimestampOffsetHeaderExtension, | |
543 kRtpTimestampOffsetHeaderExtensionDefaultId)); | |
544 capabilities.header_extensions.push_back( | |
545 RtpHeaderExtension(kRtpAbsoluteSenderTimeHeaderExtension, | |
546 kRtpAbsoluteSenderTimeHeaderExtensionDefaultId)); | |
547 capabilities.header_extensions.push_back( | |
548 RtpHeaderExtension(kRtpVideoRotationHeaderExtension, | |
549 kRtpVideoRotationHeaderExtensionDefaultId)); | |
550 if (webrtc::field_trial::FindFullName("WebRTC-SendSideBwe") == "Enabled") { | |
551 capabilities.header_extensions.push_back(RtpHeaderExtension( | |
552 kRtpTransportSequenceNumberHeaderExtension, | |
553 kRtpTransportSequenceNumberHeaderExtensionDefaultId)); | |
554 } | |
555 return capabilities; | |
555 } | 556 } |
556 | 557 |
557 void WebRtcVideoEngine2::SetExternalDecoderFactory( | 558 void WebRtcVideoEngine2::SetExternalDecoderFactory( |
558 WebRtcVideoDecoderFactory* decoder_factory) { | 559 WebRtcVideoDecoderFactory* decoder_factory) { |
559 RTC_DCHECK(!initialized_); | 560 RTC_DCHECK(!initialized_); |
560 external_decoder_factory_ = decoder_factory; | 561 external_decoder_factory_ = decoder_factory; |
561 } | 562 } |
562 | 563 |
563 void WebRtcVideoEngine2::SetExternalEncoderFactory( | 564 void WebRtcVideoEngine2::SetExternalEncoderFactory( |
564 WebRtcVideoEncoderFactory* encoder_factory) { | 565 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]; | 2684 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
2684 } | 2685 } |
2685 } | 2686 } |
2686 | 2687 |
2687 return video_codecs; | 2688 return video_codecs; |
2688 } | 2689 } |
2689 | 2690 |
2690 } // namespace cricket | 2691 } // namespace cricket |
2691 | 2692 |
2692 #endif // HAVE_WEBRTC_VIDEO | 2693 #endif // HAVE_WEBRTC_VIDEO |
OLD | NEW |