7#if defined(SUNSHINE_BUILD_CUDA)
19 struct avcodec_encode_device_t;
44typedef struct cudaArray *cudaArray_t;
46 #if !defined(__CUDACC__)
47typedef struct CUstream_st *cudaStream_t;
48typedef unsigned long long cudaTextureObject_t;
50typedef __location__(device_builtin)
struct CUstream_st *cudaStream_t;
51typedef __location__(device_builtin)
unsigned long long cudaTextureObject_t;
58 void operator()(
void *ptr);
61 class freeCudaStream_t {
63 void operator()(cudaStream_t ptr);
66 using ptr_t = std::unique_ptr<void, freeCudaPtr_t>;
67 using stream_t = std::unique_ptr<CUstream_st, freeCudaStream_t>;
69 stream_t make_stream(
int flags = 0);
80 static std::optional<tex_t> make(
int height,
int pitch);
85 tex_t &operator=(tex_t &&other);
89 int copy(std::uint8_t *src,
int height,
int pitch);
94 cudaTextureObject_t point;
95 cudaTextureObject_t linear;
102 sws_t(
int in_width,
int in_height,
int out_width,
int out_height,
int pitch,
int threadsPerBlock, ptr_t &&color_matrix);
110 static std::optional<sws_t> make(
int in_width,
int in_height,
int out_width,
int out_height,
int pitch);
113 int convert_nv12(std::uint8_t *Y, std::uint8_t *UV, std::uint32_t pitchY, std::uint32_t pitchUV, cudaTextureObject_t texture, stream_t::pointer stream);
114 int convert_nv12(std::uint8_t *Y, std::uint8_t *UV, std::uint32_t pitchY, std::uint32_t pitchUV, cudaTextureObject_t texture, stream_t::pointer stream,
const viewport_t &viewport);
115 int convert_yuv444(std::uint8_t *Y, std::uint8_t *U, std::uint8_t *V, std::uint32_t pitch, cudaTextureObject_t texture, stream_t::pointer stream);
116 int convert_yuv444(std::uint8_t *Y, std::uint8_t *U, std::uint8_t *V, std::uint32_t pitch, cudaTextureObject_t texture, stream_t::pointer stream,
const viewport_t &viewport);
std::vector< std::string > display_names(mem_type_e hwdevice_type)
List display names accepted by the selected capture backend.
Definition misc.cpp:1209
std::unique_ptr< platf::avcodec_encode_device_t > make_avcodec_encode_device(int width, int height, bool vram)
Create AVCodec encode device.
Definition cuda.cpp:657
std::unique_ptr< platf::avcodec_encode_device_t > make_avcodec_gl_encode_device(int width, int height, int offset_x, int offset_y)
Create a GL->CUDA encoding device for consuming captured dmabufs.
Definition cuda.cpp:685
std::unique_ptr< platf::deinit_t > init(const std::filesystem::path &persistence_filepath, const config::video_t &video_config)
Initialize the implementation and perform the initial state recovery (if needed).
Definition display_device.cpp:764
util::safe_ptr< T, free< T > > ptr_t
Owning pointer for Avahi allocations released with avahi_free.
Definition publish.cpp:388
Captured frame buffer shared between capture and encode stages.
Definition common.h:502
Sunshine colorimetry values derived from stream configuration.
Definition video_colorspace.h:26
util::safe_ptr< SwsContext, sws_freeContext > sws_t
Owning pointer for an FFmpeg software-scaling context.
Definition video.h:92
Declarations for colorspace functions.