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

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

Issue 2790533002: Remove ALL usage of CriticalSectionWrapper. (Closed)
Patch Set: remove winXP rw_lock include Created 3 years, 9 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 d0c3ec9b257981c351e4536ca1e02ebec95174fa..a4a7a7279d043d8cbf792a5b47168bdfbe194b81 100644
--- a/webrtc/modules/video_capture/test/video_capture_unittest.cc
+++ b/webrtc/modules/video_capture/test/video_capture_unittest.cc
@@ -16,19 +16,17 @@
#include "webrtc/api/video/i420_buffer.h"
#include "webrtc/api/video/video_frame.h"
+#include "webrtc/base/criticalsection.h"
#include "webrtc/base/scoped_ref_ptr.h"
#include "webrtc/base/timeutils.h"
#include "webrtc/common_video/libyuv/include/webrtc_libyuv.h"
#include "webrtc/modules/utility/include/process_thread.h"
#include "webrtc/modules/video_capture/video_capture.h"
#include "webrtc/modules/video_capture/video_capture_factory.h"
-#include "webrtc/system_wrappers/include/critical_section_wrapper.h"
#include "webrtc/system_wrappers/include/sleep.h"
#include "webrtc/test/frame_utils.h"
#include "webrtc/test/gtest.h"
-using webrtc::CriticalSectionWrapper;
-using webrtc::CriticalSectionScoped;
using webrtc::SleepMs;
using webrtc::VideoCaptureCapability;
using webrtc::VideoCaptureFactory;
@@ -61,8 +59,7 @@ static const int kTestFramerate = 30;
class TestVideoCaptureCallback
: public rtc::VideoSinkInterface<webrtc::VideoFrame> {
public:
- TestVideoCaptureCallback()
- : capture_cs_(CriticalSectionWrapper::CreateCriticalSection()),
+ TestVideoCaptureCallback() :
last_render_time_ms_(0),
incoming_frames_(0),
timing_warnings_(0),
@@ -74,7 +71,7 @@ class TestVideoCaptureCallback
}
void OnFrame(const webrtc::VideoFrame& videoFrame) override {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
int height = videoFrame.height();
int width = videoFrame.width();
#if defined(ANDROID) && ANDROID
@@ -107,38 +104,38 @@ class TestVideoCaptureCallback
}
void SetExpectedCapability(VideoCaptureCapability capability) {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
capability_= capability;
incoming_frames_ = 0;
last_render_time_ms_ = 0;
}
int incoming_frames() {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
return incoming_frames_;
}
int timing_warnings() {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
return timing_warnings_;
}
VideoCaptureCapability capability() {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
return capability_;
}
bool CompareLastFrame(const webrtc::VideoFrame& frame) {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
return webrtc::test::FrameBufsEqual(last_frame_,
frame.video_frame_buffer());
}
void SetExpectedCaptureRotation(webrtc::VideoRotation rotation) {
- CriticalSectionScoped cs(capture_cs_.get());
+ rtc::CritScope cs(&capture_cs_);
rotate_frame_ = rotation;
}
private:
- std::unique_ptr<CriticalSectionWrapper> capture_cs_;
+ rtc::CriticalSection capture_cs_;
VideoCaptureCapability capability_;
int64_t last_render_time_ms_;
int incoming_frames_;
« no previous file with comments | « webrtc/modules/video_capture/linux/video_capture_linux.cc ('k') | webrtc/modules/video_capture/video_capture_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698