OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2014 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 config_->rc_buf_optimal_sz = 600; | 276 config_->rc_buf_optimal_sz = 600; |
277 config_->rc_buf_sz = 1000; | 277 config_->rc_buf_sz = 1000; |
278 // Set the maximum target size of any key-frame. | 278 // Set the maximum target size of any key-frame. |
279 rc_max_intra_target_ = MaxIntraTarget(config_->rc_buf_optimal_sz); | 279 rc_max_intra_target_ = MaxIntraTarget(config_->rc_buf_optimal_sz); |
280 if (inst->codecSpecific.VP9.keyFrameInterval > 0) { | 280 if (inst->codecSpecific.VP9.keyFrameInterval > 0) { |
281 config_->kf_mode = VPX_KF_AUTO; | 281 config_->kf_mode = VPX_KF_AUTO; |
282 config_->kf_max_dist = inst->codecSpecific.VP9.keyFrameInterval; | 282 config_->kf_max_dist = inst->codecSpecific.VP9.keyFrameInterval; |
283 } else { | 283 } else { |
284 config_->kf_mode = VPX_KF_DISABLED; | 284 config_->kf_mode = VPX_KF_DISABLED; |
285 } | 285 } |
| 286 config_->rc_resize_allowed = inst->codecSpecific.VP9.automaticResizeOn ? |
| 287 1 : 0; |
286 // Determine number of threads based on the image size and #cores. | 288 // Determine number of threads based on the image size and #cores. |
287 config_->g_threads = NumberOfThreads(config_->g_w, | 289 config_->g_threads = NumberOfThreads(config_->g_w, |
288 config_->g_h, | 290 config_->g_h, |
289 number_of_cores); | 291 number_of_cores); |
290 | 292 |
291 cpu_speed_ = GetCpuSpeed(config_->g_w, config_->g_h); | 293 cpu_speed_ = GetCpuSpeed(config_->g_w, config_->g_h); |
292 | 294 |
293 // TODO(asapersson): Check configuration of temporal switch up and increase | 295 // TODO(asapersson): Check configuration of temporal switch up and increase |
294 // pattern length. | 296 // pattern length. |
295 if (num_temporal_layers_ == 1) { | 297 if (num_temporal_layers_ == 1) { |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 decoder_ = NULL; | 776 decoder_ = NULL; |
775 } | 777 } |
776 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers | 778 // Releases buffers from the pool. Any buffers not in use are deleted. Buffers |
777 // still referenced externally are deleted once fully released, not returning | 779 // still referenced externally are deleted once fully released, not returning |
778 // to the pool. | 780 // to the pool. |
779 frame_buffer_pool_.ClearPool(); | 781 frame_buffer_pool_.ClearPool(); |
780 inited_ = false; | 782 inited_ = false; |
781 return WEBRTC_VIDEO_CODEC_OK; | 783 return WEBRTC_VIDEO_CODEC_OK; |
782 } | 784 } |
783 } // namespace webrtc | 785 } // namespace webrtc |
OLD | NEW |