| 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  */ | 
| 11 | 11 | 
| 12 #include "webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_encoder.h" | 12 #include "webrtc/sdk/objc/Framework/Classes/VideoToolbox/encoder.h" | 
| 13 | 13 | 
| 14 #include <memory> | 14 #include <memory> | 
| 15 #include <string> | 15 #include <string> | 
| 16 #include <vector> | 16 #include <vector> | 
| 17 | 17 | 
| 18 #if defined(WEBRTC_IOS) | 18 #if defined(WEBRTC_IOS) | 
| 19 #import "WebRTC/UIDevice+RTCDevice.h" | 19 #import "WebRTC/UIDevice+RTCDevice.h" | 
| 20 #include "RTCUIApplication.h" | 20 #include "Common/RTCUIApplication.h" | 
| 21 #endif | 21 #endif | 
| 22 #include "libyuv/convert_from.h" | 22 #include "libyuv/convert_from.h" | 
| 23 #include "webrtc/base/checks.h" | 23 #include "webrtc/base/checks.h" | 
| 24 #include "webrtc/base/logging.h" | 24 #include "webrtc/base/logging.h" | 
| 25 #include "webrtc/common_video/h264/profile_level_id.h" | 25 #include "webrtc/common_video/h264/profile_level_id.h" | 
| 26 #include "webrtc/sdk/objc/Framework/Classes/corevideo_frame_buffer.h" | 26 #include "webrtc/sdk/objc/Framework/Classes/Video/corevideo_frame_buffer.h" | 
| 27 #include "webrtc/sdk/objc/Framework/Classes/h264_video_toolbox_nalu.h" | 27 #include "webrtc/sdk/objc/Framework/Classes/VideoToolbox/nalu_rewriter.h" | 
| 28 #include "webrtc/system_wrappers/include/clock.h" | 28 #include "webrtc/system_wrappers/include/clock.h" | 
| 29 | 29 | 
| 30 namespace internal { | 30 namespace internal { | 
| 31 | 31 | 
| 32 // The ratio between kVTCompressionPropertyKey_DataRateLimits and | 32 // The ratio between kVTCompressionPropertyKey_DataRateLimits and | 
| 33 // kVTCompressionPropertyKey_AverageBitRate. The data rate limit is set higher | 33 // kVTCompressionPropertyKey_AverageBitRate. The data rate limit is set higher | 
| 34 // than the average bit rate to avoid undershooting the target. | 34 // than the average bit rate to avoid undershooting the target. | 
| 35 const float kLimitToAverageBitRateFactor = 1.5f; | 35 const float kLimitToAverageBitRateFactor = 1.5f; | 
| 36 // These thresholds deviate from the default h264 QP thresholds, as they | 36 // These thresholds deviate from the default h264 QP thresholds, as they | 
| 37 // have been found to work better on devices that support VideoToolbox | 37 // have been found to work better on devices that support VideoToolbox | 
| (...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 737   } | 737   } | 
| 738   bitrate_adjuster_.Update(frame._length); | 738   bitrate_adjuster_.Update(frame._length); | 
| 739 } | 739 } | 
| 740 | 740 | 
| 741 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() | 741 VideoEncoder::ScalingSettings H264VideoToolboxEncoder::GetScalingSettings() | 
| 742     const { | 742     const { | 
| 743   return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, | 743   return VideoEncoder::ScalingSettings(true, internal::kLowH264QpThreshold, | 
| 744                                        internal::kHighH264QpThreshold); | 744                                        internal::kHighH264QpThreshold); | 
| 745 } | 745 } | 
| 746 }  // namespace webrtc | 746 }  // namespace webrtc | 
| OLD | NEW | 
|---|