ZMVideoSDKVideoSourceHelper.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. #import <Foundation/Foundation.h>
  2. /**
  3. @brief YUV process data information interface.
  4. */
  5. @interface ZMVideoSDKYUVProcessDataI420 : NSObject
  6. /**
  7. @brief Get the stream width.
  8. */
  9. @property (nonatomic, assign, readonly) unsigned int width;
  10. /**
  11. @brief Get the stream height.
  12. */
  13. @property (nonatomic, assign, readonly) unsigned int height;
  14. /**
  15. @brief Get the Y stride.
  16. */
  17. @property (nonatomic, assign, readonly) unsigned int yStride;
  18. /**
  19. @brief Get the U stride.
  20. */
  21. @property (nonatomic, assign, readonly) unsigned int uStride;
  22. /**
  23. @brief Get the V stride.
  24. */
  25. @property (nonatomic, assign, readonly) unsigned int vStride;
  26. /**
  27. @brief Get the video raw data rotation.
  28. */
  29. @property (nonatomic, assign, readonly) unsigned int rotation;
  30. /**
  31. @brief Determine if video raw data is limited.
  32. */
  33. @property (nonatomic, assign, readonly) BOOL isLimitedI420;
  34. /**
  35. @brief Get the YUVI420 Y buffer.
  36. @param lineNum The Y component represents the luma or brightness value of the color.
  37. @return Y buffer.
  38. */
  39. - (char*)getYBuffer:(unsigned int)lineNum;
  40. /**
  41. @brief Get the YUVI420 U.
  42. @param lineNum The U component represents the chroma value.
  43. @return U buffer.
  44. */
  45. - (char*)getUBuffer:(unsigned int)lineNum;
  46. /**
  47. @brief Get the YUVI420 V buffer.
  48. @param lineNum The V component represents the chroma value.
  49. @return V buffer.
  50. */
  51. - (char*)getVBuffer:(unsigned int)lineNum;
  52. @end
  53. /**
  54. @brief Video source preprocessor sink interface.
  55. */
  56. @protocol ZMVideoSDKVideoSourcePreProcessor <NSObject>
  57. /**
  58. @brief Callback on device capture video frame.
  59. @param rawData It is a pointer of YUV process data I420 object.
  60. */
  61. - (void)onPreProcessRawData:(ZMVideoSDKYUVProcessDataI420*)rawData;
  62. @end
  63. /**
  64. @brief Video raw data sender interface.
  65. */
  66. @interface ZMVideoSDKVideoSender : NSObject
  67. /**
  68. @brief For user to send video raw data.
  69. @param frameBuffer YUVI420 buffer.
  70. @param width The width of buffer size.
  71. @param height The height of buffer size.
  72. @param frameLength The lenght of buffer.
  73. @param rotation The rotation of buffer.
  74. */
  75. - (void)sendVideoFrame:(char*)frameBuffer width:(int)width height:(int)height frameLength:(int)frameLength rotation:(int)rotation DEPRECATED_MSG_ATTRIBUTE("Use -sendVideoFrame: width: height: frameLength: rotation: format: instead");
  76. /**
  77. @brief For user to send video raw data.
  78. @param frameBuffer YUVI420 buffer.
  79. @param width The width of buffer size.
  80. @param height The height of buffer size.
  81. @param frameLength The lenght of buffer.
  82. @param rotation The rotation of buffer.
  83. @param format Raw data format.
  84. */
  85. - (void)sendVideoFrame:(char*)frameBuffer width:(int)width height:(int)height frameLength:(int)frameLength rotation:(int)rotation format:(ZMVideoSDKFrameDataFormat)format;
  86. @end
  87. /**
  88. @brief Some infomation about video capability.
  89. */
  90. @interface ZMVideoSDKVideoCapability : NSObject
  91. /**
  92. @brief Width of video capability.
  93. */
  94. @property(nonatomic, assign) int width;
  95. /**
  96. @brief Height of video capability.
  97. */
  98. @property(nonatomic, assign) int height;
  99. /**
  100. @brief Frame of video capability.
  101. */
  102. @property(nonatomic, assign) int frame;
  103. /**
  104. @brief Video source data mode.
  105. */
  106. @property(nonatomic, assign) ZMVideoSDKVideoSourceDataMode dataMode;
  107. @end
  108. /**
  109. @brief Video source sink interface.
  110. */
  111. @protocol ZMVideoSDKVideoSource <NSObject>
  112. /**
  113. @brief Notify when video source prepare.
  114. @param sender The pointer of video sender object.
  115. @param supportedCapList The list of supported video capability.
  116. @param suggestCap Suggest video capability.
  117. */
  118. - (void)onInitialize:(ZMVideoSDKVideoSender*)sender supportedCapbilityList:(NSArray<ZMVideoSDKVideoCapability *>*)supportedCapList suggestCapbility:(ZMVideoSDKVideoCapability*)suggestCap;
  119. /**
  120. @brief Notify when video size or fps changed.
  121. @param supportedCapList The list of supported video capability.
  122. @param suggestCap Suggest video capability.
  123. */
  124. - (void)onPropertyChange:(NSArray<ZMVideoSDKVideoCapability *>*)supportedCapList suggestCapbility:(ZMVideoSDKVideoCapability*)suggestCap;
  125. /**
  126. @brief Notify when video start send raw data.
  127. */
  128. - (void)onStartSend;
  129. /**
  130. @brief Notify when video stop send raw data.
  131. */
  132. - (void)onStopSend;
  133. /**
  134. @brief Notify when video source uninitialized.
  135. */
  136. - (void)onUninitialized;
  137. @end