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

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

Issue 2408153002: Remove cricket::VideoCodec with, height and framerate properties (Closed)
Patch Set: Rebased Created 4 years, 2 months 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
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 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamCcm, kRtcpFbCcmParamFir)); 175 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamCcm, kRtcpFbCcmParamFir));
176 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kParamValueEmpty)); 176 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kParamValueEmpty));
177 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kRtcpFbNackParamPli)); 177 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamNack, kRtcpFbNackParamPli));
178 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty)); 178 codec->AddFeedbackParam(FeedbackParam(kRtcpFbParamRemb, kParamValueEmpty));
179 codec->AddFeedbackParam( 179 codec->AddFeedbackParam(
180 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty)); 180 FeedbackParam(kRtcpFbParamTransportCc, kParamValueEmpty));
181 } 181 }
182 182
183 static VideoCodec MakeVideoCodecWithDefaultFeedbackParams(int payload_type, 183 static VideoCodec MakeVideoCodecWithDefaultFeedbackParams(int payload_type,
184 const char* name) { 184 const char* name) {
185 VideoCodec codec(payload_type, name, kDefaultVideoMaxWidth, 185 VideoCodec codec(payload_type, name);
186 kDefaultVideoMaxHeight, kDefaultVideoMaxFramerate);
187 AddDefaultFeedbackParams(&codec); 186 AddDefaultFeedbackParams(&codec);
188 return codec; 187 return codec;
189 } 188 }
190 189
191 static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) { 190 static std::string CodecVectorToString(const std::vector<VideoCodec>& codecs) {
192 std::stringstream out; 191 std::stringstream out;
193 out << '{'; 192 out << '{';
194 for (size_t i = 0; i < codecs.size(); ++i) { 193 for (size_t i = 0; i < codecs.size(); ++i) {
195 out << codecs[i].ToString(); 194 out << codecs[i].ToString();
196 if (i != codecs.size() - 1) { 195 if (i != codecs.size() - 1) {
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 // we only support up to 8 external payload types. 666 // we only support up to 8 external payload types.
668 // TODO(deadbeef): mediasession.cc already has code to dynamically 667 // TODO(deadbeef): mediasession.cc already has code to dynamically
669 // determine a payload type. We should be able to just leave the payload 668 // determine a payload type. We should be able to just leave the payload
670 // type empty and let mediasession determine it. However, currently RTX 669 // type empty and let mediasession determine it. However, currently RTX
671 // codecs are associated to codecs by payload type, meaning we DO need 670 // codecs are associated to codecs by payload type, meaning we DO need
672 // to allocate unique payload types here. So to make this change we would 671 // to allocate unique payload types here. So to make this change we would
673 // need to make RTX codecs associated by name instead. 672 // need to make RTX codecs associated by name instead.
674 const int kExternalVideoPayloadTypeBase = 120; 673 const int kExternalVideoPayloadTypeBase = 120;
675 size_t payload_type = kExternalVideoPayloadTypeBase + i; 674 size_t payload_type = kExternalVideoPayloadTypeBase + i;
676 RTC_DCHECK(payload_type < 128); 675 RTC_DCHECK(payload_type < 128);
677 VideoCodec codec(static_cast<int>(payload_type), codecs[i].name, 676 VideoCodec codec(static_cast<int>(payload_type), codecs[i].name);
678 codecs[i].max_width, codecs[i].max_height,
679 codecs[i].max_fps);
680 677
681 AddDefaultFeedbackParams(&codec); 678 AddDefaultFeedbackParams(&codec);
682 AddCodecAndMaybeRtxCodec(codec, &supported_codecs); 679 AddCodecAndMaybeRtxCodec(codec, &supported_codecs);
683 } 680 }
684 LOG(LS_INFO) << "Supported codecs (incl. external codecs): " 681 LOG(LS_INFO) << "Supported codecs (incl. external codecs): "
685 << CodecVectorToString(supported_codecs); 682 << CodecVectorToString(supported_codecs);
686 LOG(LS_INFO) << "Codecs supported by the external encoder factory: " 683 LOG(LS_INFO) << "Codecs supported by the external encoder factory: "
687 << out.str(); 684 << out.str();
688 return supported_codecs; 685 return supported_codecs;
689 } 686 }
(...skipping 1308 matching lines...) Expand 10 before | Expand all | Expand 10 after
1998 parameters_.max_bitrate_bps); 1995 parameters_.max_bitrate_bps);
1999 1996
2000 int codec_max_bitrate_kbps; 1997 int codec_max_bitrate_kbps;
2001 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) { 1998 if (codec.GetParam(kCodecParamMaxBitrate, &codec_max_bitrate_kbps)) {
2002 stream_max_bitrate = codec_max_bitrate_kbps * 1000; 1999 stream_max_bitrate = codec_max_bitrate_kbps * 1000;
2003 } 2000 }
2004 encoder_config.max_bitrate_bps = stream_max_bitrate; 2001 encoder_config.max_bitrate_bps = stream_max_bitrate;
2005 2002
2006 int max_qp = kDefaultQpMax; 2003 int max_qp = kDefaultQpMax;
2007 codec.GetParam(kCodecParamMaxQuantization, &max_qp); 2004 codec.GetParam(kCodecParamMaxQuantization, &max_qp);
2008 int max_framerate =
2009 codec.framerate != 0 ? codec.framerate : kDefaultVideoMaxFramerate;
2010
2011 encoder_config.video_stream_factory = 2005 encoder_config.video_stream_factory =
2012 new rtc::RefCountedObject<EncoderStreamFactory>( 2006 new rtc::RefCountedObject<EncoderStreamFactory>(
2013 codec.name, max_qp, max_framerate, is_screencast, 2007 codec.name, max_qp, kDefaultVideoMaxFramerate, is_screencast,
2014 parameters_.conference_mode); 2008 parameters_.conference_mode);
2015 return encoder_config; 2009 return encoder_config;
2016 } 2010 }
2017 2011
2018 void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() { 2012 void WebRtcVideoChannel2::WebRtcVideoSendStream::ReconfigureEncoder() {
2019 RTC_DCHECK_RUN_ON(&thread_checker_); 2013 RTC_DCHECK_RUN_ON(&thread_checker_);
2020 if (!stream_) { 2014 if (!stream_) {
2021 // The webrtc::VideoSendStream |stream_|has not yet been created but other 2015 // The webrtc::VideoSendStream |stream_|has not yet been created but other
2022 // parameters has changed. 2016 // parameters has changed.
2023 return; 2017 return;
(...skipping 668 matching lines...) Expand 10 before | Expand all | Expand 10 after
2692 rtx_mapping[video_codecs[i].codec.id] != 2686 rtx_mapping[video_codecs[i].codec.id] !=
2693 ulpfec_config.red_payload_type) { 2687 ulpfec_config.red_payload_type) {
2694 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id]; 2688 video_codecs[i].rtx_payload_type = rtx_mapping[video_codecs[i].codec.id];
2695 } 2689 }
2696 } 2690 }
2697 2691
2698 return video_codecs; 2692 return video_codecs;
2699 } 2693 }
2700 2694
2701 } // namespace cricket 2695 } // namespace cricket
OLDNEW
« no previous file with comments | « webrtc/media/base/videoengine_unittest.h ('k') | webrtc/media/engine/webrtcvideoengine2_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698