Index: talk/app/webrtc/androidvideocapturer.cc |
diff --git a/talk/app/webrtc/androidvideocapturer.cc b/talk/app/webrtc/androidvideocapturer.cc |
index d850ab8addd54ee77dac2e987e16adebef32d06a..d31cf6b075f0c215d8071002e2d34964df0189b2 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,14 @@ 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_); |
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, |