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

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

Issue 3007683002: Let VideoEncoderSoftwareFallbackWrapper own the wrapped encoder (Closed)
Patch Set: Created 3 years, 3 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) 2016 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2016 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 return; 62 return;
63 } 63 }
64 *param_low_kbps = low_kbps; 64 *param_low_kbps = low_kbps;
65 *param_high_kbps = high_kbps; 65 *param_high_kbps = high_kbps;
66 *param_min_low_ms = min_low_ms; 66 *param_min_low_ms = min_low_ms;
67 } 67 }
68 } // namespace 68 } // namespace
69 69
70 VideoEncoderSoftwareFallbackWrapper::VideoEncoderSoftwareFallbackWrapper( 70 VideoEncoderSoftwareFallbackWrapper::VideoEncoderSoftwareFallbackWrapper(
71 const cricket::VideoCodec& codec, 71 const cricket::VideoCodec& codec,
72 webrtc::VideoEncoder* encoder) 72 std::unique_ptr<webrtc::VideoEncoder> encoder)
73 : number_of_cores_(0), 73 : number_of_cores_(0),
74 max_payload_size_(0), 74 max_payload_size_(0),
75 rates_set_(false), 75 rates_set_(false),
76 framerate_(0), 76 framerate_(0),
77 channel_parameters_set_(false), 77 channel_parameters_set_(false),
78 packet_loss_(0), 78 packet_loss_(0),
79 rtt_(0), 79 rtt_(0),
80 codec_(codec), 80 codec_(codec),
81 encoder_(encoder), 81 encoder_(std::move(encoder)),
82 callback_(nullptr), 82 callback_(nullptr),
83 forced_fallback_possible_(EnableForcedFallback(codec)) { 83 forced_fallback_possible_(EnableForcedFallback(codec)) {
84 if (forced_fallback_possible_) { 84 if (forced_fallback_possible_) {
85 GetForcedFallbackParamsFromFieldTrialGroup(&forced_fallback_.low_kbps, 85 GetForcedFallbackParamsFromFieldTrialGroup(&forced_fallback_.low_kbps,
86 &forced_fallback_.high_kbps, 86 &forced_fallback_.high_kbps,
87 &forced_fallback_.min_low_ms); 87 &forced_fallback_.min_low_ms);
88 } 88 }
89 } 89 }
90 90
91 bool VideoEncoderSoftwareFallbackWrapper::InitFallbackEncoder() { 91 bool VideoEncoderSoftwareFallbackWrapper::InitFallbackEncoder() {
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after
363 void VideoEncoderSoftwareFallbackWrapper::MaybeModifyCodecForFallback() { 363 void VideoEncoderSoftwareFallbackWrapper::MaybeModifyCodecForFallback() {
364 // We have a specific case for H264 ConstrainedBaseline because that is the 364 // We have a specific case for H264 ConstrainedBaseline because that is the
365 // only supported profile in Sw fallback. 365 // only supported profile in Sw fallback.
366 if (!cricket::CodecNamesEq(codec_.name.c_str(), cricket::kH264CodecName)) 366 if (!cricket::CodecNamesEq(codec_.name.c_str(), cricket::kH264CodecName))
367 return; 367 return;
368 codec_.SetParam(cricket::kH264FmtpProfileLevelId, 368 codec_.SetParam(cricket::kH264FmtpProfileLevelId,
369 cricket::kH264ProfileLevelConstrainedBaseline); 369 cricket::kH264ProfileLevelConstrainedBaseline);
370 } 370 }
371 371
372 } // namespace webrtc 372 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698