Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1890)

Unified Diff: media/base/video_util.h

Issue 1135823004: Implement all resolution change policies for desktop and tab capture. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@resolution_change_policy_constraints_ITEM1_CR1
Patch Set: REBASE Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/video_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/base/video_util.h
diff --git a/media/base/video_util.h b/media/base/video_util.h
index 7798ebe016e1a996bf1d0b022fe98ebbc702d53f..abbcad41abf56a79d83a581ead7727aaabe83f0c 100644
--- a/media/base/video_util.h
+++ b/media/base/video_util.h
@@ -84,6 +84,29 @@ 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 |size| is
+// preserved as closely as possible. If |size| is empty, the result will be
+// empty.
+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 |size| is
+// preserved as closely as possible. If |size| is empty, the result will be
+// empty.
+MEDIA_EXPORT gfx::Size ScaleSizeToEncompassTarget(const gfx::Size& size,
+ const gfx::Size& target);
+
+// Returns |size| with only one of its dimensions increased such that the result
+// matches the aspect ratio of |target|. This is different from
+// ScaleSizeToEncompassTarget() in two ways: 1) The goal is to match the aspect
+// ratio of |target| rather than that of |size|. 2) Only one of the dimensions
+// of |size| may change, and it may only be increased (padded). If either
+// |size| or |target| is empty, the result will be empty.
+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,
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/video_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698