Chromium Code Reviews| Index: media/base/video_capture_types.h |
| diff --git a/media/base/video_capture_types.h b/media/base/video_capture_types.h |
| index 8483a2dd42f5cb03015dffda309f08efdae20727..2f777b073f9d6f0ab06471949edb4dd94c736d6a 100644 |
| --- a/media/base/video_capture_types.h |
| +++ b/media/base/video_capture_types.h |
| @@ -18,6 +18,7 @@ namespace media { |
| typedef int VideoCaptureSessionId; |
| // Color formats from camera. This list is sorted in order of preference. |
| +// TODO(mcasas): Consider if this list can be merged with media::Format. |
| enum VideoPixelFormat { |
| PIXEL_FORMAT_I420, |
| PIXEL_FORMAT_YV12, |
| @@ -29,12 +30,19 @@ enum VideoPixelFormat { |
| PIXEL_FORMAT_RGB32, |
| PIXEL_FORMAT_ARGB, |
| PIXEL_FORMAT_MJPEG, |
| - PIXEL_FORMAT_TEXTURE, // Capture format as a GL texture. |
| - PIXEL_FORMAT_GPUMEMORYBUFFER, |
| PIXEL_FORMAT_UNKNOWN, // Color format not set. |
| PIXEL_FORMAT_MAX, |
| }; |
| +// Storage type for the pixels. In principle, all combinations of Storage and |
| +// Format are possible, though some are very typical, such as texture + ARGB, |
| +// and others are only available if the platform allows it e.g. GpuMemoryBuffer. |
| +enum VideoPixelStorage { |
| + PIXEL_STORAGE_CPU, |
| + PIXEL_STORAGE_TEXTURE, |
| + PIXEL_STORAGE_GPUMEMORYBUFFER, |
| +}; |
| + |
| // Policies for capture devices that have source content that varies in size. |
| // It is up to the implementation how the captured content will be transformed |
| // (e.g., scaling and/or letterboxing) in order to produce video frames that |
| @@ -70,9 +78,15 @@ struct MEDIA_EXPORT VideoCaptureFormat { |
| VideoCaptureFormat(const gfx::Size& frame_size, |
| float frame_rate, |
| VideoPixelFormat pixel_format); |
| + VideoCaptureFormat(const gfx::Size& frame_size, |
| + float frame_rate, |
| + VideoPixelFormat pixel_format, |
| + VideoPixelStorage pixel_storage); |
| + // TODO(mcasas): Remove this method http://crbug.com/501134. |
| std::string ToString() const; |
| static std::string PixelFormatToString(VideoPixelFormat format); |
| + static std::string PixelStorageToString(VideoPixelStorage storage); |
| // Returns the required buffer size to hold an image of a given |
| // VideoCaptureFormat with no padding and tightly packed. |
| @@ -91,6 +105,7 @@ struct MEDIA_EXPORT VideoCaptureFormat { |
| gfx::Size frame_size; |
| float frame_rate; |
| VideoPixelFormat pixel_format; |
| + VideoPixelStorage pixel_storage; |
|
miu
2015/06/23 22:58:15
Should this extra field be added in content/common
mcasas
2015/06/23 23:24:43
I don't understand, VideoPixelStorage is not
sent
miu
2015/06/23 23:35:55
I meant: There's a declaration of the VideoCapture
mcasas
2015/06/24 00:16:39
Oh yes, media_param_traits.cc, good catch, thanks.
|
| }; |
| typedef std::vector<VideoCaptureFormat> VideoCaptureFormats; |