OLD | NEW |
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 <map> | 5 #include <map> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 } | 249 } |
250 | 250 |
251 // Called on the VideoCaptureManager thread. | 251 // Called on the VideoCaptureManager thread. |
252 static void PostQuitMessageLoop(MessageLoop* message_loop) { | 252 static void PostQuitMessageLoop(MessageLoop* message_loop) { |
253 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 253 message_loop->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
254 } | 254 } |
255 | 255 |
256 // Called on the main thread. | 256 // Called on the main thread. |
257 static void PostQuitOnVideoCaptureManagerThread( | 257 static void PostQuitOnVideoCaptureManagerThread( |
258 MessageLoop* message_loop, content::ResourceContext* resource_context) { | 258 MessageLoop* message_loop, content::ResourceContext* resource_context) { |
259 resource_context->media_stream_manager()->video_capture_manager()-> | 259 resource_context->GetMediaStreamManager()->video_capture_manager()-> |
260 GetMessageLoop()->PostTask(FROM_HERE, | 260 GetMessageLoop()->PostTask(FROM_HERE, |
261 base::Bind(&PostQuitMessageLoop, | 261 base::Bind(&PostQuitMessageLoop, |
262 message_loop)); | 262 message_loop)); |
263 } | 263 } |
264 | 264 |
265 // SyncWithVideoCaptureManagerThread() waits until all pending tasks on the | 265 // SyncWithVideoCaptureManagerThread() waits until all pending tasks on the |
266 // video_capture_manager thread are executed while also processing pending | 266 // video_capture_manager thread are executed while also processing pending |
267 // task in message_loop_ on the current thread. It is used to synchronize | 267 // task in message_loop_ on the current thread. It is used to synchronize |
268 // with the video capture manager thread when we are stopping a video | 268 // with the video capture manager thread when we are stopping a video |
269 // capture device. | 269 // capture device. |
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 } | 406 } |
407 | 407 |
408 #ifdef DUMP_VIDEO | 408 #ifdef DUMP_VIDEO |
409 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { | 409 TEST_F(VideoCaptureHostTest, CaptureAndDumpVideoVga) { |
410 CaptureAndDumpVideo(640, 480, 30); | 410 CaptureAndDumpVideo(640, 480, 30); |
411 } | 411 } |
412 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { | 412 TEST_F(VideoCaptureHostTest, CaptureAndDump720P) { |
413 CaptureAndDumpVideo(1280, 720, 30); | 413 CaptureAndDumpVideo(1280, 720, 30); |
414 } | 414 } |
415 #endif | 415 #endif |
OLD | NEW |