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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 #endif | 372 #endif |
373 | 373 |
374 void AddSharedMemoryHandle(base::SharedMemoryHandle handle); | 374 void AddSharedMemoryHandle(base::SharedMemoryHandle handle); |
375 | 375 |
376 #if defined(OS_MACOSX) | 376 #if defined(OS_MACOSX) |
377 // Returns the backing CVPixelBuffer, if present. | 377 // Returns the backing CVPixelBuffer, if present. |
378 // TODO(mcasas): Rename to CvPixelBuffer() to comply with Style Guide. | 378 // TODO(mcasas): Rename to CvPixelBuffer() to comply with Style Guide. |
379 CVPixelBufferRef cv_pixel_buffer() const; | 379 CVPixelBufferRef cv_pixel_buffer() const; |
380 #endif | 380 #endif |
381 | 381 |
382 // Converts a frame with YV12A format into I420 by dropping alpha channel. | |
Pawel Osciak
2016/02/26 00:32:51
Personally, I'm wondering if this kind of a method
emircan
2016/02/26 01:33:08
I see your point about VF being too complicated ag
Pawel Osciak
2016/02/26 01:51:25
Honestly, I would really prefer not doing it this
| |
383 bool DropYV12AAlphaChannel(); | |
384 | |
382 // Adds a callback to be run when the VideoFrame is about to be destroyed. | 385 // Adds a callback to be run when the VideoFrame is about to be destroyed. |
383 // The callback may be run from ANY THREAD, and so it is up to the client to | 386 // The callback may be run from ANY THREAD, and so it is up to the client to |
384 // ensure thread safety. Although read-only access to the members of this | 387 // ensure thread safety. Although read-only access to the members of this |
385 // VideoFrame is permitted while the callback executes (including | 388 // VideoFrame is permitted while the callback executes (including |
386 // VideoFrameMetadata), clients should not assume the data pointers are | 389 // VideoFrameMetadata), clients should not assume the data pointers are |
387 // valid. | 390 // valid. |
388 void AddDestructionObserver(const base::Closure& callback); | 391 void AddDestructionObserver(const base::Closure& callback); |
389 | 392 |
390 // Returns a dictionary of optional metadata. This contains information | 393 // Returns a dictionary of optional metadata. This contains information |
391 // associated with the frame that downstream clients might use for frame-level | 394 // associated with the frame that downstream clients might use for frame-level |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
457 VideoPixelFormat format, | 460 VideoPixelFormat format, |
458 const gfx::Size& coded_size, | 461 const gfx::Size& coded_size, |
459 const gfx::Rect& visible_rect, | 462 const gfx::Rect& visible_rect, |
460 const gfx::Size& natural_size, | 463 const gfx::Size& natural_size, |
461 base::TimeDelta timestamp, | 464 base::TimeDelta timestamp, |
462 bool zero_initialize_memory); | 465 bool zero_initialize_memory); |
463 | 466 |
464 void AllocateYUV(bool zero_initialize_memory); | 467 void AllocateYUV(bool zero_initialize_memory); |
465 | 468 |
466 // Frame format. | 469 // Frame format. |
467 const VideoPixelFormat format_; | 470 VideoPixelFormat format_; |
468 | 471 |
469 // Storage type for the different planes. | 472 // Storage type for the different planes. |
470 StorageType storage_type_; // TODO(mcasas): make const | 473 StorageType storage_type_; // TODO(mcasas): make const |
471 | 474 |
472 // Width and height of the video frame, in pixels. This must include pixel | 475 // Width and height of the video frame, in pixels. This must include pixel |
473 // data for the whole image; i.e. for YUV formats with subsampled chroma | 476 // data for the whole image; i.e. for YUV formats with subsampled chroma |
474 // planes, in the case that the visible portion of the image does not line up | 477 // planes, in the case that the visible portion of the image does not line up |
475 // on a sample boundary, |coded_size_| must be rounded up appropriately and | 478 // on a sample boundary, |coded_size_| must be rounded up appropriately and |
476 // the pixel data provided for the odd pixels. | 479 // the pixel data provided for the odd pixels. |
477 const gfx::Size coded_size_; | 480 const gfx::Size coded_size_; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
525 gpu::SyncToken release_sync_token_; | 528 gpu::SyncToken release_sync_token_; |
526 | 529 |
527 VideoFrameMetadata metadata_; | 530 VideoFrameMetadata metadata_; |
528 | 531 |
529 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 532 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
530 }; | 533 }; |
531 | 534 |
532 } // namespace media | 535 } // namespace media |
533 | 536 |
534 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 537 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |