2
0

WFCUI420VideoFrame.h 927 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // WFCUI420VideoFrame.h
  3. // WFChatUIKit
  4. //
  5. // Created by Rain on 2022/10/13.
  6. // Copyright © 2022 Wildfirechat. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import <CoreMedia/CMSampleBuffer.h>
  10. NS_ASSUME_NONNULL_BEGIN
  11. @interface WFCUI420VideoFrame : NSObject
  12. @property (nonatomic, readonly) int width;
  13. @property (nonatomic, readonly) int height;
  14. @property (nonatomic, readonly) int dataLength;
  15. @property (nonatomic, readonly) UInt8 *data;
  16. @property (nonatomic, readonly) UInt8 *dataOfPlaneY;
  17. @property (nonatomic, readonly) UInt8 *dataOfPlaneU;
  18. @property (nonatomic, readonly) UInt8 *dataOfPlaneV;
  19. @property (nonatomic, readonly) int strideY;
  20. @property (nonatomic, readonly) int strideU;
  21. @property (nonatomic, readonly) int strideV;
  22. - (NSData *)toBytes;
  23. - (void)fromBytes:(NSData *)data;
  24. - (id)initWithWidth:(int)width height:(int)height;
  25. - (CVPixelBufferRef)toPixelBuffer;
  26. @end
  27. NS_ASSUME_NONNULL_END