Added the API to create an RTCRtpSender to the Objective C wrapper.
Objective C applications can now create new RTCRtpSenders and change their tracks, which gives them more fine grained control than MediaStreams. BUG= Review-Url: https://codereview.webrtc.org/1888633002 Cr-Commit-Position: refs/heads/master@{#12570}
This commit is contained in:
@ -22,6 +22,9 @@ typedef NS_ENUM(NSInteger, RTCMediaStreamTrackState) {
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
RTC_EXTERN NSString * const kRTCMediaStreamTrackKindAudio;
|
||||
RTC_EXTERN NSString * const kRTCMediaStreamTrackKindVideo;
|
||||
|
||||
RTC_EXPORT
|
||||
@interface RTCMediaStreamTrack : NSObject
|
||||
|
||||
|
||||
@ -171,6 +171,16 @@ RTC_EXPORT
|
||||
|
||||
@end
|
||||
|
||||
@interface RTCPeerConnection (Media)
|
||||
|
||||
/**
|
||||
* Create an RTCRtpSender with the specified kind and media stream ID.
|
||||
* See RTCMediaStreamTrack.h for available kinds.
|
||||
*/
|
||||
- (RTCRtpSender *)senderWithKind:(NSString *)kind streamId:(NSString *)streamId;
|
||||
|
||||
@end
|
||||
|
||||
@interface RTCPeerConnection (DataChannel)
|
||||
|
||||
/** Create a new data channel with the given label and configuration. */
|
||||
|
||||
@ -19,22 +19,20 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
RTC_EXPORT
|
||||
@protocol 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, readonly) RTCRtpParameters *parameters;
|
||||
@property(nonatomic, copy) 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, readonly) RTCMediaStreamTrack *track;
|
||||
|
||||
/** Set the new RTCRtpParameters to be used by the sender.
|
||||
* Returns YES if the new parameters were applied, NO otherwise.
|
||||
*/
|
||||
- (BOOL)setParameters:(RTCRtpParameters *)parameters;
|
||||
@property(nonatomic, copy, nullable) RTCMediaStreamTrack *track;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user