blob: 68093e92ea93592b6b0e130a837b7ae6d45115ca [file] [log] [blame]
Florent Castelliabe301f2018-06-12 18:33:49 +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 "RTCRtpHeaderExtension+Private.h"
12
Anders Carlsson7bca8ca2018-08-30 09:30:29 +020013#import "helpers/NSString+StdString.h"
Florent Castelliabe301f2018-06-12 18:33:49 +020014
Mirko Bonadeia81e9c82020-05-04 16:14:32 +020015@implementation RTC_OBJC_TYPE (RTCRtpHeaderExtension)
Florent Castelliabe301f2018-06-12 18:33:49 +020016
17@synthesize uri = _uri;
18@synthesize id = _id;
19@synthesize encrypted = _encrypted;
20
21- (instancetype)init {
Yura Yaroshevich9aec8c22021-04-14 12:41:21 +030022 webrtc::RtpExtension nativeExtension;
23 return [self initWithNativeParameters:nativeExtension];
Florent Castelliabe301f2018-06-12 18:33:49 +020024}
25
26- (instancetype)initWithNativeParameters:(const webrtc::RtpExtension &)nativeParameters {
Yura Yaroshevich9aec8c22021-04-14 12:41:21 +030027 if (self = [super init]) {
Florent Castelliabe301f2018-06-12 18:33:49 +020028 _uri = [NSString stringForStdString:nativeParameters.uri];
29 _id = nativeParameters.id;
30 _encrypted = nativeParameters.encrypt;
31 }
32 return self;
33}
34
35- (webrtc::RtpExtension)nativeParameters {
36 webrtc::RtpExtension extension;
37 extension.uri = [NSString stdStringForString:_uri];
38 extension.id = _id;
39 extension.encrypt = _encrypted;
40 return extension;
41}
42
43@end