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

Unified Diff: webrtc/api/androidvideocapturer.cc

Issue 1965953003: Android: Add support for cropping textures (Closed) 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/api/androidvideocapturer.cc
diff --git a/webrtc/api/androidvideocapturer.cc b/webrtc/api/androidvideocapturer.cc
index ee5ef665d97c37247929f170def89192679220d7..71a94fedb060b584c02c85469889558128856ac3 100644
--- a/webrtc/api/androidvideocapturer.cc
+++ b/webrtc/api/androidvideocapturer.cc
@@ -88,14 +88,12 @@ class AndroidVideoCapturer::FrameFactory : public cricket::VideoFrameFactory {
int output_width,
int output_height) const override {
if (buffer_->native_handle() != nullptr) {
- // TODO(perkj) Implement cropping.
- RTC_CHECK_EQ(cropped_input_width, buffer_->width());
- RTC_CHECK_EQ(cropped_input_height, buffer_->height());
rtc::scoped_refptr<webrtc::VideoFrameBuffer> scaled_buffer(
static_cast<webrtc_jni::AndroidTextureBuffer*>(buffer_.get())
- ->ScaleAndRotate(output_width, output_height,
- apply_rotation_ ? input_frame->rotation :
- webrtc::kVideoRotation_0));
+ ->CropScaleAndRotate(cropped_input_width, cropped_input_height,
+ output_width, output_height,
+ apply_rotation_ ? input_frame->rotation
+ : webrtc::kVideoRotation_0));
return new cricket::WebRtcVideoFrame(
scaled_buffer, input_frame->time_stamp,
apply_rotation_ ? webrtc::kVideoRotation_0 : input_frame->rotation);
« no previous file with comments | « no previous file | webrtc/api/java/jni/androidmediaencoder_jni.cc » ('j') | webrtc/api/java/jni/native_handle_impl.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698