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 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ | 5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ |
6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ | 6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "media/base/media_export.h" | 10 #include "media/base/media_export.h" |
(...skipping 14 matching lines...) Expand all Loading... |
25 PIXEL_FORMAT_RGB24, | 25 PIXEL_FORMAT_RGB24, |
26 PIXEL_FORMAT_ARGB, | 26 PIXEL_FORMAT_ARGB, |
27 PIXEL_FORMAT_MJPEG, | 27 PIXEL_FORMAT_MJPEG, |
28 PIXEL_FORMAT_NV21, | 28 PIXEL_FORMAT_NV21, |
29 PIXEL_FORMAT_YV12, | 29 PIXEL_FORMAT_YV12, |
30 PIXEL_FORMAT_MAX, | 30 PIXEL_FORMAT_MAX, |
31 }; | 31 }; |
32 | 32 |
33 // Video capture format specification. | 33 // Video capture format specification. |
34 // This class is used by the video capture device to specify the format of every | 34 // This class is used by the video capture device to specify the format of every |
35 // frame captured and returned to a client. | 35 // frame captured and returned to a client. It is also used to specify a |
| 36 // supported capture format by a device. |
36 class MEDIA_EXPORT VideoCaptureFormat { | 37 class MEDIA_EXPORT VideoCaptureFormat { |
37 public: | 38 public: |
38 VideoCaptureFormat(); | 39 VideoCaptureFormat(); |
39 VideoCaptureFormat(const gfx::Size& frame_size, | 40 VideoCaptureFormat(const gfx::Size& frame_size, |
40 int frame_rate, | 41 int frame_rate, |
41 VideoPixelFormat pixel_format); | 42 VideoPixelFormat pixel_format); |
42 | 43 |
43 // Checks that all values are in the expected range. All limits are specified | 44 // Checks that all values are in the expected range. All limits are specified |
44 // in media::Limits. | 45 // in media::Limits. |
45 bool IsValid() const; | 46 bool IsValid() const; |
46 | 47 |
47 gfx::Size frame_size; | 48 gfx::Size frame_size; |
48 int frame_rate; | 49 int frame_rate; |
49 VideoPixelFormat pixel_format; | 50 VideoPixelFormat pixel_format; |
50 }; | 51 }; |
51 | 52 |
| 53 typedef std::vector<VideoCaptureFormat> VideoCaptureFormats; |
| 54 |
52 // Parameters for starting video capture. | 55 // Parameters for starting video capture. |
53 // This class is used by the client of a video capture device to specify the | 56 // This class is used by the client of a video capture device to specify the |
54 // format of frames in which the client would like to have captured frames | 57 // format of frames in which the client would like to have captured frames |
55 // returned. | 58 // returned. |
56 class MEDIA_EXPORT VideoCaptureParams { | 59 class MEDIA_EXPORT VideoCaptureParams { |
57 public: | 60 public: |
58 VideoCaptureParams(); | 61 VideoCaptureParams(); |
59 | 62 |
60 // Requests a resolution and format at which the capture will occur. | 63 // Requests a resolution and format at which the capture will occur. |
61 VideoCaptureFormat requested_format; | 64 VideoCaptureFormat requested_format; |
62 | 65 |
63 // Allow mid-capture resolution change. | 66 // Allow mid-capture resolution change. |
64 bool allow_resolution_change; | 67 bool allow_resolution_change; |
65 }; | 68 }; |
66 | 69 |
67 // Capabilities describe the format a camera captures video in. | |
68 // This class is used by the video capture device to report the formats in which | |
69 // it is capable of capturing frames. | |
70 class MEDIA_EXPORT VideoCaptureCapability { | |
71 public: | |
72 VideoCaptureCapability(); | |
73 | |
74 // Supported resolution and format. | |
75 VideoCaptureFormat supported_format; | |
76 }; | |
77 | |
78 typedef std::vector<VideoCaptureCapability> VideoCaptureCapabilities; | |
79 | |
80 } // namespace media | 70 } // namespace media |
81 | 71 |
82 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ | 72 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ |
OLD | NEW |