| 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 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 if (default_recv_ssrc_ != 0) { | 490 if (default_recv_ssrc_ != 0) { |
| 491 channel->SetSink(default_recv_ssrc_, default_sink_); | 491 channel->SetSink(default_recv_ssrc_, default_sink_); |
| 492 } | 492 } |
| 493 } | 493 } |
| 494 | 494 |
| 495 WebRtcVideoEngine2::WebRtcVideoEngine2() | 495 WebRtcVideoEngine2::WebRtcVideoEngine2() |
| 496 : initialized_(false), | 496 : initialized_(false), |
| 497 external_decoder_factory_(NULL), | 497 external_decoder_factory_(NULL), |
| 498 external_encoder_factory_(NULL) { | 498 external_encoder_factory_(NULL) { |
| 499 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; | 499 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; |
| 500 video_codecs_ = GetSupportedCodecs(external_encoder_factory_); | |
| 501 } | 500 } |
| 502 | 501 |
| 503 WebRtcVideoEngine2::~WebRtcVideoEngine2() { | 502 WebRtcVideoEngine2::~WebRtcVideoEngine2() { |
| 504 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; | 503 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; |
| 505 } | 504 } |
| 506 | 505 |
| 507 void WebRtcVideoEngine2::Init() { | 506 void WebRtcVideoEngine2::Init() { |
| 508 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; | 507 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; |
| 509 initialized_ = true; | 508 initialized_ = true; |
| 510 } | 509 } |
| 511 | 510 |
| 512 WebRtcVideoChannel2* WebRtcVideoEngine2::CreateChannel( | 511 WebRtcVideoChannel2* WebRtcVideoEngine2::CreateChannel( |
| 513 webrtc::Call* call, | 512 webrtc::Call* call, |
| 514 const MediaConfig& config, | 513 const MediaConfig& config, |
| 515 const VideoOptions& options) { | 514 const VideoOptions& options) { |
| 516 RTC_DCHECK(initialized_); | 515 RTC_DCHECK(initialized_); |
| 517 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); | 516 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); |
| 518 return new WebRtcVideoChannel2(call, config, options, | 517 return new WebRtcVideoChannel2(call, config, options, |
| 519 external_encoder_factory_, | 518 external_encoder_factory_, |
| 520 external_decoder_factory_); | 519 external_decoder_factory_); |
| 521 } | 520 } |
| 522 | 521 |
| 523 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const { | 522 std::vector<VideoCodec> WebRtcVideoEngine2::codecs() const { |
| 524 return video_codecs_; | 523 return GetSupportedCodecs(external_encoder_factory_); |
| 525 } | 524 } |
| 526 | 525 |
| 527 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { | 526 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { |
| 528 RtpCapabilities capabilities; | 527 RtpCapabilities capabilities; |
| 529 capabilities.header_extensions.push_back( | 528 capabilities.header_extensions.push_back( |
| 530 webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri, | 529 webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri, |
| 531 webrtc::RtpExtension::kTimestampOffsetDefaultId)); | 530 webrtc::RtpExtension::kTimestampOffsetDefaultId)); |
| 532 capabilities.header_extensions.push_back( | 531 capabilities.header_extensions.push_back( |
| 533 webrtc::RtpExtension(webrtc::RtpExtension::kAbsSendTimeUri, | 532 webrtc::RtpExtension(webrtc::RtpExtension::kAbsSendTimeUri, |
| 534 webrtc::RtpExtension::kAbsSendTimeDefaultId)); | 533 webrtc::RtpExtension::kAbsSendTimeDefaultId)); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 561 simulcast_encoder_factory_.reset(); | 560 simulcast_encoder_factory_.reset(); |
| 562 | 561 |
| 563 if (encoder_factory && | 562 if (encoder_factory && |
| 564 WebRtcSimulcastEncoderFactory::UseSimulcastEncoderFactory( | 563 WebRtcSimulcastEncoderFactory::UseSimulcastEncoderFactory( |
| 565 encoder_factory->supported_codecs())) { | 564 encoder_factory->supported_codecs())) { |
| 566 simulcast_encoder_factory_.reset( | 565 simulcast_encoder_factory_.reset( |
| 567 new WebRtcSimulcastEncoderFactory(encoder_factory)); | 566 new WebRtcSimulcastEncoderFactory(encoder_factory)); |
| 568 encoder_factory = simulcast_encoder_factory_.get(); | 567 encoder_factory = simulcast_encoder_factory_.get(); |
| 569 } | 568 } |
| 570 external_encoder_factory_ = encoder_factory; | 569 external_encoder_factory_ = encoder_factory; |
| 571 | |
| 572 video_codecs_ = GetSupportedCodecs(encoder_factory); | |
| 573 } | 570 } |
| 574 | 571 |
| 575 // This is a helper function for AppendVideoCodecs below. It will return the | 572 // This is a helper function for AppendVideoCodecs below. It will return the |
| 576 // first unused dynamic payload type (in the range [96, 127]), or nothing if no | 573 // first unused dynamic payload type (in the range [96, 127]), or nothing if no |
| 577 // payload type is unused. | 574 // payload type is unused. |
| 578 static rtc::Optional<int> NextFreePayloadType( | 575 static rtc::Optional<int> NextFreePayloadType( |
| 579 const std::vector<VideoCodec>& codecs) { | 576 const std::vector<VideoCodec>& codecs) { |
| 580 static const int kFirstDynamicPayloadType = 96; | 577 static const int kFirstDynamicPayloadType = 96; |
| 581 static const int kLastDynamicPayloadType = 127; | 578 static const int kLastDynamicPayloadType = 127; |
| 582 bool is_payload_used[1 + kLastDynamicPayloadType - kFirstDynamicPayloadType] = | 579 bool is_payload_used[1 + kLastDynamicPayloadType - kFirstDynamicPayloadType] = |
| (...skipping 2032 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2615 rtx_mapping[video_codecs[i].codec.id] != | 2612 rtx_mapping[video_codecs[i].codec.id] != |
| 2616 ulpfec_config.red_payload_type) { | 2613 ulpfec_config.red_payload_type) { |
| 2617 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2614 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
| 2618 } | 2615 } |
| 2619 } | 2616 } |
| 2620 | 2617 |
| 2621 return video_codecs; | 2618 return video_codecs; |
| 2622 } | 2619 } |
| 2623 | 2620 |
| 2624 } // namespace cricket | 2621 } // namespace cricket |
| OLD | NEW |