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

Unified Diff: webrtc/modules/video_capture/test/video_capture_unittest.cc

Issue 1738863002: Replace scoped_ptr with unique_ptr in webrtc/modules/video_*/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@up4
Patch Set: rebase Created 4 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 side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/video_capture/test/video_capture_unittest.cc
diff --git a/webrtc/modules/video_capture/test/video_capture_unittest.cc b/webrtc/modules/video_capture/test/video_capture_unittest.cc
index 45d2d2f2412894a03b016b720db70bd6274fcf75..600b618f5cffe0f2f8c556325b906b69f8416acc 100644
--- a/webrtc/modules/video_capture/test/video_capture_unittest.cc
+++ b/webrtc/modules/video_capture/test/video_capture_unittest.cc
@@ -11,10 +11,10 @@
#include <stdio.h>
#include <map>
+#include <memory>
#include <sstream>
#include "testing/gtest/include/gtest/gtest.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/utility/include/process_thread.h"
@@ -25,7 +25,6 @@
#include "webrtc/system_wrappers/include/tick_util.h"
#include "webrtc/video_frame.h"
-using rtc::scoped_ptr;
using webrtc::CriticalSectionWrapper;
using webrtc::CriticalSectionScoped;
using webrtc::SleepMs;
@@ -183,7 +182,7 @@ class TestVideoCaptureCallback : public VideoCaptureDataCallback {
}
private:
- scoped_ptr<CriticalSectionWrapper> capture_cs_;
+ std::unique_ptr<CriticalSectionWrapper> capture_cs_;
VideoCaptureCapability capability_;
int capture_delay_;
int64_t last_render_time_ms_;
@@ -223,7 +222,7 @@ class TestVideoCaptureFeedBack : public VideoCaptureFeedBack {
}
private:
- scoped_ptr<CriticalSectionWrapper> capture_cs_;
+ std::unique_ptr<CriticalSectionWrapper> capture_cs_;
unsigned int frame_rate_;
VideoCaptureAlarm alarm_;
};
@@ -270,7 +269,7 @@ class VideoCaptureTest : public testing::Test {
EXPECT_EQ(capability.height, resulting_capability.height);
}
- scoped_ptr<VideoCaptureModule::DeviceInfo> device_info_;
+ std::unique_ptr<VideoCaptureModule::DeviceInfo> device_info_;
unsigned int number_of_devices_;
};
@@ -440,7 +439,8 @@ class VideoCaptureExternalTest : public testing::Test {
public:
void SetUp() {
capture_module_ = VideoCaptureFactory::Create(0, capture_input_interface_);
- process_module_ = webrtc::ProcessThread::Create("ProcessThread");
+ process_module_ =
+ rtc::ScopedToUnique(webrtc::ProcessThread::Create("ProcessThread"));
process_module_->Start();
process_module_->RegisterModule(capture_module_);
@@ -472,7 +472,7 @@ class VideoCaptureExternalTest : public testing::Test {
webrtc::VideoCaptureExternal* capture_input_interface_;
rtc::scoped_refptr<VideoCaptureModule> capture_module_;
- rtc::scoped_ptr<webrtc::ProcessThread> process_module_;
+ std::unique_ptr<webrtc::ProcessThread> process_module_;
webrtc::VideoFrame test_frame_;
TestVideoCaptureCallback capture_callback_;
TestVideoCaptureFeedBack capture_feedback_;
@@ -483,7 +483,7 @@ TEST_F(VideoCaptureExternalTest, TestExternalCapture) {
size_t length = webrtc::CalcBufferSize(webrtc::kI420,
test_frame_.width(),
test_frame_.height());
- scoped_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
webrtc::ExtractBuffer(test_frame_, length, test_buffer.get());
EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(),
length, capture_callback_.capability(), 0));
@@ -505,7 +505,7 @@ TEST_F(VideoCaptureExternalTest, MAYBE_FrameRate) {
size_t length = webrtc::CalcBufferSize(webrtc::kI420,
test_frame_.width(),
test_frame_.height());
- scoped_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
webrtc::ExtractBuffer(test_frame_, length, test_buffer.get());
EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(),
length, capture_callback_.capability(), 0));
@@ -521,7 +521,7 @@ TEST_F(VideoCaptureExternalTest, MAYBE_FrameRate) {
size_t length = webrtc::CalcBufferSize(webrtc::kI420,
test_frame_.width(),
test_frame_.height());
- scoped_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
webrtc::ExtractBuffer(test_frame_, length, test_buffer.get());
EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(),
length, capture_callback_.capability(), 0));
@@ -539,7 +539,7 @@ TEST_F(VideoCaptureExternalTest, Rotation) {
size_t length = webrtc::CalcBufferSize(webrtc::kI420,
test_frame_.width(),
test_frame_.height());
- scoped_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
+ std::unique_ptr<uint8_t[]> test_buffer(new uint8_t[length]);
webrtc::ExtractBuffer(test_frame_, length, test_buffer.get());
EXPECT_EQ(0, capture_input_interface_->IncomingFrame(test_buffer.get(),
length, capture_callback_.capability(), 0));
« no previous file with comments | « webrtc/modules/video_capture/linux/video_capture_linux.h ('k') | webrtc/modules/video_processing/frame_preprocessor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698