Sunshine latest
Self-hosted game stream host for Moonlight.
av_video.h
Go to the documentation of this file.
1
5#pragma once
6
7// platform includes
8#import <AppKit/AppKit.h>
9#import <AVFoundation/AVFoundation.h>
10
12 AVCaptureVideoDataOutput *output;
13 NSCondition *captureStopped;
14};
15
16@interface AVVideo: NSObject <AVCaptureVideoDataOutputSampleBufferDelegate>
17
18#define kMaxDisplays 32
19
20@property (nonatomic, assign) CGDirectDisplayID displayID;
21@property (nonatomic, assign) CMTime minFrameDuration;
22@property (nonatomic, assign) OSType pixelFormat;
23@property (nonatomic, assign) int frameWidth;
24@property (nonatomic, assign) int frameHeight;
25
26typedef bool (^FrameCallbackBlock)(CMSampleBufferRef);
27
28@property (nonatomic, assign) AVCaptureSession *session;
29@property (nonatomic, assign) NSMapTable<AVCaptureConnection *, AVCaptureVideoDataOutput *> *videoOutputs;
30@property (nonatomic, assign) NSMapTable<AVCaptureConnection *, FrameCallbackBlock> *captureCallbacks;
31@property (nonatomic, assign) NSMapTable<AVCaptureConnection *, dispatch_semaphore_t> *captureSignals;
32
33+ (NSArray<NSDictionary *> *)displayNames;
34+ (NSString *)getDisplayName:(CGDirectDisplayID)displayID;
35
36- (id)initWithDisplay:(CGDirectDisplayID)displayID frameRate:(int)frameRate;
37
38- (void)setFrameWidth:(int)frameWidth frameHeight:(int)frameHeight;
39- (dispatch_semaphore_t)capture:(FrameCallbackBlock)frameCallback;
40
41@end
Definition av_video.h:16
Definition av_video.h:11