| 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 <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 | 117 |
| 118 // Offers the same functionality as CreateFrame, and additionally zeroes out | 118 // Offers the same functionality as CreateFrame, and additionally zeroes out |
| 119 // the initial allocated buffers. | 119 // the initial allocated buffers. |
| 120 static scoped_refptr<VideoFrame> CreateZeroInitializedFrame( | 120 static scoped_refptr<VideoFrame> CreateZeroInitializedFrame( |
| 121 VideoPixelFormat format, | 121 VideoPixelFormat format, |
| 122 const gfx::Size& coded_size, | 122 const gfx::Size& coded_size, |
| 123 const gfx::Rect& visible_rect, | 123 const gfx::Rect& visible_rect, |
| 124 const gfx::Size& natural_size, | 124 const gfx::Size& natural_size, |
| 125 base::TimeDelta timestamp); | 125 base::TimeDelta timestamp); |
| 126 | 126 |
| 127 // Wraps a native texture of the given parameters with a VideoFrame. | 127 // Wraps a set of native textures with a VideoFrame. |
| 128 // The backing of the VideoFrame is held in the mailbox held by | |
| 129 // |mailbox_holder|, and |mailbox_holder_release_cb| will be called with | |
| 130 // a sync token as the argument when the VideoFrame is to be destroyed. | |
| 131 static scoped_refptr<VideoFrame> WrapNativeTexture( | |
| 132 VideoPixelFormat format, | |
| 133 const gpu::MailboxHolder& mailbox_holder, | |
| 134 const ReleaseMailboxCB& mailbox_holder_release_cb, | |
| 135 const gfx::Size& coded_size, | |
| 136 const gfx::Rect& visible_rect, | |
| 137 const gfx::Size& natural_size, | |
| 138 base::TimeDelta timestamp); | |
| 139 | |
| 140 // Wraps a set of native textures representing YUV data with a VideoFrame. | |
| 141 // |mailbox_holders_release_cb| will be called with a sync token as the | 128 // |mailbox_holders_release_cb| will be called with a sync token as the |
| 142 // argument when the VideoFrame is to be destroyed. | 129 // argument when the VideoFrame is to be destroyed. |
| 143 static scoped_refptr<VideoFrame> WrapYUV420NativeTextures( | 130 static scoped_refptr<VideoFrame> WrapNativeTextures( |
| 144 const gpu::MailboxHolder& y_mailbox_holder, | 131 VideoPixelFormat format, |
| 145 const gpu::MailboxHolder& u_mailbox_holder, | 132 const gpu::MailboxHolder (&mailbox_holder)[kMaxPlanes], |
| 146 const gpu::MailboxHolder& v_mailbox_holder, | |
| 147 const ReleaseMailboxCB& mailbox_holders_release_cb, | 133 const ReleaseMailboxCB& mailbox_holders_release_cb, |
| 148 const gfx::Size& coded_size, | 134 const gfx::Size& coded_size, |
| 149 const gfx::Rect& visible_rect, | 135 const gfx::Rect& visible_rect, |
| 150 const gfx::Size& natural_size, | 136 const gfx::Size& natural_size, |
| 151 base::TimeDelta timestamp); | 137 base::TimeDelta timestamp); |
| 152 | 138 |
| 153 // Wraps packed image data residing in a memory buffer with a VideoFrame. | 139 // Wraps packed image data residing in a memory buffer with a VideoFrame. |
| 154 // The image data resides in |data| and is assumed to be packed tightly in a | 140 // The image data resides in |data| and is assumed to be packed tightly in a |
| 155 // buffer of logical dimensions |coded_size| with the appropriate bit depth | 141 // buffer of logical dimensions |coded_size| with the appropriate bit depth |
| 156 // and plane count as given by |format|. Returns NULL on failure. | 142 // and plane count as given by |format|. Returns NULL on failure. |
| (...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 gpu::SyncToken release_sync_token_; | 549 gpu::SyncToken release_sync_token_; |
| 564 | 550 |
| 565 VideoFrameMetadata metadata_; | 551 VideoFrameMetadata metadata_; |
| 566 | 552 |
| 567 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 553 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
| 568 }; | 554 }; |
| 569 | 555 |
| 570 } // namespace media | 556 } // namespace media |
| 571 | 557 |
| 572 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 558 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
| OLD | NEW |