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 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 #endif | 348 #endif |
349 | 349 |
350 void AddSharedMemoryHandle(base::SharedMemoryHandle handle); | 350 void AddSharedMemoryHandle(base::SharedMemoryHandle handle); |
351 | 351 |
352 #if defined(OS_MACOSX) | 352 #if defined(OS_MACOSX) |
353 // Returns the backing CVPixelBuffer, if present. | 353 // Returns the backing CVPixelBuffer, if present. |
354 // TODO(mcasas): Rename to CvPixelBuffer() to comply with Style Guide. | 354 // TODO(mcasas): Rename to CvPixelBuffer() to comply with Style Guide. |
355 CVPixelBufferRef cv_pixel_buffer() const; | 355 CVPixelBufferRef cv_pixel_buffer() const; |
356 #endif | 356 #endif |
357 | 357 |
| 358 // Sets the mailbox release callback. |
| 359 // |
| 360 // The callback may be run from ANY THREAD, and so it is up to the client to |
| 361 // ensure thread safety. |
| 362 // |
| 363 // WARNING: This method is not thread safe; it should only be called if you |
| 364 // are still the only owner of this VideoFrame. |
| 365 void SetReleaseMailboxCB(const ReleaseMailboxCB& release_mailbox_cb); |
| 366 |
358 // Adds a callback to be run when the VideoFrame is about to be destroyed. | 367 // Adds a callback to be run when the VideoFrame is about to be destroyed. |
359 // The callback may be run from ANY THREAD, and so it is up to the client to | 368 // The callback may be run from ANY THREAD, and so it is up to the client to |
360 // ensure thread safety. Although read-only access to the members of this | 369 // ensure thread safety. Although read-only access to the members of this |
361 // VideoFrame is permitted while the callback executes (including | 370 // VideoFrame is permitted while the callback executes (including |
362 // VideoFrameMetadata), clients should not assume the data pointers are | 371 // VideoFrameMetadata), clients should not assume the data pointers are |
363 // valid. | 372 // valid. |
364 void AddDestructionObserver(const base::Closure& callback); | 373 void AddDestructionObserver(const base::Closure& callback); |
365 | 374 |
366 // Returns a dictionary of optional metadata. This contains information | 375 // Returns a dictionary of optional metadata. This contains information |
367 // associated with the frame that downstream clients might use for frame-level | 376 // associated with the frame that downstream clients might use for frame-level |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 const int unique_id_; | 551 const int unique_id_; |
543 | 552 |
544 gfx::ColorSpace color_space_; | 553 gfx::ColorSpace color_space_; |
545 | 554 |
546 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 555 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
547 }; | 556 }; |
548 | 557 |
549 } // namespace media | 558 } // namespace media |
550 | 559 |
551 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 560 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |