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

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.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) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 config->codec_settings.VP8()->tl_factory = tl_factory.get(); 42 config->codec_settings.VP8()->tl_factory = tl_factory.get();
43 } 43 }
44 return std::unique_ptr<VideoBitrateAllocator>( 44 return std::unique_ptr<VideoBitrateAllocator>(
45 VideoCodecInitializer::CreateBitrateAllocator(config->codec_settings, 45 VideoCodecInitializer::CreateBitrateAllocator(config->codec_settings,
46 std::move(tl_factory))); 46 std::move(tl_factory)));
47 } 47 }
48 48
49 void PrintCodecSettings(const VideoCodec& codec_settings) { 49 void PrintCodecSettings(const VideoCodec& codec_settings) {
50 printf(" Codec settings:\n"); 50 printf(" Codec settings:\n");
51 printf(" Codec type : %s\n", 51 printf(" Codec type : %s\n",
52 CodecTypeToPayloadName(codec_settings.codecType).value_or("Unknown")); 52 CodecTypeToPayloadString(codec_settings.codecType));
53 printf(" Start bitrate : %d kbps\n", codec_settings.startBitrate); 53 printf(" Start bitrate : %d kbps\n", codec_settings.startBitrate);
54 printf(" Max bitrate : %d kbps\n", codec_settings.maxBitrate); 54 printf(" Max bitrate : %d kbps\n", codec_settings.maxBitrate);
55 printf(" Min bitrate : %d kbps\n", codec_settings.minBitrate); 55 printf(" Min bitrate : %d kbps\n", codec_settings.minBitrate);
56 printf(" Width : %d\n", codec_settings.width); 56 printf(" Width : %d\n", codec_settings.width);
57 printf(" Height : %d\n", codec_settings.height); 57 printf(" Height : %d\n", codec_settings.height);
58 printf(" Max frame rate : %d\n", codec_settings.maxFramerate); 58 printf(" Max frame rate : %d\n", codec_settings.maxFramerate);
59 printf(" QPmax : %d\n", codec_settings.qpMax); 59 printf(" QPmax : %d\n", codec_settings.qpMax);
60 if (codec_settings.codecType == kVideoCodecVP8) { 60 if (codec_settings.codecType == kVideoCodecVP8) {
61 printf(" Complexity : %d\n", codec_settings.VP8().complexity); 61 printf(" Complexity : %d\n", codec_settings.VP8().complexity);
62 printf(" Resilience : %d\n", codec_settings.VP8().resilience); 62 printf(" Resilience : %d\n", codec_settings.VP8().resilience);
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 printf(" Filename : %s\n", config_.filename.c_str()); 182 printf(" Filename : %s\n", config_.filename.c_str());
183 printf(" Total # of frames: %d\n", 183 printf(" Total # of frames: %d\n",
184 analysis_frame_reader_->NumberOfFrames()); 184 analysis_frame_reader_->NumberOfFrames());
185 printf(" # CPU cores used : %d\n", num_cores); 185 printf(" # CPU cores used : %d\n", num_cores);
186 const char* encoder_name = encoder_->ImplementationName(); 186 const char* encoder_name = encoder_->ImplementationName();
187 printf(" Encoder implementation name: %s\n", encoder_name); 187 printf(" Encoder implementation name: %s\n", encoder_name);
188 const char* decoder_name = decoder_->ImplementationName(); 188 const char* decoder_name = decoder_->ImplementationName();
189 printf(" Decoder implementation name: %s\n", decoder_name); 189 printf(" Decoder implementation name: %s\n", decoder_name);
190 if (strcmp(encoder_name, decoder_name) == 0) { 190 if (strcmp(encoder_name, decoder_name) == 0) {
191 printf(" Codec implementation name : %s_%s\n", 191 printf(" Codec implementation name : %s_%s\n",
192 CodecTypeToPayloadName(config_.codec_settings.codecType) 192 CodecTypeToPayloadString(config_.codec_settings.codecType),
193 .value_or("Unknown"),
194 encoder_->ImplementationName()); 193 encoder_->ImplementationName());
195 } 194 }
196 PrintCodecSettings(config_.codec_settings); 195 PrintCodecSettings(config_.codec_settings);
197 printf("\n"); 196 printf("\n");
198 } 197 }
199 } 198 }
200 199
201 void VideoProcessor::Release() { 200 void VideoProcessor::Release() {
202 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_); 201 RTC_DCHECK_CALLED_SEQUENTIALLY(&sequence_checker_);
203 202
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after
499 498
500 RTC_DCHECK_GT(timestamp, 0); 499 RTC_DCHECK_GT(timestamp, 0);
501 const int ticks_per_frame = 500 const int ticks_per_frame =
502 kRtpClockRateHz / config_.codec_settings.maxFramerate; 501 kRtpClockRateHz / config_.codec_settings.maxFramerate;
503 RTC_DCHECK_EQ(timestamp % ticks_per_frame, 0); 502 RTC_DCHECK_EQ(timestamp % ticks_per_frame, 0);
504 return (timestamp / ticks_per_frame) - 1; 503 return (timestamp / ticks_per_frame) - 1;
505 } 504 }
506 505
507 } // namespace test 506 } // namespace test
508 } // namespace webrtc 507 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/media/engine/webrtcvideoengine.cc ('k') | webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698