RTCRtpReceiver+Private.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #import "RTCRtpReceiver.h"
  11. #include "api/rtp_receiver_interface.h"
  12. NS_ASSUME_NONNULL_BEGIN
  13. @class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
  14. namespace webrtc {
  15. class RtpReceiverDelegateAdapter : public RtpReceiverObserverInterface {
  16. public:
  17. RtpReceiverDelegateAdapter(RTC_OBJC_TYPE(RTCRtpReceiver) * receiver);
  18. void OnFirstPacketReceived(cricket::MediaType media_type) override;
  19. private:
  20. __weak RTC_OBJC_TYPE(RTCRtpReceiver) * receiver_;
  21. };
  22. } // namespace webrtc
  23. @interface RTC_OBJC_TYPE (RTCRtpReceiver)
  24. ()
  25. @property(nonatomic,
  26. readonly) rtc::scoped_refptr<webrtc::RtpReceiverInterface> nativeRtpReceiver;
  27. /** Initialize an RTCRtpReceiver with a native RtpReceiverInterface. */
  28. - (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
  29. nativeRtpReceiver:(rtc::scoped_refptr<webrtc::RtpReceiverInterface>)nativeRtpReceiver
  30. NS_DESIGNATED_INITIALIZER;
  31. + (RTCRtpMediaType)mediaTypeForNativeMediaType:(cricket::MediaType)nativeMediaType;
  32. + (cricket::MediaType)nativeMediaTypeForMediaType:(RTCRtpMediaType)mediaType;
  33. + (NSString*)stringForMediaType:(RTCRtpMediaType)mediaType;
  34. @end
  35. NS_ASSUME_NONNULL_END