1 /* 2 * Copyright 2016 The WebRTC project authors. All Rights Reserved. 3 * 4 * Use of this source code is governed by a BSD-style license 5 * that can be found in the LICENSE file in the root of the source 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #import "RTCRtpReceiver.h" 12 13 #include "api/rtp_receiver_interface.h" 14 15 NS_ASSUME_NONNULL_BEGIN 16 17 @class RTC_OBJC_TYPE(RTCPeerConnectionFactory); 18 19 namespace webrtc { 20 21 class RtpReceiverDelegateAdapter : public RtpReceiverObserverInterface { 22 public: 23 RtpReceiverDelegateAdapter(RTC_OBJC_TYPE(RTCRtpReceiver) * receiver); 24 25 void OnFirstPacketReceived(cricket::MediaType media_type) override; 26 27 private: 28 __weak RTC_OBJC_TYPE(RTCRtpReceiver) * receiver_; 29 }; 30 31 } // namespace webrtc 32 33 @interface RTC_OBJC_TYPE (RTCRtpReceiver) 34 () 35 36 @property(nonatomic, 37 readonly) rtc::scoped_refptr<webrtc::RtpReceiverInterface> nativeRtpReceiver; 38 39 /** Initialize an RTCRtpReceiver with a native RtpReceiverInterface. */ 40 - (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory 41 nativeRtpReceiver:(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver 42 NS_DESIGNATED_INITIALIZER; 43 44 + (RTCRtpMediaType)mediaTypeForNativeMediaType:(cricket::MediaType)nativeMediaType; 45 46 + (cricket::MediaType)nativeMediaTypeForMediaType:(RTCRtpMediaType)mediaType; 47 48 + (NSString*)stringForMediaType:(RTCRtpMediaType)mediaType; 49 50 @end 51 52 NS_ASSUME_NONNULL_END 53