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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; | 358 return WEBRTC_VIDEO_CODEC_ERR_PARAMETER; |
359 } | 359 } |
360 // Factory should guard against other codecs being used with us. | 360 // Factory should guard against other codecs being used with us. |
361 RTC_CHECK(codec_settings->codecType == codecType_) | 361 RTC_CHECK(codec_settings->codecType == codecType_) |
362 << "Unsupported codec " << codec_settings->codecType << " for " | 362 << "Unsupported codec " << codec_settings->codecType << " for " |
363 << codecType_; | 363 << codecType_; |
364 | 364 |
365 codec_mode_ = codec_settings->mode; | 365 codec_mode_ = codec_settings->mode; |
366 int init_width = codec_settings->width; | 366 int init_width = codec_settings->width; |
367 int init_height = codec_settings->height; | 367 int init_height = codec_settings->height; |
368 scale_ = (codecType_ != kVideoCodecVP9) && (webrtc::field_trial::FindFullName( | 368 scale_ = codecType_ != kVideoCodecVP9; |
369 "WebRTC-MediaCodecVideoEncoder-AutomaticResize") == "Enabled"); | |
370 | 369 |
371 ALOGD << "InitEncode request: " << init_width << " x " << init_height; | 370 ALOGD << "InitEncode request: " << init_width << " x " << init_height; |
372 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); | 371 ALOGD << "Encoder automatic resize " << (scale_ ? "enabled" : "disabled"); |
373 | 372 |
374 if (scale_) { | 373 if (scale_) { |
375 if (codecType_ == kVideoCodecVP8) { | 374 if (codecType_ == kVideoCodecVP8) { |
376 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the | 375 // QP is obtained from VP8-bitstream for HW, so the QP corresponds to the |
377 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is | 376 // (internal) range: [0, 127]. And we cannot change QP_max in HW, so it is |
378 // always = 127. Note that in SW, QP is that of the user-level range [0, | 377 // always = 127. Note that in SW, QP is that of the user-level range [0, |
379 // 63]. | 378 // 63]. |
(...skipping 873 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1253 } | 1252 } |
1254 | 1253 |
1255 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( | 1254 void MediaCodecVideoEncoderFactory::DestroyVideoEncoder( |
1256 webrtc::VideoEncoder* encoder) { | 1255 webrtc::VideoEncoder* encoder) { |
1257 ALOGD << "Destroy video encoder."; | 1256 ALOGD << "Destroy video encoder."; |
1258 delete encoder; | 1257 delete encoder; |
1259 } | 1258 } |
1260 | 1259 |
1261 } // namespace webrtc_jni | 1260 } // namespace webrtc_jni |
1262 | 1261 |
OLD | NEW |