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
3 // found in the LICENSE file.
5 #ifndef MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_
6 #define MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_
8 #include "media/base/video_frame.h"
12 // TODO(wjia): this type should be defined in a common place and
13 // shared with device manager.
14 typedef int VideoCaptureSessionId;
16 enum VideoCaptureResolutionType {
17 ConstantResolutionVideoCaptureDevice = 0,
18 VariableResolutionVideoCaptureDevice,
19 MaxVideoCaptureResolutionType, // Must be last.
22 // Color formats from camera.
23 enum VideoPixelFormat {
24 PIXEL_FORMAT_UNKNOWN, // Color format not set.
35 // Video capture format specification.
36 class MEDIA_EXPORT VideoCaptureFormat {
39 VideoCaptureFormat(int width,
42 VideoCaptureResolutionType frame_size_type);
44 // Checks that all values are in the expected range. All limits are specified
51 VideoCaptureResolutionType frame_size_type;
54 // Parameters for starting video capture.
55 class MEDIA_EXPORT VideoCaptureParams {
58 // Identifies which device is to be started.
59 VideoCaptureSessionId session_id;
61 // Requests a resolution and format at which the capture will occur.
62 VideoCaptureFormat requested_format;
65 // Capabilities describe the format a camera captures video in.
66 class MEDIA_EXPORT VideoCaptureCapability : public VideoCaptureFormat {
68 VideoCaptureCapability();
69 VideoCaptureCapability(int width,
72 VideoPixelFormat color,
73 VideoCaptureResolutionType frame_size_type);
75 VideoPixelFormat color; // Desired video type.
78 typedef std::vector<VideoCaptureCapability> VideoCaptureCapabilities;
82 #endif // MEDIA_VIDEO_CAPTURE_VIDEO_CAPTURE_TYPES_H_