Index: webrtc/common_video/include/video_frame_buffer.h |
diff --git a/webrtc/common_video/include/video_frame_buffer.h b/webrtc/common_video/include/video_frame_buffer.h |
index 6f082dee9bae928fbb005027b7262f03bdde3053..6152bc7a62361ac45f0116f23aa05429109d72fd 100644 |
--- a/webrtc/common_video/include/video_frame_buffer.h |
+++ b/webrtc/common_video/include/video_frame_buffer.h |
@@ -122,6 +122,20 @@ class I420Buffer : public VideoFrameBuffer { |
static rtc::scoped_refptr<I420Buffer> Copy( |
const rtc::scoped_refptr<VideoFrameBuffer>& buffer); |
+ static rtc::scoped_refptr<I420Buffer> Scale( |
+ const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
+ int dst_width, |
+ int dst_height); |
+ |
+ static rtc::scoped_refptr<I420Buffer> CropAndScale( |
+ const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
+ int crop_x, |
+ int crop_y, |
+ int crop_width, |
perkj_webrtc
2016/05/11 10:05:17
please document what the arguments means.
nisse-webrtc
2016/05/12 12:23:06
Done.
|
+ int crop_height, |
+ int dst_width, |
+ int dst_height); |
+ |
protected: |
~I420Buffer() override; |
@@ -187,6 +201,15 @@ class WrappedI420Buffer : public webrtc::VideoFrameBuffer { |
rtc::scoped_refptr<VideoFrameBuffer> NativeToI420Buffer() override; |
+ // Helper function to crop |buffer| without making a deep copy. May |
+ // only be used for non-native frames. |
+ static rtc::scoped_refptr<WrappedI420Buffer> ShallowCrop( |
+ const rtc::scoped_refptr<VideoFrameBuffer>& buffer, |
+ int crop_x, |
+ int crop_y, |
+ int cropped_width, |
+ int cropped_height); |
+ |
private: |
friend class rtc::RefCountedObject<WrappedI420Buffer>; |
~WrappedI420Buffer() override; |