Index: webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h |
diff --git a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h |
index e98a8f3bea1d650b2677dae2d377ff780a997489..6c39a25310da5e9459b24835079e9c529c891b47 100644 |
--- a/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h |
+++ b/webrtc/sdk/objc/Framework/Headers/WebRTC/RTCRtpReceiver.h |
@@ -16,6 +16,35 @@ |
NS_ASSUME_NONNULL_BEGIN |
+/** Represents the media type of the RtpReceiver. */ |
+typedef NS_ENUM(NSInteger, RTCRtpMediaType) { |
+ RTCRtpMediaTypeAudio, |
+ RTCRtpMediaTypeVideo, |
+ RTCRtpMediaTypeData, |
+}; |
+ |
+@class RTCRtpReceiver; |
+ |
+RTC_EXPORT |
+@protocol 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:(RTCRtpReceiver *)rtpReceiver |
+ didReceiveFirstPacketForMediaType:(RTCRtpMediaType)mediaType; |
+ |
+@end |
+ |
RTC_EXPORT |
@protocol RTCRtpReceiver <NSObject> |
@@ -38,6 +67,9 @@ RTC_EXPORT |
*/ |
@property(nonatomic, readonly) RTCMediaStreamTrack *track; |
+/** The delegate for this RtpReceiver. */ |
+@property(nonatomic, weak) id<RTCRtpReceiverDelegate> delegate; |
+ |
@end |
RTC_EXPORT |