Index: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm |
diff --git a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm |
index 1be33f0a8ff98a35e1c7a25203a3eab41a6ce460..4936568dd1b6fd04c5b4e96787b0c46508428127 100644 |
--- a/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm |
+++ b/webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm |
@@ -20,13 +20,12 @@ |
@synthesize name = _name; |
@synthesize parameters = _parameters; |
-- (instancetype)initWithPayload:(NSInteger)payload |
- name:(NSString *)name |
- parameters:(NSDictionary<NSString *, NSString *> *)parameters { |
+- (instancetype)initWithName:(NSString *)name |
+ parameters:(nullable NSDictionary<NSString *, NSString *> *)parameters { |
if (self = [super init]) { |
- _payload = payload; |
+ _payload = 0; |
_name = name; |
- _parameters = parameters; |
+ _parameters = (parameters ? parameters : @{}); |
} |
return self; |
@@ -43,6 +42,16 @@ |
parameters:params]; |
} |
+- (instancetype)initWithPayload:(NSInteger)payload |
+ name:(NSString *)name |
+ parameters:(NSDictionary<NSString *, NSString *> *)parameters { |
+ if (self = [self initWithName:name parameters:parameters]) { |
+ _payload = payload; |
+ } |
+ |
+ return self; |
+} |
+ |
- (cricket::VideoCodec)nativeVideoCodec { |
cricket::VideoCodec codec([NSString stdStringForString:_name]); |
for (NSString *paramKey in _parameters.allKeys) { |