RTCYUVPlanarBuffer.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright 2018 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 <AVFoundation/AVFoundation.h>
  11. #import "RTCMacros.h"
  12. #import "RTCVideoFrameBuffer.h"
  13. NS_ASSUME_NONNULL_BEGIN
  14. /** Protocol for RTCVideoFrameBuffers containing YUV planar data. */
  15. RTC_OBJC_EXPORT
  16. @protocol RTC_OBJC_TYPE
  17. (RTCYUVPlanarBuffer)<RTC_OBJC_TYPE(RTCVideoFrameBuffer)>
  18. @property(nonatomic, readonly) int chromaWidth;
  19. @property(nonatomic, readonly) int chromaHeight;
  20. @property(nonatomic, readonly) const uint8_t *dataY;
  21. @property(nonatomic, readonly) const uint8_t *dataU;
  22. @property(nonatomic, readonly) const uint8_t *dataV;
  23. @property(nonatomic, readonly) int strideY;
  24. @property(nonatomic, readonly) int strideU;
  25. @property(nonatomic, readonly) int strideV;
  26. - (instancetype)initWithWidth:(int)width
  27. height:(int)height
  28. dataY:(const uint8_t *)dataY
  29. dataU:(const uint8_t *)dataU
  30. dataV:(const uint8_t *)dataV;
  31. - (instancetype)initWithWidth:(int)width height:(int)height;
  32. - (instancetype)initWithWidth:(int)width
  33. height:(int)height
  34. strideY:(int)strideY
  35. strideU:(int)strideU
  36. strideV:(int)strideV;
  37. @end
  38. NS_ASSUME_NONNULL_END