RTCMediaStreamTrack+Private.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * Copyright 2015 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 "RTCMediaStreamTrack.h"
  11. #include "api/media_stream_interface.h"
  12. typedef NS_ENUM(NSInteger, RTCMediaStreamTrackType) {
  13. RTCMediaStreamTrackTypeAudio,
  14. RTCMediaStreamTrackTypeVideo,
  15. };
  16. NS_ASSUME_NONNULL_BEGIN
  17. @class RTC_OBJC_TYPE(RTCPeerConnectionFactory);
  18. @interface RTC_OBJC_TYPE (RTCMediaStreamTrack)
  19. ()
  20. @property(nonatomic, readonly) RTC_OBJC_TYPE(RTCPeerConnectionFactory) *
  21. factory;
  22. /**
  23. * The native MediaStreamTrackInterface passed in or created during
  24. * construction.
  25. */
  26. @property(nonatomic, readonly) rtc::scoped_refptr<webrtc::MediaStreamTrackInterface> nativeTrack;
  27. /**
  28. * Initialize an RTCMediaStreamTrack from a native MediaStreamTrackInterface.
  29. */
  30. - (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
  31. nativeTrack:(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack
  32. type:(RTCMediaStreamTrackType)type NS_DESIGNATED_INITIALIZER;
  33. - (instancetype)initWithFactory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory
  34. nativeTrack:(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack;
  35. - (BOOL)isEqualToTrack:(RTC_OBJC_TYPE(RTCMediaStreamTrack) *)track;
  36. + (webrtc::MediaStreamTrackInterface::TrackState)nativeTrackStateForState:
  37. (RTCMediaStreamTrackState)state;
  38. + (RTCMediaStreamTrackState)trackStateForNativeState:
  39. (webrtc::MediaStreamTrackInterface::TrackState)nativeState;
  40. + (NSString *)stringForState:(RTCMediaStreamTrackState)state;
  41. + (RTC_OBJC_TYPE(RTCMediaStreamTrack) *)
  42. mediaTrackForNativeTrack:(rtc::scoped_refptr<webrtc::MediaStreamTrackInterface>)nativeTrack
  43. factory:(RTC_OBJC_TYPE(RTCPeerConnectionFactory) *)factory;
  44. @end
  45. NS_ASSUME_NONNULL_END