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

Side by Side Diff: webrtc/modules/video_coding/video_codec_initializer.cc

Issue 2534683002: RTC_[D]CHECK_op: Remove superfluous casts (Closed)
Patch Set: test Created 4 years 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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 } 157 }
158 158
159 strncpy(video_codec.plName, payload_name.c_str(), kPayloadNameSize - 1); 159 strncpy(video_codec.plName, payload_name.c_str(), kPayloadNameSize - 1);
160 video_codec.plName[kPayloadNameSize - 1] = '\0'; 160 video_codec.plName[kPayloadNameSize - 1] = '\0';
161 video_codec.plType = payload_type; 161 video_codec.plType = payload_type;
162 video_codec.numberOfSimulcastStreams = 162 video_codec.numberOfSimulcastStreams =
163 static_cast<unsigned char>(streams.size()); 163 static_cast<unsigned char>(streams.size());
164 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000; 164 video_codec.minBitrate = streams[0].min_bitrate_bps / 1000;
165 if (video_codec.minBitrate < kEncoderMinBitrateKbps) 165 if (video_codec.minBitrate < kEncoderMinBitrateKbps)
166 video_codec.minBitrate = kEncoderMinBitrateKbps; 166 video_codec.minBitrate = kEncoderMinBitrateKbps;
167 RTC_DCHECK_LE(streams.size(), static_cast<size_t>(kMaxSimulcastStreams)); 167 RTC_DCHECK_LE(streams.size(), kMaxSimulcastStreams);
168 if (video_codec.codecType == kVideoCodecVP9) { 168 if (video_codec.codecType == kVideoCodecVP9) {
169 // If the vector is empty, bitrates will be configured automatically. 169 // If the vector is empty, bitrates will be configured automatically.
170 RTC_DCHECK(config.spatial_layers.empty() || 170 RTC_DCHECK(config.spatial_layers.empty() ||
171 config.spatial_layers.size() == 171 config.spatial_layers.size() ==
172 video_codec.VP9()->numberOfSpatialLayers); 172 video_codec.VP9()->numberOfSpatialLayers);
173 RTC_DCHECK_LE(video_codec.VP9()->numberOfSpatialLayers, 173 RTC_DCHECK_LE(video_codec.VP9()->numberOfSpatialLayers,
174 kMaxSimulcastStreams); 174 kMaxSimulcastStreams);
175 for (size_t i = 0; i < config.spatial_layers.size(); ++i) 175 for (size_t i = 0; i < config.spatial_layers.size(); ++i)
176 video_codec.spatialLayers[i] = config.spatial_layers[i]; 176 video_codec.spatialLayers[i] = config.spatial_layers[i];
177 } 177 }
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 } 216 }
217 if (video_codec.maxBitrate < kEncoderMinBitrateKbps) 217 if (video_codec.maxBitrate < kEncoderMinBitrateKbps)
218 video_codec.maxBitrate = kEncoderMinBitrateKbps; 218 video_codec.maxBitrate = kEncoderMinBitrateKbps;
219 219
220 RTC_DCHECK_GT(streams[0].max_framerate, 0); 220 RTC_DCHECK_GT(streams[0].max_framerate, 0);
221 video_codec.maxFramerate = streams[0].max_framerate; 221 video_codec.maxFramerate = streams[0].max_framerate;
222 return video_codec; 222 return video_codec;
223 } 223 }
224 224
225 } // namespace webrtc 225 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698