Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 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 | |
Anders Carlsson | 7bca8ca | 2018-08-30 09:30:29 +0200 | [diff] [blame^] | 11 | #import "RTCRtpReceiver.h" |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 12 | |
Mirko Bonadei | 92ea95e | 2017-09-15 06:47:31 +0200 | [diff] [blame] | 13 | #include "api/rtpreceiverinterface.h" |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 14 | |
| 15 | NS_ASSUME_NONNULL_BEGIN |
| 16 | |
Yura Yaroshevich | 7a16c54 | 2018-07-11 12:55:04 +0300 | [diff] [blame] | 17 | @class RTCPeerConnectionFactory; |
| 18 | |
zhihuang | 4da058c | 2017-02-08 10:41:20 -0800 | [diff] [blame] | 19 | namespace webrtc { |
| 20 | |
| 21 | class RtpReceiverDelegateAdapter : public RtpReceiverObserverInterface { |
| 22 | public: |
| 23 | RtpReceiverDelegateAdapter(RTCRtpReceiver* receiver); |
| 24 | |
| 25 | void OnFirstPacketReceived(cricket::MediaType media_type) override; |
| 26 | |
| 27 | private: |
| 28 | __weak RTCRtpReceiver* receiver_; |
| 29 | }; |
| 30 | |
| 31 | } // namespace webrtc |
| 32 | |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 33 | @interface RTCRtpReceiver () |
| 34 | |
Yves Gerey | 665174f | 2018-06-19 15:03:05 +0200 | [diff] [blame] | 35 | @property(nonatomic, readonly) rtc::scoped_refptr<webrtc::RtpReceiverInterface> nativeRtpReceiver; |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 36 | |
| 37 | /** Initialize an RTCRtpReceiver with a native RtpReceiverInterface. */ |
Yura Yaroshevich | 7a16c54 | 2018-07-11 12:55:04 +0300 | [diff] [blame] | 38 | - (instancetype)initWithFactory:(RTCPeerConnectionFactory*)factory |
| 39 | nativeRtpReceiver:(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 40 | NS_DESIGNATED_INITIALIZER; |
| 41 | |
zhihuang | 4da058c | 2017-02-08 10:41:20 -0800 | [diff] [blame] | 42 | + (RTCRtpMediaType)mediaTypeForNativeMediaType:(cricket::MediaType)nativeMediaType; |
| 43 | |
Steve Anton | 8cb344a | 2018-02-27 15:34:53 -0800 | [diff] [blame] | 44 | + (cricket::MediaType)nativeMediaTypeForMediaType:(RTCRtpMediaType)mediaType; |
| 45 | |
| 46 | + (NSString*)stringForMediaType:(RTCRtpMediaType)mediaType; |
| 47 | |
Taylor Brandstetter | db0cd9e | 2016-05-16 11:40:30 -0700 | [diff] [blame] | 48 | @end |
| 49 | |
| 50 | NS_ASSUME_NONNULL_END |