Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec.mm

Issue 3001183002: Make a friendlier RTCVideoCodecInfo initializer. (Closed)
Patch Set: Rebase Created 3 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « no previous file | webrtc/sdk/objc/Framework/Classes/PeerConnection/RTCVideoCodec+Private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698