RTCMTLVideoView.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * Copyright 2017 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 <Foundation/Foundation.h>
  11. #import "RTCMacros.h"
  12. #import "RTCVideoFrame.h"
  13. #import "RTCVideoRenderer.h"
  14. NS_ASSUME_NONNULL_BEGIN
  15. /**
  16. * RTCMTLVideoView is thin wrapper around MTKView.
  17. *
  18. * It has id<RTCVideoRenderer> property that renders video frames in the view's
  19. * bounds using Metal.
  20. * NOTE: always check if metal is available on the running device via
  21. * RTC_SUPPORTS_METAL macro before initializing this class.
  22. */
  23. NS_CLASS_AVAILABLE_IOS(9)
  24. RTC_OBJC_EXPORT
  25. @interface RTC_OBJC_TYPE (RTCMTLVideoView) : UIView<RTC_OBJC_TYPE(RTCVideoRenderer)>
  26. @property(nonatomic, weak) id<RTC_OBJC_TYPE(RTCVideoViewDelegate)> delegate;
  27. @property(nonatomic) UIViewContentMode videoContentMode;
  28. /** @abstract Enables/disables rendering.
  29. */
  30. @property(nonatomic, getter=isEnabled) BOOL enabled;
  31. /** @abstract Wrapped RTCVideoRotation, or nil.
  32. */
  33. @property(nonatomic, nullable) NSValue* rotationOverride;
  34. @end
  35. NS_ASSUME_NONNULL_END