blob: 06154950357d171e4a80e9dc25cc794a0ae88a43 [file] [log] [blame]
denicija070d5e32017-02-26 11:44:13 -08001/*
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
11#import <Foundation/Foundation.h>
12
Peter Hanspers5daaf7d2018-06-01 10:34:37 +020013#import "WebRTC/RTCVideoFrame.h"
denicija070d5e32017-02-26 11:44:13 -080014#import "WebRTC/RTCVideoRenderer.h"
15
kthelgasona2fb30c2017-03-09 03:34:27 -080016// Check if metal is supported in WebRTC.
17// NOTE: Currently arm64 == Metal.
18#if defined(__aarch64__)
19#define RTC_SUPPORTS_METAL
20#endif
21
denicija070d5e32017-02-26 11:44:13 -080022NS_ASSUME_NONNULL_BEGIN
denicija070d5e32017-02-26 11:44:13 -080023
24/**
25 * RTCMTLVideoView is thin wrapper around MTKView.
26 *
27 * It has id<RTCVideoRenderer> property that renders video frames in the view's
28 * bounds using Metal.
denicijad2088152017-04-28 02:14:54 -070029 * NOTE: always check if metal is available on the running device via
30 * RTC_SUPPORTS_METAL macro before initializing this class.
denicija070d5e32017-02-26 11:44:13 -080031 */
32NS_CLASS_AVAILABLE_IOS(9)
kthelgasona2fb30c2017-03-09 03:34:27 -080033
34RTC_EXPORT
Yves Gerey665174f2018-06-19 15:03:05 +020035@interface RTCMTLVideoView : UIView<RTCVideoRenderer>
Kári Tristan Helgason4049a252018-04-20 17:33:32 +020036
Kári Tristan Helgason06d094f2018-04-19 17:38:05 +020037@property(nonatomic, weak) id<RTCVideoViewDelegate> delegate;
Kári Tristan Helgason4049a252018-04-20 17:33:32 +020038
Peter Hanspers5daaf7d2018-06-01 10:34:37 +020039@property(nonatomic) UIViewContentMode videoContentMode;
40
41/** @abstract Enables/disables rendering.
42 */
43@property(nonatomic, getter=isEnabled) BOOL enabled;
44
45/** @abstract Wrapped RTCVideoRotation, or nil.
46 */
Peter Hanspers7c32c862018-06-14 14:12:45 +020047@property(nonatomic, nullable) NSValue* rotationOverride;
Kári Tristan Helgason4049a252018-04-20 17:33:32 +020048
denicija070d5e32017-02-26 11:44:13 -080049@end
Kári Tristan Helgason06d094f2018-04-19 17:38:05 +020050
denicija070d5e32017-02-26 11:44:13 -080051NS_ASSUME_NONNULL_END