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" |
11 #include "base/md5.h" | 11 #include "base/md5.h" |
12 #include "base/memory/shared_memory.h" | 12 #include "base/memory/shared_memory.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "media/base/buffers.h" | 14 #include "media/base/buffers.h" |
| 15 #include "media/base/video_frame_metadata.h" |
15 #include "ui/gfx/geometry/rect.h" | 16 #include "ui/gfx/geometry/rect.h" |
16 #include "ui/gfx/geometry/size.h" | 17 #include "ui/gfx/geometry/size.h" |
17 | 18 |
18 #if defined(OS_MACOSX) | 19 #if defined(OS_MACOSX) |
19 #include <CoreVideo/CVPixelBuffer.h> | 20 #include <CoreVideo/CVPixelBuffer.h> |
20 #include "base/mac/scoped_cftyperef.h" | 21 #include "base/mac/scoped_cftyperef.h" |
21 #endif | 22 #endif |
22 | 23 |
23 namespace gpu { | 24 namespace gpu { |
24 struct MailboxHolder; | 25 struct MailboxHolder; |
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
281 // Only valid to call if this is a NATIVE_TEXTURE frame. Before using the | 282 // Only valid to call if this is a NATIVE_TEXTURE frame. Before using the |
282 // mailbox, the caller must wait for the included sync point. | 283 // mailbox, the caller must wait for the included sync point. |
283 const gpu::MailboxHolder* mailbox_holder() const; | 284 const gpu::MailboxHolder* mailbox_holder() const; |
284 | 285 |
285 // Returns the shared-memory handle, if present | 286 // Returns the shared-memory handle, if present |
286 base::SharedMemoryHandle shared_memory_handle() const; | 287 base::SharedMemoryHandle shared_memory_handle() const; |
287 | 288 |
288 // Returns the offset into the shared memory where the frame data begins. | 289 // Returns the offset into the shared memory where the frame data begins. |
289 size_t shared_memory_offset() const; | 290 size_t shared_memory_offset() const; |
290 | 291 |
| 292 // Returns a dictionary of optional metadata. This contains information |
| 293 // associated with the frame that downstream clients might use for frame-level |
| 294 // logging, quality/performance optimizations, signaling, etc. |
| 295 // |
| 296 // TODO(miu): Move some of the "extra" members of VideoFrame (below) into |
| 297 // here as a later clean-up step. |
| 298 const VideoFrameMetadata* metadata() const { return &metadata_; } |
| 299 VideoFrameMetadata* metadata() { return &metadata_; } |
| 300 |
291 bool allow_overlay() const { return allow_overlay_; } | 301 bool allow_overlay() const { return allow_overlay_; } |
292 | 302 |
293 #if defined(OS_POSIX) | 303 #if defined(OS_POSIX) |
294 // Returns backing dmabuf file descriptor for given |plane|, if present. | 304 // Returns backing dmabuf file descriptor for given |plane|, if present. |
295 int dmabuf_fd(size_t plane) const; | 305 int dmabuf_fd(size_t plane) const; |
296 #endif | 306 #endif |
297 | 307 |
298 #if defined(OS_MACOSX) | 308 #if defined(OS_MACOSX) |
299 // Returns the backing CVPixelBuffer, if present. | 309 // Returns the backing CVPixelBuffer, if present. |
300 CVPixelBufferRef cv_pixel_buffer() const; | 310 CVPixelBufferRef cv_pixel_buffer() const; |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
396 | 406 |
397 base::Closure no_longer_needed_cb_; | 407 base::Closure no_longer_needed_cb_; |
398 | 408 |
399 base::TimeDelta timestamp_; | 409 base::TimeDelta timestamp_; |
400 | 410 |
401 base::Lock release_sync_point_lock_; | 411 base::Lock release_sync_point_lock_; |
402 uint32 release_sync_point_; | 412 uint32 release_sync_point_; |
403 | 413 |
404 const bool end_of_stream_; | 414 const bool end_of_stream_; |
405 | 415 |
| 416 VideoFrameMetadata metadata_; |
| 417 |
406 bool allow_overlay_; | 418 bool allow_overlay_; |
407 | 419 |
408 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 420 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
409 }; | 421 }; |
410 | 422 |
411 } // namespace media | 423 } // namespace media |
412 | 424 |
413 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 425 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |