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 __unused RTCUIApplicationStatusObserver *observer = | |
307 [RTCUIApplicationStatusObserver sharedInstance]; | |
308 #endif | |
kthelgason
2017/09/13 08:20:09
I think this needs a comment to explain to future
andersc
2017/09/13 08:46:21
Good idea. I named the method `prepareForUse` sinc
| |
304 } | 309 } |
305 return self; | 310 return self; |
306 } | 311 } |
307 | 312 |
308 - (void)dealloc { | 313 - (void)dealloc { |
309 [self destroyCompressionSession]; | 314 [self destroyCompressionSession]; |
310 } | 315 } |
311 | 316 |
312 - (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings | 317 - (NSInteger)startEncodeWithSettings:(RTCVideoEncoderSettings *)settings |
313 numberOfCores:(int)numberOfCores { | 318 numberOfCores:(int)numberOfCores { |
(...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
700 } | 705 } |
701 _bitrateAdjuster->Update(frame.buffer.length); | 706 _bitrateAdjuster->Update(frame.buffer.length); |
702 } | 707 } |
703 | 708 |
704 - (RTCVideoEncoderQpThresholds *)scalingSettings { | 709 - (RTCVideoEncoderQpThresholds *)scalingSettings { |
705 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh reshold | 710 return [[RTCVideoEncoderQpThresholds alloc] initWithThresholdsLow:kLowH264QpTh reshold |
706 high:kHighH264QpT hreshold]; | 711 high:kHighH264QpT hreshold]; |
707 } | 712 } |
708 | 713 |
709 @end | 714 @end |
OLD | NEW |