Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / media / video / capture / video_capture_types.h
index ec57c45..91118b9 100644 (file)
@@ -16,18 +16,18 @@ namespace media {
 // shared with device manager.
 typedef int VideoCaptureSessionId;
 
-// Color formats from camera.
+// Color formats from camera. This list is sorted in order of preference.
 enum VideoPixelFormat {
-  PIXEL_FORMAT_UNKNOWN,  // Color format not set.
   PIXEL_FORMAT_I420,
-  PIXEL_FORMAT_YUY2,
+  PIXEL_FORMAT_YV12,
+  PIXEL_FORMAT_NV21,
   PIXEL_FORMAT_UYVY,
+  PIXEL_FORMAT_YUY2,
   PIXEL_FORMAT_RGB24,
   PIXEL_FORMAT_ARGB,
   PIXEL_FORMAT_MJPEG,
-  PIXEL_FORMAT_NV21,
-  PIXEL_FORMAT_YV12,
   PIXEL_FORMAT_TEXTURE,  // Capture format as a GL texture.
+  PIXEL_FORMAT_UNKNOWN,  // Color format not set.
   PIXEL_FORMAT_MAX,
 };
 
@@ -36,7 +36,7 @@ enum ResolutionChangePolicy {
   // Capture device outputs a fixed resolution all the time. The resolution of
   // the first frame is the resolution for all frames.
   // It is implementation specific for the capture device to scale, letter-box
-  // and pillar-box. The only gurantee is that resolution will never change.
+  // and pillar-box. The only guarantee is that resolution will never change.
   RESOLUTION_POLICY_FIXED,
 
   // Capture device outputs frames with dynamic resolution. The width and height
@@ -75,8 +75,25 @@ class MEDIA_EXPORT VideoCaptureFormat {
   VideoPixelFormat pixel_format;
 };
 
+// Image capture format specification.
+// This class is used by the video capture device to specify the format of a
+// still image captured and returned to a client. A list of these is also
+// provided when client queries supported formats for still image capture.
+class MEDIA_EXPORT ImageCaptureFormat {
+ public:
+  ImageCaptureFormat();
+
+  ImageCaptureFormat(const gfx::Size& frame_size,
+                     VideoPixelFormat pixel_format);
+
+  gfx::Size frame_size;
+  VideoPixelFormat pixel_format;
+};
+
 typedef std::vector<VideoCaptureFormat> VideoCaptureFormats;
 
+typedef std::vector<ImageCaptureFormat> ImageCaptureFormats;
+
 // Parameters for starting video capture.
 // This class is used by the client of a video capture device to specify the
 // format of frames in which the client would like to have captured frames