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" |
(...skipping 26 matching lines...) Expand all Loading... |
37 | 37 |
38 // |plane| is one of VideoFrame::kYPlane, VideoFrame::kUPlane, | 38 // |plane| is one of VideoFrame::kYPlane, VideoFrame::kUPlane, |
39 // VideoFrame::kVPlane or VideoFrame::kAPlane | 39 // VideoFrame::kVPlane or VideoFrame::kAPlane |
40 MEDIA_EXPORT void CopyPlane(size_t plane, const uint8* source, int stride, | 40 MEDIA_EXPORT void CopyPlane(size_t plane, const uint8* source, int stride, |
41 int rows, VideoFrame* frame); | 41 int rows, VideoFrame* frame); |
42 | 42 |
43 | 43 |
44 // Fills |frame| containing YUV data to the given color values. | 44 // Fills |frame| containing YUV data to the given color values. |
45 MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v); | 45 MEDIA_EXPORT void FillYUV(VideoFrame* frame, uint8 y, uint8 u, uint8 v); |
46 | 46 |
| 47 // Fills |frame| containing YUVA data with the given color values. |
| 48 MEDIA_EXPORT void FillYUVA(VideoFrame* frame, |
| 49 uint8 y, |
| 50 uint8 u, |
| 51 uint8 v, |
| 52 uint8 a); |
| 53 |
47 // Creates a border in |frame| such that all pixels outside of | 54 // Creates a border in |frame| such that all pixels outside of |
48 // |view_area| are black. The size and position of |view_area| | 55 // |view_area| are black. The size and position of |view_area| |
49 // must be even to align correctly with the color planes. | 56 // must be even to align correctly with the color planes. |
50 // Only YV12 format video frames are currently supported. | 57 // Only YV12 format video frames are currently supported. |
51 MEDIA_EXPORT void LetterboxYUV(VideoFrame* frame, | 58 MEDIA_EXPORT void LetterboxYUV(VideoFrame* frame, |
52 const gfx::Rect& view_area); | 59 const gfx::Rect& view_area); |
53 | 60 |
54 // Rotates |src| plane by |rotation| degree with possible flipping vertically | 61 // Rotates |src| plane by |rotation| degree with possible flipping vertically |
55 // and horizontally. | 62 // and horizontally. |
56 // |rotation| is limited to {0, 90, 180, 270}. | 63 // |rotation| is limited to {0, 90, 180, 270}. |
(...skipping 23 matching lines...) Expand all Loading... |
80 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. | 87 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. |
81 // Fills the regions outside |region_in_frame| with black. | 88 // Fills the regions outside |region_in_frame| with black. |
82 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source, | 89 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source, |
83 int stride, | 90 int stride, |
84 const gfx::Rect& region_in_frame, | 91 const gfx::Rect& region_in_frame, |
85 VideoFrame* frame); | 92 VideoFrame* frame); |
86 | 93 |
87 } // namespace media | 94 } // namespace media |
88 | 95 |
89 #endif // MEDIA_BASE_VIDEO_UTIL_H_ | 96 #endif // MEDIA_BASE_VIDEO_UTIL_H_ |
OLD | NEW |