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

Unified Diff: webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m

Issue 1690313002: Update iOS AppRTCDemo to use the updated Objective-C API. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Update against master Created 4 years, 9 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
Index: webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m
diff --git a/webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m b/webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m
index b03773e7db9e50f61cef68a1c679daefd785cab0..c90373569312d3a1e966a9a813882a4b28c7b38b 100644
--- a/webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m
+++ b/webrtc/examples/objc/AppRTCDemo/RTCMediaConstraints+JSON.m
@@ -10,8 +10,6 @@
#import "RTCMediaConstraints+JSON.h"
-#import "RTCPair.h"
-
static NSString const *kRTCMediaConstraintsMandatoryKey = @"mandatory";
@implementation RTCMediaConstraints (JSON)
@@ -19,12 +17,11 @@ static NSString const *kRTCMediaConstraintsMandatoryKey = @"mandatory";
+ (RTCMediaConstraints *)constraintsFromJSONDictionary:
(NSDictionary *)dictionary {
NSDictionary *mandatory = dictionary[kRTCMediaConstraintsMandatoryKey];
- NSMutableArray *mandatoryContraints =
- [NSMutableArray arrayWithCapacity:[mandatory count]];
+ NSMutableDictionary *mandatoryContraints =
+ [NSMutableDictionary dictionaryWithCapacity:[mandatory count]];
[mandatory enumerateKeysAndObjectsUsingBlock:^(
id key, id obj, BOOL *stop) {
- [mandatoryContraints addObject:[[RTCPair alloc] initWithKey:key
- value:obj]];
+ mandatoryContraints[key] = obj;
}];
// TODO(tkchin): figure out json formats for optional constraints.
RTCMediaConstraints *constraints =

Powered by Google App Engine
This is Rietveld 408576698