Florent Castelli | dacec71 | 2018-05-24 16:24:21 +0200 | [diff] [blame] | 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 | |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame^] | 13 | #import "helpers/NSString+StdString.h" |
Florent Castelli | dacec71 | 2018-05-24 16:24:21 +0200 | [diff] [blame] | 14 | |
| 15 | @implementation RTCRtcpParameters |
| 16 | |
| 17 | @synthesize cname = _cname; |
| 18 | @synthesize isReducedSize = _isReducedSize; |
| 19 | |
| 20 | - (instancetype)init { |
| 21 | return [super init]; |
| 22 | } |
| 23 | |
| 24 | - (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters { |
| 25 | if (self = [self init]) { |
| 26 | _cname = [NSString stringForStdString:nativeParameters.cname]; |
| 27 | _isReducedSize = nativeParameters.reduced_size; |
| 28 | } |
| 29 | return self; |
| 30 | } |
| 31 | |
| 32 | - (webrtc::RtcpParameters)nativeParameters { |
| 33 | webrtc::RtcpParameters parameters; |
| 34 | parameters.cname = [NSString stdStringForString:_cname]; |
| 35 | parameters.reduced_size = _isReducedSize; |
| 36 | return parameters; |
| 37 | } |
| 38 | |
| 39 | @end |