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

Side by Side Diff: talk/app/webrtc/java/jni/androidmediaencoder_jni.cc

Issue 1493913007: VideoCapturerAndroid, handle cvo correctly (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased Created 5 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * libjingle 2 * libjingle
3 * Copyright 2015 Google Inc. 3 * Copyright 2015 Google Inc.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are met: 6 * modification, are permitted provided that the following conditions are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright notice, 8 * 1. Redistributions of source code must retain the above copyright notice,
9 * this list of conditions and the following disclaimer. 9 * this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright notice, 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
(...skipping 566 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 if (scale_) { 577 if (scale_) {
578 // Check framerate before spatial resolution change. 578 // Check framerate before spatial resolution change.
579 quality_scaler_.OnEncodeFrame(frame); 579 quality_scaler_.OnEncodeFrame(frame);
580 const webrtc::QualityScaler::Resolution scaled_resolution = 580 const webrtc::QualityScaler::Resolution scaled_resolution =
581 quality_scaler_.GetScaledResolution(); 581 quality_scaler_.GetScaledResolution();
582 if (scaled_resolution.width != frame.width() || 582 if (scaled_resolution.width != frame.width() ||
583 scaled_resolution.height != frame.height()) { 583 scaled_resolution.height != frame.height()) {
584 if (frame.native_handle() != nullptr) { 584 if (frame.native_handle() != nullptr) {
585 rtc::scoped_refptr<webrtc::VideoFrameBuffer> scaled_buffer( 585 rtc::scoped_refptr<webrtc::VideoFrameBuffer> scaled_buffer(
586 static_cast<AndroidTextureBuffer*>( 586 static_cast<AndroidTextureBuffer*>(
587 frame.video_frame_buffer().get())->CropAndScale( 587 frame.video_frame_buffer().get())->ScaleAndRotate(
588 frame.width(),
589 frame.height(),
590 scaled_resolution.width, 588 scaled_resolution.width,
591 scaled_resolution.height)); 589 scaled_resolution.height,
590 webrtc::kVideoRotation_0));
592 input_frame.set_video_frame_buffer(scaled_buffer); 591 input_frame.set_video_frame_buffer(scaled_buffer);
593 } else { 592 } else {
594 input_frame = quality_scaler_.GetScaledFrame(frame); 593 input_frame = quality_scaler_.GetScaledFrame(frame);
595 } 594 }
596 } 595 }
597 } 596 }
598 597
599 if (!MaybeReconfigureEncoderOnCodecThread(input_frame)) { 598 if (!MaybeReconfigureEncoderOnCodecThread(input_frame)) {
600 ALOGE << "Failed to reconfigure encoder."; 599 ALOGE << "Failed to reconfigure encoder.";
601 return WEBRTC_VIDEO_CODEC_ERROR; 600 return WEBRTC_VIDEO_CODEC_ERROR;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 } 1160 }
1162 1161
1163 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( 1162 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder(
1164 webrtc::VideoEncoder* encoder) { 1163 webrtc::VideoEncoder* encoder) {
1165 ALOGD << "Destroy video encoder."; 1164 ALOGD << "Destroy video encoder.";
1166 delete encoder; 1165 delete encoder;
1167 } 1166 }
1168 1167
1169 } // namespace webrtc_jni 1168 } // namespace webrtc_jni
1170 1169
OLDNEW
« no previous file with comments | « talk/app/webrtc/java/android/org/webrtc/VideoCapturerAndroid.java ('k') | talk/app/webrtc/java/jni/androidvideocapturer_jni.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698