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

Unified Diff: webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m

Issue 2688943003: Add the URL attribute to cricket::Candiate. (Objc wrapper) (Closed)
Patch Set: Fix the format. Created 3 years, 10 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/AppRTCMobile/RTCIceCandidate+JSON.m
diff --git a/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m b/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m
index b1be7fb7e3cb995353768041d15cca94e789cdf8..7769e53417e48991aabcd0b40861acfd3f1650d5 100644
--- a/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m
+++ b/webrtc/examples/objc/AppRTCMobile/RTCIceCandidate+JSON.m
@@ -18,6 +18,7 @@ static NSString const *kRTCICECandidateMidKey = @"id";
static NSString const *kRTCICECandidateMLineIndexKey = @"label";
static NSString const *kRTCICECandidateSdpKey = @"candidate";
static NSString const *kRTCICECandidatesTypeKey = @"candidates";
+static NSString const *kRTCICECandidatesServerUrlKey = @"url";
Taylor Brandstetter 2017/02/13 23:53:00 Candidate server URLs don't need to be signaled, s
Zhi Huang 2017/02/14 19:09:08 Done.
@implementation RTCIceCandidate (JSON)
@@ -27,9 +28,11 @@ static NSString const *kRTCICECandidatesTypeKey = @"candidates";
NSString *sdp = dictionary[kRTCICECandidateSdpKey];
NSNumber *num = dictionary[kRTCICECandidateMLineIndexKey];
NSInteger mLineIndex = [num integerValue];
+ NSString *url = dictionary[kRTCICECandidatesServerUrlKey];
return [[RTCIceCandidate alloc] initWithSdp:sdp
sdpMLineIndex:mLineIndex
- sdpMid:mid];
+ sdpMid:mid
+ serverUrl:url];
}
+ (NSData *)JSONDataForIceCandidates:(NSArray<RTCIceCandidate *> *)candidates
@@ -74,7 +77,8 @@ static NSString const *kRTCICECandidatesTypeKey = @"candidates";
kRTCICECandidateTypeKey : kRTCICECandidateTypeValue,
kRTCICECandidateMLineIndexKey : @(self.sdpMLineIndex),
kRTCICECandidateMidKey : self.sdpMid,
- kRTCICECandidateSdpKey : self.sdp
+ kRTCICECandidateSdpKey : self.sdp,
+ kRTCICECandidatesServerUrlKey : self.serverUrl
};
NSError *error = nil;
NSData *data =
@@ -92,7 +96,8 @@ static NSString const *kRTCICECandidatesTypeKey = @"candidates";
NSDictionary *json = @{
kRTCICECandidateMLineIndexKey : @(self.sdpMLineIndex),
kRTCICECandidateMidKey : self.sdpMid,
- kRTCICECandidateSdpKey : self.sdp
+ kRTCICECandidateSdpKey : self.sdp,
+ kRTCICECandidatesServerUrlKey : self.serverUrl
};
return json;
}

Powered by Google App Engine
This is Rietveld 408576698