From aac3eb2bba13b4aa3fefada9f3b28787fc26d780 Mon Sep 17 00:00:00 2001 From: tkchin Date: Wed, 9 Mar 2016 21:49:40 -0800 Subject: [PATCH] Minor ObjC API tweaks. Adds setConfiguration back and renames statsId back to reportId. BUG= Review URL: https://codereview.webrtc.org/1778033002 Cr-Commit-Position: refs/heads/master@{#11936} --- talk/build/build_ios_libs.sh | 3 ++- webrtc/api/objc/RTCPeerConnection.h | 8 ++++++++ webrtc/api/objc/RTCPeerConnection.mm | 4 ++++ webrtc/api/objc/RTCStatsReport.h | 2 +- webrtc/api/objc/RTCStatsReport.mm | 6 +++--- 5 files changed, 18 insertions(+), 5 deletions(-) diff --git a/talk/build/build_ios_libs.sh b/talk/build/build_ios_libs.sh index cc58ccca29..5830085066 100755 --- a/talk/build/build_ios_libs.sh +++ b/talk/build/build_ios_libs.sh @@ -73,7 +73,8 @@ function build_webrtc { else FLAVOR="${FLAVOR}-iphonesimulator" fi - export GYP_DEFINES="OS=ios target_arch=${TARGET_ARCH} clang_xcode=1" + export GYP_DEFINES="OS=ios target_arch=${TARGET_ARCH} use_objc_h264=1 \ +clang_xcode=1" export GYP_GENERATORS="ninja" export GYP_GENERATOR_FLAGS="output_dir=${OUTPUT_DIR}" webrtc/build/gyp_webrtc talk/build/merge_ios_libs.gyp diff --git a/webrtc/api/objc/RTCPeerConnection.h b/webrtc/api/objc/RTCPeerConnection.h index 80e8bf3d70..68db191bff 100644 --- a/webrtc/api/objc/RTCPeerConnection.h +++ b/webrtc/api/objc/RTCPeerConnection.h @@ -129,6 +129,14 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) { (nullable id)delegate NS_DESIGNATED_INITIALIZER; +/** Sets the PeerConnection's global configuration to |configuration|. + * Any changes to STUN/TURN servers or ICE candidate policy will affect the + * next gathering phase, and cause the next call to createOffer to generate + * new ICE credentials. Note that the BUNDLE and RTCP-multiplexing policies + * cannot be changed with this method. + */ +- (BOOL)setConfiguration:(RTCConfiguration *)configuration; + /** Terminate all media and close the transport. */ - (void)close; diff --git a/webrtc/api/objc/RTCPeerConnection.mm b/webrtc/api/objc/RTCPeerConnection.mm index 35ac07aeb7..20a893948e 100644 --- a/webrtc/api/objc/RTCPeerConnection.mm +++ b/webrtc/api/objc/RTCPeerConnection.mm @@ -248,6 +248,10 @@ void PeerConnectionDelegateAdapter::OnIceCandidate( _peerConnection->ice_gathering_state()]; } +- (BOOL)setConfiguration:(RTCConfiguration *)configuration { + return _peerConnection->SetConfiguration(configuration.nativeConfiguration); +} + - (void)close { _peerConnection->Close(); } diff --git a/webrtc/api/objc/RTCStatsReport.h b/webrtc/api/objc/RTCStatsReport.h index fc66faf2cf..f3f8907dfb 100644 --- a/webrtc/api/objc/RTCStatsReport.h +++ b/webrtc/api/objc/RTCStatsReport.h @@ -22,7 +22,7 @@ NS_ASSUME_NONNULL_BEGIN @property(nonatomic, readonly) NSString *type; /** The identifier for this object. */ -@property(nonatomic, readonly) NSString *statsId; +@property(nonatomic, readonly) NSString *reportId; /** A dictionary holding the actual stats. */ @property(nonatomic, readonly) NSDictionary *values; diff --git a/webrtc/api/objc/RTCStatsReport.mm b/webrtc/api/objc/RTCStatsReport.mm index b3cd1a19ef..99cdd287b8 100644 --- a/webrtc/api/objc/RTCStatsReport.mm +++ b/webrtc/api/objc/RTCStatsReport.mm @@ -20,12 +20,12 @@ @synthesize timestamp = _timestamp; @synthesize type = _type; -@synthesize statsId = _statsId; +@synthesize reportId = _reportId; @synthesize values = _values; - (NSString *)description { return [NSString stringWithFormat:@"RTCStatsReport:\n%@\n%@\n%f\n%@", - _statsId, + _reportId, _type, _timestamp, _values]; @@ -37,7 +37,7 @@ if (self = [super init]) { _timestamp = nativeReport.timestamp(); _type = [NSString stringForStdString:nativeReport.TypeToString()]; - _statsId = [NSString stringForStdString: + _reportId = [NSString stringForStdString: nativeReport.id()->ToString()]; NSUInteger capacity = nativeReport.values().size();