Chromium Code Reviews| 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 | |
| 13 #import "webrtc/base/objc/NSString+StdString.h" | |
| 14 | |
| 15 NSString * const kRtxCodecMimeType = @"rtx"; | |
|
tkchin_webrtc
2016/04/14 21:11:47
nit: point at the constants directly? e.g. const N
Taylor Brandstetter
2016/04/14 22:03:31
Done.
| |
| 16 NSString * const kRedCodecMimeType = @"RED"; | |
| 17 NSString * const kUlpfecCodecMimeType = @"ulpfec"; | |
| 18 NSString * const kOpusCodecMimeType = @"opus"; | |
| 19 NSString * const kIsacCodecMimeType = @"ISAC"; | |
| 20 NSString * const kL16CodecMimeType = @"L16"; | |
| 21 NSString * const kG722CodecMimeType = @"G722"; | |
| 22 NSString * const kIlbcCodecMimeType = @"ILBC"; | |
| 23 NSString * const kPcmuCodecMimeType = @"PCMU"; | |
| 24 NSString * const kPcmaCodecMimeType = @"PCMA"; | |
| 25 NSString * const kDtmfCodecMimeType = @"telephone-event"; | |
| 26 NSString * const kComfortNoiseCodecMimeType = @"CN"; | |
| 27 NSString * const kVp8CodecMimeType = @"VP8"; | |
| 28 NSString * const kVp9CodecMimeType = @"VP9"; | |
| 29 NSString * const kH264CodecMimeType = @"H264"; | |
| 30 | |
| 31 @implementation RTCRtpCodecParameters | |
| 32 | |
| 33 @synthesize payloadType = _payloadType; | |
| 34 @synthesize mimeType = _mimeType; | |
| 35 @synthesize clockRate = _clockRate; | |
| 36 @synthesize channels = _channels; | |
| 37 | |
| 38 - (instancetype)init { | |
| 39 return [super init]; | |
| 40 } | |
| 41 | |
| 42 - (instancetype)initWithNativeParameters: | |
| 43 (const webrtc::RtpCodecParameters &)nativeParameters { | |
| 44 if (self = [self init]) { | |
| 45 _payloadType = nativeParameters.payload_type; | |
| 46 _mimeType = [NSString stringForStdString:nativeParameters.mime_type]; | |
| 47 _clockRate = nativeParameters.clock_rate; | |
| 48 _channels = nativeParameters.channels; | |
| 49 } | |
| 50 return self; | |
| 51 } | |
| 52 | |
| 53 - (webrtc::RtpCodecParameters)nativeParameters { | |
| 54 webrtc::RtpCodecParameters parameters; | |
| 55 parameters.payload_type = _payloadType; | |
| 56 parameters.mime_type = [NSString stdStringForString:_mimeType]; | |
| 57 parameters.clock_rate = _clockRate; | |
| 58 parameters.channels = _channels; | |
| 59 return parameters; | |
| 60 } | |
| 61 | |
| 62 @end | |
| OLD | NEW |