Sunshine master
Self-hosted game stream host for Moonlight.
AVVideo Class Reference

AVFoundation video capture controller used by the macOS backend. More...

#include <src/platform/macos/av_video.h>

Inheritance diagram for AVVideo:
[legend]
Collaboration diagram for AVVideo:
[legend]

Instance Methods

(dispatch_semaphore_t) - capture:
 Run the capture loop for this backend.
 
(id) - initWithDisplay:frameRate:
 Initialize AVFoundation capture for a display and frame rate.
 
(void) - setFrameWidth:frameHeight:
 Set frame width frame height.
 

Protected Types

typedef bool(^) FrameCallbackBlock(CMSampleBufferRef)
 Objective-C block invoked for each captured sample buffer.
 

Properties

NSMapTable< AVCaptureConnection *, FrameCallbackBlock > * captureCallbacks
 Capture callbacks property.
 
NSMapTable< AVCaptureConnection *, dispatch_semaphore_t > * captureSignals
 Capture signals property.
 
CGDirectDisplayID displayID
 Display ID property.
 
int frameHeight
 Frame height property.
 
int frameWidth
 Frame width property.
 
CMTime minFrameDuration
 Min frame duration property.
 
OSType pixelFormat
 Pixel format property.
 
AVCaptureSession * session
 Capture session that owns the active AVFoundation inputs and outputs.
 
NSMapTable< AVCaptureConnection *, AVCaptureVideoDataOutput * > * videoOutputs
 Video outputs property.
 

Detailed Description

AVFoundation video capture controller used by the macOS backend.

Method Documentation

◆ capture:

- (dispatch_semaphore_t) capture: (FrameCallbackBlock) frameCallback

Run the capture loop for this backend.

Parameters
frameCallbackFrame callback.
Returns
Capture status reported to the streaming pipeline.

◆ initWithDisplay:frameRate:

- (id) initWithDisplay: (CGDirectDisplayID) displayID
frameRate: (int) frameRate 

Initialize AVFoundation capture for a display and frame rate.

Parameters
displayIDDisplay ID.
frameRateFrame rate.
Returns
Initialized AVVideo instance, or nil on failure.

◆ setFrameWidth:frameHeight:

- (void) setFrameWidth: (int) frameWidth
frameHeight: (int) frameHeight 

Set frame width frame height.

Parameters
frameWidthFrame width.
frameHeightFrame height.

The documentation for this class was generated from the following files: