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

Unified Diff: webrtc/media/base/videoframefactory.h

Issue 1960073002: New method CreateScaledFrame in the VideoFrameFactory interface. Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 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
Index: webrtc/media/base/videoframefactory.h
diff --git a/webrtc/media/base/videoframefactory.h b/webrtc/media/base/videoframefactory.h
index 6aa2ce51733b0c01ea8d5187ace63865a2d32571..526a4d79073da39b064e91423c9194fe958efc64 100644
--- a/webrtc/media/base/videoframefactory.h
+++ b/webrtc/media/base/videoframefactory.h
@@ -27,6 +27,15 @@ class VideoFrameFactory {
VideoFrameFactory() : apply_rotation_(false) {}
virtual ~VideoFrameFactory() {}
+ virtual std::unique_ptr<VideoFrame> CreateScaledFrame(
+ const CapturedFrame* input_frame,
+ int width,
+ int height) const;
+
+ // The CreateAliasedFrame methods are deprecated, since cropping is
+ // no longer supported, and we don't want raw pointer return types.
+ // TODO(nisse): Delete when all users are updated.
+
// The returned frame aliases the aliased_frame if the input color
// space allows for aliasing, otherwise a color conversion will
// occur. Returns NULL if conversion fails.
@@ -35,8 +44,11 @@ class VideoFrameFactory {
// size |cropped_width| x |cropped_height|.
virtual VideoFrame* CreateAliasedFrame(const CapturedFrame* input_frame,
int cropped_width,
- int cropped_height) const = 0;
-
+ int cropped_height) const {
+ // Dummy default implementation, to make it easier to delete in
+ // subclasses.
+ return NULL;
+ }
// The returned frame will be a center crop of |input_frame| with size
// |cropped_width| x |cropped_height|, scaled to |output_width| x
// |output_height|.

Powered by Google App Engine
This is Rietveld 408576698