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

Unified Diff: talk/app/webrtc/androidvideocapturer.cc

Issue 1470043002: Support texture scaling in Androids MediaEncoder (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Added test in VideoCapturerAndroid Created 5 years, 1 month 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: 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,

Powered by Google App Engine
This is Rietveld 408576698