Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(42)

Side by Side Diff: media/base/video_frame.h

Issue 1134643002: Add distinction between RGB and RGBA native texture video frames and resources (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 // argument when the VideoFrame is to be destroyed. 102 // argument when the VideoFrame is to be destroyed.
103 // |read_pixels_cb| may be used to do (slow!) readbacks from the 103 // |read_pixels_cb| may be used to do (slow!) readbacks from the
104 // texture to main memory. 104 // texture to main memory.
105 static scoped_refptr<VideoFrame> WrapNativeTexture( 105 static scoped_refptr<VideoFrame> WrapNativeTexture(
106 scoped_ptr<gpu::MailboxHolder> mailbox_holder, 106 scoped_ptr<gpu::MailboxHolder> mailbox_holder,
107 const ReleaseMailboxCB& mailbox_holder_release_cb, 107 const ReleaseMailboxCB& mailbox_holder_release_cb,
108 const gfx::Size& coded_size, 108 const gfx::Size& coded_size,
109 const gfx::Rect& visible_rect, 109 const gfx::Rect& visible_rect,
110 const gfx::Size& natural_size, 110 const gfx::Size& natural_size,
111 base::TimeDelta timestamp, 111 base::TimeDelta timestamp,
112 bool allow_overlay); 112 bool allow_overlay,
113 bool has_alpha);
113 114
114 // Wraps packed image data residing in a memory buffer with a VideoFrame. 115 // Wraps packed image data residing in a memory buffer with a VideoFrame.
115 // The image data resides in |data| and is assumed to be packed tightly in a 116 // The image data resides in |data| and is assumed to be packed tightly in a
116 // buffer of logical dimensions |coded_size| with the appropriate bit depth 117 // buffer of logical dimensions |coded_size| with the appropriate bit depth
117 // and plane count as given by |format|. The shared memory handle of the 118 // and plane count as given by |format|. The shared memory handle of the
118 // backing allocation, if present, can be passed in with |handle|. When the 119 // backing allocation, if present, can be passed in with |handle|. When the
119 // frame is destroyed, |no_longer_needed_cb.Run()| will be called. 120 // frame is destroyed, |no_longer_needed_cb.Run()| will be called.
120 // Returns NULL on failure. 121 // Returns NULL on failure.
121 static scoped_refptr<VideoFrame> WrapExternalPackedMemory( 122 static scoped_refptr<VideoFrame> WrapExternalPackedMemory(
122 Format format, 123 Format format,
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // associated with the frame that downstream clients might use for frame-level 294 // associated with the frame that downstream clients might use for frame-level
294 // logging, quality/performance optimizations, signaling, etc. 295 // logging, quality/performance optimizations, signaling, etc.
295 // 296 //
296 // TODO(miu): Move some of the "extra" members of VideoFrame (below) into 297 // TODO(miu): Move some of the "extra" members of VideoFrame (below) into
297 // here as a later clean-up step. 298 // here as a later clean-up step.
298 const VideoFrameMetadata* metadata() const { return &metadata_; } 299 const VideoFrameMetadata* metadata() const { return &metadata_; }
299 VideoFrameMetadata* metadata() { return &metadata_; } 300 VideoFrameMetadata* metadata() { return &metadata_; }
300 301
301 bool allow_overlay() const { return allow_overlay_; } 302 bool allow_overlay() const { return allow_overlay_; }
302 303
304 bool has_alpha() const { return has_alpha_; }
305
303 #if defined(OS_POSIX) 306 #if defined(OS_POSIX)
304 // Returns backing dmabuf file descriptor for given |plane|, if present. 307 // Returns backing dmabuf file descriptor for given |plane|, if present.
305 int dmabuf_fd(size_t plane) const; 308 int dmabuf_fd(size_t plane) const;
306 #endif 309 #endif
307 310
308 #if defined(OS_MACOSX) 311 #if defined(OS_MACOSX)
309 // Returns the backing CVPixelBuffer, if present. 312 // Returns the backing CVPixelBuffer, if present.
310 CVPixelBufferRef cv_pixel_buffer() const; 313 CVPixelBufferRef cv_pixel_buffer() const;
311 #endif 314 #endif
312 315
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 base::TimeDelta timestamp_; 412 base::TimeDelta timestamp_;
410 413
411 base::Lock release_sync_point_lock_; 414 base::Lock release_sync_point_lock_;
412 uint32 release_sync_point_; 415 uint32 release_sync_point_;
413 416
414 const bool end_of_stream_; 417 const bool end_of_stream_;
415 418
416 VideoFrameMetadata metadata_; 419 VideoFrameMetadata metadata_;
417 420
418 bool allow_overlay_; 421 bool allow_overlay_;
422 bool has_alpha_;
419 423
420 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 424 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
421 }; 425 };
422 426
423 } // namespace media 427 } // namespace media
424 428
425 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 429 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698