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

Side by Side Diff: webrtc/modules/video_coding/codecs/test/videoprocessor.cc

Issue 2639203005: Use std::unique_ptr in VideoProcessorIntegrationTest. (Closed)
Patch Set: rebase Created 3 years, 10 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
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h" 11 #include "webrtc/modules/video_coding/codecs/test/videoprocessor.h"
12 12
13 #include <string.h> 13 #include <string.h>
14 14
15 #include <limits> 15 #include <limits>
16 #include <memory> 16 #include <memory>
17 #include <utility> 17 #include <utility>
18 #include <vector> 18 #include <vector>
19 19
20 #include "webrtc/api/video/i420_buffer.h" 20 #include "webrtc/api/video/i420_buffer.h"
21 #include "webrtc/base/checks.h" 21 #include "webrtc/base/checks.h"
22 #include "webrtc/base/timeutils.h" 22 #include "webrtc/base/timeutils.h"
23 #include "webrtc/common_types.h"
23 #include "webrtc/modules/video_coding/include/video_codec_initializer.h" 24 #include "webrtc/modules/video_coding/include/video_codec_initializer.h"
24 #include "webrtc/modules/video_coding/utility/default_video_bitrate_allocator.h" 25 #include "webrtc/modules/video_coding/utility/default_video_bitrate_allocator.h"
25 #include "webrtc/modules/video_coding/utility/simulcast_rate_allocator.h" 26 #include "webrtc/modules/video_coding/utility/simulcast_rate_allocator.h"
26 #include "webrtc/system_wrappers/include/cpu_info.h" 27 #include "webrtc/system_wrappers/include/cpu_info.h"
27 28
28 namespace webrtc { 29 namespace webrtc {
29 namespace test { 30 namespace test {
30 31
31 TestConfig::TestConfig() 32 TestConfig::TestConfig()
32 : name(""), 33 : name(""),
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 fprintf(stderr, "Failed to initialize VideoDecoder, return code: %d\n", 141 fprintf(stderr, "Failed to initialize VideoDecoder, return code: %d\n",
141 init_result); 142 init_result);
142 return false; 143 return false;
143 } 144 }
144 145
145 if (config_.verbose) { 146 if (config_.verbose) {
146 printf("Video Processor:\n"); 147 printf("Video Processor:\n");
147 printf(" #CPU cores used : %d\n", nbr_of_cores); 148 printf(" #CPU cores used : %d\n", nbr_of_cores);
148 printf(" Total # of frames: %d\n", frame_reader_->NumberOfFrames()); 149 printf(" Total # of frames: %d\n", frame_reader_->NumberOfFrames());
149 printf(" Codec settings:\n"); 150 printf(" Codec settings:\n");
150 printf(" Start bitrate : %d kbps\n", 151 printf(" Start bitrate : %d kbps\n",
151 config_.codec_settings->startBitrate); 152 config_.codec_settings->startBitrate);
152 printf(" Width : %d\n", config_.codec_settings->width); 153 printf(" Width : %d\n", config_.codec_settings->width);
153 printf(" Height : %d\n", config_.codec_settings->height); 154 printf(" Height : %d\n", config_.codec_settings->height);
155 printf(" Codec type : %s\n",
156 CodecTypeToPayloadName(config_.codec_settings->codecType)
157 .value_or("Unknown"));
158 printf(" Encoder implementation name: %s\n",
159 encoder_->ImplementationName());
160 printf(" Decoder implementation name: %s\n",
161 decoder_->ImplementationName());
162 if (config_.codec_settings->codecType == kVideoCodecVP8) {
163 printf(" Denoising : %d\n",
164 config_.codec_settings->VP8()->denoisingOn);
165 printf(" Error concealment: %d\n",
166 config_.codec_settings->VP8()->errorConcealmentOn);
167 printf(" Frame dropping : %d\n",
168 config_.codec_settings->VP8()->frameDroppingOn);
169 printf(" Resilience : %d\n",
170 config_.codec_settings->VP8()->resilience);
171 } else if (config_.codec_settings->codecType == kVideoCodecVP9) {
172 printf(" Resilience : %d\n",
173 config_.codec_settings->VP9()->resilience);
174 }
154 } 175 }
155 initialized_ = true; 176 initialized_ = true;
156 return true; 177 return true;
157 } 178 }
158 179
159 VideoProcessorImpl::~VideoProcessorImpl() { 180 VideoProcessorImpl::~VideoProcessorImpl() {
160 delete[] last_successful_frame_buffer_; 181 delete[] last_successful_frame_buffer_;
161 encoder_->RegisterEncodeCompleteCallback(NULL); 182 encoder_->RegisterEncodeCompleteCallback(NULL);
162 delete encode_callback_; 183 delete encode_callback_;
163 decoder_->RegisterDecodeCompleteCallback(NULL); 184 decoder_->RegisterDecodeCompleteCallback(NULL);
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 } 440 }
420 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded( 441 int32_t VideoProcessorImpl::VideoProcessorDecodeCompleteCallback::Decoded(
421 VideoFrame& image) { 442 VideoFrame& image) {
422 // Forward to parent class. 443 // Forward to parent class.
423 video_processor_->FrameDecoded(image); 444 video_processor_->FrameDecoded(image);
424 return 0; 445 return 0;
425 } 446 }
426 447
427 } // namespace test 448 } // namespace test
428 } // namespace webrtc 449 } // namespace webrtc
OLDNEW
« no previous file with comments | « no previous file | webrtc/modules/video_coding/codecs/test/videoprocessor_integrationtest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698