RTCSessionDescription.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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 <Foundation/Foundation.h>
  11. #import "RTCMacros.h"
  12. /**
  13. * Represents the session description type. This exposes the same types that are
  14. * in C++, which doesn't include the rollback type that is in the W3C spec.
  15. */
  16. typedef NS_ENUM(NSInteger, RTCSdpType) {
  17. RTCSdpTypeOffer,
  18. RTCSdpTypePrAnswer,
  19. RTCSdpTypeAnswer,
  20. RTCSdpTypeRollback,
  21. };
  22. NS_ASSUME_NONNULL_BEGIN
  23. RTC_OBJC_EXPORT
  24. @interface RTC_OBJC_TYPE (RTCSessionDescription) : NSObject
  25. /** The type of session description. */
  26. @property(nonatomic, readonly) RTCSdpType type;
  27. /** The SDP string representation of this session description. */
  28. @property(nonatomic, readonly) NSString *sdp;
  29. - (instancetype)init NS_UNAVAILABLE;
  30. /** Initialize a session description with a type and SDP string. */
  31. - (instancetype)initWithType:(RTCSdpType)type sdp:(NSString *)sdp NS_DESIGNATED_INITIALIZER;
  32. + (NSString *)stringForType:(RTCSdpType)type;
  33. + (RTCSdpType)typeForString:(NSString *)string;
  34. @end
  35. NS_ASSUME_NONNULL_END