TUICommonDefine.h 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. //
  2. // TUICommonDefine.h
  3. // TUICallEngine
  4. //
  5. // Created by noah on 2022/8/4.
  6. // Copyright © 2022 Tencent. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. #import <TUICallEngine/TUILog.h>
  10. typedef NS_ENUM(NSUInteger, TUIAudioPlaybackDevice) {
  11. TUIAudioPlaybackDeviceSpeakerphone,
  12. TUIAudioPlaybackDeviceEarpiece,
  13. };
  14. typedef NS_ENUM(NSUInteger, TUICamera) {
  15. TUICameraFront,
  16. TUICameraBack,
  17. };
  18. typedef NS_ENUM(NSInteger, TUINetworkQuality) {
  19. TUINetworkQualityUnknown,
  20. TUINetworkQualityExcellent,
  21. TUINetworkQualityGood,
  22. TUINetworkQualityPoor,
  23. TUINetworkQualityBad,
  24. TUINetworkQualityVbad,
  25. TUINetworkQualityDown,
  26. };
  27. typedef NS_ENUM(NSInteger, TUIVideoRenderParamsFillMode) {
  28. /// Fill mode: the video image will be centered and scaled to fill the entire display area, where parts that exceed the area will be cropped. The displayed image may be incomplete in this mode.
  29. TUIVideoRenderParamsFillModeFill = 0,
  30. /// Fit mode: the video image will be scaled based on its long side to fit the display area, where the short side will be filled with black bars. The displayed image is complete in this mode, but there may be black bars.
  31. TUIVideoRenderParamsFillModeFit = 1,
  32. };
  33. typedef NS_ENUM(NSInteger, TUIVideoRenderParamsRotation) {
  34. /// No rotation
  35. TUIVideoRenderParamsRotation_0 = 0,
  36. /// Clockwise rotation by 90 degrees
  37. TUIVideoRenderParamsRotation_90 = 1,
  38. /// Clockwise rotation by 180 degrees
  39. TUIVideoRenderParamsRotation_180 = 2,
  40. /// Clockwise rotation by 270 degrees
  41. TUIVideoRenderParamsRotation_270 = 3,
  42. };
  43. typedef NS_ENUM(NSInteger, TUIVideoEncoderParamsResolutionMode) {
  44. /// Landscape resolution, such as 640_360 + Landscape = 640x360.
  45. TUIVideoEncoderParamsResolutionModeLandscape = 0,
  46. /// Portrait resolution, such as 640_360 + Portrait = 360x640.
  47. TUIVideoEncoderParamsResolutionModePortrait = 1,
  48. };
  49. typedef NS_ENUM(NSInteger, TUIVideoEncoderParamsResolution) {
  50. /// Aspect ratio: 4:3; resolution: 640x480; recommended bitrate (VideoCall): 600 Kbps;
  51. TUIVideoEncoderParamsResolution_640_480 = 62,
  52. /// Aspect ratio: 4:3; resolution: 960x720; recommended bitrate (VideoCall): 1000 Kbps;
  53. TUIVideoEncoderParamsResolution_960_720 = 64,
  54. /// Aspect ratio: 16:9; resolution: 640x360; recommended bitrate (VideoCall): 500 Kbps;
  55. TUIVideoEncoderParamsResolution_640_360 = 108,
  56. /// Aspect ratio: 16:9; resolution: 960x540; recommended bitrate (VideoCall): 850 Kbps;
  57. TUIVideoEncoderParamsResolution_960_540 = 110,
  58. /// Aspect ratio: 16:9; resolution: 1280x720; recommended bitrate (VideoCall): 1200 Kbps;
  59. TUIVideoEncoderParamsResolution_1280_720 = 112,
  60. /// Aspect ratio: 16:9; resolution: 1920x1080; recommended bitrate (VideoCall): 2000 Kbps;
  61. TUIVideoEncoderParamsResolution_1920_1080 = 114,
  62. };
  63. NS_ASSUME_NONNULL_BEGIN
  64. @interface TUIRoomId : NSObject
  65. @property(nonatomic, assign) UInt32 intRoomId;
  66. @property(nonatomic, copy) NSString *strRoomId;
  67. @end
  68. @interface TUINetworkQualityInfo : NSObject
  69. @property(nonatomic, copy, nullable) NSString *userId;
  70. @property(nonatomic, assign) TUINetworkQuality quality;
  71. @end
  72. @interface TUIVideoView : UIView
  73. @end
  74. @interface TUIVideoRenderParams : NSObject
  75. @property(nonatomic, assign) TUIVideoRenderParamsFillMode fillMode;
  76. @property(nonatomic, assign) TUIVideoRenderParamsRotation rotation;
  77. @end
  78. @interface TUIVideoEncoderParams : NSObject
  79. @property(nonatomic, assign) TUIVideoEncoderParamsResolution resolution;
  80. @property(nonatomic, assign) TUIVideoEncoderParamsResolutionMode resolutionMode;
  81. @end
  82. NS_ASSUME_NONNULL_END