1/* 2 * Copyright 2018 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11#import "RTCRtcpParameters+Private.h" 12 13#import "helpers/NSString+StdString.h" 14 15@implementation RTC_OBJC_TYPE (RTCRtcpParameters) 16 17@synthesize cname = _cname; 18@synthesize isReducedSize = _isReducedSize; 19 20- (instancetype)init { 21 webrtc::RtcpParameters nativeParameters; 22 return [self initWithNativeParameters:nativeParameters]; 23} 24 25- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters { 26 if (self = [super init]) { 27 _cname = [NSString stringForStdString:nativeParameters.cname]; 28 _isReducedSize = nativeParameters.reduced_size; 29 } 30 return self; 31} 32 33- (webrtc::RtcpParameters)nativeParameters { 34 webrtc::RtcpParameters parameters; 35 parameters.cname = [NSString stdStringForString:_cname]; 36 parameters.reduced_size = _isReducedSize; 37 return parameters; 38} 39 40@end 41