| 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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 ARGB = 10, // 32bpp ARGB, 1 plane. | 63 ARGB = 10, // 32bpp ARGB, 1 plane. |
| 64 YV12HD = 11, // Rec709 "HD" color space version of YV12 | 64 YV12HD = 11, // Rec709 "HD" color space version of YV12 |
| 65 // Please update UMA histogram enumeration when adding new formats here. | 65 // Please update UMA histogram enumeration when adding new formats here. |
| 66 FORMAT_MAX = YV12HD, // Must always be equal to largest entry logged. | 66 FORMAT_MAX = YV12HD, // Must always be equal to largest entry logged. |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 // Defines the internal format and the number of the textures in the mailbox | 69 // Defines the internal format and the number of the textures in the mailbox |
| 70 // holders. | 70 // holders. |
| 71 enum TextureFormat { | 71 enum TextureFormat { |
| 72 TEXTURE_RGBA, // One RGBA texture. | 72 TEXTURE_RGBA, // One RGBA texture. |
| 73 TEXTURE_RGB, // One RGB texture. |
| 73 TEXTURE_YUV_420, // 3 RED textures one per channel. UV are 2x2 subsampled. | 74 TEXTURE_YUV_420, // 3 RED textures one per channel. UV are 2x2 subsampled. |
| 74 }; | 75 }; |
| 75 | 76 |
| 76 // Returns the name of a Format as a string. | 77 // Returns the name of a Format as a string. |
| 77 static std::string FormatToString(Format format); | 78 static std::string FormatToString(Format format); |
| 78 | 79 |
| 79 // Creates a new frame in system memory with given parameters. Buffers for | 80 // Creates a new frame in system memory with given parameters. Buffers for |
| 80 // the frame are allocated but not initialized. | 81 // the frame are allocated but not initialized. |
| 81 static scoped_refptr<VideoFrame> CreateFrame( | 82 static scoped_refptr<VideoFrame> CreateFrame( |
| 82 Format format, | 83 Format format, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 105 // The backing of the VideoFrame is held in the mailbox held by | 106 // The backing of the VideoFrame is held in the mailbox held by |
| 106 // |mailbox_holder|, and |mailbox_holder_release_cb| will be called with | 107 // |mailbox_holder|, and |mailbox_holder_release_cb| will be called with |
| 107 // a syncpoint as the argument when the VideoFrame is to be destroyed. | 108 // a syncpoint as the argument when the VideoFrame is to be destroyed. |
| 108 static scoped_refptr<VideoFrame> WrapNativeTexture( | 109 static scoped_refptr<VideoFrame> WrapNativeTexture( |
| 109 const gpu::MailboxHolder& mailbox_holder, | 110 const gpu::MailboxHolder& mailbox_holder, |
| 110 const ReleaseMailboxCB& mailbox_holder_release_cb, | 111 const ReleaseMailboxCB& mailbox_holder_release_cb, |
| 111 const gfx::Size& coded_size, | 112 const gfx::Size& coded_size, |
| 112 const gfx::Rect& visible_rect, | 113 const gfx::Rect& visible_rect, |
| 113 const gfx::Size& natural_size, | 114 const gfx::Size& natural_size, |
| 114 base::TimeDelta timestamp, | 115 base::TimeDelta timestamp, |
| 115 bool allow_overlay); | 116 bool allow_overlay, |
| 117 bool has_alpha); |
| 116 | 118 |
| 117 // Wraps a set of native textures representing YUV data with a VideoFrame. | 119 // Wraps a set of native textures representing YUV data with a VideoFrame. |
| 118 // |mailbox_holders_release_cb| will be called with a syncpoint as the | 120 // |mailbox_holders_release_cb| will be called with a syncpoint as the |
| 119 // argument when the VideoFrame is to be destroyed. | 121 // argument when the VideoFrame is to be destroyed. |
| 120 static scoped_refptr<VideoFrame> WrapYUV420NativeTextures( | 122 static scoped_refptr<VideoFrame> WrapYUV420NativeTextures( |
| 121 const gpu::MailboxHolder& y_mailbox_holder, | 123 const gpu::MailboxHolder& y_mailbox_holder, |
| 122 const gpu::MailboxHolder& u_mailbox_holder, | 124 const gpu::MailboxHolder& u_mailbox_holder, |
| 123 const gpu::MailboxHolder& v_mailbox_holder, | 125 const gpu::MailboxHolder& v_mailbox_holder, |
| 124 const ReleaseMailboxCB& mailbox_holders_release_cb, | 126 const ReleaseMailboxCB& mailbox_holders_release_cb, |
| 125 const gfx::Size& coded_size, | 127 const gfx::Size& coded_size, |
| (...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 VideoFrameMetadata metadata_; | 443 VideoFrameMetadata metadata_; |
| 442 | 444 |
| 443 bool allow_overlay_; | 445 bool allow_overlay_; |
| 444 | 446 |
| 445 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 447 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
| 446 }; | 448 }; |
| 447 | 449 |
| 448 } // namespace media | 450 } // namespace media |
| 449 | 451 |
| 450 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 452 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |