|
Sunshine master
Self-hosted game stream host for Moonlight.
|
Definitions for x11 capture. More...
#include <fstream>#include <thread>#include <sys/ipc.h>#include <sys/shm.h>#include <X11/extensions/Xfixes.h>#include <X11/extensions/Xrandr.h>#include <X11/X.h>#include <X11/Xlib.h>#include <X11/Xutil.h>#include <xcb/shm.h>#include <xcb/xfixes.h>#include "cuda.h"#include "graphics.h"#include "misc.h"#include "src/config.h"#include "src/globals.h"#include "src/logging.h"#include "src/platform/common.h"#include "src/task_pool.h"#include "src/video.h"#include "vaapi.h"#include "x11grab.h"Classes | |
| struct | platf::shm_attr_t |
| X11 shared-memory image dimensions and identifiers. More... | |
| class | platf::shm_data_t |
| RAII wrapper that detaches mapped SysV shared memory. More... | |
| class | platf::shm_id_t |
| RAII wrapper that removes a SysV shared-memory segment. More... | |
| struct | platf::shm_img_t |
| X11 shared-memory image and segment ownership. More... | |
| struct | platf::x11_attr_t |
| X11 display, window, and attribute handles for capture. More... | |
| struct | platf::x11_img_t |
| X11 image wrapper used by the software capture path. More... | |
Macros | |
| #define | _FN(x, ret, args) |
| Macro for FN. | |
Typedefs | |
| typedef int(* | platf::x11::CloseDisplay_fn) (Display *display) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef xcb_connection_t *(* | platf::xcb::connect_fn) (const char *displayname, int *screenp) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef int(* | platf::xcb::connection_has_error_fn) (xcb_connection_t *c) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| using | platf::crtc_info_t = util::dyn_safe_ptr<_XRRCrtcInfo, &x11::rr::FreeCrtcInfo> |
XRandR CRTC info pointer released with XRRFreeCrtcInfo. | |
| typedef void(* | platf::xcb::disconnect_fn) (xcb_connection_t *c) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef int(* | platf::x11::Free_fn) (void *data) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef void(* | platf::x11::rr::FreeCrtcInfo_fn) (XRRCrtcInfo *crtcInfo) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef void(* | platf::x11::rr::FreeOutputInfo_fn) (XRROutputInfo *outputInfo) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef void(* | platf::x11::rr::FreeScreenResources_fn) (XRRScreenResources *resources) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef std::uint32_t(* | platf::xcb::generate_id_fn) (xcb_connection_t *c) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef xcb_query_extension_reply_t *(* | platf::xcb::get_extension_data_fn) (xcb_connection_t *c, xcb_extension_t *ext) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef xcb_setup_t *(* | platf::xcb::get_setup_fn) (xcb_connection_t *c) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef XRRCrtcInfo *(* | platf::x11::rr::GetCrtcInfo_fn) (Display *dpy, XRRScreenResources *resources, RRCrtc crtc) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef XFixesCursorImage *(* | platf::x11::fix::GetCursorImage_fn) (Display *dpy) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef XImage *(* | platf::x11::GetImage_fn) (Display *display, Drawable d, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef XRROutputInfo *(* | platf::x11::rr::GetOutputInfo_fn) (Display *dpy, XRRScreenResources *resources, RROutput output) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef XRRScreenResources *(* | platf::x11::rr::GetScreenResources_fn) (Display *dpy, Window window) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef Status(* | platf::x11::GetWindowAttributes_fn) (Display *display, Window w, XWindowAttributes *window_attributes_return) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef Status(* | platf::x11::InitThreads_fn) (void) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef Display *(* | platf::x11::OpenDisplay_fn) (_Xconst char *display_name) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| using | platf::output_info_t = util::dyn_safe_ptr<_XRROutputInfo, &x11::rr::FreeOutputInfo> |
XRandR output info pointer released with XRRFreeOutputInfo. | |
| using | platf::screen_res_t = util::dyn_safe_ptr<_XRRScreenResources, &x11::rr::FreeScreenResources> |
XRandR screen resources pointer released with XRRFreeScreenResources. | |
| typedef xcb_screen_iterator_t(* | platf::xcb::setup_roots_iterator_fn) (const xcb_setup_t *R) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef xcb_void_cookie_t(* | platf::xcb::shm_attach_fn) (xcb_connection_t *c, xcb_shm_seg_t shmseg, uint32_t shmid, uint8_t read_only) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef xcb_shm_get_image_reply_t *(* | platf::xcb::shm_get_image_reply_fn) (xcb_connection_t *c, xcb_shm_get_image_cookie_t cookie, xcb_generic_error_t **e) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| typedef xcb_shm_get_image_cookie_t(* | platf::xcb::shm_get_image_unchecked_fn) (xcb_connection_t *c, xcb_drawable_t drawable, int16_t x, int16_t y, uint16_t width, uint16_t height, uint32_t plane_mask, uint8_t format, xcb_shm_seg_t shmseg, uint32_t offset) |
| Function pointer type for the dynamically loaded X11 entry point. | |
| using | platf::xcb_connect_t = util::dyn_safe_ptr<xcb_connection_t, &xcb::disconnect> |
XCB connection pointer released with xcb_disconnect. | |
| using | platf::xcb_img_t = util::c_ptr<xcb_shm_get_image_reply_t> |
XCB image pointer released with xcb_image_destroy. | |
| using | platf::xcursor_t = util::safe_ptr<XFixesCursorImage, freeX> |
XFixes cursor image pointer released with XFree. | |
| using | platf::ximg_t = util::safe_ptr<XImage, freeImage> |
XImage pointer released with XDestroyImage. | |
Functions | |
| void | platf::x11::freeCursorCtx (cursor_ctx_t::pointer ctx) |
| Release cursor context resources. | |
| void | platf::x11::freeDisplay (_XDisplay *xdisplay) |
| Release display resources. | |
| void | platf::freeImage (XImage *) |
| Release image resources. | |
| void | platf::freeX (XFixesCursorImage *) |
| Release x resources. | |
| int | platf::xcb::init () |
| Initialize XFixes cursor tracking for an X11 display. | |
| int | platf::xcb::init_shm () |
| Initialize shared-memory support for X11 capture. | |
| int | platf::load_x11 () |
| Load X11 entry points used by the X11 capture backend. | |
| int | platf::load_xcb () |
| Load XCB entry points used by the X11 capture backend. | |
| xdisplay_t | platf::x11::make_display () |
| Open and initialize the display connection used for capture. | |
| std::shared_ptr< display_t > | platf::x11_display (platf::mem_type_e hwdevice_type, const std::string &display_name, const ::video::config_t &config) |
| Create an X11 display capture backend. | |
| std::vector< std::string > | platf::x11_display_names () |
| Enumerate display names accepted by the X11 backend. | |
Definitions for x11 capture.
| #define _FN | ( | x, | |
| ret, | |||
| args ) |
| typedef int(* platf::x11::CloseDisplay_fn) (Display *display) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_connection_t *(* platf::xcb::connect_fn) (const char *displayname, int *screenp) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef int(* platf::xcb::connection_has_error_fn) (xcb_connection_t *c) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef void(* platf::xcb::disconnect_fn) (xcb_connection_t *c) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef int(* platf::x11::Free_fn) (void *data) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef void(* platf::x11::rr::FreeCrtcInfo_fn) (XRRCrtcInfo *crtcInfo) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef void(* platf::x11::rr::FreeOutputInfo_fn) (XRROutputInfo *outputInfo) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef void(* platf::x11::rr::FreeScreenResources_fn) (XRRScreenResources *resources) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef std::uint32_t(* platf::xcb::generate_id_fn) (xcb_connection_t *c) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_query_extension_reply_t *(* platf::xcb::get_extension_data_fn) (xcb_connection_t *c, xcb_extension_t *ext) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_setup_t *(* platf::xcb::get_setup_fn) (xcb_connection_t *c) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef XRRCrtcInfo *(* platf::x11::rr::GetCrtcInfo_fn) (Display *dpy, XRRScreenResources *resources, RRCrtc crtc) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef XFixesCursorImage *(* platf::x11::fix::GetCursorImage_fn) (Display *dpy) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef XImage *(* platf::x11::GetImage_fn) (Display *display, Drawable d, int x, int y, unsigned int width, unsigned int height, unsigned long plane_mask, int format) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef XRROutputInfo *(* platf::x11::rr::GetOutputInfo_fn) (Display *dpy, XRRScreenResources *resources, RROutput output) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef XRRScreenResources *(* platf::x11::rr::GetScreenResources_fn) (Display *dpy, Window window) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef Status(* platf::x11::GetWindowAttributes_fn) (Display *display, Window w, XWindowAttributes *window_attributes_return) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef Status(* platf::x11::InitThreads_fn) (void) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef Display *(* platf::x11::OpenDisplay_fn) (_Xconst char *display_name) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_screen_iterator_t(* platf::xcb::setup_roots_iterator_fn) (const xcb_setup_t *R) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_void_cookie_t(* platf::xcb::shm_attach_fn) (xcb_connection_t *c, xcb_shm_seg_t shmseg, uint32_t shmid, uint8_t read_only) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_shm_get_image_reply_t *(* platf::xcb::shm_get_image_reply_fn) (xcb_connection_t *c, xcb_shm_get_image_cookie_t cookie, xcb_generic_error_t **e) |
Function pointer type for the dynamically loaded X11 entry point.
| typedef xcb_shm_get_image_cookie_t(* platf::xcb::shm_get_image_unchecked_fn) (xcb_connection_t *c, xcb_drawable_t drawable, int16_t x, int16_t y, uint16_t width, uint16_t height, uint32_t plane_mask, uint8_t format, xcb_shm_seg_t shmseg, uint32_t offset) |
Function pointer type for the dynamically loaded X11 entry point.
| void platf::x11::freeCursorCtx | ( | cursor_ctx_t::pointer | ctx | ) |
Release cursor context resources.
| ctx | Native context object used by the operation or callback. |
| void platf::x11::freeDisplay | ( | _XDisplay * | xdisplay | ) |
Release display resources.
| xdisplay | X11 display connection. |
| void platf::freeImage | ( | XImage * | p | ) |
Release image resources.
| p | Pointer passed to the deleter or conversion helper. |
| void platf::freeX | ( | XFixesCursorImage * | p | ) |
Release x resources.
| p | Pointer passed to the deleter or conversion helper. |
| int platf::xcb::init | ( | ) |
Initialize XFixes cursor tracking for an X11 display.
| int platf::xcb::init_shm | ( | ) |
Initialize shared-memory support for X11 capture.
| int platf::load_x11 | ( | ) |
Load X11 entry points used by the X11 capture backend.
| int platf::load_xcb | ( | ) |
Load XCB entry points used by the X11 capture backend.
| xdisplay_t platf::x11::make_display | ( | ) |
Open and initialize the display connection used for capture.
| std::shared_ptr< display_t > platf::x11_display | ( | platf::mem_type_e | hwdevice_type, |
| const std::string & | display_name, | ||
| const ::video::config_t & | config ) |
Create an X11 display capture backend.
| hwdevice_type | Hardware device type requested for capture or encode. |
| display_name | Display name. |
| config | Configuration values to apply. |
| std::vector< std::string > platf::x11_display_names | ( | ) |
Enumerate display names accepted by the X11 backend.