X11 display, window, and attribute handles for capture.
More...
|
|
std::chrono::nanoseconds | delay |
| | Delay before the timer task becomes eligible to run.
|
| |
|
mem_type_e | mem_type |
| | Mem type.
|
| |
|
XWindowAttributes | xattr |
| | Cached X11 window attributes used to detect size changes.
|
| |
|
x11::xdisplay_t | xdisplay |
| | X11 display connection used for capture.
|
| |
|
Window | xwindow |
| | Root window being captured.
|
| |
|
int | env_height {0} |
| | Height of the full capture environment in physical pixels.
|
| |
|
int | env_logical_height {0} |
| | Height of the full capture environment after display scaling.
|
| |
|
int | env_logical_width {0} |
| | Width of the full capture environment after display scaling.
|
| |
|
int | env_width {0} |
| | Width of the full capture environment in physical pixels.
|
| |
|
int | height {0} |
| | Height of the captured display in physical pixels.
|
| |
|
int | logical_height {0} |
| | Height of the captured display after display scaling.
|
| |
|
int | logical_width {0} |
| | Width of the captured display after display scaling.
|
| |
|
int | offset_x {0} |
| | Horizontal capture offset in physical pixels.
|
| |
|
int | offset_y {0} |
| | Vertical capture offset in physical pixels.
|
| |
|
int | width {0} |
| | Width of the captured display in physical pixels.
|
| |
|
| using | pull_free_image_cb_t = std::function<bool(std::shared_ptr<img_t> &img_out)> |
| | Get free image from pool. Calls must be synchronized. Blocks until there is free image in the pool or capture is interrupted.
|
| |
| using | push_captured_image_cb_t = std::function<bool(std::shared_ptr<img_t> &&img, bool frame_captured)> |
| | Callback for when a new image is ready. When display has a new image ready or a timeout occurs, this callback will be called with the image. If a frame was captured, frame_captured will be true. If a timeout occurred, it will be false.
|
| |
|
logging::time_delta_periodic_logger | sleep_overshoot_logger = {debug, "Frame capture sleep overshoot"} |
| | Periodic logger for capture sleep overshoot measurements.
|
| |
X11 display, window, and attribute handles for capture.
◆ x11_attr_t()
| platf::x11_attr_t::x11_attr_t |
( |
mem_type_e | mem_type | ) |
|
|
inline |
Open the X11 display and initialize capture attributes.
Last X (NOT the streamed monitor!) size. This way we can trigger reinitialization if the dimensions changed while streaming
- Parameters
-
| mem_type | Requested memory path for the capture backend. |
◆ alloc_img()
| std::shared_ptr< img_t > platf::x11_attr_t::alloc_img |
( |
| ) |
|
|
inlineoverridevirtual |
Allocate an image buffer compatible with this display backend.
- Returns
- Allocated img object, or null when unavailable.
Implements platf::display_t.
◆ capture()
Capture a frame.
- Parameters
-
| push_captured_image_cb | The callback that is called with captured image, must be called from the same thread as capture() |
| pull_free_image_cb | Capture backends call this callback to get empty image from the pool. If backend uses multiple threads, calls to this callback must be synchronized. Calls to this callback and push_captured_image_cb must be synchronized as well. |
| cursor | A pointer to the flag that indicates whether the cursor should be captured as well. |
- Return values
-
Implements platf::display_t.
◆ dummy_img()
| int platf::x11_attr_t::dummy_img |
( |
img_t * | img | ) |
|
|
inlineoverridevirtual |
Populate a fallback image when real capture data is unavailable.
- Parameters
-
| img | Image or frame object to read from or populate. |
- Returns
- Capture status reported to the streaming pipeline.
Implements platf::display_t.
◆ init()
| int platf::x11_attr_t::init |
( |
const std::string & | display_name, |
|
|
const ::video::config_t & | config ) |
|
inline |
Open the X11 display and cache capture window attributes.
- Parameters
-
| display_name | Display name. |
| config | Configuration values to apply. |
- Returns
- 0 on success; nonzero or negative platform status on failure.
◆ make_avcodec_encode_device()
Create AVCodec encode device.
- Parameters
-
| pix_fmt | Sunshine pixel format to convert or allocate for. |
- Returns
- Constructed AVCodec encode device object.
Reimplemented from platf::display_t.
◆ refresh()
| void platf::x11_attr_t::refresh |
( |
| ) |
|
|
inline |
Called when the display attributes should change.
◆ snapshot()
Capture a display frame into the provided image object.
- Parameters
-
| pull_free_image_cb | Callback that provides an available image buffer. |
| img_out | XImage-backed captured frame returned to the streaming pipeline. |
| timeout | Maximum time to wait for the operation. |
| cursor | Cursor image or visibility state to composite. |
- Returns
- Capture status reported to the streaming pipeline.
The documentation for this struct was generated from the following file: