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 13 matching lines...) Expand all Loading... |
24 PIXEL_FORMAT_UYVY, | 24 PIXEL_FORMAT_UYVY, |
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_TEXTURE, // Capture format as a GL texture. | 30 PIXEL_FORMAT_TEXTURE, // Capture format as a GL texture. |
31 PIXEL_FORMAT_MAX, | 31 PIXEL_FORMAT_MAX, |
32 }; | 32 }; |
33 | 33 |
| 34 // Policies for capture devices that has source content with dynamic resolution. |
| 35 enum ResolutionChangePolicy { |
| 36 // Capture device outputs a fixed resolution all the time. The resolution of |
| 37 // the first frame is the resolution for all frames. |
| 38 // It is implementation specific for the capture device to scale, letter-box |
| 39 // and pillar-box. The only gurantee is that resolution will never change. |
| 40 RESOLUTION_POLICY_FIXED, |
| 41 |
| 42 // Capture device outputs frames with dynamic resolution. The width and height |
| 43 // will not exceed the maximum dimensions specified. The typical scenario is |
| 44 // the frames will have the same aspect ratio as the original content and |
| 45 // scaled down to fit inside the limit. |
| 46 RESOLUTION_POLICY_DYNAMIC_WITHIN_LIMIT, |
| 47 |
| 48 RESOLUTION_POLICY_LAST, |
| 49 }; |
| 50 |
34 // Some drivers use rational time per frame instead of float frame rate, this | 51 // Some drivers use rational time per frame instead of float frame rate, this |
35 // constant k is used to convert between both: A fps -> [k/k*A] seconds/frame. | 52 // constant k is used to convert between both: A fps -> [k/k*A] seconds/frame. |
36 const int kFrameRatePrecision = 10000; | 53 const int kFrameRatePrecision = 10000; |
37 | 54 |
38 // Video capture format specification. | 55 // Video capture format specification. |
39 // This class is used by the video capture device to specify the format of every | 56 // This class is used by the video capture device to specify the format of every |
40 // frame captured and returned to a client. It is also used to specify a | 57 // frame captured and returned to a client. It is also used to specify a |
41 // supported capture format by a device. | 58 // supported capture format by a device. |
42 class MEDIA_EXPORT VideoCaptureFormat { | 59 class MEDIA_EXPORT VideoCaptureFormat { |
43 public: | 60 public: |
(...skipping 20 matching lines...) Expand all Loading... |
64 // This class is used by the client of a video capture device to specify the | 81 // This class is used by the client of a video capture device to specify the |
65 // format of frames in which the client would like to have captured frames | 82 // format of frames in which the client would like to have captured frames |
66 // returned. | 83 // returned. |
67 class MEDIA_EXPORT VideoCaptureParams { | 84 class MEDIA_EXPORT VideoCaptureParams { |
68 public: | 85 public: |
69 VideoCaptureParams(); | 86 VideoCaptureParams(); |
70 | 87 |
71 // Requests a resolution and format at which the capture will occur. | 88 // Requests a resolution and format at which the capture will occur. |
72 VideoCaptureFormat requested_format; | 89 VideoCaptureFormat requested_format; |
73 | 90 |
74 // Allow mid-capture resolution change. | 91 // Policy for resolution change. |
75 bool allow_resolution_change; | 92 ResolutionChangePolicy resolution_change_policy; |
76 }; | 93 }; |
77 | 94 |
78 } // namespace media | 95 } // namespace media |
79 | 96 |
80 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ | 97 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ |
OLD | NEW |