RTCYUVPlanarBuffer.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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 RTCYUVPlanarBuffer <RTCVideoFrameBuffer>
  17. @property(nonatomic, readonly) int chromaWidth;
  18. @property(nonatomic, readonly) int chromaHeight;
  19. @property(nonatomic, readonly) const uint8_t *dataY;
  20. @property(nonatomic, readonly) const uint8_t *dataU;
  21. @property(nonatomic, readonly) const uint8_t *dataV;
  22. @property(nonatomic, readonly) int strideY;
  23. @property(nonatomic, readonly) int strideU;
  24. @property(nonatomic, readonly) int strideV;
  25. - (instancetype)initWithWidth:(int)width
  26. height:(int)height
  27. dataY:(const uint8_t *)dataY
  28. dataU:(const uint8_t *)dataU
  29. dataV:(const uint8_t *)dataV;
  30. - (instancetype)initWithWidth:(int)width height:(int)height;
  31. - (instancetype)initWithWidth:(int)width
  32. height:(int)height
  33. strideY:(int)strideY
  34. strideU:(int)strideU
  35. strideV:(int)strideV;
  36. @end
  37. NS_ASSUME_NONNULL_END