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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 if (sw_fallback_required_) { | 398 if (sw_fallback_required_) { |
399 return WEBRTC_VIDEO_CODEC_OK; | 399 return WEBRTC_VIDEO_CODEC_OK; |
400 } | 400 } |
401 codec_mode_ = codec_settings->mode; | 401 codec_mode_ = codec_settings->mode; |
402 int init_width = codec_settings->width; | 402 int init_width = codec_settings->width; |
403 int init_height = codec_settings->height; | 403 int init_height = codec_settings->height; |
404 // Scaling is disabled for VP9, but optionally enabled for VP8. | 404 // Scaling is disabled for VP9, but optionally enabled for VP8. |
405 // TODO(pbos): Extract automaticResizeOn out of VP8 settings. | 405 // TODO(pbos): Extract automaticResizeOn out of VP8 settings. |
406 scale_ = false; | 406 scale_ = false; |
407 if (codecType_ == kVideoCodecVP8) { | 407 if (codecType_ == kVideoCodecVP8) { |
408 scale_ = codec_settings->codecSpecific.VP8.automaticResizeOn; | 408 scale_ = codec_settings->VP8().automaticResizeOn; |
409 } else if (codecType_ != kVideoCodecVP9) { | 409 } else if (codecType_ != kVideoCodecVP9) { |
410 scale_ = true; | 410 scale_ = true; |
411 } | 411 } |
412 | 412 |
413 ALOGD << "InitEncode request: " << init_width << " x " << init_height; | 413 ALOGD << "InitEncode request: " << init_width << " x " << init_height; |
414 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); | 414 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); |
415 | 415 |
416 if (scale_) { | 416 if (scale_) { |
417 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264) { | 417 if (codecType_ == kVideoCodecVP8 || codecType_ == kVideoCodecH264) { |
418 quality_scaler_.Init(codecType_, codec_settings->startBitrate, | 418 quality_scaler_.Init(codecType_, codec_settings->startBitrate, |
(...skipping 953 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1372 return supported_codecs_; | 1372 return supported_codecs_; |
1373 } | 1373 } |
1374 | 1374 |
1375 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1375 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1376 webrtc::VideoEncoder* encoder) { | 1376 webrtc::VideoEncoder* encoder) { |
1377 ALOGD << "Destroy video encoder."; | 1377 ALOGD << "Destroy video encoder."; |
1378 delete encoder; | 1378 delete encoder; |
1379 } | 1379 } |
1380 | 1380 |
1381 } // namespace webrtc_jni | 1381 } // namespace webrtc_jni |
OLD | NEW |