Chromium Code Reviews| Index: media/base/video_util.h |
| diff --git a/media/base/video_util.h b/media/base/video_util.h |
| index 7798ebe016e1a996bf1d0b022fe98ebbc702d53f..04013bc64778b54b65c52830ff3dace09efaa521 100644 |
| --- a/media/base/video_util.h |
| +++ b/media/base/video_util.h |
| @@ -84,6 +84,26 @@ MEDIA_EXPORT void RotatePlaneByPixels( |
| MEDIA_EXPORT gfx::Rect ComputeLetterboxRegion(const gfx::Rect& bounds, |
| const gfx::Size& content); |
| +// Return a scaled |size| whose area is less than or equal to |target|, where |
| +// one of its dimensions is equal to |target|'s. The aspect ratio of the result |
| +// is preserved as closely as possible. If |size| is empty, its aspect ratio |
|
Wez
2015/05/13 19:05:09
nit: Aspect ratio of |size| is preserved as closel
miu
2015/05/14 01:21:33
Done.
|
| +// would be undefined; and in this case an empty Size would be returned. |
| +MEDIA_EXPORT gfx::Size ScaleSizeToFitWithinTarget(const gfx::Size& size, |
| + const gfx::Size& target); |
| + |
| +// Return a scaled |size| whose area is greater than or equal to |target|, where |
| +// one of its dimensions is equal to |target|'s. The aspect ratio of the result |
| +// is preserved as closely as possible. If |size| is empty, its aspect ratio |
|
Wez
2015/05/13 19:05:09
nit: You mean the aspect ratio of |size| is preser
miu
2015/05/14 01:21:33
Done.
|
| +// would be undefined; and in this case an empty Size would be returned. |
|
Wez
2015/05/13 19:05:09
I'd suggest just saying that the result is always
miu
2015/05/14 01:21:33
Done.
|
| +MEDIA_EXPORT gfx::Size ScaleSizeToEncompassTarget(const gfx::Size& size, |
| + const gfx::Size& target); |
| + |
| +// Returns |size| with one of its dimensions increased such that the result |
| +// matches the aspect ratio of |target|. If |target| is empty, its aspect ratio |
|
Wez
2015/05/13 19:05:09
It's not immediately obvious how this differs from
miu
2015/05/14 01:21:33
Done. Elaborated further in the comment.
|
| +// would be undefined; and in this case an empty Size would be returned. |
|
Wez
2015/05/13 19:05:09
Surely the same is true if |size| is empty?
Sugge
miu
2015/05/14 01:21:33
Yes.
|
| +MEDIA_EXPORT gfx::Size PadToMatchAspectRatio(const gfx::Size& size, |
| + const gfx::Size& target); |
| + |
| // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. |
| // Fills the regions outside |region_in_frame| with black. |
| MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source, |