| 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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 623 } | 623 } |
| 624 external_encoder_factory_ = encoder_factory; | 624 external_encoder_factory_ = encoder_factory; |
| 625 | 625 |
| 626 video_codecs_ = GetSupportedCodecs(); | 626 video_codecs_ = GetSupportedCodecs(); |
| 627 } | 627 } |
| 628 | 628 |
| 629 std::vector<VideoCodec> WebRtcVideoEngine2::GetSupportedCodecs() const { | 629 std::vector<VideoCodec> WebRtcVideoEngine2::GetSupportedCodecs() const { |
| 630 std::vector<VideoCodec> supported_codecs = DefaultVideoCodecList(); | 630 std::vector<VideoCodec> supported_codecs = DefaultVideoCodecList(); |
| 631 | 631 |
| 632 if (external_encoder_factory_ == NULL) { | 632 if (external_encoder_factory_ == NULL) { |
| 633 LOG(LS_INFO) << "Supported codecs: " |
| 634 << CodecVectorToString(supported_codecs); |
| 633 return supported_codecs; | 635 return supported_codecs; |
| 634 } | 636 } |
| 635 | 637 |
| 638 std::stringstream out; |
| 636 const std::vector<WebRtcVideoEncoderFactory::VideoCodec>& codecs = | 639 const std::vector<WebRtcVideoEncoderFactory::VideoCodec>& codecs = |
| 637 external_encoder_factory_->codecs(); | 640 external_encoder_factory_->codecs(); |
| 638 for (size_t i = 0; i < codecs.size(); ++i) { | 641 for (size_t i = 0; i < codecs.size(); ++i) { |
| 642 out << codecs[i].name; |
| 643 if (i != codecs.size() - 1) { |
| 644 out << ", "; |
| 645 } |
| 639 // Don't add internally-supported codecs twice. | 646 // Don't add internally-supported codecs twice. |
| 640 if (CodecIsInternallySupported(codecs[i].name)) { | 647 if (CodecIsInternallySupported(codecs[i].name)) { |
| 641 continue; | 648 continue; |
| 642 } | 649 } |
| 643 | 650 |
| 644 // External video encoders are given payloads 120-127. This also means that | 651 // External video encoders are given payloads 120-127. This also means that |
| 645 // we only support up to 8 external payload types. | 652 // we only support up to 8 external payload types. |
| 646 const int kExternalVideoPayloadTypeBase = 120; | 653 const int kExternalVideoPayloadTypeBase = 120; |
| 647 size_t payload_type = kExternalVideoPayloadTypeBase + i; | 654 size_t payload_type = kExternalVideoPayloadTypeBase + i; |
| 648 RTC_DCHECK(payload_type < 128); | 655 RTC_DCHECK(payload_type < 128); |
| 649 VideoCodec codec(static_cast<int>(payload_type), codecs[i].name, | 656 VideoCodec codec(static_cast<int>(payload_type), codecs[i].name, |
| 650 codecs[i].max_width, codecs[i].max_height, | 657 codecs[i].max_width, codecs[i].max_height, |
| 651 codecs[i].max_fps); | 658 codecs[i].max_fps); |
| 652 | 659 |
| 653 AddDefaultFeedbackParams(&codec); | 660 AddDefaultFeedbackParams(&codec); |
| 654 supported_codecs.push_back(codec); | 661 supported_codecs.push_back(codec); |
| 655 } | 662 } |
| 663 LOG(LS_INFO) << "Supported codecs (incl. external codecs): " |
| 664 << CodecVectorToString(supported_codecs); |
| 665 LOG(LS_INFO) << "Codecs supported by the external encoder factory: " |
| 666 << out.str(); |
| 656 return supported_codecs; | 667 return supported_codecs; |
| 657 } | 668 } |
| 658 | 669 |
| 659 WebRtcVideoChannel2::WebRtcVideoChannel2( | 670 WebRtcVideoChannel2::WebRtcVideoChannel2( |
| 660 webrtc::Call* call, | 671 webrtc::Call* call, |
| 661 const MediaConfig& config, | 672 const MediaConfig& config, |
| 662 const VideoOptions& options, | 673 const VideoOptions& options, |
| 663 const std::vector<VideoCodec>& recv_codecs, | 674 const std::vector<VideoCodec>& recv_codecs, |
| 664 WebRtcVideoEncoderFactory* external_encoder_factory, | 675 WebRtcVideoEncoderFactory* external_encoder_factory, |
| 665 WebRtcVideoDecoderFactory* external_decoder_factory) | 676 WebRtcVideoDecoderFactory* external_decoder_factory) |
| (...skipping 1910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2576 rtx_mapping[video_codecs[i].codec.id] != | 2587 rtx_mapping[video_codecs[i].codec.id] != |
| 2577 fec_settings.red_payload_type) { | 2588 fec_settings.red_payload_type) { |
| 2578 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; | 2589 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; |
| 2579 } | 2590 } |
| 2580 } | 2591 } |
| 2581 | 2592 |
| 2582 return video_codecs; | 2593 return video_codecs; |
| 2583 } | 2594 } |
| 2584 | 2595 |
| 2585 } // namespace cricket | 2596 } // namespace cricket |
| OLD | NEW |