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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 // Allocates a hole frame. | 279 // Allocates a hole frame. |
280 static scoped_refptr<VideoFrame> CreateHoleFrame(const gfx::Size& size); | 280 static scoped_refptr<VideoFrame> CreateHoleFrame(const gfx::Size& size); |
281 #endif // defined(VIDEO_HOLE) | 281 #endif // defined(VIDEO_HOLE) |
282 | 282 |
283 static size_t NumPlanes(Format format); | 283 static size_t NumPlanes(Format format); |
284 | 284 |
285 // Returns the required allocation size for a (tightly packed) frame of the | 285 // Returns the required allocation size for a (tightly packed) frame of the |
286 // given coded size and format. | 286 // given coded size and format. |
287 static size_t AllocationSize(Format format, const gfx::Size& coded_size); | 287 static size_t AllocationSize(Format format, const gfx::Size& coded_size); |
288 | 288 |
| 289 // Returns the actual allocation size for a YUV frame that is created by |
| 290 // CreateFrame() method. |
| 291 static size_t AlignedAllocationSize(const scoped_refptr<VideoFrame>& frame); |
| 292 |
289 // Returns the plane gfx::Size (in bytes) for a plane of the given coded size | 293 // Returns the plane gfx::Size (in bytes) for a plane of the given coded size |
290 // and format. | 294 // and format. |
291 static gfx::Size PlaneSize(Format format, | 295 static gfx::Size PlaneSize(Format format, |
292 size_t plane, | 296 size_t plane, |
293 const gfx::Size& coded_size); | 297 const gfx::Size& coded_size); |
294 | 298 |
295 // Returns horizontal bits per pixel for given |plane| and |format|. | 299 // Returns horizontal bits per pixel for given |plane| and |format|. |
296 static int PlaneHorizontalBitsPerPixel(Format format, size_t plane); | 300 static int PlaneHorizontalBitsPerPixel(Format format, size_t plane); |
297 | 301 |
298 // Returns bits per pixel for given |plane| and |format|. | 302 // Returns bits per pixel for given |plane| and |format|. |
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 uint32 release_sync_point_; | 516 uint32 release_sync_point_; |
513 | 517 |
514 VideoFrameMetadata metadata_; | 518 VideoFrameMetadata metadata_; |
515 | 519 |
516 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); | 520 DISALLOW_IMPLICIT_CONSTRUCTORS(VideoFrame); |
517 }; | 521 }; |
518 | 522 |
519 } // namespace media | 523 } // namespace media |
520 | 524 |
521 #endif // MEDIA_BASE_VIDEO_FRAME_H_ | 525 #endif // MEDIA_BASE_VIDEO_FRAME_H_ |
OLD | NEW |