OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 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 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
530 target_bitrate_bps_ = 1000 * new_bitrate_kbit; | 530 target_bitrate_bps_ = 1000 * new_bitrate_kbit; |
531 bitrate_adjuster_.SetTargetBitrateBps(target_bitrate_bps_); | 531 bitrate_adjuster_.SetTargetBitrateBps(target_bitrate_bps_); |
532 SetBitrateBps(bitrate_adjuster_.GetAdjustedBitrateBps()); | 532 SetBitrateBps(bitrate_adjuster_.GetAdjustedBitrateBps()); |
533 return WEBRTC_VIDEO_CODEC_OK; | 533 return WEBRTC_VIDEO_CODEC_OK; |
534 } | 534 } |
535 | 535 |
536 int H264VideoToolboxEncoder::Release() { | 536 int H264VideoToolboxEncoder::Release() { |
537 // Need to reset so that the session is invalidated and won't use the | 537 // Need to reset so that the session is invalidated and won't use the |
538 // callback anymore. Do not remove callback until the session is invalidated | 538 // callback anymore. Do not remove callback until the session is invalidated |
539 // since async encoder callbacks can occur until invalidation. | 539 // since async encoder callbacks can occur until invalidation. |
540 int ret = ResetCompressionSession(); | 540 DestroyCompressionSession(); |
541 callback_ = nullptr; | 541 callback_ = nullptr; |
jtt_webrtc
2017/07/20 17:56:00
I don't think you need to make this change anymore
kthelgason
2017/07/21 09:09:36
I'll remove it from this CL and create a new one w
| |
542 return ret; | 542 return WEBRTC_VIDEO_CODEC_OK; |
543 } | 543 } |
544 | 544 |
545 int H264VideoToolboxEncoder::ResetCompressionSession() { | 545 int H264VideoToolboxEncoder::ResetCompressionSession() { |
546 DestroyCompressionSession(); | 546 DestroyCompressionSession(); |
547 | 547 |
548 // Set source image buffer attributes. These attributes will be present on | 548 // Set source image buffer attributes. These attributes will be present on |
549 // buffers retrieved from the encoder's pixel buffer pool. | 549 // buffers retrieved from the encoder's pixel buffer pool. |
550 const size_t attributes_size = 3; | 550 const size_t attributes_size = 3; |
551 CFTypeRef keys[attributes_size] = { | 551 CFTypeRef keys[attributes_size] = { |
552 #if defined(WEBRTC_IOS) | 552 #if defined(WEBRTC_IOS) |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
756 } | 756 } |
757 bitrate_adjuster_.Update(frame._length); | 757 bitrate_adjuster_.Update(frame._length); |
758 } | 758 } |
759 | 759 |
760 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() | 760 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() |
761 const { | 761 const { |
762 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, | 762 return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, |
763 internal::kHighH264QpThreshold); | 763 internal::kHighH264QpThreshold); |
764 } | 764 } |
765 } // namespace webrtc | 765 } // namespace webrtc |
OLD | NEW |