This reverts commit f88236066e65762f5543bf0ac141f23b76849126. Reason for revert: Thanks for the fix Karim ! Unfortunately this commit breaks some downstream projects. I'll work on a reland. Original change's description: > Expose setHeaderExtensionsToNegotiate for iOS > > Bug: webrtc:15766 > Change-Id: I56ec97ab272c14b4b70f6c3d7a3daedde11738c4 > Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/336100 > Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> > Reviewed-by: Peter Hanspers <peterhanspers@webrtc.org> > Auto-Submit: Karim Ham <karim@karhm.com> > Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org> > Cr-Commit-Position: refs/heads/main@{#43121} Bug: webrtc:15766 Change-Id: Ie0ccf73bec192452e288b7421eb8a1ecdb0eda67 No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/364284 Owners-Override: Jeremy Leconte <jleconte@webrtc.org> Commit-Queue: Jeremy Leconte <jleconte@webrtc.org> Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com> Cr-Commit-Position: refs/heads/main@{#43124}
58 lines
2.2 KiB
Plaintext
58 lines
2.2 KiB
Plaintext
/*
|
|
* Copyright 2024 The WebRTC project authors. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by a BSD-style license
|
|
* that can be found in the LICENSE file in the root of the source
|
|
* tree. An additional intellectual property rights grant can be found
|
|
* in the file PATENTS. All contributing project authors may
|
|
* be found in the AUTHORS file in the root of the source tree.
|
|
*/
|
|
|
|
#import "RTCRtpHeaderExtensionCapability+Private.h"
|
|
|
|
#import "helpers/NSString+StdString.h"
|
|
|
|
@implementation RTC_OBJC_TYPE (RTCRtpHeaderExtensionCapability)
|
|
|
|
@synthesize uri = _uri;
|
|
@synthesize preferredId = _preferredId;
|
|
@synthesize preferredEncrypted = _preferredEncrypted;
|
|
|
|
- (instancetype)init {
|
|
webrtc::RtpHeaderExtensionCapability nativeRtpHeaderExtensionCapability;
|
|
return [self initWithNativeRtpHeaderExtensionCapability:nativeRtpHeaderExtensionCapability];
|
|
}
|
|
|
|
- (instancetype)initWithNativeRtpHeaderExtensionCapability:
|
|
(const webrtc::RtpHeaderExtensionCapability &)nativeRtpHeaderExtensionCapability {
|
|
self = [super init];
|
|
if (self) {
|
|
_uri = [NSString stringForStdString:nativeRtpHeaderExtensionCapability.uri];
|
|
if (nativeRtpHeaderExtensionCapability.preferred_id) {
|
|
_preferredId = [NSNumber numberWithInt:*nativeRtpHeaderExtensionCapability.preferred_id];
|
|
}
|
|
_preferredEncrypted = nativeRtpHeaderExtensionCapability.preferred_encrypt;
|
|
}
|
|
return self;
|
|
}
|
|
|
|
- (NSString *)description {
|
|
return [NSString stringWithFormat:@"RTC_OBJC_TYPE(RTCRtpHeaderExtensionCapability) {\n uri: "
|
|
@"%@\n preferredId: %@\n preferredEncrypted: %d\n}",
|
|
_uri,
|
|
_preferredId,
|
|
_preferredEncrypted];
|
|
}
|
|
|
|
- (webrtc::RtpHeaderExtensionCapability)nativeRtpHeaderExtensionCapability {
|
|
webrtc::RtpHeaderExtensionCapability rtpHeaderExtensionCapability;
|
|
rtpHeaderExtensionCapability.uri = [NSString stdStringForString:_uri];
|
|
if (_preferredId != nil) {
|
|
rtpHeaderExtensionCapability.preferred_id = std::optional<int>(_preferredId.intValue);
|
|
}
|
|
rtpHeaderExtensionCapability.preferred_encrypt = _preferredEncrypted;
|
|
return rtpHeaderExtensionCapability;
|
|
}
|
|
|
|
@end
|