| 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_UTIL_H_ | 5 #ifndef MEDIA_BASE_VIDEO_UTIL_H_ |
| 6 #define MEDIA_BASE_VIDEO_UTIL_H_ | 6 #define MEDIA_BASE_VIDEO_UTIL_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "media/base/media_export.h" | 9 #include "media/base/media_export.h" |
| 10 #include "ui/gfx/size.h" |
| 10 | 11 |
| 11 namespace media { | 12 namespace media { |
| 12 | 13 |
| 13 class VideoFrame; | 14 class VideoFrame; |
| 14 | 15 |
| 16 // Computes the size of |visible_size| for a given aspect ratio. |
| 17 MEDIA_EXPORT gfx::Size GetNaturalSize(const gfx::Size& visible_size, |
| 18 int aspect_ratio_numerator, |
| 19 int aspect_ratio_denominator); |
| 20 |
| 15 // Copies a plane of YUV source into a VideoFrame object, taking into account | 21 // Copies a plane of YUV source into a VideoFrame object, taking into account |
| 16 // source and destinations dimensions. | 22 // source and destinations dimensions. |
| 17 // | 23 // |
| 18 // NOTE: rows is *not* the same as height! | 24 // NOTE: rows is *not* the same as height! |
| 19 MEDIA_EXPORT void CopyYPlane(const uint8* source, int stride, int rows, | 25 MEDIA_EXPORT void CopyYPlane(const uint8* source, int stride, int rows, |
| 20 VideoFrame* frame); | 26 VideoFrame* frame); |
| 21 MEDIA_EXPORT void CopyUPlane(const uint8* source, int stride, int rows, | 27 MEDIA_EXPORT void CopyUPlane(const uint8* source, int stride, int rows, |
| 22 VideoFrame* frame); | 28 VideoFrame* frame); |
| 23 MEDIA_EXPORT void CopyVPlane(const uint8* source, int stride, int rows, | 29 MEDIA_EXPORT void CopyVPlane(const uint8* source, int stride, int rows, |
| 24 VideoFrame* frame); | 30 VideoFrame* frame); |
| 25 | 31 |
| 26 // Fills |frame| containing YUV data to the given color values. | 32 // Fills |frame| containing YUV data to the given color values. |
| 27 MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v); | 33 MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v); |
| 28 | 34 |
| 29 } // namespace media | 35 } // namespace media |
| 30 | 36 |
| 31 #endif // MEDIA_BASE_VIDEO_UTIL_H_ | 37 #endif // MEDIA_BASE_VIDEO_UTIL_H_ |
| OLD | NEW |