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