Sunshine master
Self-hosted game stream host for Moonlight.
vaapi.h File Reference

Declarations for VA-API hardware accelerated capture. More...

#include "misc.h"
#include "src/platform/common.h"
Include dependency graph for vaapi.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::unique_ptr< platf::avcodec_encode_device_tva::make_avcodec_encode_device (int width, int height, bool vram)
 
std::unique_ptr< platf::avcodec_encode_device_tva::make_avcodec_encode_device (int width, int height, file_t &&card, int offset_x, int offset_y, bool vram)
 Create AVCodec encode device.
 
std::unique_ptr< platf::avcodec_encode_device_tva::make_avcodec_encode_device (int width, int height, int offset_x, int offset_y, bool vram)
 Create AVCodec encode device.
 
bool va::validate (int fd)
 Validate that the configured VAAPI device can be used.
 

Detailed Description

Declarations for VA-API hardware accelerated capture.

Function Documentation

◆ make_avcodec_encode_device() [1/3]

std::unique_ptr< platf::avcodec_encode_device_t > va::make_avcodec_encode_device ( int width,
int height,
bool vram )

Width --> Width of the image Height --> Height of the image offset_x --> Horizontal offset of the image in the texture offset_y --> Vertical offset of the image in the texture file_t card --> The file descriptor of the render device used for encoding

Parameters
widthFrame or display width in pixels.
heightFrame or display height in pixels.
vramWhether the image should use GPU memory instead of system memory.
Returns
Constructed AVCodec encode device object.

◆ make_avcodec_encode_device() [2/3]

std::unique_ptr< platf::avcodec_encode_device_t > va::make_avcodec_encode_device ( int width,
int height,
file_t && card,
int offset_x,
int offset_y,
bool vram )

Create AVCodec encode device.

Parameters
widthFrame or display width in pixels.
heightFrame or display height in pixels.
cardVideo device path or render node used for VAAPI.
offset_xOffset x.
offset_yOffset y.
vramWhether the image should use GPU memory instead of system memory.
Returns
Constructed AVCodec encode device object.

◆ make_avcodec_encode_device() [3/3]

std::unique_ptr< platf::avcodec_encode_device_t > va::make_avcodec_encode_device ( int width,
int height,
int offset_x,
int offset_y,
bool vram )

Create AVCodec encode device.

Parameters
widthFrame or display width in pixels.
heightFrame or display height in pixels.
offset_xOffset x.
offset_yOffset y.
vramWhether the image should use GPU memory instead of system memory.
Returns
Constructed AVCodec encode device object.

◆ validate()

bool va::validate ( int fd)

Validate that the configured VAAPI device can be used.

Parameters
fdNative file descriptor to wrap or inspect.
Returns
True when the VAAPI device is usable for capture or encode.