Chromium Code Reviews| 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/rect.h" | 10 #include "ui/gfx/rect.h" |
| 11 #include "ui/gfx/size.h" | 11 #include "ui/gfx/size.h" |
| 12 | 12 |
| 13 namespace media { | 13 namespace media { |
| 14 | 14 |
| 15 class VideoFrame; | 15 class VideoFrame; |
| 16 | 16 |
| 17 // Computes the size of |visible_size| for a given aspect ratio. | 17 // Computes the size of |visible_size| for a given aspect ratio. |
| 18 MEDIA_EXPORT gfx::Size GetNaturalSize(const gfx::Size& visible_size, | 18 MEDIA_EXPORT gfx::Size GetNaturalSize(const gfx::Size& visible_size, |
| 19 int aspect_ratio_numerator, | 19 int aspect_ratio_numerator, |
| 20 int aspect_ratio_denominator); | 20 int aspect_ratio_denominator); |
| 21 | 21 |
| 22 // Copies a plane of YUV source into a VideoFrame object, taking into account | 22 // Copies a plane of YUV(A) source into a VideoFrame object, taking into account |
| 23 // source and destinations dimensions. | 23 // source and destinations dimensions. |
| 24 // | 24 // |
| 25 // NOTE: rows is *not* the same as height! | 25 // NOTE: rows is *not* the same as height! |
| 26 MEDIA_EXPORT void CopyYPlane(const uint8* source, int stride, int rows, | 26 MEDIA_EXPORT void CopyYPlane(const uint8* source, int stride, int rows, |
| 27 VideoFrame* frame); | 27 VideoFrame* frame); |
| 28 MEDIA_EXPORT void CopyUPlane(const uint8* source, int stride, int rows, | 28 MEDIA_EXPORT void CopyUPlane(const uint8* source, int stride, int rows, |
| 29 VideoFrame* frame); | 29 VideoFrame* frame); |
| 30 MEDIA_EXPORT void CopyVPlane(const uint8* source, int stride, int rows, | 30 MEDIA_EXPORT void CopyVPlane(const uint8* source, int stride, int rows, |
| 31 VideoFrame* frame); | 31 VideoFrame* frame); |
| 32 MEDIA_EXPORT void CopyAPlane(const uint8* source, int stride, int rows, | |
| 33 VideoFrame* frame); | |
| 34 // Sets A Plane values to be completely opaque (all 255's) | |
|
scherkus (not reviewing)
2013/04/04 00:36:17
nit: add blank line before // comments
nit: "A Pl
vignesh
2013/04/04 18:17:52
Done.
| |
| 35 MEDIA_EXPORT void MakeOpaqueAPlane(int stride, int rows, VideoFrame* frame); | |
| 32 // |plane| is one of VideoFrame::kYPlane, VideoFrame::kUPlane, | 36 // |plane| is one of VideoFrame::kYPlane, VideoFrame::kUPlane, |
|
scherkus (not reviewing)
2013/04/04 00:36:17
nit: add blank line before //
vignesh
2013/04/04 18:17:52
Done.
| |
| 33 // or VideoFrame::kVPlane. | 37 // VideoFrame::kVPlane or VideoFrame::kAPlane |
| 34 MEDIA_EXPORT void CopyPlane(size_t plane, const uint8* source, int stride, | 38 MEDIA_EXPORT void CopyPlane(size_t plane, const uint8* source, int stride, |
| 35 int rows, VideoFrame* frame); | 39 int rows, VideoFrame* frame); |
| 36 | 40 |
| 37 | 41 |
| 38 // Fills |frame| containing YUV data to the given color values. | 42 // Fills |frame| containing YUV data to the given color values. |
| 39 MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v); | 43 MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v); |
| 40 | 44 |
| 41 // Creates a border in |frame| such that all pixels outside of | 45 // Creates a border in |frame| such that all pixels outside of |
| 42 // |view_area| are black. The size and position of |view_area| | 46 // |view_area| are black. The size and position of |view_area| |
| 43 // must be even to align correctly with the color planes. | 47 // must be even to align correctly with the color planes. |
| (...skipping 29 matching lines...) Expand all Loading... | |
| 73 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. | 77 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. |
| 74 // Fills the regions outside |region_in_frame| with black. | 78 // Fills the regions outside |region_in_frame| with black. |
| 75 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source, | 79 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source, |
| 76 int stride, | 80 int stride, |
| 77 const gfx::Rect& region_in_frame, | 81 const gfx::Rect& region_in_frame, |
| 78 VideoFrame* frame); | 82 VideoFrame* frame); |
| 79 | 83 |
| 80 } // namespace media | 84 } // namespace media |
| 81 | 85 |
| 82 #endif // MEDIA_BASE_VIDEO_UTIL_H_ | 86 #endif // MEDIA_BASE_VIDEO_UTIL_H_ |
| OLD | NEW |