|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Declarations for graphics related functions. More...
#include <optional>#include <string_view>#include <glad/egl.h>#include <glad/gl.h>#include "misc.h"#include "src/logging.h"#include "src/platform/common.h"#include "src/utility.h"#include "src/video_colorspace.h"Go to the source code of this file.
Classes | |
| class | gl::buffer_t |
| EGL image buffer with plane descriptors and imported GL textures. More... | |
| class | egl::cursor_t |
| Cursor image and hotspot metadata captured from the window system. More... | |
| class | gl::frame_buf_t |
| OpenGL framebuffer handle wrapper. More... | |
| class | egl::img_descriptor_t |
| Captured image descriptor shared by EGL conversion paths. More... | |
| struct | egl::nv12_img_t |
| NV12 capture image backed by EGL and OpenGL resources. More... | |
| class | gl::program_t |
| OpenGL shader program with attached shader stages. More... | |
| struct | egl::rgb_img_t |
| RGB capture image backed by EGL and OpenGL resources. More... | |
| class | gl::shader_t |
| OpenGL shader object that compiles GLSL source. More... | |
| struct | egl::surface_descriptor_t |
| EGL surface descriptor used to import a captured DMA-BUF. More... | |
| class | egl::sws_t |
| EGL/OpenGL scaler and colorspace conversion pipeline. More... | |
| class | gl::tex_t |
| OpenGL texture handle wrapper. More... | |
| struct | egl::yuv444_img_t |
| YUV 4:4:4 capture image backed by EGL and OpenGL resources. More... | |
Macros | |
| #define | gl_drain_errors gl_drain_errors_helper(__FILE__ ":" SUNSHINE_STRINGIFY(__LINE__)) |
| Macro for gl drain errors. | |
| #define | gl_drain_errors_helper(x) |
| Macro for gl drain errors helper. | |
| #define | SUNSHINE_STRINGIFY(x) |
| Macro for SUNSHINE STRINGIFY. | |
| #define | SUNSHINE_STRINGIFY_HELPER(x) |
| Macro for SUNSHINE STRINGIFY HELPER. | |
Typedefs | |
| typedef device *(* | gbm::create_device_fn) (int fd) |
| Function pointer used to create a GBM device from a file descriptor. | |
| typedef void(* | gbm::device_destroy_fn) (device *gbm) |
| Function pointer used to destroy a GBM device. | |
| using | egl::display_t = util::dyn_safe_ptr_v2<void, EGLBoolean, &eglTerminate> |
| Owning pointer for an EGL display connection. | |
| using | frame_t = util::safe_ptr<AVFrame, free_frame> |
| Owning pointer for an EGL frame object. | |
| using | gbm::gbm_t = util::dyn_safe_ptr<device, &device_destroy> |
| Owning GBM device pointer released with the GBM destroy callback. | |
| using | gl::PFNGLEGLIMAGETARGETTEXTURE2DOESPROC = void (*)(GLenum target, void *image) |
| Function pointer type for glEGLImageTargetTexture2DOES. | |
Functions | |
| int | close (int __fd) |
| Release the native resource held by the RAII wrapper. | |
| rgb_t | egl::create_blank (platf::img_t &img) |
| Create a black RGB texture of the specified image size. | |
| std::optional< nv12_t > | egl::create_nv12_target (int width, int height, AVPixelFormat format) |
| Create biplanar YUV textures to render into. | |
| std::optional< yuv444_t > | egl::create_yuv444_target (int width, int height, AVPixelFormat format) |
| Create YUV444 target. | |
| void | gl::drain_errors (const std::string_view &prefix) |
| Drain and log pending OpenGL errors. | |
| PFNGLEGLIMAGETARGETTEXTURE2DOESPROC | gl::egl_image_target_texture_2d () |
| Bind an EGL image to the current OpenGL texture target. | |
| bool | egl::fail () |
| Log EGL failure details and return an error code. | |
| void | free_frame (AVFrame *frame) |
| Release an FFmpeg frame allocated by the capture or conversion backend. | |
| std::optional< rgb_t > | egl::import_source (display_t::pointer egl_display, const surface_descriptor_t &xrgb) |
| Import the source frame texture for EGL/OpenGL conversion. | |
| std::optional< nv12_t > | egl::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. | |
| std::optional< yuv444_t > | egl::import_target (display_t::pointer egl_display, std::array< file_t, yuv444_img_t::num_fds > &&fds, const surface_descriptor_t &y, const surface_descriptor_t &u, const surface_descriptor_t &v) |
| Import a YUV444 target surface. | |
| int | gbm::init () |
| Load GBM symbols required for EGL device creation. | |
| std::optional< ctx_t > | egl::make_ctx (display_t::pointer display) |
| Create an EGL/OpenGL context for capture or conversion. | |
| display_t | egl::make_display (std::variant< gbm::gbm_t::pointer, wl_display *, _XDisplay * > native_display) |
| Open and initialize the display connection used for capture. | |
Declarations for graphics related functions.
| #define gl_drain_errors_helper | ( | x | ) |
Macro for gl drain errors helper.
| #define SUNSHINE_STRINGIFY | ( | x | ) |
Macro for SUNSHINE STRINGIFY.
| #define SUNSHINE_STRINGIFY_HELPER | ( | x | ) |
Macro for SUNSHINE STRINGIFY HELPER.
| int close | ( | int | __fd | ) |
Release the native resource held by the RAII wrapper.
| __fd | File descriptor owned by the RAII wrapper. |
| rgb_t egl::create_blank | ( | platf::img_t & | img | ) |
Create a black RGB texture of the specified image size.
Create a blank RGB texture for an image.
| img | The image to use for texture sizing. |
| std::optional< nv12_t > egl::create_nv12_target | ( | int | width, |
| int | height, | ||
| AVPixelFormat | format ) |
Create biplanar YUV textures to render into.
Creates biplanar YUV textures to render into.
| width | Width of the target frame. |
| height | Height of the target frame. |
| format | Format of the target frame. |
| std::optional< yuv444_t > egl::create_yuv444_target | ( | int | width, |
| int | height, | ||
| AVPixelFormat | format ) |
Create YUV444 target.
| width | Frame or display width in pixels. |
| height | Frame or display height in pixels. |
| format | Pixel, audio, or protocol format being converted. |
| void gl::drain_errors | ( | const std::string_view & | prefix | ) |
Drain and log pending OpenGL errors.
| prefix | Text prefix used when formatting the message. |
| PFNGLEGLIMAGETARGETTEXTURE2DOESPROC gl::egl_image_target_texture_2d | ( | ) |
Bind an EGL image to the current OpenGL texture target.
Resolve the GLES extension used to bind EGL images as textures.
| bool egl::fail | ( | ) |
Log EGL failure details and return an error code.
| void free_frame | ( | AVFrame * | frame | ) |
Release an FFmpeg frame allocated by the capture or conversion backend.
| frame | Video or graphics frame being processed. |
| std::optional< rgb_t > egl::import_source | ( | display_t::pointer | egl_display, |
| const surface_descriptor_t & | xrgb ) |
Import the source frame texture for EGL/OpenGL conversion.
Import an RGB source surface.
| egl_display | EGL display used to create the image. |
| xrgb | XRGB surface descriptor to import. |
| std::optional< nv12_t > egl::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.
Import an NV12 target surface.
| egl_display | EGL display used to create the images. |
| fds | File descriptors backing the NV12 image. |
| y | Luma plane descriptor. |
| uv | Chroma plane descriptor. |
| std::optional< yuv444_t > egl::import_target | ( | display_t::pointer | egl_display, |
| std::array< file_t, yuv444_img_t::num_fds > && | fds, | ||
| const surface_descriptor_t & | y, | ||
| const surface_descriptor_t & | u, | ||
| const surface_descriptor_t & | v ) |
Import a YUV444 target surface.
| egl_display | EGL display. |
| fds | Target plane file descriptors. |
| y | Y plane descriptor. |
| u | U plane descriptor. |
| v | V plane descriptor. |
| int gbm::init | ( | ) |
Load GBM symbols required for EGL device creation.
| std::optional< ctx_t > egl::make_ctx | ( | display_t::pointer | display | ) |
Create an EGL/OpenGL context for capture or conversion.
| display | Display object or identifier associated with the operation. |
| display_t egl::make_display | ( | std::variant< gbm::gbm_t::pointer, wl_display *, _XDisplay * > | native_display | ) |
Open and initialize the display connection used for capture.
| native_display | Native display. |