blob: e279b098b55ac7cb35503f3e6df913b0b360f83b [file] [log] [blame]
denicijad2088152017-04-28 02:14:54 -07001/*
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#if TARGET_OS_IPHONE
13#import <UIKit/UIKit.h>
14#else
15#import <AppKit/AppKit.h>
16#endif
17
18#import "WebRTC/RTCVideoFrame.h"
19
20NS_ASSUME_NONNULL_BEGIN
21/**
22 * Protocol defining ability to render RTCVideoFrame in Metal enabled views.
23 */
24@protocol RTCMTLRenderer<NSObject>
25
26/**
27 * Method to be implemented to perform actual rendering of the provided frame.
28 *
29 * @param frame The frame to be rendered.
30 */
31- (void)drawFrame:(RTCVideoFrame *)frame;
32
33/**
34 * Sets the provided view as rendering destination if possible.
35 *
36 * If not possible method returns NO and callers of the method are responisble for performing
37 * cleanups.
38 */
39
40#if TARGET_OS_IOS
41- (BOOL)addRenderingDestination:(__kindof UIView *)view;
42#else
43- (BOOL)addRenderingDestination:(__kindof NSView *)view;
44#endif
45
46@end
47
48/**
JT Teha4888f02018-05-30 16:45:36 +000049 * Implementation of RTCMTLRenderer protocol for rendering native nv12 video frames.
denicijad2088152017-04-28 02:14:54 -070050 */
51NS_AVAILABLE(10_11, 9_0)
52@interface RTCMTLRenderer : NSObject<RTCMTLRenderer>
denicijad2088152017-04-28 02:14:54 -070053@end
54
55NS_ASSUME_NONNULL_END