RTCVideoCodecH264.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * Copyright 2017 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 <WebRTC/RTCMacros.h>
  12. #import <WebRTC/RTCVideoCodecFactory.h>
  13. /** Class for H264 specific config. */
  14. typedef NS_ENUM(NSUInteger, RTCH264PacketizationMode) {
  15. RTCH264PacketizationModeNonInterleaved = 0, // Mode 1 - STAP-A, FU-A is allowed
  16. RTCH264PacketizationModeSingleNalUnit // Mode 0 - only single NALU allowed
  17. };
  18. RTC_EXPORT
  19. @interface RTCCodecSpecificInfoH264 : NSObject <RTCCodecSpecificInfo>
  20. @property(nonatomic, assign) RTCH264PacketizationMode packetizationMode;
  21. @end
  22. /** H264 Profiles and levels. */
  23. typedef NS_ENUM(NSUInteger, RTCH264Profile) {
  24. RTCH264ProfileConstrainedBaseline,
  25. RTCH264ProfileBaseline,
  26. RTCH264ProfileMain,
  27. RTCH264ProfileConstrainedHigh,
  28. RTCH264ProfileHigh,
  29. };
  30. typedef NS_ENUM(NSUInteger, RTCH264Level) {
  31. RTCH264Level1_b = 0,
  32. RTCH264Level1 = 10,
  33. RTCH264Level1_1 = 11,
  34. RTCH264Level1_2 = 12,
  35. RTCH264Level1_3 = 13,
  36. RTCH264Level2 = 20,
  37. RTCH264Level2_1 = 21,
  38. RTCH264Level2_2 = 22,
  39. RTCH264Level3 = 30,
  40. RTCH264Level3_1 = 31,
  41. RTCH264Level3_2 = 32,
  42. RTCH264Level4 = 40,
  43. RTCH264Level4_1 = 41,
  44. RTCH264Level4_2 = 42,
  45. RTCH264Level5 = 50,
  46. RTCH264Level5_1 = 51,
  47. RTCH264Level5_2 = 52
  48. };
  49. RTC_EXPORT
  50. @interface RTCH264ProfileLevelId : NSObject
  51. @property(nonatomic, readonly) RTCH264Profile profile;
  52. @property(nonatomic, readonly) RTCH264Level level;
  53. @property(nonatomic, readonly) NSString *hexString;
  54. - (instancetype)initWithHexString:(NSString *)hexString;
  55. - (instancetype)initWithProfile:(RTCH264Profile)profile level:(RTCH264Level)level;
  56. @end
  57. /** Encoder. */
  58. RTC_EXPORT
  59. @interface RTCVideoEncoderH264 : NSObject <RTCVideoEncoder>
  60. - (instancetype)initWithCodecInfo:(RTCVideoCodecInfo *)codecInfo;
  61. @end
  62. /** Decoder. */
  63. RTC_EXPORT
  64. @interface RTCVideoDecoderH264 : NSObject <RTCVideoDecoder>
  65. @end
  66. /** Encoder factory. */
  67. RTC_EXPORT
  68. @interface RTCVideoEncoderFactoryH264 : NSObject <RTCVideoEncoderFactory>
  69. @end
  70. /** Decoder factory. */
  71. RTC_EXPORT
  72. @interface RTCVideoDecoderFactoryH264 : NSObject <RTCVideoDecoderFactory>
  73. @end