Compile rtc_api_objc on Mac.
BUG= Review URL: https://codereview.webrtc.org/1726213002 Cr-Commit-Position: refs/heads/master@{#11771}
This commit is contained in:
parent
103c5347bc
commit
6b03995bef
@ -122,19 +122,19 @@
|
||||
}, # libjingle_peerconnection_java
|
||||
]
|
||||
}],
|
||||
['OS=="ios"', {
|
||||
['OS=="ios" or (OS=="mac" and mac_deployment_target=="10.7")', {
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'rtc_api_objc',
|
||||
'type': 'static_library',
|
||||
'includes': [
|
||||
'../build/objc_common.gypi',
|
||||
],
|
||||
'dependencies': [
|
||||
'<(webrtc_root)/base/base.gyp:rtc_base_objc',
|
||||
'libjingle_peerconnection',
|
||||
],
|
||||
'sources': [
|
||||
'objc/RTCAVFoundationVideoSource+Private.h',
|
||||
'objc/RTCAVFoundationVideoSource.h',
|
||||
'objc/RTCAVFoundationVideoSource.mm',
|
||||
'objc/RTCAudioTrack+Private.h',
|
||||
'objc/RTCAudioTrack.h',
|
||||
'objc/RTCAudioTrack.mm',
|
||||
@ -191,14 +191,17 @@
|
||||
'objc/RTCVideoTrack+Private.h',
|
||||
'objc/RTCVideoTrack.h',
|
||||
'objc/RTCVideoTrack.mm',
|
||||
'objc/avfoundationvideocapturer.h',
|
||||
'objc/avfoundationvideocapturer.mm',
|
||||
],
|
||||
'conditions': [
|
||||
['OS=="ios"', {
|
||||
'sources': [
|
||||
'objc/RTCAVFoundationVideoSource+Private.h',
|
||||
'objc/RTCAVFoundationVideoSource.h',
|
||||
'objc/RTCAVFoundationVideoSource.mm',
|
||||
'objc/RTCEAGLVideoView.h',
|
||||
'objc/RTCEAGLVideoView.m',
|
||||
'objc/avfoundationvideocapturer.h',
|
||||
'objc/avfoundationvideocapturer.mm',
|
||||
],
|
||||
'all_dependent_settings': {
|
||||
'xcode_settings': {
|
||||
@ -228,11 +231,6 @@
|
||||
],
|
||||
}],
|
||||
],
|
||||
'xcode_settings': {
|
||||
'CLANG_ENABLE_OBJC_ARC': 'YES',
|
||||
'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
|
||||
'GCC_PREFIX_HEADER': 'objc/WebRTC-Prefix.pch',
|
||||
},
|
||||
}
|
||||
],
|
||||
}], # OS=="ios"
|
||||
|
||||
@ -137,11 +137,14 @@
|
||||
},
|
||||
], # targets
|
||||
}], # OS=="android"
|
||||
['OS=="ios"', {
|
||||
['OS=="ios" or (OS=="mac" and mac_deployment_target=="10.7")', {
|
||||
'targets': [
|
||||
{
|
||||
'target_name': 'rtc_api_objc_tests',
|
||||
'type': 'executable',
|
||||
'includes': [
|
||||
'../build/objc_common.gypi',
|
||||
],
|
||||
'dependencies': [
|
||||
'<(webrtc_root)/api/api.gyp:rtc_api_objc',
|
||||
'<(webrtc_root)/base/base_tests.gyp:rtc_base_tests_utils',
|
||||
@ -155,9 +158,6 @@
|
||||
'objctests/RTCSessionDescriptionTest.mm',
|
||||
],
|
||||
'xcode_settings': {
|
||||
'CLANG_ENABLE_OBJC_ARC': 'YES',
|
||||
'CLANG_WARN_OBJC_MISSING_PROPERTY_SYNTHESIS': 'YES',
|
||||
'GCC_PREFIX_HEADER': 'objc/WebRTC-Prefix.pch',
|
||||
# |-ObjC| flag needed to make sure category method implementations
|
||||
# are included:
|
||||
# https://developer.apple.com/library/mac/qa/qa1490/_index.html
|
||||
|
||||
@ -12,6 +12,8 @@
|
||||
|
||||
@class RTCIceServer;
|
||||
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
/**
|
||||
* Represents the ice transport policy. This exposes the same states in C++,
|
||||
* which include one more state than what exists in the W3C spec.
|
||||
@ -53,7 +55,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface RTCConfiguration : NSObject
|
||||
|
||||
/** An array of Ice Servers available to be used by ICE. */
|
||||
@property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
|
||||
@property(nonatomic, copy, nonnull) NSArray *iceServers;
|
||||
// @property(nonatomic, copy) NSArray<RTCIceServer *> *iceServers;
|
||||
|
||||
/** Which candidates the ICE agent is allowed to use. The W3C calls it
|
||||
* |iceTransportPolicy|, while in C++ it is called |type|. */
|
||||
@ -72,7 +75,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/** Key type used to generate SSL identity. Default is ECDSA. */
|
||||
@property(nonatomic, assign) RTCEncryptionKeyType keyType;
|
||||
|
||||
- (instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
- (nonnull instancetype)init NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@interface RTCIceCandidate : NSObject
|
||||
|
||||
@ -27,16 +28,16 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) NSInteger sdpMLineIndex;
|
||||
|
||||
/** The SDP string for this candidate. */
|
||||
@property(nonatomic, readonly) NSString *sdp;
|
||||
@property(nonatomic, readonly, nonnull) NSString *sdp;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/**
|
||||
* Initialize an RTCIceCandidate from SDP.
|
||||
*/
|
||||
- (instancetype)initWithSdp:(NSString *)sdp
|
||||
sdpMLineIndex:(NSInteger)sdpMLineIndex
|
||||
sdpMid:(nullable NSString *)sdpMid
|
||||
- (nonnull instancetype)initWithSdp:(nonnull NSString *)sdp
|
||||
sdpMLineIndex:(NSInteger)sdpMLineIndex
|
||||
sdpMid:(nullable NSString *)sdpMid
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
@ -11,11 +11,13 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@interface RTCIceServer : NSObject
|
||||
|
||||
/** URI(s) for this server represented as NSStrings. */
|
||||
@property(nonatomic, copy, readonly) NSArray<NSString *> *urlStrings;
|
||||
@property(nonatomic, copy, readonly, nonnull) NSArray *urlStrings;
|
||||
// @property(nonatomic, copy, readonly) NSArray<NSString *> *urlStrings;
|
||||
|
||||
/** Username to use if this RTCIceServer object is a TURN server. */
|
||||
@property(nonatomic, copy, readonly, nullable) NSString *username;
|
||||
@ -23,18 +25,20 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/** Credential to use if this RTCIceServer object is a TURN server. */
|
||||
@property(nonatomic, copy, readonly, nullable) NSString *credential;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/** Convenience initializer for a server with no authentication (e.g. STUN). */
|
||||
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings;
|
||||
- (nonnull instancetype)initWithURLStrings:(nonnull NSArray *)urlStrings;
|
||||
// - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings;
|
||||
|
||||
/**
|
||||
* Initialize an RTCIceServer with its associated URLs, optional username,
|
||||
* optional credential, and credentialType.
|
||||
*/
|
||||
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
|
||||
username:(nullable NSString *)username
|
||||
credential:(nullable NSString *)credential
|
||||
- (nonnull instancetype)initWithURLStrings:(nonnull NSArray *)urlStrings
|
||||
// - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
|
||||
username:(nullable NSString *)username
|
||||
credential:(nullable NSString *)credential
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
@ -14,19 +14,22 @@
|
||||
#import "webrtc/base/objc/NSString+StdString.h"
|
||||
|
||||
@implementation RTCIceServer
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@synthesize urlStrings = _urlStrings;
|
||||
@synthesize username = _username;
|
||||
@synthesize credential = _credential;
|
||||
|
||||
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings {
|
||||
- (instancetype)initWithURLStrings:(NSArray *)urlStrings {
|
||||
// - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings {
|
||||
NSParameterAssert(urlStrings.count);
|
||||
return [self initWithURLStrings:urlStrings
|
||||
username:nil
|
||||
credential:nil];
|
||||
}
|
||||
|
||||
- (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
|
||||
- (instancetype)initWithURLStrings:(NSArray *)urlStrings
|
||||
// - (instancetype)initWithURLStrings:(NSArray<NSString *> *)urlStrings
|
||||
username:(NSString *)username
|
||||
credential:(NSString *)credential {
|
||||
NSParameterAssert(urlStrings.count);
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
#include "webrtc/api/mediaconstraintsinterface.h"
|
||||
#include "webrtc/base/scoped_ptr.h"
|
||||
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class MediaConstraints : public MediaConstraintsInterface {
|
||||
@ -46,7 +48,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
/** Return a native Constraints object representing these constraints */
|
||||
+ (webrtc::MediaConstraintsInterface::Constraints)
|
||||
nativeConstraintsForConstraints:
|
||||
(NSDictionary<NSString *, NSString *> *)constraints;
|
||||
(NSDictionary *)constraints;
|
||||
// (NSDictionary<NSString *, NSString *> *)constraints;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -11,17 +11,23 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@interface RTCMediaConstraints : NSObject
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/** Initialize with mandatory and/or optional constraints. */
|
||||
- (instancetype)initWithMandatoryConstraints:
|
||||
(nullable NSDictionary<NSString *, NSString *> *)mandatory
|
||||
optionalConstraints:
|
||||
(nullable NSDictionary<NSString *, NSString *> *)optional
|
||||
- (nonnull instancetype)initWithMandatoryConstraints:
|
||||
(nullable NSDictionary *)mandatory
|
||||
optionalConstraints:
|
||||
(nullable NSDictionary *)optional
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
// - (instancetype)initWithMandatoryConstraints:
|
||||
// (nullable NSDictionary<NSString *, NSString *> *)mandatory
|
||||
// optionalConstraints:
|
||||
// (nullable NSDictionary<NSString *, NSString *> *)optional
|
||||
// NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -13,6 +13,8 @@
|
||||
#import "webrtc/api/objc/RTCMediaConstraints+Private.h"
|
||||
#import "webrtc/base/objc/NSString+StdString.h"
|
||||
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
MediaConstraints::~MediaConstraints() {}
|
||||
@ -38,14 +40,18 @@ MediaConstraints::GetOptional() const {
|
||||
|
||||
|
||||
@implementation RTCMediaConstraints {
|
||||
NSDictionary<NSString *, NSString *> *_mandatory;
|
||||
NSDictionary<NSString *, NSString *> *_optional;
|
||||
NSDictionary *_mandatory;
|
||||
// NSDictionary<NSString *, NSString *> *_mandatory;
|
||||
NSDictionary *_optional;
|
||||
// NSDictionary<NSString *, NSString *> *_optional;
|
||||
}
|
||||
|
||||
- (instancetype)initWithMandatoryConstraints:
|
||||
(NSDictionary<NSString *, NSString *> *)mandatory
|
||||
(NSDictionary *)mandatory
|
||||
// (NSDictionary<NSString *, NSString *> *)mandatory
|
||||
optionalConstraints:
|
||||
(NSDictionary<NSString *, NSString *> *)optional {
|
||||
(NSDictionary *)optional {
|
||||
// (NSDictionary<NSString *, NSString *> *)optional {
|
||||
if (self = [super init]) {
|
||||
_mandatory = [[NSDictionary alloc] initWithDictionary:mandatory
|
||||
copyItems:YES];
|
||||
@ -76,15 +82,17 @@ MediaConstraints::GetOptional() const {
|
||||
|
||||
+ (webrtc::MediaConstraintsInterface::Constraints)
|
||||
nativeConstraintsForConstraints:
|
||||
(NSDictionary<NSString *, NSString *> *)constraints {
|
||||
(NSDictionary *)constraints {
|
||||
// (NSDictionary<NSString *, NSString *> *)constraints {
|
||||
webrtc::MediaConstraintsInterface::Constraints nativeConstraints;
|
||||
for (NSString *key in constraints) {
|
||||
NSAssert([key isKindOfClass:[NSString class]],
|
||||
@"%@ is not an NSString.", key);
|
||||
NSAssert([constraints[key] isKindOfClass:[NSString class]],
|
||||
@"%@ is not an NSString.", constraints[key]);
|
||||
NSString *value = [constraints objectForKey:key];
|
||||
NSAssert([value isKindOfClass:[NSString class]],
|
||||
@"%@ is not an NSString.", value);
|
||||
nativeConstraints.push_back(webrtc::MediaConstraintsInterface::Constraint(
|
||||
key.stdString, constraints[key].stdString));
|
||||
key.stdString, value.stdString));
|
||||
}
|
||||
return nativeConstraints;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@class RTCAudioTrack;
|
||||
@class RTCVideoTrack;
|
||||
@ -18,10 +19,12 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface RTCMediaStream : NSObject
|
||||
|
||||
/** The audio tracks in this stream. */
|
||||
@property(nonatomic, strong, readonly) NSArray<RTCAudioTrack *> *audioTracks;
|
||||
@property(nonatomic, strong, readonly) NSArray *audioTracks;
|
||||
// @property(nonatomic, strong, readonly) NSArray<RTCAudioTrack *> *audioTracks;
|
||||
|
||||
/** The video tracks in this stream. */
|
||||
@property(nonatomic, strong, readonly) NSArray<RTCVideoTrack *> *videoTracks;
|
||||
@property(nonatomic, strong, readonly) NSArray *videoTracks;
|
||||
// @property(nonatomic, strong, readonly) NSArray<RTCVideoTrack *> *videoTracks;
|
||||
|
||||
/** An identifier for this media stream. */
|
||||
@property(nonatomic, readonly) NSString *streamId;
|
||||
|
||||
@ -18,17 +18,21 @@
|
||||
#import "webrtc/api/objc/RTCVideoTrack+Private.h"
|
||||
#import "webrtc/base/objc/NSString+StdString.h"
|
||||
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@implementation RTCMediaStream {
|
||||
NSMutableArray *_audioTracks;
|
||||
NSMutableArray *_videoTracks;
|
||||
rtc::scoped_refptr<webrtc::MediaStreamInterface> _nativeMediaStream;
|
||||
}
|
||||
|
||||
- (NSArray<RTCAudioTrack *> *)audioTracks {
|
||||
- (NSArray *)audioTracks {
|
||||
// - (NSArray<RTCAudioTrack *> *)audioTracks {
|
||||
return [_audioTracks copy];
|
||||
}
|
||||
|
||||
- (NSArray<RTCVideoTrack *> *)videoTracks {
|
||||
- (NSArray *)videoTracks {
|
||||
// - (NSArray<RTCVideoTrack *> *)videoTracks {
|
||||
return [_videoTracks copy];
|
||||
}
|
||||
|
||||
|
||||
@ -16,12 +16,15 @@
|
||||
#import "webrtc/api/objc/RTCStatsReport+Private.h"
|
||||
#import "webrtc/base/objc/NSString+StdString.h"
|
||||
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
namespace webrtc {
|
||||
|
||||
class StatsObserverAdapter : public StatsObserver {
|
||||
public:
|
||||
StatsObserverAdapter(void (^completionHandler)
|
||||
(NSArray<RTCStatsReport *> *stats)) {
|
||||
(NSArray *stats)) {
|
||||
// (NSArray<RTCStatsReport *> *stats)) {
|
||||
completion_handler_ = completionHandler;
|
||||
}
|
||||
|
||||
@ -42,7 +45,8 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
}
|
||||
|
||||
private:
|
||||
void (^completion_handler_)(NSArray<RTCStatsReport *> *stats);
|
||||
void (^completion_handler_)(NSArray *stats);
|
||||
// void (^completion_handler_)(NSArray<RTCStatsReport *> *stats);
|
||||
};
|
||||
} // namespace webrtc
|
||||
|
||||
@ -51,7 +55,8 @@ class StatsObserverAdapter : public StatsObserver {
|
||||
- (void)statsForTrack:(RTCMediaStreamTrack *)mediaStreamTrack
|
||||
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
|
||||
completionHandler:
|
||||
(void (^)(NSArray<RTCStatsReport *> *stats))completionHandler {
|
||||
(void (^)(NSArray *stats))completionHandler {
|
||||
// (void (^)(NSArray<RTCStatsReport *> *stats))completionHandler {
|
||||
rtc::scoped_refptr<webrtc::StatsObserverAdapter> observer(
|
||||
new rtc::RefCountedObject<webrtc::StatsObserverAdapter>
|
||||
(completionHandler));
|
||||
|
||||
@ -22,8 +22,9 @@
|
||||
@class RTCStatsReport;
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
extern NSString * const kRTCPeerConnectionErrorDomain;
|
||||
extern NSString * _Nonnull const kRTCPeerConnectionErrorDomain;
|
||||
extern int const kRTCSessionDescriptionErrorCode;
|
||||
|
||||
/** Represents the signaling state of the peer connection. */
|
||||
@ -66,35 +67,36 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
|
||||
@protocol RTCPeerConnectionDelegate <NSObject>
|
||||
|
||||
/** Called when the SignalingState changed. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didChangeSignalingState:(RTCSignalingState)stateChanged;
|
||||
|
||||
/** Called when media is received on a new stream from remote peer. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
didAddStream:(RTCMediaStream *)stream;
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didAddStream:(nonnull RTCMediaStream *)stream;
|
||||
|
||||
/** Called when a remote peer closes a stream. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
didRemoveStream:(RTCMediaStream *)stream;
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didRemoveStream:(nonnull RTCMediaStream *)stream;
|
||||
|
||||
/** Called when negotiation is needed, for example ICE has restarted. */
|
||||
- (void)peerConnectionShouldNegotiate:(RTCPeerConnection *)peerConnection;
|
||||
- (void)peerConnectionShouldNegotiate:
|
||||
(nonnull RTCPeerConnection *)peerConnection;
|
||||
|
||||
/** Called any time the IceConnectionState changes. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didChangeIceConnectionState:(RTCIceConnectionState)newState;
|
||||
|
||||
/** Called any time the IceGatheringState changes. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didChangeIceGatheringState:(RTCIceGatheringState)newState;
|
||||
|
||||
/** New ice candidate has been found. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
didGenerateIceCandidate:(RTCIceCandidate *)candidate;
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didGenerateIceCandidate:(nonnull RTCIceCandidate *)candidate;
|
||||
|
||||
/** New data channel has been opened. */
|
||||
- (void)peerConnection:(RTCPeerConnection *)peerConnection
|
||||
didOpenDataChannel:(RTCDataChannel *)dataChannel;
|
||||
- (void)peerConnection:(nonnull RTCPeerConnection *)peerConnection
|
||||
didOpenDataChannel:(nonnull RTCDataChannel *)dataChannel;
|
||||
|
||||
@end
|
||||
|
||||
@ -104,8 +106,8 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
|
||||
/** The object that will be notifed about events such as state changes and
|
||||
* streams being added or removed.
|
||||
*/
|
||||
@property(nonatomic, weak) id<RTCPeerConnectionDelegate> delegate;
|
||||
@property(nonatomic, readonly) NSArray *localStreams;
|
||||
@property(nonatomic, weak, nullable) id<RTCPeerConnectionDelegate> delegate;
|
||||
@property(nonatomic, readonly, nonnull) NSArray *localStreams;
|
||||
@property(nonatomic, readonly, nullable)
|
||||
RTCSessionDescription *localDescription;
|
||||
@property(nonatomic, readonly, nullable)
|
||||
@ -114,54 +116,62 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
|
||||
@property(nonatomic, readonly) RTCIceConnectionState iceConnectionState;
|
||||
@property(nonatomic, readonly) RTCIceGatheringState iceGatheringState;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
/** Initialize an RTCPeerConnection with a configuration, constraints, and
|
||||
* delegate.
|
||||
*/
|
||||
- (instancetype)initWithFactory:(RTCPeerConnectionFactory *)factory
|
||||
configuration:(RTCConfiguration *)configuration
|
||||
constraints:(RTCMediaConstraints *)constraints
|
||||
delegate:(id<RTCPeerConnectionDelegate>)delegate
|
||||
- (nonnull instancetype)initWithFactory:
|
||||
(nonnull RTCPeerConnectionFactory *)factory
|
||||
configuration:
|
||||
(nonnull RTCConfiguration *)configuration
|
||||
constraints:
|
||||
(nonnull RTCMediaConstraints *)constraints
|
||||
delegate:
|
||||
(nullable id<RTCPeerConnectionDelegate>)delegate
|
||||
NS_DESIGNATED_INITIALIZER;
|
||||
|
||||
/** Terminate all media and close the transport. */
|
||||
- (void)close;
|
||||
|
||||
/** Provide a remote candidate to the ICE Agent. */
|
||||
- (void)addIceCandidate:(RTCIceCandidate *)candidate;
|
||||
- (void)addIceCandidate:(nonnull RTCIceCandidate *)candidate;
|
||||
|
||||
/** Add a new media stream to be sent on this peer connection. */
|
||||
- (void)addStream:(RTCMediaStream *)stream;
|
||||
- (void)addStream:(nonnull RTCMediaStream *)stream;
|
||||
|
||||
/** Remove the given media stream from this peer connection. */
|
||||
- (void)removeStream:(RTCMediaStream *)stream;
|
||||
- (void)removeStream:(nonnull RTCMediaStream *)stream;
|
||||
|
||||
/** Generate an SDP offer. */
|
||||
- (void)offerForConstraints:(RTCMediaConstraints *)constraints
|
||||
completionHandler:(void (^)(RTCSessionDescription *sdp,
|
||||
NSError *error))completionHandler;
|
||||
- (void)offerForConstraints:(nonnull RTCMediaConstraints *)constraints
|
||||
completionHandler:(nullable void (^)
|
||||
(RTCSessionDescription * _Nullable sdp,
|
||||
NSError * _Nullable error))completionHandler;
|
||||
|
||||
/** Generate an SDP answer. */
|
||||
- (void)answerForConstraints:(RTCMediaConstraints *)constraints
|
||||
completionHandler:(void (^)(RTCSessionDescription *sdp,
|
||||
NSError *error))completionHandler;
|
||||
- (void)answerForConstraints:(nonnull RTCMediaConstraints *)constraints
|
||||
completionHandler:(nullable void (^)
|
||||
(RTCSessionDescription * _Nullable sdp,
|
||||
NSError * _Nullable error))completionHandler;
|
||||
|
||||
/** Apply the supplied RTCSessionDescription as the local description. */
|
||||
- (void)setLocalDescription:(RTCSessionDescription *)sdp
|
||||
completionHandler:(void (^)(NSError *error))completionHandler;
|
||||
- (void)setLocalDescription:(nonnull RTCSessionDescription *)sdp
|
||||
completionHandler:
|
||||
(nullable void (^)(NSError * _Nullable error))completionHandler;
|
||||
|
||||
/** Apply the supplied RTCSessionDescription as the remote description. */
|
||||
- (void)setRemoteDescription:(RTCSessionDescription *)sdp
|
||||
completionHandler:(void (^)(NSError *error))completionHandler;
|
||||
- (void)setRemoteDescription:(nonnull RTCSessionDescription *)sdp
|
||||
completionHandler:
|
||||
(nullable void (^)(NSError * _Nullable error))completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
@interface RTCPeerConnection (DataChannel)
|
||||
|
||||
/** Create a new data channel with the given label and configuration. */
|
||||
- (RTCDataChannel *)dataChannelForLabel:(NSString *)label
|
||||
configuration:(RTCDataChannelConfiguration *)configuration;
|
||||
- (nonnull RTCDataChannel *)dataChannelForLabel:(nonnull NSString *)label
|
||||
configuration:(nonnull RTCDataChannelConfiguration *)configuration;
|
||||
|
||||
@end
|
||||
|
||||
@ -171,10 +181,11 @@ typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
|
||||
* statistics are gathered for all tracks.
|
||||
*/
|
||||
- (void)statsForTrack:
|
||||
(nullable RTCMediaStreamTrack *)mediaStreamTrack
|
||||
(nonnull RTCMediaStreamTrack *)mediaStreamTrack
|
||||
statsOutputLevel:(RTCStatsOutputLevel)statsOutputLevel
|
||||
completionHandler:
|
||||
(void (^)(NSArray<RTCStatsReport *> *stats))completionHandler;
|
||||
(nullable void (^)(NSArray * _Nonnull stats))completionHandler;
|
||||
// (nullable void (^)(NSArray<RTCStatsReport *> *stats))completionHandler;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
/** This does not currently conform to the spec. */
|
||||
@interface RTCStatsReport : NSObject
|
||||
@ -25,7 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) NSString *statsId;
|
||||
|
||||
/** A dictionary holding the actual stats. */
|
||||
@property(nonatomic, readonly) NSDictionary<NSString *, NSString *> *values;
|
||||
@property(nonatomic, readonly) NSDictionary *values;
|
||||
// @property(nonatomic, readonly) NSDictionary<NSString *, NSString *> *values;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
|
||||
@ -16,6 +16,8 @@
|
||||
#import "webrtc/base/objc/NSString+StdString.h"
|
||||
#import "webrtc/base/objc/RTCLogging.h"
|
||||
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@implementation RTCStatsReport
|
||||
|
||||
@synthesize timestamp = _timestamp;
|
||||
@ -50,9 +52,8 @@
|
||||
valuePair.second->ToString()];
|
||||
|
||||
// Not expecting duplicate keys.
|
||||
RTC_DCHECK(values[key]);
|
||||
|
||||
values[key] = value;
|
||||
RTC_DCHECK(![values objectForKey:key]);
|
||||
[values setObject:value forKey:key];
|
||||
}
|
||||
_values = values;
|
||||
}
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
// TODO(hjon): Update nullability types. See http://crbug/webrtc/5592
|
||||
|
||||
@interface RTCVideoFrame : NSObject
|
||||
|
||||
@ -30,7 +31,7 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@property(nonatomic, readonly) int32_t uPitch;
|
||||
@property(nonatomic, readonly) int32_t vPitch;
|
||||
|
||||
- (instancetype)init NS_UNAVAILABLE;
|
||||
- (nonnull instancetype)init NS_UNAVAILABLE;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@ -1,13 +0,0 @@
|
||||
/*
|
||||
* Copyright 2015 The WebRTC project authors. All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by a BSD-style license
|
||||
* that can be found in the LICENSE file in the root of the source
|
||||
* tree. An additional intellectual property rights grant can be found
|
||||
* in the file PATENTS. All contributing project authors may
|
||||
* be found in the AUTHORS file in the root of the source tree.
|
||||
*/
|
||||
|
||||
#if !defined(__has_feature) || !__has_feature(objc_arc)
|
||||
#error "This file requires ARC support."
|
||||
#endif
|
||||
@ -47,7 +47,7 @@
|
||||
EXPECT_EQ(constraints.count, nativeConstraints.size());
|
||||
|
||||
for (NSString *key in constraints) {
|
||||
NSString *value = constraints[key];
|
||||
NSString *value = [constraints objectForKey:key];
|
||||
|
||||
std::string nativeValue;
|
||||
bool found = nativeConstraints.FindFirst(key.stdString, &nativeValue);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user