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

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

Issue 2998293002: Make CodecType conversion functions non-optional. (Closed)
Patch Set: Keep old functions for backwards-compat 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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const std::vector<VideoStream>& streams, 97 const std::vector<VideoStream>& streams,
98 const std::string& payload_name, 98 const std::string& payload_name,
99 int payload_type, 99 int payload_type,
100 bool nack_enabled) { 100 bool nack_enabled) {
101 static const int kEncoderMinBitrateKbps = 30; 101 static const int kEncoderMinBitrateKbps = 30;
102 RTC_DCHECK(!streams.empty()); 102 RTC_DCHECK(!streams.empty());
103 RTC_DCHECK_GE(config.min_transmit_bitrate_bps, 0); 103 RTC_DCHECK_GE(config.min_transmit_bitrate_bps, 0);
104 104
105 VideoCodec video_codec; 105 VideoCodec video_codec;
106 memset(&video_codec, 0, sizeof(video_codec)); 106 memset(&video_codec, 0, sizeof(video_codec));
107 video_codec.codecType = PayloadNameToCodecType(payload_name) 107 video_codec.codecType = PayloadStringToCodecType(payload_name);
108 .value_or(VideoCodecType::kVideoCodecGeneric);
109 108
110 switch (config.content_type) { 109 switch (config.content_type) {
111 case VideoEncoderConfig::ContentType::kRealtimeVideo: 110 case VideoEncoderConfig::ContentType::kRealtimeVideo:
112 video_codec.mode = kRealtimeVideo; 111 video_codec.mode = kRealtimeVideo;
113 break; 112 break;
114 case VideoEncoderConfig::ContentType::kScreen: 113 case VideoEncoderConfig::ContentType::kScreen:
115 video_codec.mode = kScreensharing; 114 video_codec.mode = kScreensharing;
116 if (!streams.empty() && 115 if (!streams.empty() &&
117 streams[0].temporal_layer_thresholds_bps.size() == 1) { 116 streams[0].temporal_layer_thresholds_bps.size() == 1) {
118 video_codec.targetBitrate = 117 video_codec.targetBitrate =
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 } 235 }
237 if (video_codec.maxBitrate < kEncoderMinBitrateKbps) 236 if (video_codec.maxBitrate < kEncoderMinBitrateKbps)
238 video_codec.maxBitrate = kEncoderMinBitrateKbps; 237 video_codec.maxBitrate = kEncoderMinBitrateKbps;
239 238
240 RTC_DCHECK_GT(streams[0].max_framerate, 0); 239 RTC_DCHECK_GT(streams[0].max_framerate, 0);
241 video_codec.maxFramerate = streams[0].max_framerate; 240 video_codec.maxFramerate = streams[0].max_framerate;
242 return video_codec; 241 return video_codec;
243 } 242 }
244 243
245 } // namespace webrtc 244 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/modules/video_coding/utility/ivf_file_writer.cc ('k') | webrtc/sdk/android/src/jni/androidmediaencoder_jni.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698