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. | |
mcasas
2014/09/08 09:09:53
s/gurantee/guarantee/
| |
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 19 matching lines...) Expand all Loading... | |
63 // This class is used by the client of a video capture device to specify the | 80 // This class is used by the client of a video capture device to specify the |
64 // format of frames in which the client would like to have captured frames | 81 // format of frames in which the client would like to have captured frames |
65 // returned. | 82 // returned. |
66 class MEDIA_EXPORT VideoCaptureParams { | 83 class MEDIA_EXPORT VideoCaptureParams { |
67 public: | 84 public: |
68 VideoCaptureParams(); | 85 VideoCaptureParams(); |
69 | 86 |
70 // Requests a resolution and format at which the capture will occur. | 87 // Requests a resolution and format at which the capture will occur. |
71 VideoCaptureFormat requested_format; | 88 VideoCaptureFormat requested_format; |
72 | 89 |
73 // Allow mid-capture resolution change. | 90 // Policy for resolution change. |
74 bool allow_resolution_change; | 91 ResolutionChangePolicy resolution_change_policy; |
75 }; | 92 }; |
76 | 93 |
77 } // namespace media | 94 } // namespace media |
78 | 95 |
79 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ | 96 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_ |
OLD | NEW |