| Index: webrtc/api/androidvideocapturer.cc
|
| diff --git a/webrtc/api/androidvideocapturer.cc b/webrtc/api/androidvideocapturer.cc
|
| index ee5ef665d97c37247929f170def89192679220d7..a3eeddd36b5a9ebcdfdc2a8be76334cb71dfda31 100644
|
| --- a/webrtc/api/androidvideocapturer.cc
|
| +++ b/webrtc/api/androidvideocapturer.cc
|
| @@ -64,6 +64,41 @@ class AndroidVideoCapturer::FrameFactory : public cricket::VideoFrameFactory {
|
| return &captured_frame_;
|
| }
|
|
|
| + std::unique_ptr<cricket::VideoFrame> CreateScaledCroppedFrame(
|
| + const cricket::CapturedFrame* input_frame,
|
| + int crop_x,
|
| + int crop_y,
|
| + int crop_width,
|
| + int crop_height,
|
| + int dst_width,
|
| + int dst_height) const {
|
| + // Check that input_frame is actually our frame.
|
| + RTC_CHECK(input_frame == &captured_frame_);
|
| + RTC_CHECK(buffer_->native_handle() == nullptr);
|
| +
|
| + rtc::scoped_refptr<VideoFrameBuffer> scaled_buffer;
|
| + if (dst_width == crop_width && dst_height == crop_height) {
|
| + if (dst_width == buffer_->width() && dst_height == buffer_->height()) {
|
| + scaled_buffer = buffer_;
|
| + } else {
|
| + scaled_buffer = WrappedI420Buffer::ShallowCrop(
|
| + buffer_, crop_x, crop_y, dst_width, dst_height);
|
| + }
|
| + }
|
| + else {
|
| + scaled_buffer = I420Buffer::CropAndScale(
|
| + buffer_, crop_x, crop_y, crop_width, crop_height,
|
| + dst_width, dst_height);
|
| + }
|
| + std::unique_ptr<cricket::VideoFrame> frame(
|
| + new cricket::WebRtcVideoFrame(scaled_buffer,
|
| + input_frame->time_stamp,
|
| + input_frame->rotation));
|
| + return apply_rotation_ ? std::unique_ptr<cricket::VideoFrame>(
|
| + frame->GetCopyWithRotationApplied()->Copy())
|
| + : std::move(frame);
|
| + }
|
| +
|
| cricket::VideoFrame* CreateAliasedFrame(
|
| const cricket::CapturedFrame* captured_frame,
|
| int dst_width,
|
|
|