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

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: fixed tests. Cleaned up 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())->CropScaleAndRotate(
588 frame.width(), 588 frame.width(),
589 frame.height(), 589 frame.height(),
590 scaled_resolution.width, 590 scaled_resolution.width,
591 scaled_resolution.height)); 591 scaled_resolution.height,
592 webrtc::kVideoRotation_0));
592 input_frame.set_video_frame_buffer(scaled_buffer); 593 input_frame.set_video_frame_buffer(scaled_buffer);
593 } else { 594 } else {
594 input_frame = quality_scaler_.GetScaledFrame(frame); 595 input_frame = quality_scaler_.GetScaledFrame(frame);
595 } 596 }
596 } 597 }
597 } 598 }
598 599
599 if (!MaybeReconfigureEncoderOnCodecThread(input_frame)) { 600 if (!MaybeReconfigureEncoderOnCodecThread(input_frame)) {
600 ALOGE << "Failed to reconfigure encoder."; 601 ALOGE << "Failed to reconfigure encoder.";
601 return WEBRTC_VIDEO_CODEC_ERROR; 602 return WEBRTC_VIDEO_CODEC_ERROR;
(...skipping 559 matching lines...) Expand 10 before | Expand all | Expand 10 after
1161 } 1162 }
1162 1163
1163 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( 1164 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder(
1164 webrtc::VideoEncoder* encoder) { 1165 webrtc::VideoEncoder* encoder) {
1165 ALOGD << "Destroy video encoder."; 1166 ALOGD << "Destroy video encoder.";
1166 delete encoder; 1167 delete encoder;
1167 } 1168 }
1168 1169
1169 } // namespace webrtc_jni 1170 } // namespace webrtc_jni
1170 1171
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698