Commit cd4ef2cd authored by Ильжан's avatar Ильжан
Browse files

Initial commit

parents
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCMetricsSampleInfo.h"
/**
* Enables gathering of metrics (which can be fetched with
* RTCGetAndResetMetrics). Must be called before any other call into WebRTC.
*/
RTC_EXTERN void RTCEnableMetrics(void);
/** Gets and clears native histograms. */
RTC_EXTERN NSArray<RTC_OBJC_TYPE(RTCMetricsSampleInfo) *>* RTCGetAndResetMetrics(void);
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCMetricsSampleInfo) : NSObject
/**
* Example of RTCMetricsSampleInfo:
* name: "WebRTC.Video.InputFramesPerSecond"
* min: 1
* max: 100
* bucketCount: 50
* samples: [29]:2 [30]:1
*/
/** The name of the histogram. */
@property(nonatomic, readonly) NSString *name;
/** The minimum bucket value. */
@property(nonatomic, readonly) int min;
/** The maximum bucket value. */
@property(nonatomic, readonly) int max;
/** The number of buckets. */
@property(nonatomic, readonly) int bucketCount;
/** A dictionary holding the samples <value, # of events>. */
@property(nonatomic, readonly) NSDictionary<NSNumber *, NSNumber *> *samples;
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCI420Buffer.h"
#import "RTCMutableYUVPlanarBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Extension of the I420 buffer with mutable data access */
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCMutableI420Buffer)<RTC_OBJC_TYPE(RTCI420Buffer), RTC_OBJC_TYPE(RTCMutableYUVPlanarBuffer)> @end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCYUVPlanarBuffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Extension of the YUV planar data buffer with mutable data access */
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCMutableYUVPlanarBuffer)<RTC_OBJC_TYPE(RTCYUVPlanarBuffer)>
@property(nonatomic, readonly) uint8_t *mutableDataY;
@property(nonatomic, readonly) uint8_t *mutableDataU;
@property(nonatomic, readonly) uint8_t *mutableDataV;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCI420Buffer.h"
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** RTCI420Buffer implements the RTCI420Buffer protocol */
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCI420Buffer) : NSObject<RTC_OBJC_TYPE(RTCI420Buffer)>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <AVFoundation/AVFoundation.h>
#import "RTCMacros.h"
#import "RTCMutableI420Buffer.h"
#import "RTCNativeI420Buffer.h"
NS_ASSUME_NONNULL_BEGIN
/** Mutable version of RTCI420Buffer */
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCMutableI420Buffer) : RTC_OBJC_TYPE(RTCI420Buffer)<RTC_OBJC_TYPE(RTCMutableI420Buffer)>
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2020 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.
*/
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
/** Listens for NWPathMonitor updates and forwards the results to a C++
* observer.
*/
@interface RTCNetworkMonitor : NSObject
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
@class RTC_OBJC_TYPE(RTCConfiguration);
@class RTC_OBJC_TYPE(RTCDataChannel);
@class RTC_OBJC_TYPE(RTCDataChannelConfiguration);
@class RTC_OBJC_TYPE(RTCIceCandidate);
@class RTC_OBJC_TYPE(RTCMediaConstraints);
@class RTC_OBJC_TYPE(RTCMediaStream);
@class RTC_OBJC_TYPE(RTCMediaStreamTrack);
@class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
@class RTC_OBJC_TYPE(RTCRtpReceiver);
@class RTC_OBJC_TYPE(RTCRtpSender);
@class RTC_OBJC_TYPE(RTCRtpTransceiver);
@class RTC_OBJC_TYPE(RTCRtpTransceiverInit);
@class RTC_OBJC_TYPE(RTCSessionDescription);
@class RTC_OBJC_TYPE(RTCStatisticsReport);
@class RTC_OBJC_TYPE(RTCLegacyStatsReport);
typedef NS_ENUM(NSInteger, RTCRtpMediaType);
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kRTCPeerConnectionErrorDomain;
extern int const kRTCSessionDescriptionErrorCode;
/** Represents the signaling state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCSignalingState) {
RTCSignalingStateStable,
RTCSignalingStateHaveLocalOffer,
RTCSignalingStateHaveLocalPrAnswer,
RTCSignalingStateHaveRemoteOffer,
RTCSignalingStateHaveRemotePrAnswer,
// Not an actual state, represents the total number of states.
RTCSignalingStateClosed,
};
/** Represents the ice connection state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCIceConnectionState) {
RTCIceConnectionStateNew,
RTCIceConnectionStateChecking,
RTCIceConnectionStateConnected,
RTCIceConnectionStateCompleted,
RTCIceConnectionStateFailed,
RTCIceConnectionStateDisconnected,
RTCIceConnectionStateClosed,
RTCIceConnectionStateCount,
};
/** Represents the combined ice+dtls connection state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCPeerConnectionState) {
RTCPeerConnectionStateNew,
RTCPeerConnectionStateConnecting,
RTCPeerConnectionStateConnected,
RTCPeerConnectionStateDisconnected,
RTCPeerConnectionStateFailed,
RTCPeerConnectionStateClosed,
};
/** Represents the ice gathering state of the peer connection. */
typedef NS_ENUM(NSInteger, RTCIceGatheringState) {
RTCIceGatheringStateNew,
RTCIceGatheringStateGathering,
RTCIceGatheringStateComplete,
};
/** Represents the stats output level. */
typedef NS_ENUM(NSInteger, RTCStatsOutputLevel) {
RTCStatsOutputLevelStandard,
RTCStatsOutputLevelDebug,
};
@class RTC_OBJC_TYPE(RTCPeerConnection);
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCPeerConnectionDelegate)<NSObject>
/** Called when the SignalingState changed. */
- (void)peerConnection
: (RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection didChangeSignalingState
: (RTCSignalingState)stateChanged;
/** Called when media is received on a new stream from remote peer. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didAddStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream;
/** Called when a remote peer closes a stream.
* This is not called when RTCSdpSemanticsUnifiedPlan is specified.
*/
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didRemoveStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream;
/** Called when negotiation is needed, for example ICE has restarted. */
- (void)peerConnectionShouldNegotiate:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection;
/** Called any time the IceConnectionState changes. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didChangeIceConnectionState:(RTCIceConnectionState)newState;
/** Called any time the IceGatheringState changes. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didChangeIceGatheringState:(RTCIceGatheringState)newState;
/** New ice candidate has been found. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didGenerateIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate;
/** Called when a group of local Ice candidates have been removed. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didRemoveIceCandidates:(NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *)candidates;
/** New data channel has been opened. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didOpenDataChannel:(RTC_OBJC_TYPE(RTCDataChannel) *)dataChannel;
/** Called when signaling indicates a transceiver will be receiving media from
* the remote endpoint.
* This is only called with RTCSdpSemanticsUnifiedPlan specified.
*/
@optional
/** Called any time the IceConnectionState changes following standardized
* transition. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didChangeStandardizedIceConnectionState:(RTCIceConnectionState)newState;
/** Called any time the PeerConnectionState changes. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didChangeConnectionState:(RTCPeerConnectionState)newState;
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didStartReceivingOnTransceiver:(RTC_OBJC_TYPE(RTCRtpTransceiver) *)transceiver;
/** Called when a receiver and its track are created. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didAddReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)rtpReceiver
streams:(NSArray<RTC_OBJC_TYPE(RTCMediaStream) *> *)mediaStreams;
/** Called when the receiver and its track are removed. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didRemoveReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)rtpReceiver;
/** Called when the selected ICE candidate pair is changed. */
- (void)peerConnection:(RTC_OBJC_TYPE(RTCPeerConnection) *)peerConnection
didChangeLocalCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)local
remoteCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)remote
lastReceivedMs:(int)lastDataReceivedMs
changeReason:(NSString *)reason;
@end
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCPeerConnection) : NSObject
/** The object that will be notifed about events such as state changes and
* streams being added or removed.
*/
@property(nonatomic, weak, nullable) id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)> delegate;
/** This property is not available with RTCSdpSemanticsUnifiedPlan. Please use
* |senders| instead.
*/
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCMediaStream) *> *localStreams;
@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCSessionDescription) * localDescription;
@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCSessionDescription) * remoteDescription;
@property(nonatomic, readonly) RTCSignalingState signalingState;
@property(nonatomic, readonly) RTCIceConnectionState iceConnectionState;
@property(nonatomic, readonly) RTCPeerConnectionState connectionState;
@property(nonatomic, readonly) RTCIceGatheringState iceGatheringState;
@property(nonatomic, readonly, copy) RTC_OBJC_TYPE(RTCConfiguration) * configuration;
/** Gets all RTCRtpSenders associated with this peer connection.
* Note: reading this property returns different instances of RTCRtpSender.
* Use isEqual: instead of == to compare RTCRtpSender instances.
*/
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCRtpSender) *> *senders;
/** Gets all RTCRtpReceivers associated with this peer connection.
* Note: reading this property returns different instances of RTCRtpReceiver.
* Use isEqual: instead of == to compare RTCRtpReceiver instances.
*/
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCRtpReceiver) *> *receivers;
/** Gets all RTCRtpTransceivers associated with this peer connection.
* Note: reading this property returns different instances of
* RTCRtpTransceiver. Use isEqual: instead of == to compare
* RTCRtpTransceiver instances. This is only available with
* RTCSdpSemanticsUnifiedPlan specified.
*/
@property(nonatomic, readonly) NSArray<RTC_OBJC_TYPE(RTCRtpTransceiver) *> *transceivers;
- (instancetype)init NS_UNAVAILABLE;
/** 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:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration;
/** Terminate all media and close the transport. */
- (void)close;
/** Provide a remote candidate to the ICE Agent. */
- (void)addIceCandidate:(RTC_OBJC_TYPE(RTCIceCandidate) *)candidate;
/** Remove a group of remote candidates from the ICE Agent. */
- (void)removeIceCandidates:(NSArray<RTC_OBJC_TYPE(RTCIceCandidate) *> *)candidates;
/** Add a new media stream to be sent on this peer connection.
* This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use
* addTrack instead.
*/
- (void)addStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream;
/** Remove the given media stream from this peer connection.
* This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use
* removeTrack instead.
*/
- (void)removeStream:(RTC_OBJC_TYPE(RTCMediaStream) *)stream;
/** Add a new media stream track to be sent on this peer connection, and return
* the newly created RTCRtpSender. The RTCRtpSender will be
* associated with the streams specified in the |streamIds| list.
*
* Errors: If an error occurs, returns nil. An error can occur if:
* - A sender already exists for the track.
* - The peer connection is closed.
*/
- (RTC_OBJC_TYPE(RTCRtpSender) *)addTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
streamIds:(NSArray<NSString *> *)streamIds;
/** With PlanB semantics, removes an RTCRtpSender from this peer connection.
*
* With UnifiedPlan semantics, sets sender's track to null and removes the
* send component from the associated RTCRtpTransceiver's direction.
*
* Returns YES on success.
*/
- (BOOL)removeTrack:(RTC_OBJC_TYPE(RTCRtpSender) *)sender;
/** addTransceiver creates a new RTCRtpTransceiver and adds it to the set of
* transceivers. Adding a transceiver will cause future calls to CreateOffer
* to add a media description for the corresponding transceiver.
*
* The initial value of |mid| in the returned transceiver is nil. Setting a
* new session description may change it to a non-nil value.
*
* https://w3c.github.io/webrtc-pc/#dom-rtcpeerconnection-addtransceiver
*
* Optionally, an RtpTransceiverInit structure can be specified to configure
* the transceiver from construction. If not specified, the transceiver will
* default to having a direction of kSendRecv and not be part of any streams.
*
* These methods are only available when Unified Plan is enabled (see
* RTCConfiguration).
*/
/** Adds a transceiver with a sender set to transmit the given track. The kind
* of the transceiver (and sender/receiver) will be derived from the kind of
* the track.
*/
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverWithTrack:
(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track;
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)
addTransceiverWithTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)init;
/** Adds a transceiver with the given kind. Can either be RTCRtpMediaTypeAudio
* or RTCRtpMediaTypeVideo.
*/
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType;
- (RTC_OBJC_TYPE(RTCRtpTransceiver) *)addTransceiverOfType:(RTCRtpMediaType)mediaType
init:(RTC_OBJC_TYPE(RTCRtpTransceiverInit) *)
init;
/** Generate an SDP offer. */
- (void)offerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
completionHandler:(nullable void (^)(RTC_OBJC_TYPE(RTCSessionDescription) * _Nullable sdp,
NSError *_Nullable error))completionHandler;
/** Generate an SDP answer. */
- (void)answerForConstraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
completionHandler:
(nullable void (^)(RTC_OBJC_TYPE(RTCSessionDescription) * _Nullable sdp,
NSError *_Nullable error))completionHandler;
/** Apply the supplied RTCSessionDescription as the local description. */
- (void)setLocalDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp
completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler;
/** Apply the supplied RTCSessionDescription as the remote description. */
- (void)setRemoteDescription:(RTC_OBJC_TYPE(RTCSessionDescription) *)sdp
completionHandler:(nullable void (^)(NSError *_Nullable error))completionHandler;
/** Limits the bandwidth allocated for all RTP streams sent by this
* PeerConnection. Nil parameters will be unchanged. Setting
* |currentBitrateBps| will force the available bitrate estimate to the given
* value. Returns YES if the parameters were successfully updated.
*/
- (BOOL)setBweMinBitrateBps:(nullable NSNumber *)minBitrateBps
currentBitrateBps:(nullable NSNumber *)currentBitrateBps
maxBitrateBps:(nullable NSNumber *)maxBitrateBps;
/** Start or stop recording an Rtc EventLog. */
- (BOOL)startRtcEventLogWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
- (void)stopRtcEventLog;
@end
@interface RTC_OBJC_TYPE (RTCPeerConnection)
(Media)
/** Create an RTCRtpSender with the specified kind and media stream ID.
* See RTCMediaStreamTrack.h for available kinds.
* This method is not supported with RTCSdpSemanticsUnifiedPlan. Please use
* addTransceiver instead.
*/
- (RTC_OBJC_TYPE(RTCRtpSender) *)senderWithKind : (NSString *)kind streamId
: (NSString *)streamId;
@end
@interface RTC_OBJC_TYPE (RTCPeerConnection)
(DataChannel)
/** Create a new data channel with the given label and configuration. */
- (nullable RTC_OBJC_TYPE(RTCDataChannel) *)dataChannelForLabel
: (NSString *)label configuration : (RTC_OBJC_TYPE(RTCDataChannelConfiguration) *)configuration;
@end
typedef void (^RTCStatisticsCompletionHandler)(RTC_OBJC_TYPE(RTCStatisticsReport) *);
@interface RTC_OBJC_TYPE (RTCPeerConnection)
(Stats)
/** Gather stats for the given RTCMediaStreamTrack. If |mediaStreamTrack| is nil
* statistics are gathered for all tracks.
*/
- (void)statsForTrack
: (nullable RTC_OBJC_TYPE(RTCMediaStreamTrack) *)mediaStreamTrack statsOutputLevel
: (RTCStatsOutputLevel)statsOutputLevel completionHandler
: (nullable void (^)(NSArray<RTC_OBJC_TYPE(RTCLegacyStatsReport) *> *stats))completionHandler;
/** Gather statistic through the v2 statistics API. */
- (void)statisticsWithCompletionHandler:(RTCStatisticsCompletionHandler)completionHandler;
/** Spec-compliant getStats() performing the stats selection algorithm with the
* sender.
*/
- (void)statisticsForSender:(RTC_OBJC_TYPE(RTCRtpSender) *)sender
completionHandler:(RTCStatisticsCompletionHandler)completionHandler;
/** Spec-compliant getStats() performing the stats selection algorithm with the
* receiver.
*/
- (void)statisticsForReceiver:(RTC_OBJC_TYPE(RTCRtpReceiver) *)receiver
completionHandler:(RTCStatisticsCompletionHandler)completionHandler;
@end
NS_ASSUME_NONNULL_END
/*
* 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
@class RTC_OBJC_TYPE(RTCAudioSource);
@class RTC_OBJC_TYPE(RTCAudioTrack);
@class RTC_OBJC_TYPE(RTCConfiguration);
@class RTC_OBJC_TYPE(RTCMediaConstraints);
@class RTC_OBJC_TYPE(RTCMediaStream);
@class RTC_OBJC_TYPE(RTCPeerConnection);
@class RTC_OBJC_TYPE(RTCVideoSource);
@class RTC_OBJC_TYPE(RTCVideoTrack);
@class RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions);
@protocol RTC_OBJC_TYPE
(RTCPeerConnectionDelegate);
@protocol RTC_OBJC_TYPE
(RTCVideoDecoderFactory);
@protocol RTC_OBJC_TYPE
(RTCVideoEncoderFactory);
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCPeerConnectionFactory) : NSObject
/* Initialize object with default H264 video encoder/decoder factories */
- (instancetype)init;
/* Initialize object with injectable video encoder/decoder factories */
- (instancetype)
initWithEncoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoEncoderFactory)>)encoderFactory
decoderFactory:(nullable id<RTC_OBJC_TYPE(RTCVideoDecoderFactory)>)decoderFactory;
/** Initialize an RTCAudioSource with constraints. */
- (RTC_OBJC_TYPE(RTCAudioSource) *)audioSourceWithConstraints:
(nullable RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints;
/** Initialize an RTCAudioTrack with an id. Convenience ctor to use an audio source
* with no constraints.
*/
- (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithTrackId:(NSString *)trackId;
/** Initialize an RTCAudioTrack with a source and an id. */
- (RTC_OBJC_TYPE(RTCAudioTrack) *)audioTrackWithSource:(RTC_OBJC_TYPE(RTCAudioSource) *)source
trackId:(NSString *)trackId;
/** Initialize a generic RTCVideoSource. The RTCVideoSource should be
* passed to a RTCVideoCapturer implementation, e.g.
* RTCCameraVideoCapturer, in order to produce frames.
*/
- (RTC_OBJC_TYPE(RTCVideoSource) *)videoSource;
/** Initialize an RTCVideoTrack with a source and an id. */
- (RTC_OBJC_TYPE(RTCVideoTrack) *)videoTrackWithSource:(RTC_OBJC_TYPE(RTCVideoSource) *)source
trackId:(NSString *)trackId;
/** Initialize an RTCMediaStream with an id. */
- (RTC_OBJC_TYPE(RTCMediaStream) *)mediaStreamWithStreamId:(NSString *)streamId;
/** Initialize an RTCPeerConnection with a configuration, constraints, and
* delegate.
*/
- (RTC_OBJC_TYPE(RTCPeerConnection) *)
peerConnectionWithConfiguration:(RTC_OBJC_TYPE(RTCConfiguration) *)configuration
constraints:(RTC_OBJC_TYPE(RTCMediaConstraints) *)constraints
delegate:(nullable id<RTC_OBJC_TYPE(RTCPeerConnectionDelegate)>)delegate;
/** Set the options to be used for subsequently created RTCPeerConnections */
- (void)setOptions:(nonnull RTC_OBJC_TYPE(RTCPeerConnectionFactoryOptions) *)options;
/** Start an AecDump recording. This API call will likely change in the future. */
- (BOOL)startAecDumpWithFilePath:(NSString *)filePath maxSizeInBytes:(int64_t)maxSizeInBytes;
/* Stop an active AecDump recording */
- (void)stopAecDump;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCPeerConnectionFactoryOptions) : NSObject
@property(nonatomic, assign) BOOL disableEncryption;
@property(nonatomic, assign) BOOL disableNetworkMonitor;
@property(nonatomic, assign) BOOL ignoreLoopbackNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreVPNNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreCellularNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreWiFiNetworkAdapter;
@property(nonatomic, assign) BOOL ignoreEthernetNetworkAdapter;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtcpParameters) : NSObject
/** The Canonical Name used by RTCP. */
@property(nonatomic, readonly, copy) NSString *cname;
/** Whether reduced size RTCP is configured or compound RTCP. */
@property(nonatomic, assign) BOOL isReducedSize;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_EXTERN const NSString *const kRTCRtxCodecName;
RTC_EXTERN const NSString *const kRTCRedCodecName;
RTC_EXTERN const NSString *const kRTCUlpfecCodecName;
RTC_EXTERN const NSString *const kRTCFlexfecCodecName;
RTC_EXTERN const NSString *const kRTCOpusCodecName;
RTC_EXTERN const NSString *const kRTCIsacCodecName;
RTC_EXTERN const NSString *const kRTCL16CodecName;
RTC_EXTERN const NSString *const kRTCG722CodecName;
RTC_EXTERN const NSString *const kRTCIlbcCodecName;
RTC_EXTERN const NSString *const kRTCPcmuCodecName;
RTC_EXTERN const NSString *const kRTCPcmaCodecName;
RTC_EXTERN const NSString *const kRTCDtmfCodecName;
RTC_EXTERN const NSString *const kRTCComfortNoiseCodecName;
RTC_EXTERN const NSString *const kRTCVp8CodecName;
RTC_EXTERN const NSString *const kRTCVp9CodecName;
RTC_EXTERN const NSString *const kRTCH264CodecName;
/** Defined in http://w3c.github.io/webrtc-pc/#idl-def-RTC_OBJC_TYPE(RTCRtpCodecParameters) */
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpCodecParameters) : NSObject
/** The RTP payload type. */
@property(nonatomic, assign) int payloadType;
/**
* The codec MIME subtype. Valid types are listed in:
* http://www.iana.org/assignments/rtp-parameters/rtp-parameters.xhtml#rtp-parameters-2
*
* Several supported types are represented by the constants above.
*/
@property(nonatomic, readonly, nonnull) NSString *name;
/**
* The media type of this codec. Equivalent to MIME top-level type.
*
* Valid values are kRTCMediaStreamTrackKindAudio and
* kRTCMediaStreamTrackKindVideo.
*/
@property(nonatomic, readonly, nonnull) NSString *kind;
/** The codec clock rate expressed in Hertz. */
@property(nonatomic, readonly, nullable) NSNumber *clockRate;
/**
* The number of channels (mono=1, stereo=2).
* Set to null for video codecs.
**/
@property(nonatomic, readonly, nullable) NSNumber *numChannels;
/** The "format specific parameters" field from the "a=fmtp" line in the SDP */
@property(nonatomic, readonly, nonnull) NSDictionary *parameters;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** Corresponds to webrtc::Priority. */
typedef NS_ENUM(NSInteger, RTCPriority) {
RTCPriorityVeryLow,
RTCPriorityLow,
RTCPriorityMedium,
RTCPriorityHigh
};
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpEncodingParameters) : NSObject
/** The idenfifier for the encoding layer. This is used in simulcast. */
@property(nonatomic, copy, nullable) NSString *rid;
/** Controls whether the encoding is currently transmitted. */
@property(nonatomic, assign) BOOL isActive;
/** The maximum bitrate to use for the encoding, or nil if there is no
* limit.
*/
@property(nonatomic, copy, nullable) NSNumber *maxBitrateBps;
/** The minimum bitrate to use for the encoding, or nil if there is no
* limit.
*/
@property(nonatomic, copy, nullable) NSNumber *minBitrateBps;
/** The maximum framerate to use for the encoding, or nil if there is no
* limit.
*/
@property(nonatomic, copy, nullable) NSNumber *maxFramerate;
/** The requested number of temporal layers to use for the encoding, or nil
* if the default should be used.
*/
@property(nonatomic, copy, nullable) NSNumber *numTemporalLayers;
/** Scale the width and height down by this factor for video. If nil,
* implementation default scaling factor will be used.
*/
@property(nonatomic, copy, nullable) NSNumber *scaleResolutionDownBy;
/** The SSRC being used by this encoding. */
@property(nonatomic, readonly, nullable) NSNumber *ssrc;
/** The relative bitrate priority. */
@property(nonatomic, assign) double bitratePriority;
/** The relative DiffServ Code Point priority. */
@property(nonatomic, assign) RTCPriority networkPriority;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2017 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
/** Information for header. Corresponds to webrtc::RTPFragmentationHeader. */
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpFragmentationHeader) : NSObject
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationOffset;
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationLength;
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationTimeDiff;
@property(nonatomic, strong) NSArray<NSNumber *> *fragmentationPlType;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpHeaderExtension) : NSObject
/** The URI of the RTP header extension, as defined in RFC5285. */
@property(nonatomic, readonly, copy) NSString *uri;
/** The value put in the RTP packet to identify the header extension. */
@property(nonatomic, readonly) int id;
/** Whether the header extension is encrypted or not. */
@property(nonatomic, readonly, getter=isEncrypted) BOOL encrypted;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCRtcpParameters.h"
#import "RTCRtpCodecParameters.h"
#import "RTCRtpEncodingParameters.h"
#import "RTCRtpHeaderExtension.h"
NS_ASSUME_NONNULL_BEGIN
/** Corresponds to webrtc::DegradationPreference. */
typedef NS_ENUM(NSInteger, RTCDegradationPreference) {
RTCDegradationPreferenceDisabled,
RTCDegradationPreferenceMaintainFramerate,
RTCDegradationPreferenceMaintainResolution,
RTCDegradationPreferenceBalanced
};
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpParameters) : NSObject
/** A unique identifier for the last set of parameters applied. */
@property(nonatomic, copy) NSString *transactionId;
/** Parameters used for RTCP. */
@property(nonatomic, readonly, copy) RTC_OBJC_TYPE(RTCRtcpParameters) * rtcp;
/** An array containing parameters for RTP header extensions. */
@property(nonatomic, readonly, copy)
NSArray<RTC_OBJC_TYPE(RTCRtpHeaderExtension) *> *headerExtensions;
/** The currently active encodings in the order of preference. */
@property(nonatomic, copy) NSArray<RTC_OBJC_TYPE(RTCRtpEncodingParameters) *> *encodings;
/** The negotiated set of send codecs in order of preference. */
@property(nonatomic, copy) NSArray<RTC_OBJC_TYPE(RTCRtpCodecParameters) *> *codecs;
/**
* Degradation preference in case of CPU adaptation or constrained bandwidth.
* If nil, implementation default degradation preference will be used.
*/
@property(nonatomic, copy, nullable) NSNumber *degradationPreference;
- (instancetype)init NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCMediaStreamTrack.h"
#import "RTCRtpParameters.h"
NS_ASSUME_NONNULL_BEGIN
/** Represents the media type of the RtpReceiver. */
typedef NS_ENUM(NSInteger, RTCRtpMediaType) {
RTCRtpMediaTypeAudio,
RTCRtpMediaTypeVideo,
RTCRtpMediaTypeData,
};
@class RTC_OBJC_TYPE(RTCRtpReceiver);
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCRtpReceiverDelegate)<NSObject>
/** Called when the first RTP packet is received.
*
* Note: Currently if there are multiple RtpReceivers of the same media type,
* they will all call OnFirstPacketReceived at once.
*
* For example, if we create three audio receivers, A/B/C, they will listen to
* the same signal from the underneath network layer. Whenever the first audio packet
* is received, the underneath signal will be fired. All the receivers A/B/C will be
* notified and the callback of the receiver's delegate will be called.
*
* The process is the same for video receivers.
*/
- (void)rtpReceiver
: (RTC_OBJC_TYPE(RTCRtpReceiver) *)rtpReceiver didReceiveFirstPacketForMediaType
: (RTCRtpMediaType)mediaType;
@end
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCRtpReceiver)<NSObject>
/** A unique identifier for this receiver. */
@property(nonatomic, readonly) NSString *receiverId;
/** The currently active RTCRtpParameters, as defined in
* https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters.
*
* The WebRTC specification only defines RTCRtpParameters in terms of senders,
* but this API also applies them to receivers, similar to ORTC:
* http://ortc.org/wp-content/uploads/2016/03/ortc.html#rtcrtpparameters*.
*/
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCRtpParameters) * parameters;
/** The RTCMediaStreamTrack associated with the receiver.
* Note: reading this property returns a new instance of
* RTCMediaStreamTrack. Use isEqual: instead of == to compare
* RTCMediaStreamTrack instances.
*/
@property(nonatomic, readonly, nullable) RTC_OBJC_TYPE(RTCMediaStreamTrack) * track;
/** The delegate for this RtpReceiver. */
@property(nonatomic, weak) id<RTC_OBJC_TYPE(RTCRtpReceiverDelegate)> delegate;
@end
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpReceiver) : NSObject <RTC_OBJC_TYPE(RTCRtpReceiver)>
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCDtmfSender.h"
#import "RTCMacros.h"
#import "RTCMediaStreamTrack.h"
#import "RTCRtpParameters.h"
NS_ASSUME_NONNULL_BEGIN
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCRtpSender)<NSObject>
/** A unique identifier for this sender. */
@property(nonatomic, readonly) NSString *senderId;
/** The currently active RTCRtpParameters, as defined in
* https://www.w3.org/TR/webrtc/#idl-def-RTCRtpParameters.
*/
@property(nonatomic, copy) RTC_OBJC_TYPE(RTCRtpParameters) * parameters;
/** The RTCMediaStreamTrack associated with the sender.
* Note: reading this property returns a new instance of
* RTCMediaStreamTrack. Use isEqual: instead of == to compare
* RTCMediaStreamTrack instances.
*/
@property(nonatomic, copy, nullable) RTC_OBJC_TYPE(RTCMediaStreamTrack) * track;
/** IDs of streams associated with the RTP sender */
@property(nonatomic, copy) NSArray<NSString *> *streamIds;
/** The RTCDtmfSender accociated with the RTP sender. */
@property(nonatomic, readonly, nullable) id<RTC_OBJC_TYPE(RTCDtmfSender)> dtmfSender;
@end
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpSender) : NSObject <RTC_OBJC_TYPE(RTCRtpSender)>
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2018 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
#import "RTCRtpReceiver.h"
#import "RTCRtpSender.h"
NS_ASSUME_NONNULL_BEGIN
extern NSString *const kRTCRtpTransceiverErrorDomain;
/** https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverdirection */
typedef NS_ENUM(NSInteger, RTCRtpTransceiverDirection) {
RTCRtpTransceiverDirectionSendRecv,
RTCRtpTransceiverDirectionSendOnly,
RTCRtpTransceiverDirectionRecvOnly,
RTCRtpTransceiverDirectionInactive,
RTCRtpTransceiverDirectionStopped
};
/** Structure for initializing an RTCRtpTransceiver in a call to
* RTCPeerConnection.addTransceiver.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiverinit
*/
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpTransceiverInit) : NSObject
/** Direction of the RTCRtpTransceiver. See RTCRtpTransceiver.direction. */
@property(nonatomic) RTCRtpTransceiverDirection direction;
/** The added RTCRtpTransceiver will be added to these streams. */
@property(nonatomic) NSArray<NSString *> *streamIds;
/** TODO(bugs.webrtc.org/7600): Not implemented. */
@property(nonatomic) NSArray<RTC_OBJC_TYPE(RTCRtpEncodingParameters) *> *sendEncodings;
@end
@class RTC_OBJC_TYPE(RTCRtpTransceiver);
/** The RTCRtpTransceiver maps to the RTCRtpTransceiver defined by the
* WebRTC specification. A transceiver represents a combination of an RTCRtpSender
* and an RTCRtpReceiver that share a common mid. As defined in JSEP, an
* RTCRtpTransceiver is said to be associated with a media description if its
* mid property is non-nil; otherwise, it is said to be disassociated.
* JSEP: https://tools.ietf.org/html/draft-ietf-rtcweb-jsep-24
*
* Note that RTCRtpTransceivers are only supported when using
* RTCPeerConnection with Unified Plan SDP.
*
* WebRTC specification for RTCRtpTransceiver, the JavaScript analog:
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver
*/
RTC_OBJC_EXPORT
@protocol RTC_OBJC_TYPE
(RTCRtpTransceiver)<NSObject>
/** Media type of the transceiver. The sender and receiver will also have this
* type.
*/
@property(nonatomic, readonly) RTCRtpMediaType mediaType;
/** The mid attribute is the mid negotiated and present in the local and
* remote descriptions. Before negotiation is complete, the mid value may be
* nil. After rollbacks, the value may change from a non-nil value to nil.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-mid
*/
@property(nonatomic, readonly) NSString *mid;
/** The sender attribute exposes the RTCRtpSender corresponding to the RTP
* media that may be sent with the transceiver's mid. The sender is always
* present, regardless of the direction of media.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-sender
*/
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCRtpSender) * sender;
/** The receiver attribute exposes the RTCRtpReceiver corresponding to the RTP
* media that may be received with the transceiver's mid. The receiver is
* always present, regardless of the direction of media.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-receiver
*/
@property(nonatomic, readonly) RTC_OBJC_TYPE(RTCRtpReceiver) * receiver;
/** The isStopped attribute indicates that the sender of this transceiver will
* no longer send, and that the receiver will no longer receive. It is true if
* either stop has been called or if setting the local or remote description
* has caused the RTCRtpTransceiver to be stopped.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stopped
*/
@property(nonatomic, readonly) BOOL isStopped;
/** The direction attribute indicates the preferred direction of this
* transceiver, which will be used in calls to createOffer and createAnswer.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction
*/
@property(nonatomic, readonly) RTCRtpTransceiverDirection direction;
/** The currentDirection attribute indicates the current direction negotiated
* for this transceiver. If this transceiver has never been represented in an
* offer/answer exchange, or if the transceiver is stopped, the value is not
* present and this method returns NO.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-currentdirection
*/
- (BOOL)currentDirection:(RTCRtpTransceiverDirection *)currentDirectionOut;
/** The stop method irreversibly stops the RTCRtpTransceiver. The sender of
* this transceiver will no longer send, the receiver will no longer receive.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-stop
*/
- (void)stopInternal;
/** An update of directionality does not take effect immediately. Instead,
* future calls to createOffer and createAnswer mark the corresponding media
* descriptions as sendrecv, sendonly, recvonly, or inactive.
* https://w3c.github.io/webrtc-pc/#dom-rtcrtptransceiver-direction
*/
- (void)setDirection:(RTCRtpTransceiverDirection)direction error:(NSError **)error;
@end
RTC_OBJC_EXPORT
@interface RTC_OBJC_TYPE (RTCRtpTransceiver) : NSObject <RTC_OBJC_TYPE(RTCRtpTransceiver)>
- (instancetype)init NS_UNAVAILABLE;
@end
NS_ASSUME_NONNULL_END
/*
* Copyright 2016 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.
*/
#import <Foundation/Foundation.h>
#import "RTCMacros.h"
/**
* Initialize and clean up the SSL library. Failure is fatal. These call the
* corresponding functions in webrtc/rtc_base/ssladapter.h.
*/
RTC_EXTERN BOOL RTCInitializeSSL(void);
RTC_EXTERN BOOL RTCCleanupSSL(void);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment