Chromium Code Reviews| 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 "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/md5.h" | 9 #include "base/md5.h" |
| 10 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
| (...skipping 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 kYPlane = 0, | 33 kYPlane = 0, |
| 34 kUPlane = 1, | 34 kUPlane = 1, |
| 35 kVPlane = 2, | 35 kVPlane = 2, |
| 36 kAPlane = 3, | 36 kAPlane = 3, |
| 37 }; | 37 }; |
| 38 | 38 |
| 39 // Surface formats roughly based on FOURCC labels, see: | 39 // Surface formats roughly based on FOURCC labels, see: |
| 40 // http://www.fourcc.org/rgb.php | 40 // http://www.fourcc.org/rgb.php |
| 41 // http://www.fourcc.org/yuv.php | 41 // http://www.fourcc.org/yuv.php |
| 42 // Logged to UMA, so never reuse values. | |
| 42 enum Format { | 43 enum Format { |
| 43 INVALID = 0, // Invalid format value. Used for error reporting. | 44 INVALID = 0, // Invalid format value. Used for error reporting. |
| 44 RGB32 = 4, // 32bpp RGB packed with extra byte 8:8:8 | 45 RGB32 = 4, // 32bpp RGB packed with extra byte 8:8:8 |
| 45 YV12 = 6, // 12bpp YVU planar 1x1 Y, 2x2 VU samples | 46 YV12 = 6, // 12bpp YVU planar 1x1 Y, 2x2 VU samples |
| 46 YV16 = 7, // 16bpp YVU planar 1x1 Y, 2x1 VU samples | 47 YV16 = 7, // 16bpp YVU planar 1x1 Y, 2x1 VU samples |
| 47 EMPTY = 9, // An empty frame. | 48 EMPTY = 9, // An empty frame. |
| 48 I420 = 11, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. | 49 I420 = 11, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. |
| 49 NATIVE_TEXTURE = 12, // Native texture. Pixel-format agnostic. | 50 NATIVE_TEXTURE = 12, // Native texture. Pixel-format agnostic. |
| 50 #if defined(GOOGLE_TV) | 51 #if defined(GOOGLE_TV) |
| 51 HOLE = 13, // Hole frame. | 52 HOLE = 13, // Hole frame. |
| 52 #endif | 53 #endif |
| 53 YV12A = 14, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. | 54 YV12A = 14, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. |
| 55 FORMAT_HISTOGRAM_MAX, // Must be greater than all other formats. | |
|
scherkus (not reviewing)
2013/10/30 19:37:06
since we don't prefix the other enums here with FO
| |
| 54 }; | 56 }; |
| 55 | 57 |
| 56 // Returns the name of a Format as a string. | 58 // Returns the name of a Format as a string. |
| 57 static std::string FormatToString(Format format); | 59 static std::string FormatToString(Format format); |
| 58 | 60 |
| 59 // This class calls the TextureNoLongerNeededCallback when the last reference | 61 // This class calls the TextureNoLongerNeededCallback when the last reference |
| 60 // on the class is destroyed. The VideoFrame holds a reference to the mailbox | 62 // on the class is destroyed. The VideoFrame holds a reference to the mailbox |
| 61 // but anyone else who queries the mailbox should also hold a reference while | 63 // but anyone else who queries the mailbox should also hold a reference while |
| 62 // it is uses the mailbox, to ensure it remains valid. When finished with the | 64 // it is uses the mailbox, to ensure it remains valid. When finished with the |
| 63 // mailbox, call Return() with a new sync point, to ensure the mailbox remains | 65 // mailbox, call Return() with a new sync point, to ensure the mailbox remains |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 290 base::Closure no_longer_needed_cb_; | 292 base::Closure no_longer_needed_cb_; |
| 291 | 293 |
| 292 base::TimeDelta timestamp_; | 294 base::TimeDelta timestamp_; |
| 293 | 295 |
| 294 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 296 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
| 295 }; | 297 }; |
| 296 | 298 |
| 297 } // namespace media | 299 } // namespace media |
| 298 | 300 |
| 299 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 301 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |