diff --git a/sdk/objc/api/peerconnection/RTCRtcpParameters+Private.h b/sdk/objc/api/peerconnection/RTCRtcpParameters+Private.h index 94c1f92956..c4d196cf79 100644 --- a/sdk/objc/api/peerconnection/RTCRtcpParameters+Private.h +++ b/sdk/objc/api/peerconnection/RTCRtcpParameters+Private.h @@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) webrtc::RtcpParameters nativeParameters; /** Initialize the object with a native RtcpParameters structure. */ -- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters; +- (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters + NS_DESIGNATED_INITIALIZER; @end diff --git a/sdk/objc/api/peerconnection/RTCRtcpParameters.h b/sdk/objc/api/peerconnection/RTCRtcpParameters.h index 1bbaedcf7e..2f7aad3aef 100644 --- a/sdk/objc/api/peerconnection/RTCRtcpParameters.h +++ b/sdk/objc/api/peerconnection/RTCRtcpParameters.h @@ -23,7 +23,7 @@ RTC_OBJC_EXPORT /** Whether reduced size RTCP is configured or compound RTCP. */ @property(nonatomic, assign) BOOL isReducedSize; -- (instancetype)init NS_DESIGNATED_INITIALIZER; +- (instancetype)init; @end diff --git a/sdk/objc/api/peerconnection/RTCRtcpParameters.mm b/sdk/objc/api/peerconnection/RTCRtcpParameters.mm index 4d6084b90d..e92ee4b3e7 100644 --- a/sdk/objc/api/peerconnection/RTCRtcpParameters.mm +++ b/sdk/objc/api/peerconnection/RTCRtcpParameters.mm @@ -18,11 +18,12 @@ @synthesize isReducedSize = _isReducedSize; - (instancetype)init { - return [super init]; + webrtc::RtcpParameters nativeParameters; + return [self initWithNativeParameters:nativeParameters]; } - (instancetype)initWithNativeParameters:(const webrtc::RtcpParameters &)nativeParameters { - if (self = [self init]) { + if (self = [super init]) { _cname = [NSString stringForStdString:nativeParameters.cname]; _isReducedSize = nativeParameters.reduced_size; } diff --git a/sdk/objc/api/peerconnection/RTCRtpCodecParameters+Private.h b/sdk/objc/api/peerconnection/RTCRtpCodecParameters+Private.h index 7833068837..ff23cfd642 100644 --- a/sdk/objc/api/peerconnection/RTCRtpCodecParameters+Private.h +++ b/sdk/objc/api/peerconnection/RTCRtpCodecParameters+Private.h @@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) webrtc::RtpCodecParameters nativeParameters; /** Initialize the object with a native RtpCodecParameters structure. */ -- (instancetype)initWithNativeParameters:(const webrtc::RtpCodecParameters &)nativeParameters; +- (instancetype)initWithNativeParameters:(const webrtc::RtpCodecParameters &)nativeParameters + NS_DESIGNATED_INITIALIZER; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpCodecParameters.h b/sdk/objc/api/peerconnection/RTCRtpCodecParameters.h index a68d9eb873..afa2fd5fe2 100644 --- a/sdk/objc/api/peerconnection/RTCRtpCodecParameters.h +++ b/sdk/objc/api/peerconnection/RTCRtpCodecParameters.h @@ -66,7 +66,7 @@ RTC_OBJC_EXPORT /** The "format specific parameters" field from the "a=fmtp" line in the SDP */ @property(nonatomic, readonly, nonnull) NSDictionary *parameters; -- (instancetype)init NS_DESIGNATED_INITIALIZER; +- (instancetype)init; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpCodecParameters.mm b/sdk/objc/api/peerconnection/RTCRtpCodecParameters.mm index 1dbd683e24..b48d51f9ca 100644 --- a/sdk/objc/api/peerconnection/RTCRtpCodecParameters.mm +++ b/sdk/objc/api/peerconnection/RTCRtpCodecParameters.mm @@ -44,12 +44,13 @@ const NSString * const kRTCH264CodecName = @(cricket::kH264CodecName); @synthesize parameters = _parameters; - (instancetype)init { - return [super init]; + webrtc::RtpCodecParameters nativeParameters; + return [self initWithNativeParameters:nativeParameters]; } - (instancetype)initWithNativeParameters: (const webrtc::RtpCodecParameters &)nativeParameters { - if (self = [self init]) { + if (self = [super init]) { _payloadType = nativeParameters.payload_type; _name = [NSString stringForStdString:nativeParameters.name]; switch (nativeParameters.kind) { diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters+Private.h b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters+Private.h index 074c9b175b..d12ca624e3 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters+Private.h +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters+Private.h @@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) webrtc::RtpEncodingParameters nativeParameters; /** Initialize the object with a native RtpEncodingParameters structure. */ -- (instancetype)initWithNativeParameters:(const webrtc::RtpEncodingParameters &)nativeParameters; +- (instancetype)initWithNativeParameters:(const webrtc::RtpEncodingParameters &)nativeParameters + NS_DESIGNATED_INITIALIZER; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h index facd7e5129..af6d5832b5 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.h @@ -65,7 +65,7 @@ RTC_OBJC_EXPORT /** The relative DiffServ Code Point priority. */ @property(nonatomic, assign) RTCPriority networkPriority; -- (instancetype)init NS_DESIGNATED_INITIALIZER; +- (instancetype)init; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm index eec6ce4015..a42439f964 100644 --- a/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm +++ b/sdk/objc/api/peerconnection/RTCRtpEncodingParameters.mm @@ -26,12 +26,13 @@ @synthesize networkPriority = _networkPriority; - (instancetype)init { - return [super init]; + webrtc::RtpEncodingParameters nativeParameters; + return [self initWithNativeParameters:nativeParameters]; } - (instancetype)initWithNativeParameters: (const webrtc::RtpEncodingParameters &)nativeParameters { - if (self = [self init]) { + if (self = [super init]) { if (!nativeParameters.rid.empty()) { _rid = [NSString stringForStdString:nativeParameters.rid]; } diff --git a/sdk/objc/api/peerconnection/RTCRtpHeaderExtension+Private.h b/sdk/objc/api/peerconnection/RTCRtpHeaderExtension+Private.h index 6255847fb9..0e0fbba5ac 100644 --- a/sdk/objc/api/peerconnection/RTCRtpHeaderExtension+Private.h +++ b/sdk/objc/api/peerconnection/RTCRtpHeaderExtension+Private.h @@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) webrtc::RtpExtension nativeParameters; /** Initialize the object with a native RtpExtension structure. */ -- (instancetype)initWithNativeParameters:(const webrtc::RtpExtension &)nativeParameters; +- (instancetype)initWithNativeParameters:(const webrtc::RtpExtension &)nativeParameters + NS_DESIGNATED_INITIALIZER; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.h b/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.h index 15be5af56c..4000bf5372 100644 --- a/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.h +++ b/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.h @@ -26,7 +26,7 @@ RTC_OBJC_EXPORT /** Whether the header extension is encrypted or not. */ @property(nonatomic, readonly, getter=isEncrypted) BOOL encrypted; -- (instancetype)init NS_DESIGNATED_INITIALIZER; +- (instancetype)init; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.mm b/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.mm index a19228e629..68093e92ea 100644 --- a/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.mm +++ b/sdk/objc/api/peerconnection/RTCRtpHeaderExtension.mm @@ -19,11 +19,12 @@ @synthesize encrypted = _encrypted; - (instancetype)init { - return [super init]; + webrtc::RtpExtension nativeExtension; + return [self initWithNativeParameters:nativeExtension]; } - (instancetype)initWithNativeParameters:(const webrtc::RtpExtension &)nativeParameters { - if (self = [self init]) { + if (self = [super init]) { _uri = [NSString stringForStdString:nativeParameters.uri]; _id = nativeParameters.id; _encrypted = nativeParameters.encrypt; diff --git a/sdk/objc/api/peerconnection/RTCRtpParameters+Private.h b/sdk/objc/api/peerconnection/RTCRtpParameters+Private.h index 369475a81d..139617f727 100644 --- a/sdk/objc/api/peerconnection/RTCRtpParameters+Private.h +++ b/sdk/objc/api/peerconnection/RTCRtpParameters+Private.h @@ -21,7 +21,8 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) webrtc::RtpParameters nativeParameters; /** Initialize the object with a native RtpParameters structure. */ -- (instancetype)initWithNativeParameters:(const webrtc::RtpParameters &)nativeParameters; +- (instancetype)initWithNativeParameters:(const webrtc::RtpParameters &)nativeParameters + NS_DESIGNATED_INITIALIZER; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpParameters.h b/sdk/objc/api/peerconnection/RTCRtpParameters.h index fff6a85886..3d71c55ab9 100644 --- a/sdk/objc/api/peerconnection/RTCRtpParameters.h +++ b/sdk/objc/api/peerconnection/RTCRtpParameters.h @@ -51,7 +51,7 @@ RTC_OBJC_EXPORT */ @property(nonatomic, copy, nullable) NSNumber *degradationPreference; -- (instancetype)init NS_DESIGNATED_INITIALIZER; +- (instancetype)init; @end diff --git a/sdk/objc/api/peerconnection/RTCRtpParameters.mm b/sdk/objc/api/peerconnection/RTCRtpParameters.mm index 2236b9aa36..2baf0ecd80 100644 --- a/sdk/objc/api/peerconnection/RTCRtpParameters.mm +++ b/sdk/objc/api/peerconnection/RTCRtpParameters.mm @@ -26,12 +26,13 @@ @synthesize degradationPreference = _degradationPreference; - (instancetype)init { - return [super init]; + webrtc::RtpParameters nativeParameters; + return [self initWithNativeParameters:nativeParameters]; } - (instancetype)initWithNativeParameters: (const webrtc::RtpParameters &)nativeParameters { - if (self = [self init]) { + if (self = [super init]) { _transactionId = [NSString stringForStdString:nativeParameters.transaction_id]; _rtcp = [[RTC_OBJC_TYPE(RTCRtcpParameters) alloc] initWithNativeParameters:nativeParameters.rtcp];