blob: e92ee4b3e7ebf7f4c5d0604fe610f082e846daab [file] [log] [blame]
Florent Castellidacec712018-05-24 16:24:21 +02001/*
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
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020013#import "helpers/NSString+StdString.h"
Florent Castellidacec712018-05-24 16:24:21 +020014
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020015@implementation RTC_OBJC_TYPE (RTCRtcpParameters)
Florent Castellidacec712018-05-24 16:24:21 +020016
17@synthesize cname = _cname;
18@synthesize isReducedSize = _isReducedSize;
19
20- (instancetype)init {
Yura Yaroshevich9aec8c22021-04-14 12:41:21 +030021 webrtc::RtcpParameters nativeParameters;
22 return [self initWithNativeParameters:nativeParameters];
Florent Castellidacec712018-05-24 16:24:21 +020023}
24
25- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters {
Yura Yaroshevich9aec8c22021-04-14 12:41:21 +030026 if (self = [super init]) {
Florent Castellidacec712018-05-24 16:24:21 +020027 _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