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 |
+// 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 |
+// would be undefined; and in this case an empty Size would be returned. |
+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 |
+// would be undefined; and in this case an empty Size would be returned. |
+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, |