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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
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/geometry/rect.h" 10 #include "ui/gfx/geometry/rect.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 int rotation, // Clockwise. 77 int rotation, // Clockwise.
78 bool flip_vert, 78 bool flip_vert,
79 bool flip_horiz); 79 bool flip_horiz);
80 80
81 // Return the largest centered rectangle with the same aspect ratio of |content| 81 // Return the largest centered rectangle with the same aspect ratio of |content|
82 // that fits entirely inside of |bounds|. If |content| is empty, its aspect 82 // that fits entirely inside of |bounds|. If |content| is empty, its aspect
83 // ratio would be undefined; and in this case an empty Rect would be returned. 83 // ratio would be undefined; and in this case an empty Rect would be returned.
84 MEDIA_EXPORT gfx::Rect ComputeLetterboxRegion(const gfx::Rect& bounds, 84 MEDIA_EXPORT gfx::Rect ComputeLetterboxRegion(const gfx::Rect& bounds,
85 const gfx::Size& content); 85 const gfx::Size& content);
86 86
87 // Return a scaled |size| whose area is less than or equal to |target|, where
88 // one of its dimensions is equal to |target|'s. The aspect ratio of the result
89 // is preserved as closely as possible. If |size| is empty, its aspect ratio
90 // would be undefined; and in this case an empty Size would be returned.
91 MEDIA_EXPORT gfx::Size ScaleSizeToFitWithinTarget(const gfx::Size& size,
92 const gfx::Size& target);
93
94 // Return a scaled |size| whose area is greater than or equal to |target|, where
95 // one of its dimensions is equal to |target|'s. The aspect ratio of the result
96 // is preserved as closely as possible. If |size| is empty, its aspect ratio
97 // would be undefined; and in this case an empty Size would be returned.
98 MEDIA_EXPORT gfx::Size ScaleSizeToEncompassTarget(const gfx::Size& size,
99 const gfx::Size& target);
100
101 // Returns |size| with one of its dimensions increased such that the result
102 // matches the aspect ratio of |target|. If |target| is empty, its aspect ratio
103 // would be undefined; and in this case an empty Size would be returned.
104 MEDIA_EXPORT gfx::Size PadToMatchAspectRatio(const gfx::Size& size,
105 const gfx::Size& target);
106
87 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame. 107 // Copy an RGB bitmap into the specified |region_in_frame| of a YUV video frame.
88 // Fills the regions outside |region_in_frame| with black. 108 // Fills the regions outside |region_in_frame| with black.
89 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source, 109 MEDIA_EXPORT void CopyRGBToVideoFrame(const uint8* source,
90 int stride, 110 int stride,
91 const gfx::Rect& region_in_frame, 111 const gfx::Rect& region_in_frame,
92 VideoFrame* frame); 112 VideoFrame* frame);
93 113
94 } // namespace media 114 } // namespace media
95 115
96 #endif // MEDIA_BASE_VIDEO_UTIL_H_ 116 #endif // MEDIA_BASE_VIDEO_UTIL_H_
OLDNEW
« no previous file with comments | « content/content_tests.gypi ('k') | media/base/video_util.cc » ('j') | media/base/video_util.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698