Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(360)

Side by Side Diff: webrtc/media/engine/webrtcvideoengine2.cc

Issue 2489173004: Revert of Stop caching supported codecs in WebRtcVideoEngine2 (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | webrtc/pc/channelmanager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 525 matching lines...) Expand 10 before | Expand all | Expand 10 after
536 if (default_recv_ssrc_ != 0) { 536 if (default_recv_ssrc_ != 0) {
537 channel->SetSink(default_recv_ssrc_, default_sink_); 537 channel->SetSink(default_recv_ssrc_, default_sink_);
538 } 538 }
539 } 539 }
540 540
541 WebRtcVideoEngine2::WebRtcVideoEngine2() 541 WebRtcVideoEngine2::WebRtcVideoEngine2()
542 : initialized_(false), 542 : initialized_(false),
543 external_decoder_factory_(NULL), 543 external_decoder_factory_(NULL),
544 external_encoder_factory_(NULL) { 544 external_encoder_factory_(NULL) {
545 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()"; 545 LOG(LS_INFO) << "WebRtcVideoEngine2::WebRtcVideoEngine2()";
546 video_codecs_ = GetSupportedCodecs(external_encoder_factory_);
546 } 547 }
547 548
548 WebRtcVideoEngine2::~WebRtcVideoEngine2() { 549 WebRtcVideoEngine2::~WebRtcVideoEngine2() {
549 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2"; 550 LOG(LS_INFO) << "WebRtcVideoEngine2::~WebRtcVideoEngine2";
550 } 551 }
551 552
552 void WebRtcVideoEngine2::Init() { 553 void WebRtcVideoEngine2::Init() {
553 LOG(LS_INFO) << "WebRtcVideoEngine2::Init"; 554 LOG(LS_INFO) << "WebRtcVideoEngine2::Init";
554 initialized_ = true; 555 initialized_ = true;
555 } 556 }
556 557
557 WebRtcVideoChannel2* WebRtcVideoEngine2::CreateChannel( 558 WebRtcVideoChannel2* WebRtcVideoEngine2::CreateChannel(
558 webrtc::Call* call, 559 webrtc::Call* call,
559 const MediaConfig& config, 560 const MediaConfig& config,
560 const VideoOptions& options) { 561 const VideoOptions& options) {
561 RTC_DCHECK(initialized_); 562 RTC_DCHECK(initialized_);
562 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString(); 563 LOG(LS_INFO) << "CreateChannel. Options: " << options.ToString();
563 return new WebRtcVideoChannel2(call, config, options, 564 return new WebRtcVideoChannel2(call, config, options,
564 external_encoder_factory_, 565 external_encoder_factory_,
565 external_decoder_factory_); 566 external_decoder_factory_);
566 } 567 }
567 568
568 const std::vector<VideoCodec> WebRtcVideoEngine2::codecs() const { 569 const std::vector<VideoCodec>& WebRtcVideoEngine2::codecs() const {
569 return GetSupportedCodecs(external_encoder_factory_); 570 return video_codecs_;
570 } 571 }
571 572
572 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const { 573 RtpCapabilities WebRtcVideoEngine2::GetCapabilities() const {
573 RtpCapabilities capabilities; 574 RtpCapabilities capabilities;
574 capabilities.header_extensions.push_back( 575 capabilities.header_extensions.push_back(
575 webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri, 576 webrtc::RtpExtension(webrtc::RtpExtension::kTimestampOffsetUri,
576 webrtc::RtpExtension::kTimestampOffsetDefaultId)); 577 webrtc::RtpExtension::kTimestampOffsetDefaultId));
577 capabilities.header_extensions.push_back( 578 capabilities.header_extensions.push_back(
578 webrtc::RtpExtension(webrtc::RtpExtension::kAbsSendTimeUri, 579 webrtc::RtpExtension(webrtc::RtpExtension::kAbsSendTimeUri,
579 webrtc::RtpExtension::kAbsSendTimeDefaultId)); 580 webrtc::RtpExtension::kAbsSendTimeDefaultId));
(...skipping 26 matching lines...) Expand all
606 simulcast_encoder_factory_.reset(); 607 simulcast_encoder_factory_.reset();
607 608
608 if (encoder_factory && 609 if (encoder_factory &&
609 WebRtcSimulcastEncoderFactory::UseSimulcastEncoderFactory( 610 WebRtcSimulcastEncoderFactory::UseSimulcastEncoderFactory(
610 encoder_factory->supported_codecs())) { 611 encoder_factory->supported_codecs())) {
611 simulcast_encoder_factory_.reset( 612 simulcast_encoder_factory_.reset(
612 new WebRtcSimulcastEncoderFactory(encoder_factory)); 613 new WebRtcSimulcastEncoderFactory(encoder_factory));
613 encoder_factory = simulcast_encoder_factory_.get(); 614 encoder_factory = simulcast_encoder_factory_.get();
614 } 615 }
615 external_encoder_factory_ = encoder_factory; 616 external_encoder_factory_ = encoder_factory;
617
618 video_codecs_ = GetSupportedCodecs(encoder_factory);
616 } 619 }
617 620
618 static std::vector<VideoCodec> GetSupportedCodecs( 621 static std::vector<VideoCodec> GetSupportedCodecs(
619 const WebRtcVideoEncoderFactory* external_encoder_factory) { 622 const WebRtcVideoEncoderFactory* external_encoder_factory) {
620 std::vector<VideoCodec> supported_codecs = DefaultVideoCodecList(); 623 std::vector<VideoCodec> supported_codecs = DefaultVideoCodecList();
621 624
622 if (external_encoder_factory == nullptr) { 625 if (external_encoder_factory == nullptr) {
623 LOG(LS_INFO) << "Supported codecs: " 626 LOG(LS_INFO) << "Supported codecs: "
624 << CodecVectorToString(supported_codecs); 627 << CodecVectorToString(supported_codecs);
625 return supported_codecs; 628 return supported_codecs;
(...skipping 1945 matching lines...) Expand 10 before | Expand all | Expand 10 after
2571 rtx_mapping[video_codecs[i].codec.id] != 2574 rtx_mapping[video_codecs[i].codec.id] !=
2572 ulpfec_config.red_payload_type) { 2575 ulpfec_config.red_payload_type) {
2573 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2576 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2574 } 2577 }
2575 } 2578 }
2576 2579
2577 return video_codecs; 2580 return video_codecs;
2578 } 2581 }
2579 2582
2580 } // namespace cricket 2583 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine2.h ('k') | webrtc/pc/channelmanager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698