Minor ObjC header updates.
BUG=
Review URL: https://codereview.webrtc.org/1845133002
Cr-Commit-Position: refs/heads/master@{#12183}
diff --git a/webrtc/api/objc/RTCAVFoundationVideoSource.h b/webrtc/api/objc/RTCAVFoundationVideoSource.h
index d7cdbef..6d224d3 100644
--- a/webrtc/api/objc/RTCAVFoundationVideoSource.h
+++ b/webrtc/api/objc/RTCAVFoundationVideoSource.h
@@ -38,5 +38,4 @@
@end
-
NS_ASSUME_NONNULL_END
diff --git a/webrtc/api/objc/RTCAudioTrack+Private.h b/webrtc/api/objc/RTCAudioTrack+Private.h
index bcedca6..ea86b1f 100644
--- a/webrtc/api/objc/RTCAudioTrack+Private.h
+++ b/webrtc/api/objc/RTCAudioTrack+Private.h
@@ -14,6 +14,7 @@
NS_ASSUME_NONNULL_BEGIN
+@class RTCPeerConnectionFactory;
@interface RTCAudioTrack ()
/** AudioTrackInterface created or passed in at construction. */
diff --git a/webrtc/api/objc/RTCAudioTrack.h b/webrtc/api/objc/RTCAudioTrack.h
index 284206e..c33a7b4 100644
--- a/webrtc/api/objc/RTCAudioTrack.h
+++ b/webrtc/api/objc/RTCAudioTrack.h
@@ -12,8 +12,6 @@
NS_ASSUME_NONNULL_BEGIN
-@class RTCPeerConnectionFactory;
-
@interface RTCAudioTrack : RTCMediaStreamTrack
- (instancetype)init NS_UNAVAILABLE;
diff --git a/webrtc/api/objc/RTCDataChannel.h b/webrtc/api/objc/RTCDataChannel.h
index 43f5767..59ab2b8 100644
--- a/webrtc/api/objc/RTCDataChannel.h
+++ b/webrtc/api/objc/RTCDataChannel.h
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#import <AvailabilityMacros.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@@ -32,7 +33,6 @@
@class RTCDataChannel;
-
@protocol RTCDataChannelDelegate <NSObject>
/** The data channel state changed. */
@@ -43,7 +43,6 @@
didReceiveMessageWithBuffer:(RTCDataBuffer *)buffer;
@optional
-
/** The data channel's |bufferedAmount| changed. */
- (void)dataChannel:(RTCDataChannel *)dataChannel
didChangeBufferedAmount:(uint64_t)amount;
@@ -53,12 +52,13 @@
/** Represents the state of the data channel. */
typedef NS_ENUM(NSInteger, RTCDataChannelState) {
- RTCDataChannelStateConnecting,
- RTCDataChannelStateOpen,
- RTCDataChannelStateClosing,
- RTCDataChannelStateClosed,
+ RTCDataChannelStateConnecting,
+ RTCDataChannelStateOpen,
+ RTCDataChannelStateClosing,
+ RTCDataChannelStateClosed,
};
+
@interface RTCDataChannel : NSObject
/**
@@ -67,9 +67,16 @@
*/
@property(nonatomic, readonly) NSString *label;
+/** Whether the data channel can send messages in unreliable mode. */
+@property(nonatomic, readonly) BOOL isReliable DEPRECATED_ATTRIBUTE;
+
/** Returns whether this data channel is ordered or not. */
@property(nonatomic, readonly) BOOL isOrdered;
+/** Deprecated. Use maxPacketLifeTime. */
+@property(nonatomic, readonly) NSUInteger maxRetransmitTime
+ DEPRECATED_ATTRIBUTE;
+
/**
* The length of the time window (in milliseconds) during which transmissions
* and retransmissions may occur in unreliable mode.
@@ -92,6 +99,9 @@
*/
@property(nonatomic, readonly) BOOL isNegotiated;
+/** Deprecated. Use channelId. */
+@property(nonatomic, readonly) NSInteger streamId DEPRECATED_ATTRIBUTE;
+
/** The identifier for this data channel. */
@property(nonatomic, readonly) int channelId;
diff --git a/webrtc/api/objc/RTCDataChannel.mm b/webrtc/api/objc/RTCDataChannel.mm
index 4be3a22..a2c2e18 100644
--- a/webrtc/api/objc/RTCDataChannel.mm
+++ b/webrtc/api/objc/RTCDataChannel.mm
@@ -86,7 +86,7 @@
@implementation RTCDataChannel {
- rtc::scoped_refptr<webrtc::DataChannelInterface> _nativDataChannel;
+ rtc::scoped_refptr<webrtc::DataChannelInterface> _nativeDataChannel;
rtc::scoped_ptr<webrtc::DataChannelDelegateAdapter> _observer;
BOOL _isObserverRegistered;
}
@@ -100,40 +100,52 @@
}
- (NSString *)label {
- return [NSString stringForStdString:_nativDataChannel->label()];
+ return [NSString stringForStdString:_nativeDataChannel->label()];
+}
+
+- (BOOL)isReliable {
+ return _nativeDataChannel->reliable();
}
- (BOOL)isOrdered {
- return _nativDataChannel->ordered();
+ return _nativeDataChannel->ordered();
+}
+
+- (NSUInteger)maxRetransmitTime {
+ return self.maxPacketLifeTime;
}
- (uint16_t)maxPacketLifeTime {
- return _nativDataChannel->maxRetransmitTime();
+ return _nativeDataChannel->maxRetransmitTime();
}
- (uint16_t)maxRetransmits {
- return _nativDataChannel->maxRetransmits();
+ return _nativeDataChannel->maxRetransmits();
}
- (NSString *)protocol {
- return [NSString stringForStdString:_nativDataChannel->protocol()];
+ return [NSString stringForStdString:_nativeDataChannel->protocol()];
}
- (BOOL)isNegotiated {
- return _nativDataChannel->negotiated();
+ return _nativeDataChannel->negotiated();
+}
+
+- (NSInteger)streamId {
+ return self.channelId;
}
- (int)channelId {
- return _nativDataChannel->id();
+ return _nativeDataChannel->id();
}
- (RTCDataChannelState)readyState {
return [[self class] dataChannelStateForNativeState:
- _nativDataChannel->state()];
+ _nativeDataChannel->state()];
}
- (uint64_t)bufferedAmount {
- return _nativDataChannel->buffered_amount();
+ return _nativeDataChannel->buffered_amount();
}
- (void)setDelegate:(id<RTCDataChannelDelegate>)delegate {
@@ -141,22 +153,22 @@
return;
}
if (_isObserverRegistered) {
- _nativDataChannel->UnregisterObserver();
+ _nativeDataChannel->UnregisterObserver();
_isObserverRegistered = NO;
}
_delegate = delegate;
if (_delegate) {
- _nativDataChannel->RegisterObserver(_observer.get());
+ _nativeDataChannel->RegisterObserver(_observer.get());
_isObserverRegistered = YES;
}
}
- (void)close {
- _nativDataChannel->Close();
+ _nativeDataChannel->Close();
}
- (BOOL)sendData:(RTCDataBuffer *)data {
- return _nativDataChannel->Send(*data.nativeDataBuffer);
+ return _nativeDataChannel->Send(*data.nativeDataBuffer);
}
- (NSString *)description {
@@ -173,7 +185,7 @@
(rtc::scoped_refptr<webrtc::DataChannelInterface>)nativeDataChannel {
NSParameterAssert(nativeDataChannel);
if (self = [super init]) {
- _nativDataChannel = nativeDataChannel;
+ _nativeDataChannel = nativeDataChannel;
_observer.reset(new webrtc::DataChannelDelegateAdapter(self));
}
return self;
diff --git a/webrtc/api/objc/RTCDataChannelConfiguration.h b/webrtc/api/objc/RTCDataChannelConfiguration.h
index ef0562e..fbe342d 100644
--- a/webrtc/api/objc/RTCDataChannelConfiguration.h
+++ b/webrtc/api/objc/RTCDataChannelConfiguration.h
@@ -8,6 +8,7 @@
* be found in the AUTHORS file in the root of the source tree.
*/
+#import <AvailabilityMacros.h>
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@@ -17,6 +18,9 @@
/** Set to YES if ordered delivery is required. */
@property(nonatomic, assign) BOOL isOrdered;
+/** Deprecated. Use maxPacketLifeTime. */
+@property(nonatomic, assign) NSInteger maxRetransmitTimeMs DEPRECATED_ATTRIBUTE;
+
/**
* Max period in milliseconds in which retransmissions will be sent. After this
* time, no more retransmissions will be sent. -1 if unset.
@@ -31,8 +35,11 @@
*/
@property(nonatomic, assign) BOOL isNegotiated;
-/** The stream id, or SID, for SCTP data channels. -1 if unset. */
-@property(nonatomic, assign) int streamId;
+/** Deprecated. Use channelId. */
+@property(nonatomic, assign) int streamId DEPRECATED_ATTRIBUTE;
+
+/** The id of the data channel. */
+@property(nonatomic, assign) int channelId;
/** Set by the application and opaque to the WebRTC implementation. */
@property(nonatomic) NSString *protocol;
diff --git a/webrtc/api/objc/RTCDataChannelConfiguration.mm b/webrtc/api/objc/RTCDataChannelConfiguration.mm
index 77de4ee..4a1dcb0 100644
--- a/webrtc/api/objc/RTCDataChannelConfiguration.mm
+++ b/webrtc/api/objc/RTCDataChannelConfiguration.mm
@@ -25,6 +25,14 @@
_nativeDataChannelInit.ordered = isOrdered;
}
+- (NSInteger)maxRetransmitTimeMs {
+ return self.maxPacketLifeTime;
+}
+
+- (void)setMaxRetransmitTimeMs:(NSInteger)maxRetransmitTimeMs {
+ self.maxPacketLifeTime = maxRetransmitTimeMs;
+}
+
- (int)maxPacketLifeTime {
return _nativeDataChannelInit.maxRetransmitTime;
}
@@ -58,11 +66,19 @@
}
- (int)streamId {
- return _nativeDataChannelInit.id;
+ return self.channelId;
}
- (void)setStreamId:(int)streamId {
- _nativeDataChannelInit.id = streamId;
+ self.channelId = streamId;
}
-@end
\ No newline at end of file
+- (int)channelId {
+ return _nativeDataChannelInit.id;
+}
+
+- (void)setChannelId:(int)channelId {
+ _nativeDataChannelInit.id = channelId;
+}
+
+@end
diff --git a/webrtc/api/objc/RTCVideoFrame.h b/webrtc/api/objc/RTCVideoFrame.h
index 8ed23ba..8061047 100644
--- a/webrtc/api/objc/RTCVideoFrame.h
+++ b/webrtc/api/objc/RTCVideoFrame.h
@@ -12,6 +12,7 @@
NS_ASSUME_NONNULL_BEGIN
+// RTCVideoFrame is an ObjectiveC version of cricket::VideoFrame.
@interface RTCVideoFrame : NSObject
/** Width without rotation applied. */