7#if defined(SUNSHINE_BUILD_CUDA)
47using cudaArray_t =
struct cudaArray *;
49 #if !defined(__CUDACC__)
53using cudaStream_t =
struct CUstream_st *;
57using cudaTextureObject_t =
unsigned long long;
59typedef __location__(device_builtin)
struct CUstream_st *cudaStream_t;
60typedef __location__(device_builtin)
unsigned long long cudaTextureObject_t;
67 void operator()(
void *ptr);
70 class freeCudaStream_t {
72 void operator()(cudaStream_t ptr);
75 using ptr_t = std::unique_ptr<void, freeCudaPtr_t>;
76 using stream_t = std::unique_ptr<CUstream_st, freeCudaStream_t>;
78 stream_t make_stream(
int flags = 0);
89 static std::optional<tex_t> make(
int height,
int pitch);
94 tex_t &operator=(tex_t &&other);
98 int copy(std::uint8_t *src,
int height,
int pitch);
106 cudaTextureObject_t point;
107 cudaTextureObject_t
linear;
116 sws_t(
int in_width,
int in_height,
int out_width,
int out_height,
int pitch,
int threadsPerBlock, ptr_t &&color_matrix);
124 static std::optional<sws_t> make(
int in_width,
int in_height,
int out_width,
int out_height,
int pitch);
127 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);
128 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);
129 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);
130 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);
132 void apply_colorspace(
const video::sunshine_colorspace_t &colorspace);
134 int load_ram(platf::img_t &img, cudaArray_t array);
std::vector< std::string > display_names(mem_type_e hwdevice_type)
List display names accepted by the selected capture backend.
Definition misc.cpp:1312
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:655
int init()
Map CUDA graphics resources for use as an image.
Definition cuda.cpp:143
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:683
@ linear
Linear scRGB input; apply the sRGB curve.
Definition display.h:194
util::safe_ptr< T, free< T > > ptr_t
Owning pointer for Avahi allocations released with avahi_free.
Definition publish.cpp:386
AVCodec-backed encode device and frame state.
Definition common.h:594
Captured frame buffer shared between capture and encode stages.
Definition common.h:530
util::safe_ptr< SwsContext, &sws_freeContext > sws_t
Owning pointer for an FFmpeg software-scaling context released with sws_freeContext().
Definition video.h:120
Declarations for colorspace functions.
@ copy
Ask for a frame now.
Definition wayland.h:104