Sunshine0.0.5917
Sunshine 0.0.5917
Self-hosted game stream host for Moonlight.
Loading...
Searching...
No Matches
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <array>
9#include <optional>
10#include <string_view>
11
12// lib includes
13#include <glad/egl.h>
14#include <glad/gl.h>
15
16// local includes
17#include "misc.h"
18#include "src/logging.h"
19#include "src/platform/common.h"
20#include "src/utility.h"
22
27#define SUNSHINE_STRINGIFY_HELPER(x) #x
32#define SUNSHINE_STRINGIFY(x) SUNSHINE_STRINGIFY_HELPER(x)
37#define gl_drain_errors_helper(x) gl::drain_errors(x)
42#define gl_drain_errors gl_drain_errors_helper(__FILE__ ":" SUNSHINE_STRINGIFY(__LINE__))
43
50extern "C" int close(int __fd);
51
52// X11 Display
53extern "C" struct _XDisplay;
54
55struct AVFrame;
61void free_frame(AVFrame *frame);
62
67
68namespace gl {
69 extern GladGLContext ctx;
70
71 // glEGLImageTargetTexture2DOES (GL_OES_EGL_image) is not part of desktop GL —
72 // it is a GLES extension that must be loaded manually via eglGetProcAddress.
73 // GLeglImageOES is typedef void* per the Khronos spec (gl.xml).
77 using PFNGLEGLIMAGETARGETTEXTURE2DOESPROC = void (*)(GLenum target, void *image);
84
90 void drain_errors(const std::string_view &prefix);
91
95 class tex_t: public util::buffer_t<GLuint> {
96 using util::buffer_t<GLuint>::buffer_t;
97
98 public:
102 tex_t(tex_t &&) = default;
108 tex_t &operator=(tex_t &&) = default;
109
110 ~tex_t();
111
118 static tex_t make(std::size_t count);
119 };
120
124 class frame_buf_t: public util::buffer_t<GLuint> {
125 using util::buffer_t<GLuint>::buffer_t;
126
127 public:
138
139 ~frame_buf_t();
140
147 static frame_buf_t make(std::size_t count);
148
152 inline void bind(std::nullptr_t, std::nullptr_t) {
153 int x = 0;
154 for (auto fb : (*this)) {
155 ctx.BindFramebuffer(GL_FRAMEBUFFER, fb);
156 ctx.FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + x, 0, 0);
157
158 ++x;
159 }
160 return;
161 }
162
169 template<class It>
170 void bind(It it_begin, It it_end) {
171 using namespace std::literals;
172 if (std::distance(it_begin, it_end) > size()) {
173 BOOST_LOG(warning) << "To many elements to bind"sv;
174 return;
175 }
176
177 int x = 0;
178 std::for_each(it_begin, it_end, [&](auto tex) {
179 ctx.BindFramebuffer(GL_FRAMEBUFFER, (*this)[x]);
180 ctx.BindTexture(GL_TEXTURE_2D, tex);
181
182 ctx.FramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0 + x, tex, 0);
183
184 ++x;
185 });
186 }
187
198 void copy(int id, int texture, int offset_x, int offset_y, int width, int height);
199 };
200
204 class shader_t {
205 KITTY_USING_MOVE_T(shader_internal_t, GLuint, std::numeric_limits<GLuint>::max(), {
206 if (el != std::numeric_limits<GLuint>::max()) {
207 ctx.DeleteShader(el);
208 }
209 });
210
211 public:
217 std::string err_str();
218
226 static util::Either<shader_t, std::string> compile(const std::string_view &source, GLenum type);
227
233 GLuint handle() const;
234
235 private:
236 shader_internal_t _shader;
237 };
238
242 class buffer_t {
243 KITTY_USING_MOVE_T(buffer_internal_t, GLuint, std::numeric_limits<GLuint>::max(), {
244 if (el != std::numeric_limits<GLuint>::max()) {
245 ctx.DeleteBuffers(1, &el);
246 }
247 });
248
249 public:
258 static buffer_t make(util::buffer_t<GLint> &&offsets, const char *block, const std::string_view &data);
259
265 GLuint handle() const;
266
272 const char *block() const;
273
280 void update(const std::string_view &view, std::size_t offset = 0);
288 void update(std::string_view *members, std::size_t count, std::size_t offset = 0);
289
290 private:
291 const char *_block;
292
293 std::size_t _size;
294
295 util::buffer_t<GLint> _offsets;
296
297 buffer_internal_t _buffer;
298 };
299
303 class program_t {
304 KITTY_USING_MOVE_T(program_internal_t, GLuint, std::numeric_limits<GLuint>::max(), {
305 if (el != std::numeric_limits<GLuint>::max()) {
306 ctx.DeleteProgram(el);
307 }
308 });
309
310 public:
316 std::string err_str();
317
325 static util::Either<program_t, std::string> link(const shader_t &vert, const shader_t &frag);
326
332 void bind(const buffer_t &buffer);
333
342 std::optional<buffer_t> uniform(const char *block, std::pair<const char *, std::string_view> *members, std::size_t count);
343
349 GLuint handle() const;
350
351 private:
352 program_internal_t _program;
353 };
354} // namespace gl
355
356namespace gbm {
357 struct device;
361 using device_destroy_fn = void (*)(device *gbm);
365 using create_device_fn = device *(*)(int fd);
366
369
374
380 int init();
381
382} // namespace gbm
383
384namespace egl {
389
399
403 struct nv12_img_t {
405 EGLImage r8;
406 EGLImage bg88;
407
410
411 // sizeof(va::DRMPRIMESurfaceDescriptor::objects) / sizeof(va::DRMPRIMESurfaceDescriptor::objects[0]);
412 static constexpr std::size_t num_fds = 4;
413
414 std::array<file_t, num_fds> fds;
415 };
416
422 EGLImage r8;
423 EGLImage g8;
424 EGLImage b8;
425
428
429 static constexpr std::size_t num_fds = 4;
430
431 std::array<file_t, num_fds> fds;
432 };
433
434#ifndef DOXYGEN
435 KITTY_USING_MOVE_T(rgb_t, rgb_img_t, , {
436 if (el.xrgb8) {
437 eglDestroyImage(el.display, el.xrgb8);
438 }
439 });
440
441 KITTY_USING_MOVE_T(nv12_t, nv12_img_t, , {
442 if (el.r8) {
443 eglDestroyImage(el.display, el.r8);
444 }
445
446 if (el.bg88) {
447 eglDestroyImage(el.display, el.bg88);
448 }
449 });
450
451 KITTY_USING_MOVE_T(yuv444_t, yuv444_img_t, , {
452 if (el.r8) {
453 eglDestroyImage(el.display, el.r8);
454 }
455
456 if (el.g8) {
457 eglDestroyImage(el.display, el.g8);
458 }
459
460 if (el.b8) {
461 eglDestroyImage(el.display, el.b8);
462 }
463 });
464
465 KITTY_USING_MOVE_T(ctx_t, (std::tuple<display_t::pointer, EGLContext>), , {
466 TUPLE_2D_REF(disp, ctx, el);
467 if (ctx) {
468 eglMakeCurrent(disp, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT);
469 eglDestroyContext(disp, ctx);
470 }
471 });
472#else
476 class rgb_t;
477
481 class nv12_t;
482
486 class yuv444_t;
487
491 class ctx_t;
492#endif
493
498 int width;
499 int height;
500 std::array<int, 4> fds;
501 std::uint32_t fourcc;
502 std::uint64_t modifier;
503 std::array<std::uint32_t, 4> pitches;
504 std::array<std::uint32_t, 4> offsets;
505 };
506
513 display_t make_display(std::variant<gbm::gbm_t::pointer, wl_display *, _XDisplay *> native_display);
520 std::optional<ctx_t> make_ctx(display_t::pointer display);
521
526
532 std::optional<rgb_t> import_source(display_t::pointer egl_display, const surface_descriptor_t &xrgb);
533
539 rgb_t create_blank(platf::img_t &img);
540
546 std::optional<nv12_t> import_target(
547 display_t::pointer egl_display,
548 std::array<file_t, nv12_img_t::num_fds> &&fds,
549 const surface_descriptor_t &y,
550 const surface_descriptor_t &uv
551 );
552
563 std::optional<yuv444_t> import_target(
564 display_t::pointer egl_display,
565 std::array<file_t, yuv444_img_t::num_fds> &&fds,
566 const surface_descriptor_t &y,
567 const surface_descriptor_t &u,
568 const surface_descriptor_t &v
569 );
570
578 std::optional<nv12_t> create_nv12_target(int width, int height, AVPixelFormat format);
579
588 std::optional<yuv444_t> create_yuv444_target(int width, int height, AVPixelFormat format);
589
593 class cursor_t: public platf::img_t {
594 public:
595 int x;
596 int y;
597 int src_w;
598 int src_h;
599
600 unsigned long serial;
601
602 std::vector<std::uint8_t> buffer;
603 };
604
605 // Allow cursor and the underlying image to be kept together
610 public:
612 reset();
613 }
614
618 void reset() {
619 for (auto fd_index = 0; fd_index < 4; ++fd_index) {
620 if (sd.fds[fd_index] >= 0) {
621 close(sd.fds[fd_index]);
622
623 sd.fds[fd_index] = -1;
624 }
625 }
626 }
627
629
630 // Increment sequence when new rgb_t needs to be created
631 std::uint64_t sequence;
632
633 // Frame is vertically flipped (GL convention)
634 bool y_invert {false};
635
636 // PipeWire metadata
637 std::optional<uint64_t> pts;
638 std::optional<uint64_t> seq;
639 std::optional<bool> pw_damage;
640 std::optional<uint32_t> pw_flags;
641 };
642
646 class sws_t {
647 public:
658 static std::optional<sws_t> make_nv12(int in_width, int in_height, int out_width, int out_height, gl::tex_t &&tex);
669 static std::optional<sws_t> make_yuv444(int in_width, int in_height, int out_width, int out_height, gl::tex_t &&tex);
670
682 static std::optional<sws_t> make(int in_width, int in_height, int out_width, int out_height, AVPixelFormat format, bool is_yuv444);
683
684 // Convert the loaded image into the first two framebuffers
692
693 // Convert the loaded image into the first three framebuffers
701
702 // Draw loaded image by programs to frame buffers
712 int draw_programs_to_buffers(GLenum attachments[], gl::frame_buf_t &fb, int count, bool is_yuv444);
713
714 // Make an area of the image black
726 int blank(gl::frame_buf_t &fb, int offsetX_, int offsetY_, int width, int height, bool is_yuv444);
727
733 void load_ram(platf::img_t &img);
743 void load_vram(img_descriptor_t &img, int offset_x, int offset_y, int texture, bool is_yuv444);
744
751 void apply_colorspace(const video::sunshine_colorspace_t &colorspace, bool is_yuv444);
752
753 // The first texture is the monitor image.
754 // The second texture is the cursor image
756
757 // The cursor image will be blended into this framebuffer
760
761 // Y - shader, UV - shader, Cursor - shader : for nv12
762 // Y - shader, U - shader, V - shader, Cursor - shader : for yuv444
763 std::array<gl::program_t, 4> program;
765
772
773 // Pointer to the texture to be converted to nv12
775
776 // Store latest cursor for load_vram
777 std::uint64_t serial;
778 };
779
785 bool fail();
786} // namespace egl
util::safe_ptr< CodedBitstreamContext, &close > ctx_t
Owning coded bitstream context pointer that calls ff_cbs_close.
Definition cbs.cpp:35
Cursor image and hotspot metadata captured from the window system.
Definition graphics.h:593
std::vector< std::uint8_t > buffer
Cursor image pixels.
Definition graphics.h:602
unsigned long serial
X11 cursor serial used to detect cursor image changes.
Definition graphics.h:600
int y
Cursor hotspot or surface Y coordinate.
Definition graphics.h:596
int x
Cursor hotspot or surface X coordinate.
Definition graphics.h:595
int src_w
Cursor source image width in pixels.
Definition graphics.h:597
int src_h
Cursor source image height in pixels.
Definition graphics.h:598
Captured image descriptor shared by EGL conversion paths.
Definition graphics.h:609
std::optional< bool > pw_damage
Whether PipeWire damage tracking should be used.
Definition graphics.h:639
std::optional< uint32_t > pw_flags
PipeWire frame flags reported with the buffer.
Definition graphics.h:640
std::optional< uint64_t > seq
PipeWire frame sequence number.
Definition graphics.h:638
std::uint64_t sequence
Monotonic value used to detect when GL resources must be recreated.
Definition graphics.h:631
surface_descriptor_t sd
DMA-BUF surface descriptor for the captured image.
Definition graphics.h:628
void reset()
Reset the object to its initial empty state.
Definition graphics.h:618
bool y_invert
Whether the shader should invert the Y axis.
Definition graphics.h:634
std::optional< uint64_t > pts
PipeWire presentation timestamp.
Definition graphics.h:637
EGL/OpenGL scaler and colorspace conversion pipeline.
Definition graphics.h:646
gl::tex_t tex
Source and cursor textures used by the conversion pipeline.
Definition graphics.h:755
int offsetY
Offset y.
Definition graphics.h:771
int convert_yuv444(gl::frame_buf_t &fb)
Convert the loaded source image into YUV444 output planes.
Definition graphics.cpp:1510
int in_width
In width.
Definition graphics.h:768
int in_height
In height.
Definition graphics.h:769
gl::frame_buf_t cursor_framebuffer
Cursor framebuffer.
Definition graphics.h:758
static std::optional< sws_t > make(int in_width, int in_height, int out_width, int out_height, AVPixelFormat format, bool is_yuv444)
Allocate the underlying object and wrap it in the owning handle.
Definition graphics.cpp:1360
int out_width
Out width.
Definition graphics.h:766
int convert_nv12(gl::frame_buf_t &fb)
Convert the loaded source image into NV12 output planes.
Definition graphics.cpp:1488
static std::optional< sws_t > make_nv12(int in_width, int in_height, int out_width, int out_height, gl::tex_t &&tex)
Create a software-scaling pipeline that renders to NV12 planes.
Definition graphics.cpp:1133
void apply_colorspace(const video::sunshine_colorspace_t &colorspace, bool is_yuv444)
Apply the configured colorspace metadata to the active frame.
Definition graphics.cpp:1071
int blank(gl::frame_buf_t &fb, int offsetX_, int offsetY_, int width, int height, bool is_yuv444)
Clear the render target to a blank frame.
Definition graphics.cpp:1344
int offsetX
Offset x.
Definition graphics.h:770
gl::buffer_t color_matrix
Color matrix.
Definition graphics.h:764
gl::frame_buf_t copy_framebuffer
Copy framebuffer.
Definition graphics.h:759
void load_ram(platf::img_t &img)
Load ram data from the backing API or store.
Definition graphics.cpp:1397
static std::optional< sws_t > make_yuv444(int in_width, int in_height, int out_width, int out_height, gl::tex_t &&tex)
Create a software-scaling pipeline that renders to YUV444 planes.
Definition graphics.cpp:1239
void load_vram(img_descriptor_t &img, int offset_x, int offset_y, int texture, bool is_yuv444)
Load vram data from the backing API or store.
Definition graphics.cpp:1404
int loaded_texture
Loaded texture.
Definition graphics.h:774
int out_height
Out height.
Definition graphics.h:767
std::uint64_t serial
Serial.
Definition graphics.h:777
int draw_programs_to_buffers(GLenum attachments[], gl::frame_buf_t &fb, int count, bool is_yuv444)
Render the loaded source texture into output framebuffers.
Definition graphics.cpp:1466
std::array< gl::program_t, 4 > program
Program.
Definition graphics.h:763
EGL image buffer with plane descriptors and imported GL textures.
Definition graphics.h:242
void update(const std::string_view &view, std::size_t offset=0)
Update one uniform member in the block buffer.
Definition graphics.cpp:184
static buffer_t make(util::buffer_t< GLint > &&offsets, const char *block, const std::string_view &data)
Allocate the underlying object and wrap it in the owning handle.
Definition graphics.cpp:163
const char * block() const
Query a uniform block index from an OpenGL program.
Definition graphics.cpp:180
GLuint handle() const
Return the native handle owned by the wrapper.
Definition graphics.cpp:176
OpenGL framebuffer handle wrapper.
Definition graphics.h:124
void bind(std::nullptr_t, std::nullptr_t)
Bind each framebuffer and clear its color attachment.
Definition graphics.h:152
void bind(It it_begin, It it_end)
Bind textures to this object's framebuffers as color attachments.
Definition graphics.h:170
static frame_buf_t make(std::size_t count)
Allocate the underlying object and wrap it in the owning handle.
Definition graphics.cpp:110
frame_buf_t(frame_buf_t &&)=default
Move ownership of OpenGL framebuffer object names.
frame_buf_t & operator=(frame_buf_t &&)=default
Assign state from another instance while preserving ownership semantics.
void copy(int id, int texture, int offset_x, int offset_y, int width, int height)
Definition graphics.cpp:118
OpenGL shader program with attached shader stages.
Definition graphics.h:303
std::optional< buffer_t > uniform(const char *block, std::pair< const char *, std::string_view > *members, std::size_t count)
Query a uniform location from an OpenGL program.
Definition graphics.cpp:249
GLuint handle() const
Return the native handle owned by the wrapper.
Definition graphics.cpp:297
std::string err_str()
Read the program linker log.
Definition graphics.cpp:201
static util::Either< program_t, std::string > link(const shader_t &vert, const shader_t &frag)
Link an OpenGL program from compiled shaders.
Definition graphics.cpp:215
void bind(const buffer_t &buffer)
Bind this program and attach a uniform buffer block.
Definition graphics.cpp:242
OpenGL shader object that compiles GLSL source.
Definition graphics.h:204
static util::Either< shader_t, std::string > compile(const std::string_view &source, GLenum type)
Compile an OpenGL shader and report compiler errors.
Definition graphics.cpp:139
std::string err_str()
Read the shader compiler log.
Definition graphics.cpp:125
GLuint handle() const
Return the native handle owned by the wrapper.
Definition graphics.cpp:159
OpenGL texture handle wrapper.
Definition graphics.h:95
tex_t(tex_t &&)=default
Move ownership of OpenGL texture object names.
static tex_t make(std::size_t count)
Allocate the underlying object and wrap it in the owning handle.
Definition graphics.cpp:85
tex_t & operator=(tex_t &&)=default
Assign state from another instance while preserving ownership semantics.
Tagged storage for one of two possible value types.
Definition utility.h:750
Owning contiguous buffer with an explicit logical element count.
Definition utility.h:1398
size_t size() const
Definition utility.h:1485
element_type * pointer
Definition utility.h:823
Declarations for common platform specific utilities.
PFNGLEGLIMAGETARGETTEXTURE2DOESPROC egl_image_target_texture_2d()
Bind an EGL image to the current OpenGL texture target.
Definition graphics.cpp:65
GladGLContext ctx
Loaded OpenGL function table for the active context.
Definition graphics.cpp:58
std::optional< rgb_t > import_source(display_t::pointer egl_display, const surface_descriptor_t &xrgb)
Import the source frame texture for EGL/OpenGL conversion.
Definition graphics.cpp:772
void free_frame(AVFrame *frame)
Release an FFmpeg frame allocated by the capture or conversion backend.
Definition graphics.cpp:1539
std::optional< ctx_t > make_ctx(display_t::pointer display)
Create an EGL/OpenGL context for capture or conversion.
Definition graphics.cpp:573
bool fail()
Log EGL failure details and return an error code.
Definition graphics.cpp:491
std::optional< nv12_t > create_nv12_target(int width, int height, AVPixelFormat format)
Create biplanar YUV textures to render into.
Definition graphics.cpp:981
int init()
Load GBM symbols required for EGL device creation.
Definition graphics.cpp:310
rgb_t create_blank(platf::img_t &img)
Create a black RGB texture of the specified image size.
Definition graphics.cpp:806
device_destroy_fn device_destroy
Device destroy.
Definition graphics.cpp:304
void ensure_privileged_egl_worker_started()
Allows the EGL privileged worker thread to be constructed early.
Definition graphics.cpp:484
display_t make_display(std::variant< gbm::gbm_t::pointer, wl_display *, _XDisplay * > native_display)
Open and initialize the display connection used for capture.
Definition graphics.cpp:495
std::optional< nv12_t > import_target(display_t::pointer egl_display, std::array< file_t, nv12_img_t::num_fds > &&fds, const surface_descriptor_t &y, const surface_descriptor_t &uv)
Import the output frame target for EGL/OpenGL conversion.
Definition graphics.cpp:881
void drain_errors(const std::string_view &prefix)
Drain and log pending OpenGL errors.
Definition graphics.cpp:72
create_device_fn create_device
Create device.
Definition graphics.cpp:305
std::optional< yuv444_t > create_yuv444_target(int width, int height, AVPixelFormat format)
Create YUV444 target.
Definition graphics.cpp:1024
void(*)(device *gbm) device_destroy_fn
Function pointer used to destroy a GBM device.
Definition graphics.h:361
int close(int __fd)
Release the native resource held by the RAII wrapper.
device *(*)(int fd) create_device_fn
Function pointer used to create a GBM device from a file descriptor.
Definition graphics.h:365
util::safe_ptr< AVFrame, &free_frame > frame_t
Owning pointer for an EGL frame object.
Definition graphics.h:66
util::dyn_safe_ptr< device, &device_destroy > gbm_t
Owning GBM device pointer released with the GBM destroy callback.
Definition graphics.h:373
util::dyn_safe_ptr_v2< void, EGLBoolean, &eglTerminate > display_t
Owning pointer for an EGL display connection.
Definition graphics.h:388
void(*)(GLenum target, void *image) PFNGLEGLIMAGETARGETTEXTURE2DOESPROC
Function pointer type for glEGLImageTargetTexture2DOES.
Definition graphics.h:77
Miscellaneous declarations for Linux.
bl::sources::severity_logger< int > warning
Strange events.
Definition logging.cpp:45
Declarations for logging related functions.
NV12 capture image backed by EGL and OpenGL resources.
Definition graphics.h:403
EGLImage bg88
EGL image for the NV12 interleaved chroma plane.
Definition graphics.h:406
static constexpr std::size_t num_fds
Maximum number of DMA-BUF plane file descriptors exported by VAAPI.
Definition graphics.h:412
gl::tex_t tex
Textures containing the imported Y and UV planes.
Definition graphics.h:408
display_t::pointer display
EGL display that owns the imported planes.
Definition graphics.h:404
gl::frame_buf_t buf
OpenGL framebuffer object used for rendering.
Definition graphics.h:409
std::array< file_t, num_fds > fds
DMA-BUF file descriptors for each exported plane.
Definition graphics.h:414
EGLImage r8
EGL image for the NV12 luma plane.
Definition graphics.h:405
RGB capture image backed by EGL and OpenGL resources.
Definition graphics.h:393
display_t::pointer display
EGL display that owns the imported image.
Definition graphics.h:394
EGLImage xrgb8
EGL image for the imported XRGB plane.
Definition graphics.h:395
gl::tex_t tex
Texture containing the imported RGB plane.
Definition graphics.h:397
EGL surface descriptor used to import a captured DMA-BUF.
Definition graphics.h:497
std::array< std::uint32_t, 4 > pitches
Row stride in bytes for each DMA-BUF plane.
Definition graphics.h:503
std::uint32_t fourcc
DRM fourcc pixel format for the buffer.
Definition graphics.h:501
std::array< std::uint32_t, 4 > offsets
Byte offset to the first pixel for each DMA-BUF plane.
Definition graphics.h:504
std::uint64_t modifier
DRM format modifier describing the buffer layout.
Definition graphics.h:502
std::array< int, 4 > fds
DMA-BUF file descriptors for up to four planes.
Definition graphics.h:500
int height
Frame or display height in pixels.
Definition graphics.h:499
int width
Frame or display width in pixels.
Definition graphics.h:498
YUV 4:4:4 capture image backed by EGL and OpenGL resources.
Definition graphics.h:420
EGLImage b8
EGL image for the V plane.
Definition graphics.h:424
display_t::pointer display
EGL display that owns the imported planes.
Definition graphics.h:421
EGLImage r8
EGL image for the Y plane.
Definition graphics.h:422
std::array< file_t, num_fds > fds
DMA-BUF file descriptors for each exported plane.
Definition graphics.h:431
EGLImage g8
EGL image for the U plane.
Definition graphics.h:423
gl::frame_buf_t buf
OpenGL framebuffer object used for rendering.
Definition graphics.h:427
static constexpr std::size_t num_fds
Num fds.
Definition graphics.h:429
gl::tex_t tex
Textures containing the imported Y, U, and V planes.
Definition graphics.h:426
Captured frame buffer shared between capture and encode stages.
Definition common.h:530
Sunshine colorimetry values derived from stream configuration.
Definition video_colorspace.h:36
Declarations for utility functions.
safe_ptr< T, dynamic< T, ReturnType, function > > dyn_safe_ptr_v2
Safe pointer wrapper for runtime-resolved release functions with status returns.
Definition utility.h:1629
#define TUPLE_2D_REF(a, b, expr)
Bind both elements of an existing 2-tuple expression to local references.
Definition utility.h:165
uniq_ptr< T, Destroy< T *, void, function > > safe_ptr
Unique pointer using a compile-time C-style destroy function.
Definition utility.h:1590
#define KITTY_USING_MOVE_T(move_t, t, init_val, z)
Define a move-only RAII wrapper with caller-provided initial value and destructor body.
Definition utility.h:51
safe_ptr< T, dynamic< T, void, function > > dyn_safe_ptr
Unique pointer using a runtime-provided destroy function.
Definition utility.h:1623
Declarations for colorspace functions.