| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright 2015 The WebRTC project authors. All Rights Reserved. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
| 5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
| 6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
| 7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
| 8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
| 9 */ | 9 */ |
| 10 | 10 |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 if (sw_fallback_required_) { | 397 if (sw_fallback_required_) { |
| 398 return WEBRTC_VIDEO_CODEC_OK; | 398 return WEBRTC_VIDEO_CODEC_OK; |
| 399 } | 399 } |
| 400 codec_mode_ = codec_settings->mode; | 400 codec_mode_ = codec_settings->mode; |
| 401 int init_width = codec_settings->width; | 401 int init_width = codec_settings->width; |
| 402 int init_height = codec_settings->height; | 402 int init_height = codec_settings->height; |
| 403 // Scaling is disabled for VP9, but optionally enabled for VP8. | 403 // Scaling is disabled for VP9, but optionally enabled for VP8. |
| 404 // TODO(pbos): Extract automaticResizeOn out of VP8 settings. | 404 // TODO(pbos): Extract automaticResizeOn out of VP8 settings. |
| 405 scale_ = false; | 405 scale_ = false; |
| 406 if (codecType_ == kVideoCodecVP8) { | 406 if (codecType_ == kVideoCodecVP8) { |
| 407 scale_ = codec_settings->VP8().automaticResizeOn; | 407 scale_ = codec_settings->codecSpecific.VP8.automaticResizeOn; |
| 408 } else if (codecType_ != kVideoCodecVP9) { | 408 } else if (codecType_ != kVideoCodecVP9) { |
| 409 scale_ = true; | 409 scale_ = true; |
| 410 } | 410 } |
| 411 | 411 |
| 412 ALOGD << "InitEncode request: " << init_width << " x " << init_height; | 412 ALOGD << "InitEncode request: " << init_width << " x " << init_height; |
| 413 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); | 413 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); |
| 414 | 414 |
| 415 if (scale_) { | 415 if (scale_) { |
| 416 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264) { | 416 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264) { |
| 417 quality_scaler_.Init(codecType_, codec_settings->startBitrate, | 417 quality_scaler_.Init(codecType_, codec_settings->startBitrate, |
| (...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1370 return supported_codecs_; | 1370 return supported_codecs_; |
| 1371 } | 1371 } |
| 1372 | 1372 |
| 1373 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1373 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
| 1374 webrtc::VideoEncoder* encoder) { | 1374 webrtc::VideoEncoder* encoder) { |
| 1375 ALOGD << "Destroy video encoder."; | 1375 ALOGD << "Destroy video encoder."; |
| 1376 delete encoder; | 1376 delete encoder; |
| 1377 } | 1377 } |
| 1378 | 1378 |
| 1379 } // namespace webrtc_jni | 1379 } // namespace webrtc_jni |
| OLD | NEW |