Sunshine latest
Self-hosted game stream host for Moonlight.
video.h File Reference

Declarations for video. More...

#include "input.h"
#include "platform/common.h"
#include "thread_safe.h"
#include "video_colorspace.h"
#include <libavcodec/avcodec.h>
#include <libswscale/swscale.h>
Include dependency graph for video.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  video::encoder_t::codec_t
 
struct  video::config_t
 
struct  video::encode_session_t
 
struct  video::encoder_platform_formats_avcodec
 
struct  video::encoder_platform_formats_nvenc
 
struct  video::encoder_platform_formats_t
 
struct  video::encoder_t
 
struct  video::hdr_info_raw_t
 
struct  video::encoder_t::option_t
 
struct  video::packet_raw_avcodec
 
struct  video::packet_raw_generic
 
struct  video::packet_raw_t
 
struct  video::packet_raw_t::replace_t
 

Macros

#define _CONVERT(x)
 

Typedefs

using video::avcodec_buffer_t = util::safe_ptr<AVBufferRef, free_buffer>
 
using video::avcodec_ctx_t = util::safe_ptr<AVCodecContext, free_ctx>
 
using video::avcodec_frame_t = util::safe_ptr<AVFrame, free_frame>
 
using video::hdr_info_t = std::unique_ptr<hdr_info_raw_t>
 
using video::img_event_t = std::shared_ptr<safe::event_t<std::shared_ptr<platf::img_t>>>
 
using video::packet_t = std::unique_ptr<packet_raw_t>
 
using video::sws_t = util::safe_ptr<SwsContext, sws_freeContext>
 

Functions

void video::capture (safe::mail_t mail, config_t config, void *channel_data)
 
void video::free_buffer (AVBufferRef *ref)
 
void video::free_ctx (AVCodecContext *ctx)
 
void video::free_frame (AVFrame *frame)
 
platf::mem_type_e video::map_base_dev_type (AVHWDeviceType type)
 
platf::pix_fmt_e video::map_pix_fmt (AVPixelFormat fmt)
 
int video::probe_encoders ()
 Probe encoders and select the preferred encoder. This is called once at startup and each time a stream is launched to ensure the best encoder is selected. Encoder availability can change at runtime due to all sorts of things from driver updates to eGPUs.
 
bool video::validate_encoder (encoder_t &encoder, bool expect_failure)
 

Detailed Description

Declarations for video.

Macro Definition Documentation

◆ _CONVERT

#define _CONVERT ( x)
Value:
case flag_e::x: \
return std::string_view(#x)

Function Documentation

◆ probe_encoders()

int video::probe_encoders ( )

Probe encoders and select the preferred encoder. This is called once at startup and each time a stream is launched to ensure the best encoder is selected. Encoder availability can change at runtime due to all sorts of things from driver updates to eGPUs.

Warning
This is only safe to call when there is no client actively streaming.