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}
This commit is contained in:
tkchin 2016-03-09 21:49:40 -08:00 committed by Commit bot
parent 221464713e
commit aac3eb2bba
5 changed files with 18 additions and 5 deletions

View File

@ -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

View File

@ -129,6 +129,14 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
(nullable id<RTCPeerConnectionDelegate>)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;

View File

@ -248,6 +248,10 @@ void PeerConnectionDelegateAdapter::OnIceCandidate(
_peerConnection->ice_gathering_state()];
}
- (BOOL)setConfiguration:(RTCConfiguration *)configuration {
return _peerConnection->SetConfiguration(configuration.nativeConfiguration);
}
- (void)close {
_peerConnection->Close();
}

View File

@ -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<NSString *, NSString *> *values;

View File

@ -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();