Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(192)

Side by Side Diff: webrtc/sdk/objc/Framework/Classes/VideoToolbox/RTCVideoEncoderH264.mm

Issue 3009383002: Enhance RTCUIApplicationStatusObserver thread safety. (Closed)
Patch Set: Rebase Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698