| 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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 294 // conditions, 0.95 seems to give us better overall bitrate over long periods | 294 // conditions, 0.95 seems to give us better overall bitrate over long periods |
| 295 // of time. | 295 // of time. |
| 296 - (instancetype)initWithCodecInfo:(RTCVideoCodecInfo *)codecInfo { | 296 - (instancetype)initWithCodecInfo:(RTCVideoCodecInfo *)codecInfo { |
| 297 if (self = [super init]) { | 297 if (self = [super init]) { |
| 298 _codecInfo = codecInfo; | 298 _codecInfo = codecInfo; |
| 299 _bitrateAdjuster = new webrtc::BitrateAdjuster(webrtc::Clock::GetRealTimeClo
ck(), .5, .95); | 299 _bitrateAdjuster = new webrtc::BitrateAdjuster(webrtc::Clock::GetRealTimeClo
ck(), .5, .95); |
| 300 _packetizationMode = RTCH264PacketizationModeNonInterleaved; | 300 _packetizationMode = RTCH264PacketizationModeNonInterleaved; |
| 301 _profile = ExtractProfile([codecInfo nativeVideoCodec]); | 301 _profile = ExtractProfile([codecInfo nativeVideoCodec]); |
| 302 LOG(LS_INFO) << "Using profile " << CFStringToString(_profile); | 302 LOG(LS_INFO) << "Using profile " << CFStringToString(_profile); |
| 303 RTC_CHECK([codecInfo.name isEqualToString:@"H264"]); | 303 RTC_CHECK([codecInfo.name isEqualToString:@"H264"]); |
| 304 |
| 305 #if defined(WEBRTC_IOS) |
| 306 [RTCUIApplicationStatusObserver prepareForUse]; |
| 307 #endif |
| 304 } | 308 } |
| 305 return self; | 309 return self; |
| 306 } | 310 } |
| 307 | 311 |
| 308 - (void)dealloc { | 312 - (void)dealloc { |
| 309 [self destroyCompressionSession]; | 313 [self destroyCompressionSession]; |
| 310 } | 314 } |
| 311 | 315 |
| 312 - (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings | 316 - (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings |
| 313 numberOfCores:(int)numberOfCores { | 317 numberOfCores:(int)numberOfCores { |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 } | 704 } |
| 701 _bitrateAdjuster->Update(frame.buffer.length); | 705 _bitrateAdjuster->Update(frame.buffer.length); |
| 702 } | 706 } |
| 703 | 707 |
| 704 - (RTCVideoEncoderQpThresholds *)scalingSettings { | 708 - (RTCVideoEncoderQpThresholds *)scalingSettings { |
| 705 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh
reshold | 709 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh
reshold |
| 706 high:kHighH264QpT
hreshold]; | 710 high:kHighH264QpT
hreshold]; |
| 707 } | 711 } |
| 708 | 712 |
| 709 @end | 713 @end |
| OLD | NEW |