ref: 77fa5100306f9402990ea5e0810c7d6180aabf05
parent: d3d22aa7c9ff19af3af2cf21cd7c7739fc2c6263
author: Jingning Han <[email protected]>
date: Tue Nov 27 04:49:12 EST 2018
Replace deprecated scoped_ptr with unique_ptr Change-Id: I2793a1b65164946eb7d67d80ccba9e798db3d9af
--- a/test/decode_svc_test.cc
+++ b/test/decode_svc_test.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <string>
#include "test/codec_factory.h"
@@ -53,7 +54,7 @@
// number of frames decoded. This results in 1/4x1/4 resolution (320x180).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer0) {
const std::string filename = GET_PARAM(1);
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
@@ -70,7 +71,7 @@
// number of frames decoded. This results in 1/2x1/2 resolution (640x360).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer1) {
const std::string filename = GET_PARAM(1);
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
@@ -87,7 +88,7 @@
// number of frames decoded. This results in the full resolution (1280x720).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer2) {
const std::string filename = GET_PARAM(1);
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
@@ -105,7 +106,7 @@
// the decoding should result in the full resolution (1280x720).
TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer10) {
const std::string filename = GET_PARAM(1);
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
video.reset(new libvpx_test::IVFVideoSource(filename));
ASSERT_TRUE(video.get() != NULL);
video->Init();
--- a/test/encode_test_driver.cc
+++ b/test/encode_test_driver.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <string>
#include "third_party/googletest/src/include/gtest/gtest.h"
@@ -179,7 +180,7 @@
}
BeginPassHook(pass);
- testing::internal::scoped_ptr<Encoder> encoder(
+ std::unique_ptr<Encoder> encoder(
codec_->CreateEncoder(cfg_, deadline_, init_flags_, &stats_));
ASSERT_TRUE(encoder.get() != NULL);
@@ -193,7 +194,7 @@
if (init_flags_ & VPX_CODEC_USE_OUTPUT_PARTITION) {
dec_init_flags |= VPX_CODEC_USE_INPUT_FRAGMENTS;
}
- testing::internal::scoped_ptr<Decoder> decoder(
+ std::unique_ptr<Decoder> decoder(
codec_->CreateDecoder(dec_cfg, dec_init_flags));
bool again;
for (again = true; again; video->Next()) {
--- a/test/external_frame_buffer_test.cc
+++ b/test/external_frame_buffer_test.cc
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
#include <string>
#include "./vpx_config.h"
@@ -392,7 +393,7 @@
#endif
// Open compressed video file.
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
if (filename.substr(filename.length() - 3, 3) == "ivf") {
video.reset(new libvpx_test::IVFVideoSource(filename));
} else {
--- a/test/invalid_file_test.cc
+++ b/test/invalid_file_test.cc
@@ -10,6 +10,7 @@
#include <cstdio>
#include <cstdlib>
+#include <memory>
#include <string>
#include <vector>
#include "third_party/googletest/src/include/gtest/gtest.h"
@@ -89,7 +90,7 @@
const std::string filename = input.filename;
// Open compressed video file.
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
if (filename.substr(filename.length() - 3, 3) == "ivf") {
video.reset(new libvpx_test::IVFVideoSource(filename));
} else if (filename.substr(filename.length() - 4, 4) == "webm") {
--- a/test/test_vector_test.cc
+++ b/test/test_vector_test.cc
@@ -10,6 +10,7 @@
#include <cstdio>
#include <cstdlib>
+#include <memory>
#include <set>
#include <string>
#include "third_party/googletest/src/include/gtest/gtest.h"
@@ -100,7 +101,7 @@
SCOPED_TRACE(str);
// Open compressed video file.
- testing::internal::scoped_ptr<libvpx_test::CompressedVideoSource> video;
+ std::unique_ptr<libvpx_test::CompressedVideoSource> video;
if (filename.substr(filename.length() - 3, 3) == "ivf") {
video.reset(new libvpx_test::IVFVideoSource(filename));
} else if (filename.substr(filename.length() - 4, 4) == "webm") {
--- a/test/vp9_arf_freq_test.cc
+++ b/test/vp9_arf_freq_test.cc
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
@@ -190,7 +192,7 @@
init_flags_ = VPX_CODEC_USE_PSNR;
if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
- testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
+ std::unique_ptr<libvpx_test::VideoSource> video;
if (is_extension_y4m(test_video_param_.filename)) {
video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0,
kFrames));
--- a/test/vp9_encoder_parms_get_to_decoder.cc
+++ b/test/vp9_encoder_parms_get_to_decoder.cc
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
@@ -138,7 +140,7 @@
TEST_P(VpxEncoderParmsGetToDecoder, BitstreamParms) {
init_flags_ = VPX_CODEC_USE_PSNR;
- testing::internal::scoped_ptr<libvpx_test::VideoSource> video(
+ std::unique_ptr<libvpx_test::VideoSource> video(
new libvpx_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames));
ASSERT_TRUE(video.get() != NULL);
--- a/test/vp9_end_to_end_test.cc
+++ b/test/vp9_end_to_end_test.cc
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include "memory"
+
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
@@ -200,7 +202,7 @@
init_flags_ = VPX_CODEC_USE_PSNR;
if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
- testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
+ std::unique_ptr<libvpx_test::VideoSource> video;
if (is_extension_y4m(test_video_param_.filename)) {
video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0,
kFrames));
@@ -227,7 +229,7 @@
denoiser_on_ = 1;
if (cfg_.g_bit_depth > 8) init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
- testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
+ std::unique_ptr<libvpx_test::VideoSource> video;
if (is_extension_y4m(test_video_param_.filename)) {
video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename, 0,
kFrames));
--- a/test/vp9_motion_vector_test.cc
+++ b/test/vp9_motion_vector_test.cc
@@ -8,6 +8,8 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#include <memory>
+
#include "third_party/googletest/src/include/gtest/gtest.h"
#include "test/codec_factory.h"
@@ -81,7 +83,7 @@
cfg_.g_profile = 0;
init_flags_ = VPX_CODEC_USE_PSNR;
- testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
+ std::unique_ptr<libvpx_test::VideoSource> video;
video.reset(new libvpx_test::YUVVideoSource(
"niklas_640_480_30.yuv", VPX_IMG_FMT_I420, 3840, 2160, // 2048, 1080,
30, 1, 0, 5));
--- a/test/y4m_video_source.h
+++ b/test/y4m_video_source.h
@@ -10,6 +10,7 @@
#ifndef VPX_TEST_Y4M_VIDEO_SOURCE_H_
#define VPX_TEST_Y4M_VIDEO_SOURCE_H_
#include <algorithm>
+#include <memory>
#include <string>
#include "test/video_source.h"
@@ -108,7 +109,7 @@
std::string file_name_;
FILE *input_file_;
- testing::internal::scoped_ptr<vpx_image_t> img_;
+ std::unique_ptr<vpx_image_t> img_;
unsigned int start_;
unsigned int limit_;
unsigned int frame_;