| 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 // Implementation of a fake VideoCaptureDevice class. Used for testing other | 5 // Implementation of a fake VideoCaptureDevice class. Used for testing other |
| 6 // video capture classes when no real hardware is available. | 6 // video capture classes when no real hardware is available. |
| 7 | 7 |
| 8 #ifndef MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 8 #ifndef MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
| 9 #define MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 9 #define MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 | 47 |
| 48 // |thread_checker_| is used to check that all methods are called in the | 48 // |thread_checker_| is used to check that all methods are called in the |
| 49 // correct thread that owns the object. | 49 // correct thread that owns the object. |
| 50 base::ThreadChecker thread_checker_; | 50 base::ThreadChecker thread_checker_; |
| 51 | 51 |
| 52 const FakeVideoCaptureDeviceType device_type_; | 52 const FakeVideoCaptureDeviceType device_type_; |
| 53 | 53 |
| 54 scoped_ptr<VideoCaptureDevice::Client> client_; | 54 scoped_ptr<VideoCaptureDevice::Client> client_; |
| 55 // |fake_frame_| is used for capturing on Own Buffers. | 55 // |fake_frame_| is used for capturing on Own Buffers. |
| 56 scoped_ptr<uint8[]> fake_frame_; | 56 scoped_ptr<uint8[]> fake_frame_; |
| 57 // Target time for the next frame delivery. |
| 58 base::TimeTicks next_frame_time_; |
| 57 int frame_count_; | 59 int frame_count_; |
| 58 VideoCaptureFormat capture_format_; | 60 VideoCaptureFormat capture_format_; |
| 59 | 61 |
| 60 // FakeVideoCaptureDevice post tasks to itself for frame construction and | 62 // FakeVideoCaptureDevice post tasks to itself for frame construction and |
| 61 // needs to deal with asynchronous StopAndDeallocate(). | 63 // needs to deal with asynchronous StopAndDeallocate(). |
| 62 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_; | 64 base::WeakPtrFactory<FakeVideoCaptureDevice> weak_factory_; |
| 63 | 65 |
| 64 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); | 66 DISALLOW_COPY_AND_ASSIGN(FakeVideoCaptureDevice); |
| 65 }; | 67 }; |
| 66 | 68 |
| 67 } // namespace media | 69 } // namespace media |
| 68 | 70 |
| 69 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ | 71 #endif // MEDIA_VIDEO_CAPTURE_FAKE_VIDEO_CAPTURE_DEVICE_H_ |
| OLD | NEW |