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

Side by Side Diff: media/video/capture/video_capture_device_unittest.cc

Issue 12090109: Tab Capture: Backing store readbacks to YV12 VideoFrames. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Style fix per wjia Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/memory/scoped_ptr.h" 5 #include "base/memory/scoped_ptr.h"
6 #include "base/message_loop.h" 6 #include "base/message_loop.h"
7 #include "base/synchronization/waitable_event.h" 7 #include "base/synchronization/waitable_event.h"
8 #include "base/test/test_timeouts.h" 8 #include "base/test/test_timeouts.h"
9 #include "base/threading/thread.h" 9 #include "base/threading/thread.h"
10 #include "media/video/capture/fake_video_capture_device.h" 10 #include "media/video/capture/fake_video_capture_device.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 virtual void OnFrameInfo( 55 virtual void OnFrameInfo(
56 const VideoCaptureCapability& info) OVERRIDE { 56 const VideoCaptureCapability& info) OVERRIDE {
57 OnFrameInfo(info.width, info.height, info.frame_rate, info.color); 57 OnFrameInfo(info.width, info.height, info.frame_rate, info.color);
58 } 58 }
59 59
60 virtual void OnIncomingCapturedFrame(const uint8* data, int length, 60 virtual void OnIncomingCapturedFrame(const uint8* data, int length,
61 base::Time timestamp) OVERRIDE { 61 base::Time timestamp) OVERRIDE {
62 wait_event_->Signal(); 62 wait_event_->Signal();
63 } 63 }
64 64
65 virtual void OnIncomingCapturedVideoFrame(media::VideoFrame* frame,
66 base::Time timestamp) OVERRIDE {
67 wait_event_->Signal();
68 }
69
65 private: 70 private:
66 base::WaitableEvent* wait_event_; 71 base::WaitableEvent* wait_event_;
67 }; 72 };
68 73
69 class VideoCaptureDeviceTest : public testing::Test { 74 class VideoCaptureDeviceTest : public testing::Test {
70 public: 75 public:
71 VideoCaptureDeviceTest(): wait_event_(false, false) { } 76 VideoCaptureDeviceTest(): wait_event_(false, false) { }
72 77
73 void PostQuitTask() { 78 void PostQuitTask() {
74 loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure()); 79 loop_->PostTask(FROM_HERE, MessageLoop::QuitClosure());
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 device->Allocate(1280, 720, 30, frame_observer_.get()); 286 device->Allocate(1280, 720, 30, frame_observer_.get());
282 287
283 device->Start(); 288 device->Start();
284 // Get captured video frames. 289 // Get captured video frames.
285 PostQuitTask(); 290 PostQuitTask();
286 EXPECT_TRUE(wait_event_.TimedWait(TestTimeouts::action_max_timeout())); 291 EXPECT_TRUE(wait_event_.TimedWait(TestTimeouts::action_max_timeout()));
287 device->DeAllocate(); 292 device->DeAllocate();
288 } 293 }
289 294
290 }; // namespace media 295 }; // namespace media
OLDNEW
« no previous file with comments | « media/video/capture/video_capture_device.h ('k') | ui/surface/accelerated_surface_transformer_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698