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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 int32_t u_stride, | 198 int32_t u_stride, |
199 int32_t v_stride, | 199 int32_t v_stride, |
200 uint8_t* y_data, | 200 uint8_t* y_data, |
201 uint8_t* u_data, | 201 uint8_t* u_data, |
202 uint8_t* v_data, | 202 uint8_t* v_data, |
203 const gfx::GpuMemoryBufferHandle& y_handle, | 203 const gfx::GpuMemoryBufferHandle& y_handle, |
204 const gfx::GpuMemoryBufferHandle& u_handle, | 204 const gfx::GpuMemoryBufferHandle& u_handle, |
205 const gfx::GpuMemoryBufferHandle& v_handle, | 205 const gfx::GpuMemoryBufferHandle& v_handle, |
206 base::TimeDelta timestamp); | 206 base::TimeDelta timestamp); |
207 | 207 |
208 // Wraps external YUVA data of the given parameters with a VideoFrame. | |
209 // The returned VideoFrame does not own the data passed in. | |
210 static scoped_refptr<VideoFrame> WrapExternalYuvaData( | |
211 VideoPixelFormat format, | |
212 const gfx::Size& coded_size, | |
213 const gfx::Rect& visible_rect, | |
214 const gfx::Size& natural_size, | |
215 int32_t y_stride, | |
216 int32_t u_stride, | |
217 int32_t v_stride, | |
218 int32_t a_stride, | |
219 uint8_t* y_data, | |
220 uint8_t* u_data, | |
221 uint8_t* v_data, | |
222 uint8_t* a_data, | |
223 base::TimeDelta timestamp); | |
224 | |
225 #if defined(OS_LINUX) | 208 #if defined(OS_LINUX) |
226 // Wraps provided dmabufs | 209 // Wraps provided dmabufs |
227 // (https://www.kernel.org/doc/Documentation/dma-buf-sharing.txt) with a | 210 // (https://www.kernel.org/doc/Documentation/dma-buf-sharing.txt) with a |
228 // VideoFrame. The dmabuf fds are dup()ed on creation, so that the VideoFrame | 211 // VideoFrame. The dmabuf fds are dup()ed on creation, so that the VideoFrame |
229 // retains a reference to them, and are automatically close()d on destruction, | 212 // retains a reference to them, and are automatically close()d on destruction, |
230 // dropping the reference. The caller may safely close() its reference after | 213 // dropping the reference. The caller may safely close() its reference after |
231 // calling WrapExternalDmabufs(). | 214 // calling WrapExternalDmabufs(). |
232 // The image data is only accessible via dmabuf fds, which are usually passed | 215 // The image data is only accessible via dmabuf fds, which are usually passed |
233 // directly to a hardware device and/or to another process, or can also be | 216 // directly to a hardware device and/or to another process, or can also be |
234 // mapped via mmap() for CPU access. | 217 // mapped via mmap() for CPU access. |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 gpu::SyncToken release_sync_token_; | 521 gpu::SyncToken release_sync_token_; |
539 | 522 |
540 VideoFrameMetadata metadata_; | 523 VideoFrameMetadata metadata_; |
541 | 524 |
542 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 525 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
543 }; | 526 }; |
544 | 527 |
545 } // namespace media | 528 } // namespace media |
546 | 529 |
547 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 530 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |