Chromium Code Reviews| Index: talk/app/webrtc/androidvideocapturer.cc |
| diff --git a/talk/app/webrtc/androidvideocapturer.cc b/talk/app/webrtc/androidvideocapturer.cc |
| index d850ab8addd54ee77dac2e987e16adebef32d06a..08549a5951db81b77ba773c780e3f653fc14d7be 100644 |
| --- a/talk/app/webrtc/androidvideocapturer.cc |
| +++ b/talk/app/webrtc/androidvideocapturer.cc |
| @@ -26,6 +26,7 @@ |
| */ |
| #include "talk/app/webrtc/androidvideocapturer.h" |
| +#include "talk/app/webrtc/java/jni/native_handle_impl.h" |
| #include "talk/media/webrtc/webrtcvideoframe.h" |
| #include "webrtc/base/common.h" |
| #include "webrtc/base/json.h" |
| @@ -100,10 +101,13 @@ class AndroidVideoCapturer::FrameFactory : public cricket::VideoFrameFactory { |
| int cropped_input_height, |
| int output_width, |
| int output_height) const override { |
| + rtc::scoped_refptr<webrtc::VideoFrameBuffer> buffer(buffer_); |
|
magjed_webrtc
2015/11/25 13:38:28
Move this inside the if-statement, i.e.
rtc::scope
perkj_webrtc
2015/11/25 20:56:20
Done.
|
| if (buffer_->native_handle() != nullptr) { |
| - // TODO(perkj): Implement CreateAliasedFrame properly for textures. |
| + buffer = static_cast<webrtc_jni::AndroidTextureBuffer*>(buffer_.get()) |
| + ->CropAndScale(cropped_input_width, cropped_input_height, |
| + output_width, output_height); |
| rtc::scoped_ptr<cricket::VideoFrame> frame(new cricket::WebRtcVideoFrame( |
| - buffer_, input_frame->time_stamp, input_frame->rotation)); |
| + buffer, input_frame->time_stamp, input_frame->rotation)); |
| return frame.release(); |
| } |
| return VideoFrameFactory::CreateAliasedFrame(input_frame, |