OLD | NEW |
(Empty) | |
| 1 /* |
| 2 * Copyright 2016 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 "RTCRtpCodecParameters+Private.h" |
| 12 #import "webrtc/base/objc/NSString+StdString.h" |
| 13 |
| 14 @implementation RTCRtpCodecParameters |
| 15 |
| 16 @synthesize payloadType = _payloadType; |
| 17 @synthesize mimeType = _mimeType; |
| 18 @synthesize clockRate = _clockRate; |
| 19 @synthesize channels = _channels; |
| 20 |
| 21 - (instancetype)init { |
| 22 return [super init]; |
| 23 } |
| 24 |
| 25 - (instancetype)initWithNativeParameters: |
| 26 (const webrtc::RtpCodecParameters &)nativeParameters { |
| 27 if (self = [self init]) { |
| 28 _payloadType = nativeParameters.payload_type; |
| 29 _mimeType = [NSString stringForStdString:nativeParameters.mime_type]; |
| 30 _clockRate = nativeParameters.clock_rate; |
| 31 _channels = nativeParameters.channels; |
| 32 _isActive = nativeParameters.active; |
| 33 } |
| 34 return self; |
| 35 } |
| 36 |
| 37 - (webrtc::RtpCodecParameters)nativeParameters { |
| 38 webrtc::RtpCodecParameters parameters; |
| 39 parameters.payload_type = _payloadType; |
| 40 parameters.mime_type = [NSString stdStringForString:_mimeType]; |
| 41 parameters.clock_rate = _clockRate; |
| 42 parameters.channels = _channels; |
| 43 return parameters; |
| 44 } |
| 45 |
| 46 @end |
OLD | NEW |