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 <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | |
10 #include "media/base/media_export.h" | 11 #include "media/base/media_export.h" |
11 #include "ui/gfx/geometry/rect.h" | 12 #include "ui/gfx/geometry/rect.h" |
12 #include "ui/gfx/geometry/size.h" | 13 #include "ui/gfx/geometry/size.h" |
13 | 14 |
14 namespace media { | 15 namespace media { |
15 | 16 |
16 class VideoFrame; | 17 class VideoFrame; |
17 | 18 |
18 // Computes the size of |visible_size| for a given aspect ratio. | 19 // Computes the size of |visible_size| for a given aspect ratio. |
19 MEDIA_EXPORT gfx::Size GetNaturalSize(const gfx::Size& visible_size, | 20 MEDIA_EXPORT gfx::Size GetNaturalSize(const gfx::Size& visible_size, |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
85 MEDIA_EXPORT gfx::Size PadToMatchAspectRatio(const gfx::Size& size, | 86 MEDIA_EXPORT gfx::Size PadToMatchAspectRatio(const gfx::Size& size, |
86 const gfx::Size& target); | 87 const gfx::Size& target); |
87 | 88 |
88 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. | 89 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. |
89 // Fills the regions outside |region_in_frame| with black. | 90 // Fills the regions outside |region_in_frame| with black. |
90 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8_t* source, | 91 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8_t* source, |
91 int stride, | 92 int stride, |
92 const gfx::Rect& region_in_frame, | 93 const gfx::Rect& region_in_frame, |
93 VideoFrame* frame); | 94 VideoFrame* frame); |
94 | 95 |
96 // Converts a frame with YV12A format into I420 by dropping alpha channel. | |
97 MEDIA_EXPORT scoped_refptr<VideoFrame> DropYV12AAlphaChannel( | |
mcasas
2016/02/29 23:48:01
I was surprised that it returned a scoped_refptr<V
emircan
2016/03/01 20:07:55
I see your point. WrapAsOpaque() might also imply
| |
98 const scoped_refptr<VideoFrame>& frame); | |
99 | |
95 } // namespace media | 100 } // namespace media |
96 | 101 |
97 #endif // MEDIA_BASE_VIDEO_UTIL_H_ | 102 #endif // MEDIA_BASE_VIDEO_UTIL_H_ |
OLD | NEW |