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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
46 YV16 = 7, // 16bpp YVU planar 1x1 Y, 2x1 VU samples | 46 YV16 = 7, // 16bpp YVU planar 1x1 Y, 2x1 VU samples |
47 EMPTY = 9, // An empty frame. | 47 EMPTY = 9, // An empty frame. |
48 I420 = 11, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. | 48 I420 = 11, // 12bpp YVU planar 1x1 Y, 2x2 UV samples. |
49 NATIVE_TEXTURE = 12, // Native texture. Pixel-format agnostic. | 49 NATIVE_TEXTURE = 12, // Native texture. Pixel-format agnostic. |
50 #if defined(GOOGLE_TV) | 50 #if defined(GOOGLE_TV) |
51 HOLE = 13, // Hole frame. | 51 HOLE = 13, // Hole frame. |
52 #endif | 52 #endif |
53 YV12A = 14, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. | 53 YV12A = 14, // 20bpp YUVA planar 1x1 Y, 2x2 VU, 1x1 A samples. |
54 }; | 54 }; |
55 | 55 |
56 static std::string FormatToString(Format format) { | |
scherkus (not reviewing)
2013/08/02 23:18:19
don't inline this function declaration inside the
Ty Overby
2013/08/03 00:02:23
Done.
| |
57 switch(format){ | |
58 case VideoFrame::Format::INVALID: | |
59 return "INVALID"; | |
60 case VideoFrame::Format::RGB32: | |
61 return "RGB32"; | |
62 case VideoFrame::Format::YV12: | |
63 return "YV12"; | |
64 case VideoFrame::Format::YV16: | |
65 return "YV16"; | |
66 case VideoFrame::Format::EMPTY: | |
67 return "EMPTY"; | |
68 case VideoFrame::Format::I420: | |
69 return "I420"; | |
70 case VideoFrame::Format::YV12A: | |
71 return "YV12A"; | |
72 case VideoFrame::Format::NATIVE_TEXTURE: | |
73 return "NATIVE_TEXTURE"; | |
74 } | |
75 } | |
76 | |
56 // This class calls the TextureNoLongerNeededCallback when the last reference | 77 // This class calls the TextureNoLongerNeededCallback when the last reference |
57 // on the class is destroyed. The VideoFrame holds a reference to the mailbox | 78 // on the class is destroyed. The VideoFrame holds a reference to the mailbox |
58 // but anyone else who queries the mailbox should also hold a reference while | 79 // but anyone else who queries the mailbox should also hold a reference while |
59 // it is uses the mailbox, to ensure it remains valid. When finished with the | 80 // it is uses the mailbox, to ensure it remains valid. When finished with the |
60 // mailbox, call Return() with a new sync point, to ensure the mailbox remains | 81 // mailbox, call Return() with a new sync point, to ensure the mailbox remains |
61 // valid for the issued commands. | 82 // valid for the issued commands. |
62 class MEDIA_EXPORT MailboxHolder | 83 class MEDIA_EXPORT MailboxHolder |
63 : public base::RefCountedThreadSafe<MailboxHolder> { | 84 : public base::RefCountedThreadSafe<MailboxHolder> { |
64 public: | 85 public: |
65 typedef base::Callback<void(uint32 sync_point)> | 86 typedef base::Callback<void(uint32 sync_point)> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
266 base::Closure no_longer_needed_cb_; | 287 base::Closure no_longer_needed_cb_; |
267 | 288 |
268 base::TimeDelta timestamp_; | 289 base::TimeDelta timestamp_; |
269 | 290 |
270 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 291 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
271 }; | 292 }; |
272 | 293 |
273 } // namespace media | 294 } // namespace media |
274 | 295 |
275 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 296 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |