| 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_BASE_VIDEO_FRAME_H_ | 5 #ifndef MEDIA_BASE_VIDEO_FRAME_H_ |
| 6 #define MEDIA_BASE_VIDEO_FRAME_H_ | 6 #define MEDIA_BASE_VIDEO_FRAME_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 enum { | 33 enum { |
| 34 kFrameSizeAlignment = 16, | 34 kFrameSizeAlignment = 16, |
| 35 kFrameSizePadding = 16, | 35 kFrameSizePadding = 16, |
| 36 kFrameAddressAlignment = 32 | 36 kFrameAddressAlignment = 32 |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 enum { | 39 enum { |
| 40 kMaxPlanes = 4, | 40 kMaxPlanes = 4, |
| 41 | 41 |
| 42 kYPlane = 0, | 42 kYPlane = 0, |
| 43 kARGBPlane = kYPlane, | |
| 44 kUPlane = 1, | 43 kUPlane = 1, |
| 45 kUVPlane = kUPlane, | 44 kUVPlane = kUPlane, |
| 46 kVPlane = 2, | 45 kVPlane = 2, |
| 47 kAPlane = 3, | 46 kAPlane = 3, |
| 48 }; | 47 }; |
| 49 | 48 |
| 50 // Surface formats roughly based on FOURCC labels, see: | 49 // Surface formats roughly based on FOURCC labels, see: |
| 51 // http://www.fourcc.org/rgb.php | 50 // http://www.fourcc.org/rgb.php |
| 52 // http://www.fourcc.org/yuv.php | 51 // http://www.fourcc.org/yuv.php |
| 53 // Logged to UMA, so never reuse values. | 52 // Logged to UMA, so never reuse values. |
| 54 enum Format { | 53 enum Format { |
| 55 UNKNOWN = 0, // Unknown format value. | 54 UNKNOWN = 0, // Unknown format value. |
| 56 YV12 = 1, // 12bpp YVU planar 1x1 Y, 2x2 VU samples | 55 YV12 = 1, // 12bpp YVU planar 1x1 Y, 2x2 VU samples |
| 57 YV16 = 2, // 16bpp YVU planar 1x1 Y, 2x1 VU samples | 56 YV16 = 2, // 16bpp YVU planar 1x1 Y, 2x1 VU samples |
| 58 I420 = 3, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. | 57 I420 = 3, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. |
| 59 YV12A = 4, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. | 58 YV12A = 4, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. |
| 60 #if defined(VIDEO_HOLE) | 59 #if defined(VIDEO_HOLE) |
| 61 HOLE = 5, // Hole frame. | 60 HOLE = 5, // Hole frame. |
| 62 #endif // defined(VIDEO_HOLE) | 61 #endif // defined(VIDEO_HOLE) |
| 63 NATIVE_TEXTURE = 6, // Native texture. Pixel-format agnostic. | 62 NATIVE_TEXTURE = 6, // Native texture. Pixel-format agnostic. |
| 64 YV12J = 7, // JPEG color range version of YV12 | 63 YV12J = 7, // JPEG color range version of YV12 |
| 65 NV12 = 8, // 12bpp 1x1 Y plane followed by an interleaved 2x2 UV plane. | 64 NV12 = 8, // 12bpp 1x1 Y plane followed by an interleaved 2x2 UV plane. |
| 66 YV24 = 9, // 24bpp YUV planar, no subsampling. | 65 YV24 = 9, // 24bpp YUV planar, no subsampling. |
| 67 ARGB = 10, // 32bpp ARGB, 1 plane. | 66 FORMAT_MAX = YV24, // Must always be equal to largest entry logged. |
| 68 // Please update UMA histogram enumeration when adding new formats here. | |
| 69 FORMAT_MAX = ARGB, // Must always be equal to largest entry logged. | |
| 70 }; | 67 }; |
| 71 | 68 |
| 72 // Returns the name of a Format as a string. | 69 // Returns the name of a Format as a string. |
| 73 static std::string FormatToString(Format format); | 70 static std::string FormatToString(Format format); |
| 74 | 71 |
| 75 // Creates a new frame in system memory with given parameters. Buffers for | 72 // Creates a new frame in system memory with given parameters. Buffers for |
| 76 // the frame are allocated but not initialized. | 73 // the frame are allocated but not initialized. |
| 77 static scoped_refptr<VideoFrame> CreateFrame( | 74 static scoped_refptr<VideoFrame> CreateFrame( |
| 78 Format format, | 75 Format format, |
| 79 const gfx::Size& coded_size, | 76 const gfx::Size& coded_size, |
| (...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 uint32 release_sync_point_; | 405 uint32 release_sync_point_; |
| 409 | 406 |
| 410 const bool end_of_stream_; | 407 const bool end_of_stream_; |
| 411 | 408 |
| 412 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 409 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
| 413 }; | 410 }; |
| 414 | 411 |
| 415 } // namespace media | 412 } // namespace media |
| 416 | 413 |
| 417 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 414 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |