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

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

Issue 1267003004: Revert to zero-initializing buffers for FFmpegVideoDecoder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed method name. Created 5 years, 4 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 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 290
291 VideoPixelFormat format() const { return format_; } 291 VideoPixelFormat format() const { return format_; }
292 StorageType storage_type() const { return storage_type_; } 292 StorageType storage_type() const { return storage_type_; }
293 293
294 const gfx::Size& coded_size() const { return coded_size_; } 294 const gfx::Size& coded_size() const { return coded_size_; }
295 const gfx::Rect& visible_rect() const { return visible_rect_; } 295 const gfx::Rect& visible_rect() const { return visible_rect_; }
296 const gfx::Size& natural_size() const { return natural_size_; } 296 const gfx::Size& natural_size() const { return natural_size_; }
297 297
298 int stride(size_t plane) const; 298 int stride(size_t plane) const;
299 299
300 // Returns the actual allocated size for a frame.
301 size_t allocated_size() const;
DaleCurtis 2015/08/04 19:07:44 Return inline.
emircan 2015/08/04 19:54:35 Done.
302
300 // Returns the number of bytes per row and number of rows for a given plane. 303 // Returns the number of bytes per row and number of rows for a given plane.
301 // 304 //
302 // As opposed to stride(), row_bytes() refers to the bytes representing 305 // As opposed to stride(), row_bytes() refers to the bytes representing
303 // frame data scanlines (coded_size.width() pixels, without stride padding). 306 // frame data scanlines (coded_size.width() pixels, without stride padding).
304 int row_bytes(size_t plane) const; 307 int row_bytes(size_t plane) const;
305 int rows(size_t plane) const; 308 int rows(size_t plane) const;
306 309
307 // Returns pointer to the buffer for a given plane, if this is an 310 // Returns pointer to the buffer for a given plane, if this is an
308 // IsMappable() frame type. The memory is owned by VideoFrame object and must 311 // IsMappable() frame type. The memory is owned by VideoFrame object and must
309 // not be freed by the caller. 312 // not be freed by the caller.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 440
438 // Width and height of the visible portion of the video frame 441 // Width and height of the visible portion of the video frame
439 // (|visible_rect_.size()|) with aspect ratio taken into account. 442 // (|visible_rect_.size()|) with aspect ratio taken into account.
440 const gfx::Size natural_size_; 443 const gfx::Size natural_size_;
441 444
442 // Array of strides for each plane, typically greater or equal to the width 445 // Array of strides for each plane, typically greater or equal to the width
443 // of the surface divided by the horizontal sampling period. Note that 446 // of the surface divided by the horizontal sampling period. Note that
444 // strides can be negative. 447 // strides can be negative.
445 int32 strides_[kMaxPlanes]; 448 int32 strides_[kMaxPlanes];
446 449
450 // Actual allocation size for a YUV frame with alignments and padding.
451 size_t allocated_size_;
452
447 // Array of data pointers to each plane. 453 // Array of data pointers to each plane.
448 // TODO(mcasas): we don't know on ctor if we own |data_| or not. After 454 // TODO(mcasas): we don't know on ctor if we own |data_| or not. After
449 // refactoring VideoFrame, change to scoped_ptr<uint8, AlignedFreeDeleter>. 455 // refactoring VideoFrame, change to scoped_ptr<uint8, AlignedFreeDeleter>.
450 uint8* data_[kMaxPlanes]; 456 uint8* data_[kMaxPlanes];
451 457
452 // Native texture mailboxes, if this is a IsTexture() frame. 458 // Native texture mailboxes, if this is a IsTexture() frame.
453 gpu::MailboxHolder mailbox_holders_[kMaxPlanes]; 459 gpu::MailboxHolder mailbox_holders_[kMaxPlanes];
454 ReleaseMailboxCB mailbox_holders_release_cb_; 460 ReleaseMailboxCB mailbox_holders_release_cb_;
455 461
456 // Shared memory handle and associated offset inside it, if this frame is 462 // Shared memory handle and associated offset inside it, if this frame is
(...skipping 19 matching lines...) Expand all
476 uint32 release_sync_point_; 482 uint32 release_sync_point_;
477 483
478 VideoFrameMetadata metadata_; 484 VideoFrameMetadata metadata_;
479 485
480 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 486 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
481 }; 487 };
482 488
483 } // namespace media 489 } // namespace media
484 490
485 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 491 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698