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:
skvlad
2016-04-29 15:30:16 -07:00
committed by Commit bot
parent b3bedca932
commit f3569c8a8f
7 changed files with 84 additions and 23 deletions

View File

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

View File

@ -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. */

View File

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