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

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: Returning 0 for default. 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 allocation size for a YUV frame that is created by
301 // CreateFrame() method.
302 size_t allocated_size() const { return allocated_size_; }
303
300 // Returns the number of bytes per row and number of rows for a given plane. 304 // Returns the number of bytes per row and number of rows for a given plane.
301 // 305 //
302 // As opposed to stride(), row_bytes() refers to the bytes representing 306 // As opposed to stride(), row_bytes() refers to the bytes representing
303 // frame data scanlines (coded_size.width() pixels, without stride padding). 307 // frame data scanlines (coded_size.width() pixels, without stride padding).
304 int row_bytes(size_t plane) const; 308 int row_bytes(size_t plane) const;
305 int rows(size_t plane) const; 309 int rows(size_t plane) const;
306 310
307 // Returns pointer to the buffer for a given plane, if this is an 311 // 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 312 // IsMappable() frame type. The memory is owned by VideoFrame object and must
309 // not be freed by the caller. 313 // not be freed by the caller.
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
437 441
438 // Width and height of the visible portion of the video frame 442 // Width and height of the visible portion of the video frame
439 // (|visible_rect_.size()|) with aspect ratio taken into account. 443 // (|visible_rect_.size()|) with aspect ratio taken into account.
440 const gfx::Size natural_size_; 444 const gfx::Size natural_size_;
441 445
442 // Array of strides for each plane, typically greater or equal to the width 446 // 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 447 // of the surface divided by the horizontal sampling period. Note that
444 // strides can be negative. 448 // strides can be negative.
445 int32 strides_[kMaxPlanes]; 449 int32 strides_[kMaxPlanes];
446 450
451 // Actual allocation size for a YUV frame with alignments and padding.
452 size_t allocated_size_;
miu 2015/08/04 20:16:22 This isn't needed. See comments below.
453
447 // Array of data pointers to each plane. 454 // Array of data pointers to each plane.
448 // TODO(mcasas): we don't know on ctor if we own |data_| or not. After 455 // TODO(mcasas): we don't know on ctor if we own |data_| or not. After
449 // refactoring VideoFrame, change to scoped_ptr<uint8, AlignedFreeDeleter>. 456 // refactoring VideoFrame, change to scoped_ptr<uint8, AlignedFreeDeleter>.
450 uint8* data_[kMaxPlanes]; 457 uint8* data_[kMaxPlanes];
451 458
452 // Native texture mailboxes, if this is a IsTexture() frame. 459 // Native texture mailboxes, if this is a IsTexture() frame.
453 gpu::MailboxHolder mailbox_holders_[kMaxPlanes]; 460 gpu::MailboxHolder mailbox_holders_[kMaxPlanes];
454 ReleaseMailboxCB mailbox_holders_release_cb_; 461 ReleaseMailboxCB mailbox_holders_release_cb_;
455 462
456 // Shared memory handle and associated offset inside it, if this frame is 463 // Shared memory handle and associated offset inside it, if this frame is
(...skipping 19 matching lines...) Expand all
476 uint32 release_sync_point_; 483 uint32 release_sync_point_;
477 484
478 VideoFrameMetadata metadata_; 485 VideoFrameMetadata metadata_;
479 486
480 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); 487 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame);
481 }; 488 };
482 489
483 } // namespace media 490 } // namespace media
484 491
485 #endif // MEDIA_BASE_VIDEO_FRAME_H_ 492 #endif // MEDIA_BASE_VIDEO_FRAME_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698