Replace deprecated scoped_ptr with unique_ptr
Change-Id: I2793a1b65164946eb7d67d80ccba9e798db3d9af
This commit is contained in:
@@ -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 @@ class DecodeSvcTest : public ::libvpx_test::DecoderTest,
|
||||
// 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 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer0) {
|
||||
// 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 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer1) {
|
||||
// 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 @@ TEST_P(DecodeSvcTest, DecodeSvcTestUpToSpatialLayer2) {
|
||||
// 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();
|
||||
|
||||
@@ -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 @@ void EncoderTest::RunLoop(VideoSource *video) {
|
||||
}
|
||||
|
||||
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 @@ void EncoderTest::RunLoop(VideoSource *video) {
|
||||
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()) {
|
||||
|
||||
@@ -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 @@ TEST_P(ExternalFrameBufferMD5Test, ExtFBMD5Match) {
|
||||
#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 {
|
||||
|
||||
@@ -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 @@ class InvalidFileTest : public ::libvpx_test::DecoderTest,
|
||||
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") {
|
||||
|
||||
@@ -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 @@ TEST_P(TestVectorTest, MD5Match) {
|
||||
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") {
|
||||
|
||||
@@ -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 @@ TEST_P(ArfFreqTest, MinArfFreqTest) {
|
||||
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));
|
||||
|
||||
@@ -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 @@ class VpxEncoderParmsGetToDecoder
|
||||
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);
|
||||
|
||||
|
||||
@@ -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 @@ TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) {
|
||||
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 @@ TEST_P(EndToEndTestLarge, EndtoEndPSNRDenoiserAQTest) {
|
||||
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));
|
||||
|
||||
@@ -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 @@ TEST_P(MotionVectorTestLarge, OverallTest) {
|
||||
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));
|
||||
|
||||
@@ -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 @@ class Y4mVideoSource : public VideoSource {
|
||||
|
||||
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_;
|
||||
|
||||
Reference in New Issue
Block a user