mirror of
https://github.com/mollyim/webrtc.git
synced 2025-05-13 13:50:40 +01:00
Use default rtp parameters to init wrappers in iOS
Before these changes default initialized iOS wrappers around various RTP*Parameters types had their own default values of nonnull values, which did not always matched default values from native code, which then causes override of default native values, if library user didn't specified it's own initialization. After these changes default initialization of iOS wrappers uses default property values from default initialized native types. Bug: None Change-Id: Ie21a7dc38ddc3862aca8ec424859c776c67b1388 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/215220 Reviewed-by: Kári Helgason <kthelgason@webrtc.org> Commit-Queue: Kári Helgason <kthelgason@webrtc.org> Cr-Commit-Position: refs/heads/master@{#33731}
This commit is contained in:
parent
89f3dd5bf7
commit
9aec8c239f
15 changed files with 30 additions and 20 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ RTC_OBJC_EXPORT
|
|||
*/
|
||||
@property(nonatomic, copy, nullable) NSNumber *degradationPreference;
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
- (instancetype)init;
|
||||
|
||||
@end
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue