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 // VideoCaptureDevice is the abstract base class for realizing video capture | 5 // VideoCaptureDevice is the abstract base class for realizing video capture |
6 // device support in Chromium. It provides the interface for OS dependent | 6 // device support in Chromium. It provides the interface for OS dependent |
7 // implementations. | 7 // implementations. |
8 // The class is created and functions are invoked on a thread owned by | 8 // The class is created and functions are invoked on a thread owned by |
9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS | 9 // VideoCaptureManager. Capturing is done on other threads, depending on the OS |
10 // specific implementation. | 10 // specific implementation. |
11 | 11 |
12 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 12 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
13 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 13 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
14 | 14 |
| 15 #include <stdint.h> |
15 #include <list> | 16 #include <list> |
16 #include <string> | 17 #include <string> |
17 | 18 |
18 #include "base/logging.h" | 19 #include "base/logging.h" |
19 #include "base/memory/ref_counted.h" | 20 #include "base/memory/ref_counted.h" |
20 #include "base/memory/scoped_ptr.h" | 21 #include "base/memory/scoped_ptr.h" |
21 #include "base/single_thread_task_runner.h" | 22 #include "base/single_thread_task_runner.h" |
22 #include "base/time/time.h" | 23 #include "base/time/time.h" |
23 #include "media/base/media_export.h" | 24 #include "media/base/media_export.h" |
24 #include "media/base/video_frame.h" | 25 #include "media/base/video_frame.h" |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 // | 318 // |
318 // This function must be called between InitializeImageCapture() and | 319 // This function must be called between InitializeImageCapture() and |
319 // ReleaseImageCapture(). | 320 // ReleaseImageCapture(). |
320 virtual void CaptureImage() {} | 321 virtual void CaptureImage() {} |
321 | 322 |
322 protected: | 323 protected: |
323 static const int kPowerLine50Hz = 50; | 324 static const int kPowerLine50Hz = 50; |
324 static const int kPowerLine60Hz = 60; | 325 static const int kPowerLine60Hz = 60; |
325 }; | 326 }; |
326 | 327 |
| 328 // Helper function to compare video capture formats when finding the most |
| 329 // closely matched video format given a requested video format. |
| 330 // Smaller difference means more closely matched formats. |
| 331 // Prioritizes according to this list: |
| 332 // 1. Closest matching height. |
| 333 // 2. Closest matching width. |
| 334 // 3. Closest matching frame rate. |
| 335 // 4. Best color format. |
| 336 // Nr 4. is not commutative, i.e. the order of the inputs to this |
| 337 // function matters. |
| 338 uint64_t DiffVideoCaptureFormat(const VideoCaptureFormat& requested, |
| 339 const VideoCaptureFormat& supported); |
| 340 |
327 } // namespace media | 341 } // namespace media |
328 | 342 |
329 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ | 343 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_DEVICE_H_ |
OLD | NEW |