Revert "Reland c91b178b07b0d - Delete dead signin code (SigninGlobalError)"
[chromium-blink-merge.git] / media / base / video_types.h
blob5e122edc7366014f46df3b0315e56735b052ea92
1 // Copyright 2015 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_BASE_VIDEO_TYPES_H_
6 #define MEDIA_BASE_VIDEO_TYPES_H_
8 #include <string>
10 #include "build/build_config.h"
11 #include "media/base/media_export.h"
13 namespace media {
15 // Pixel formats roughly based on FOURCC labels, see:
16 // http://www.fourcc.org/rgb.php and http://www.fourcc.org/yuv.php
17 // Logged to UMA, so never reuse values. Leave gaps if necessary.
18 enum VideoPixelFormat {
19 PIXEL_FORMAT_UNKNOWN = 0, // Unknown or unspecified format value.
20 PIXEL_FORMAT_YV12 = 1, // 12bpp YVU planar 1x1 Y, 2x2 VU samples.
21 PIXEL_FORMAT_I420 =
22 2, // 12bpp YUV planar 1x1 Y, 2x2 UV samples, a.k.a. YU12.
23 PIXEL_FORMAT_YV16 = 3, // 16bpp YVU planar 1x1 Y, 2x1 VU samples.
24 PIXEL_FORMAT_YV12A = 4, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples.
25 PIXEL_FORMAT_YV24 = 5, // 24bpp YUV planar, no subsampling.
26 PIXEL_FORMAT_NV12 =
27 6, // 12bpp with Y plane followed by a 2x2 interleaved UV plane.
28 PIXEL_FORMAT_ARGB = 7, // 32bpp ARGB, 1 plane.
29 PIXEL_FORMAT_XRGB = 8, // 24bpp XRGB, 1 plane.
30 PIXEL_FORMAT_UYVY = 9, // 16bpp UYVY 4:2:2, 1 plane.
31 // Please update UMA histogram enumeration when adding new formats here.
32 PIXEL_FORMAT_MAX =
33 PIXEL_FORMAT_UYVY, // Must always be equal to largest entry logged.
36 // Color space or color range used for the pixels.
37 // Logged to UMA, so never reuse values. Leave gaps if necessary.
38 enum ColorSpace {
39 COLOR_SPACE_UNSPECIFIED = 0, // In general this is Rec601.
40 // The JPEG color space is the combination of Rec.601 and full range colors
41 // (aka pc range colors).
42 COLOR_SPACE_JPEG = 1,
43 COLOR_SPACE_HD_REC709 = 2, // Rec709 "HD" color space.
44 COLOR_SPACE_SD_REC601 = 3, // Rec601 "SD" color space.
45 COLOR_SPACE_MAX = COLOR_SPACE_SD_REC601,
48 // Returns the name of a Format as a string.
49 MEDIA_EXPORT std::string VideoPixelFormatToString(VideoPixelFormat format);
51 // Returns true if |format| is a YUV format with multiple planes.
52 MEDIA_EXPORT bool IsYuvPlanar(VideoPixelFormat format);
54 } // namespace media
56 #endif // MEDIA_BASE_VIDEO_TYPES_H_