15#include <boost/core/noncopyable.hpp>
17 #include <boost/asio.hpp>
18 #include <boost/process/v1.hpp>
29#include <moonlight-common-c/src/Limelight.h>
32using namespace std::literals;
37struct AVHWFramesContext;
51 namespace filesystem {
55 namespace process::v1 {
58 template<
typename Char>
77 constexpr auto MAX_GAMEPADS = 16;
83 constexpr std::uint32_t
START = 0x0010;
84 constexpr std::uint32_t
BACK = 0x0020;
89 constexpr std::uint32_t
HOME = 0x0400;
90 constexpr std::uint32_t
A = 0x1000;
91 constexpr std::uint32_t
B = 0x2000;
92 constexpr std::uint32_t
X = 0x4000;
93 constexpr std::uint32_t
Y = 0x8000;
94 constexpr std::uint32_t
PADDLE1 = 0x010000;
95 constexpr std::uint32_t
PADDLE2 = 0x020000;
96 constexpr std::uint32_t
PADDLE3 = 0x040000;
97 constexpr std::uint32_t
PADDLE4 = 0x080000;
135 msg.
type = gamepad_feedback_e::rumble;
137 msg.
data.rumble = {lowfreq, highfreq};
151 msg.
type = gamepad_feedback_e::rumble_triggers;
153 msg.
data.rumble_triggers = {left, right};
167 msg.
type = gamepad_feedback_e::set_motion_event_state;
169 msg.
data.motion_event_state.motion_type = motion_type;
170 msg.
data.motion_event_state.report_rate = report_rate;
185 msg.
type = gamepad_feedback_e::set_rgb_led;
187 msg.
data.rgb_led = {r, g, b};
204 msg.
type = gamepad_feedback_e::set_adaptive_triggers;
206 msg.
data.adaptive_triggers = {.event_flags = event_flags, .type_left = type_left, .type_right = type_right, .left = left, .right = right};
215 std::uint16_t lowfreq;
216 std::uint16_t highfreq;
220 std::uint16_t left_trigger;
221 std::uint16_t right_trigger;
225 std::uint16_t report_rate;
226 std::uint8_t motion_type;
227 } motion_event_state;
236 uint16_t controllerNumber;
240 std::array<uint8_t, 10> left;
241 std::array<uint8_t, 10> right;
335 using namespace std::literals;
337 #define _CONVERT(x) \
371 namespace platform_caps {
502 struct img_t: std::enable_shared_from_this<img_t> {
595 BOOST_LOG(
error) <<
"Illegal call to hwdevice_t::set_frame(). Did you forget to override it?";
745 std::memset(&metadata, 0,
sizeof(metadata));
791 virtual ~mic_t() =
default;
818 virtual std::unique_ptr<mic_t>
microphone(
const std::uint8_t *mapping,
int channels, std::uint32_t sample_rate, std::uint32_t frame_size,
bool continuous, [[maybe_unused]]
bool host_audio_enabled) = 0;
852 std::filesystem::path
appdata();
875 std::pair<std::uint16_t, std::string>
from_sockaddr_ex(
const sockaddr *
const);
922 boost::process::v1::child
run_command(
bool elevated,
bool interactive,
const std::string &cmd, boost::filesystem::path &working_dir,
const boost::process::v1::environment &env, FILE *file, std::error_code &ec, boost::process::v1::group *group);
938 void adjust_thread_priority(thread_priority_e priority);
946 void set_thread_name(
const std::string &name);
948 void enable_mouse_keys();
951 void streaming_will_start();
952 void streaming_will_stop();
1014 if (offset < desc.size) {
1016 desc.buffer + offset,
1020 offset -= desc.size;
1033 bool send_batch(batched_send_info_t &send_info);
1076 std::unique_ptr<deinit_t> enable_socket_qos(uintptr_t native_socket, boost::asio::ip::address &address, uint16_t port, qos_data_type_e data_type,
bool dscp_tagging);
1082 void open_url(
const std::string &url);
1089 bool request_process_group_exit(std::uintptr_t native_handle);
1096 bool process_group_running(std::uintptr_t native_handle);
1120 void move_mouse(input_t &input,
int deltaX,
int deltaY);
1129 void abs_mouse(input_t &input,
const touch_port_t &touch_port,
float x,
float y);
1137 void button_mouse(input_t &input,
int button,
bool release);
1144 void scroll(input_t &input,
int distance);
1151 void hscroll(input_t &input,
int distance);
1160 void keyboard_update(input_t &input, uint16_t modcode,
bool release, uint8_t flags);
1161 void gamepad_update(input_t &input,
int nr,
const gamepad_state_t &gamepad_state);
1169 void unicode(input_t &input,
char *utf8,
int size);
1235 void free_gamepad(
input_t &input,
int nr);
1247 [[nodiscard]] std::unique_ptr<deinit_t> start();
1255 [[nodiscard]] std::unique_ptr<deinit_t> init();
1261 std::string get_host_name();
1270 std::string resolve_render_device();
1278 std::vector<supported_gamepad_t> &supported_gamepads(input_t *input);
1290 virtual void sleep_for(
const std::chrono::nanoseconds &duration) = 0;
1296 virtual operator bool() = 0;
A helper class for tracking and logging short time intervals across a period of time.
Definition logging.h:204
Abstract platform-agnostic base of standalone NVENC encoder. Derived classes perform platform-specifi...
Definition nvenc_base.h:26
Platform audio controller that manages sinks and microphone capture.
Definition common.h:797
virtual std::unique_ptr< mic_t > microphone(const std::uint8_t *mapping, int channels, std::uint32_t sample_rate, std::uint32_t frame_size, bool continuous, bool host_audio_enabled)=0
Create a microphone capture stream for the requested layout.
virtual std::optional< sink_t > sink_info()=0
Query host and virtual sink names available to Sunshine.
virtual int set_sink(const std::string &sink)=0
Update the sink value on the backend.
virtual bool is_sink_available(const std::string &sink)=0
Check if the audio sink is available in the system.
virtual ~audio_control_t()=default
Destroy the audio control.
RAII helper that runs shutdown cleanup when destroyed.
Definition common.h:491
virtual ~deinit_t()=default
Destroy the deinitializer.
Abstract display capture backend used by the streaming pipeline.
Definition common.h:658
virtual bool is_codec_supported(std::string_view name, const ::video::config_t &config)
Check that a given codec is supported by the display device.
Definition common.h:755
std::function< bool(std::shared_ptr< img_t > &&img, bool frame_captured)> push_captured_image_cb_t
Callback for when a new image is ready. When display has a new image ready or a timeout occurs,...
Definition common.h:667
virtual bool get_hdr_metadata(SS_HDR_METADATA &metadata)
Read HDR metadata for the active display mode.
Definition common.h:744
int env_height
Height of the full capture environment in physical pixels.
Definition common.h:765
int env_logical_height
Height of the full capture environment after display scaling.
Definition common.h:767
std::function< bool(std::shared_ptr< img_t > &img_out)> pull_free_image_cb_t
Get free image from pool. Calls must be synchronized. Blocks until there is free image in the pool or...
Definition common.h:676
logging::time_delta_periodic_logger sleep_overshoot_logger
Periodic logger for capture sleep overshoot measurements.
Definition common.h:775
int offset_y
Vertical capture offset in physical pixels.
Definition common.h:763
virtual capture_e capture(const push_captured_image_cb_t &push_captured_image_cb, const pull_free_image_cb_t &pull_free_image_cb, bool *cursor)=0
Capture a frame.
virtual std::unique_ptr< nvenc_encode_device_t > make_nvenc_encode_device(pix_fmt_e pix_fmt)
Create NVENC encode device.
Definition common.h:725
int width
Width of the captured display in physical pixels.
Definition common.h:768
int logical_height
Height of the captured display after display scaling.
Definition common.h:771
int env_width
Width of the full capture environment in physical pixels.
Definition common.h:764
int height
Height of the captured display in physical pixels.
Definition common.h:769
virtual std::unique_ptr< avcodec_encode_device_t > make_avcodec_encode_device(pix_fmt_e pix_fmt)
Create AVCodec encode device.
Definition common.h:715
int offset_x
Horizontal capture offset in physical pixels.
Definition common.h:762
virtual bool is_hdr()
Report whether the active display mode is HDR.
Definition common.h:734
int env_logical_width
Width of the full capture environment after display scaling.
Definition common.h:766
virtual std::shared_ptr< img_t > alloc_img()=0
Allocate an image buffer compatible with this display backend.
int logical_width
Width of the captured display after display scaling.
Definition common.h:770
virtual int dummy_img(img_t *img)=0
Populate a fallback image when real capture data is unavailable.
Audio capture source used by the streaming pipeline.
Definition common.h:781
virtual capture_e sample(std::vector< float > &frame_buffer)=0
Deliver a captured audio sample to Sunshine's audio pipeline.
std::shared_ptr< post_t< queue_t< T > > > queue_t
Mailbox-backed queue wrapper for typed messages.
Definition thread_safe.h:797
Unique pointer wrapper with customizable pointer and deleter types.
Definition utility.h:820
mem_type_e
Enumerates supported mem type options.
Definition common.h:303
constexpr std::uint32_t B
Moonlight gamepad button mask bit for B.
Definition common.h:91
speaker_e
Enumerates supported speaker options.
Definition common.h:255
@ BACK_LEFT
Back left.
Definition common.h:260
@ LOW_FREQUENCY
Low frequency.
Definition common.h:259
@ SIDE_RIGHT
Side right.
Definition common.h:263
@ MAX_SPEAKERS
Maximum number of speakers.
Definition common.h:264
@ FRONT_LEFT
Front left.
Definition common.h:256
@ SIDE_LEFT
Side left.
Definition common.h:262
@ FRONT_CENTER
Front center.
Definition common.h:258
@ BACK_RIGHT
Back right.
Definition common.h:261
@ FRONT_RIGHT
Front right.
Definition common.h:257
constexpr std::uint32_t LEFT_BUTTON
Moonlight gamepad button mask bit for left shoulder.
Definition common.h:87
constexpr std::uint32_t DPAD_LEFT
Moonlight gamepad button mask bit for D-pad left.
Definition common.h:81
std::string get_mac_address(const std::string_view &address)
Return the hardware MAC address associated with a network address.
Definition misc.cpp:364
constexpr std::uint32_t DPAD_UP
Moonlight gamepad button mask bit for D-pad up.
Definition common.h:79
std::shared_ptr< display_t > display(mem_type_e hwdevice_type, const std::string &display_name, const video::config_t &config)
Get the display_t instance for the given hwdevice_type. If display_name is empty, use the first monit...
Definition misc.cpp:1254
constexpr std::uint32_t PADDLE3
Moonlight gamepad button mask bit for paddle 3.
Definition common.h:96
constexpr auto SERVICE_TYPE
mDNS service type advertised for GameStream discovery.
Definition common.h:1244
std::pair< std::uint16_t, std::string > from_sockaddr_ex(const sockaddr *const)
Convert a socket address to a port and printable IP address.
Definition misc.cpp:345
pix_fmt_e
Enumerates supported pix fmt options.
Definition common.h:316
@ yuv420p10
YUV 4:2:0 10-bit.
@ yuv444p
Planar 8-bit YUV 4:4:4.
@ yuv444p16
Planar 10-bit (shifted to 16-bit) YUV 4:4:4.
int alloc_gamepad(input_t &input, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue)
Create a new virtual gamepad.
Definition inputtino.cpp:109
constexpr std::uint32_t HOME
Moonlight gamepad button mask bit for Home.
Definition common.h:89
bool has_elevated_privileges(bool all_caps)
Check is the current process is running with elevated privileges (e.g. system admin/etc....
Definition misc.cpp:1467
std::filesystem::path appdata()
Performs migration if necessary, then returns the appdata directory.
Definition misc.cpp:251
constexpr std::uint32_t TOUCHPAD_BUTTON
Moonlight gamepad button mask bit for touchpad click.
Definition common.h:98
constexpr std::uint32_t LEFT_STICK
Moonlight gamepad button mask bit for left stick press.
Definition common.h:85
constexpr std::uint32_t DPAD_RIGHT
Moonlight gamepad button mask bit for D-pad right.
Definition common.h:82
constexpr std::uint32_t PADDLE2
Moonlight gamepad button mask bit for paddle 2.
Definition common.h:95
constexpr std::uint32_t RIGHT_STICK
Moonlight gamepad button mask bit for right stick press.
Definition common.h:86
qos_data_type_e
Identifies traffic classes used for socket QoS tagging.
Definition common.h:1061
std::unique_ptr< high_precision_timer > create_high_precision_timer()
Create platform-specific timer capable of high-precision sleep.
Definition misc.cpp:1394
std::string_view from_pix_fmt(pix_fmt_e pix_fmt)
Convert a Sunshine pixel format enum to its string name.
Definition common.h:334
constexpr std::uint8_t map_surround51[]
Moonlight speaker order for 5.1 surround audio.
Definition common.h:277
uint32_t caps_t
Bitset containing platform capability flags.
Definition common.h:375
std::unique_ptr< audio_control_t > audio_control()
Create the platform audio controller.
Definition audio.cpp:678
constexpr std::uint32_t PADDLE1
Moonlight gamepad button mask bit for paddle 1.
Definition common.h:94
std::unique_ptr< client_input_t > allocate_client_input_context(input_t &input)
Allocate a context to store per-client input data.
Definition inputtino.cpp:31
constexpr std::uint32_t PADDLE4
Moonlight gamepad button mask bit for paddle 4.
Definition common.h:97
constexpr std::uint8_t map_stereo[]
Moonlight speaker order for stereo audio.
Definition common.h:270
constexpr caps_t pen_touch
Capability bit indicating native pen and touch support.
Definition common.h:380
constexpr std::uint32_t A
Moonlight gamepad button mask bit for A.
Definition common.h:90
constexpr auto SERVICE_NAME
mDNS service instance name advertised for GameStream discovery.
Definition common.h:1243
constexpr std::uint8_t map_surround71[]
Moonlight speaker order for 7.1 surround audio.
Definition common.h:288
bool send(send_info_t &send_info)
Send the serialized response over the active socket.
Definition misc.cpp:867
constexpr std::uint32_t DPAD_DOWN
Moonlight gamepad button mask bit for D-pad down.
Definition common.h:80
void pen_update(client_input_t *input, const touch_port_t &touch_port, const pen_input_t &pen)
Send a pen event to the OS.
Definition inputtino.cpp:104
void gamepad_motion(input_t &input, const gamepad_motion_t &motion)
Send a gamepad motion event to the OS.
Definition inputtino.cpp:132
bool needs_encoder_reenumeration()
Check if GPUs/drivers have changed since the last call to this function.
Definition misc.cpp:1249
gamepad_feedback_e
Enumerates supported gamepad feedback options.
Definition common.h:113
@ rumble_triggers
Rumble triggers.
@ set_adaptive_triggers
Set adaptive triggers.
@ set_motion_event_state
Set motion event state.
@ set_rgb_led
Set RGB LED.
boost::process::v1::child run_command(bool elevated, bool interactive, const std::string &cmd, boost::filesystem::path &working_dir, const boost::process::v1::environment &env, FILE *file, std::error_code &ec, boost::process::v1::group *group)
Launch a configured preparation or application command.
constexpr std::uint32_t BACK
Moonlight gamepad button mask bit for Back.
Definition common.h:84
thread_priority_e
Enumerates supported thread priority options.
Definition common.h:927
@ critical
Critical priority.
void drop_elevated_privileges(bool all_caps)
Drop elevated privileges (e.g. system admin/nice etc.)
Definition misc.cpp:1496
std::string from_sockaddr(const sockaddr *const)
Convert a socket address to a printable IP address.
Definition misc.cpp:329
constexpr std::uint32_t RIGHT_BUTTON
Moonlight gamepad button mask bit for right shoulder.
Definition common.h:88
safe::mail_raw_t::queue_t< gamepad_feedback_msg_t > feedback_queue_t
Queue used to deliver controller feedback commands to the platform backend.
Definition common.h:249
constexpr std::uint32_t START
Moonlight gamepad button mask bit for Start.
Definition common.h:83
constexpr std::uint32_t MISC_BUTTON
Moonlight gamepad button mask bit for the miscellaneous button.
Definition common.h:99
void gamepad_battery(input_t &input, const gamepad_battery_t &battery)
Send a gamepad battery event to the OS.
Definition inputtino.cpp:137
constexpr std::uint32_t X
Moonlight gamepad button mask bit for X.
Definition common.h:92
platform_caps::caps_t get_capabilities()
Get the supported platform capabilities to advertise to the client.
Definition inputtino.cpp:142
std::vector< std::string > display_names(mem_type_e hwdevice_type)
List display names accepted by the selected capture backend.
Definition misc.cpp:1209
void gamepad_touch(input_t &input, const gamepad_touch_t &touch)
Send a gamepad touch event to the OS.
Definition inputtino.cpp:127
void touch_update(client_input_t *input, const touch_port_t &touch_port, const touch_input_t &touch)
Send a touch event to the OS.
Definition inputtino.cpp:99
constexpr caps_t controller_touch
Capability bit indicating controller touchpad support.
Definition common.h:384
capture_e
Enumerates supported capture options.
Definition common.h:647
@ reinit
Need to reinitialize.
@ interrupted
Capture was interrupted.
constexpr std::uint32_t Y
Moonlight gamepad button mask bit for Y.
Definition common.h:93
void freeInput(void *)
Release a platform input backend created by input().
Definition inputtino.cpp:38
Declarations for the configuration of Sunshine.
avahi::EntryGroup * group
Active Avahi entry group that owns the published service.
Definition publish.cpp:398
bl::sources::severity_logger< int > debug
Follow what is happening.
Definition logging.cpp:41
bl::sources::severity_logger< int > error
Recoverable errors.
Definition logging.cpp:44
boost::shared_ptr< boost::log::sinks::asynchronous_sink< boost::log::sinks::text_ostream_backend > > sink
Sink.
Definition logging.cpp:38
Declarations for logging related functions.
Standalone NVENC encoder.
Definition nvenc_base.cpp:94
AVCodec-backed encode device and frame state.
Definition common.h:566
int convert(platf::img_t &img) override
Convert a captured image into the encoder input representation.
Definition common.h:576
virtual int prepare_to_derive_context(int hw_device_type)
Prepare to derive a context.
Definition common.h:623
virtual void init_codec_options(AVCodecContext *ctx, AVDictionary **options)
Provides a hook for allow platform-specific code to adjust codec options.
Definition common.h:614
virtual void apply_colorspace()
Apply the configured colorspace metadata to the active frame.
Definition common.h:583
AVFrame * frame
FFmpeg frame currently owned by the encode device.
Definition common.h:568
virtual int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx)
Set the frame to be encoded.
Definition common.h:594
void * data
Backend-specific conversion state.
Definition common.h:567
virtual void init_hwframes(AVHWFramesContext *frames)
Initialize the hwframes context.
Definition common.h:605
Buffers and native metadata for one batched send operation.
Definition common.h:984
boost::asio::ip::address & source_address
Local source IP address for outgoing packets.
Definition common.h:1005
const char * headers
Optional header bytes prepended to each payload.
Definition common.h:986
std::vector< buffer_descriptor_t > & payload_buffers
Payload buffers containing one or more packet blocks.
Definition common.h:992
buffer_descriptor_t buffer_for_payload_offset(ptrdiff_t offset)
Returns a payload buffer descriptor for the given payload offset.
Definition common.h:1012
std::uintptr_t native_socket
Platform socket handle used for the send operation.
Definition common.h:1002
size_t block_count
Number of packet blocks to send.
Definition common.h:1000
uint16_t target_port
Destination UDP port for outgoing packets.
Definition common.h:1004
size_t block_offset
First packet block index to send.
Definition common.h:997
size_t header_size
Header size in bytes.
Definition common.h:987
size_t payload_size
Payload size in bytes for each packet block.
Definition common.h:993
boost::asio::ip::address & target_address
Destination IP address for outgoing packets.
Definition common.h:1003
Platform buffer pointer and size for batched socket sends.
Definition common.h:959
size_t size
Size of the buffer in bytes.
Definition common.h:961
buffer_descriptor_t(const char *buffer, size_t size)
Describe a contiguous byte buffer for batched socket sending.
Definition common.h:970
const char * buffer
Pointer to the payload buffer.
Definition common.h:960
Base interface for hardware or software frame conversion.
Definition common.h:549
video::sunshine_colorspace_t colorspace
Colorspace metadata expected by the encoder.
Definition common.h:560
virtual int convert(platf::img_t &img)=0
Convert a captured image into the encoder input representation.
Capabilities reported when a controller is connected.
Definition common.h:417
std::uint8_t type
Protocol or controller type discriminator.
Definition common.h:418
std::uint32_t supportedButtons
Button mask supported by the connected controller.
Definition common.h:420
std::uint16_t capabilities
Capability flags advertised by the controller.
Definition common.h:419
Battery state reported by a virtual gamepad.
Definition common.h:452
std::uint8_t state
Battery state reported by the client.
Definition common.h:454
std::uint8_t percentage
Battery charge percentage.
Definition common.h:455
gamepad_id_t id
Gamepad identifier for the event.
Definition common.h:453
Feedback command sent from Sunshine to a virtual gamepad.
Definition common.h:124
static gamepad_feedback_msg_t make_motion_event_state(std::uint16_t id, std::uint8_t motion_type, std::uint16_t report_rate)
Motion-event feedback command payload for a controller.
Definition common.h:165
std::uint16_t id
Controller identifier associated with this message.
Definition common.h:211
union platf::gamepad_feedback_msg_t::@13 data
Controller feedback payload for the selected feedback type.
static gamepad_feedback_msg_t make_rumble(std::uint16_t id, std::uint16_t lowfreq, std::uint16_t highfreq)
Create a rumble object or message.
Definition common.h:133
static gamepad_feedback_msg_t make_rgb_led(std::uint16_t id, std::uint8_t r, std::uint8_t g, std::uint8_t b)
Create RGB led.
Definition common.h:183
static gamepad_feedback_msg_t make_rumble_triggers(std::uint16_t id, std::uint16_t left, std::uint16_t right)
Create rumble triggers.
Definition common.h:149
static gamepad_feedback_msg_t make_adaptive_triggers(std::uint16_t id, uint8_t event_flags, uint8_t type_left, uint8_t type_right, const std::array< uint8_t, 10 > &left, const std::array< uint8_t, 10 > &right)
Create adaptive triggers.
Definition common.h:202
gamepad_feedback_e type
Feedback command type stored in the union payload.
Definition common.h:210
Global and client-relative identifiers for a virtual gamepad.
Definition common.h:403
int globalIndex
Index unique across all connected clients.
Definition common.h:406
std::uint8_t clientRelativeIndex
Client relative index.
Definition common.h:411
Accelerometer or gyroscope sample from a controller.
Definition common.h:438
float z
Depth or Z-axis vector component.
Definition common.h:446
float x
Horizontal coordinate or vector component.
Definition common.h:444
gamepad_id_t id
Gamepad identifier for the event.
Definition common.h:439
float y
Vertical coordinate or vector component.
Definition common.h:445
std::uint8_t motionType
Motion type.
Definition common.h:440
Button and axis state received for a virtual gamepad.
Definition common.h:390
std::int16_t rsX
Right stick X-axis value.
Definition common.h:396
std::uint32_t buttonFlags
Moonlight button mask for the current gamepad state.
Definition common.h:391
std::uint8_t lt
Left trigger value.
Definition common.h:392
std::int16_t lsX
Left stick X-axis value.
Definition common.h:394
std::int16_t rsY
Right stick Y-axis value.
Definition common.h:397
std::uint8_t rt
Right trigger value.
Definition common.h:393
std::int16_t lsY
Left stick Y-axis value.
Definition common.h:395
Touchpad contact data reported by a controller.
Definition common.h:426
float pressure
Contact pressure reported by the client.
Definition common.h:432
std::uint32_t pointerId
Client-provided pointer identifier for a touch contact.
Definition common.h:429
float y
Vertical coordinate or vector component.
Definition common.h:431
std::uint8_t eventType
Moonlight event type for the input packet.
Definition common.h:428
float x
Horizontal coordinate or vector component.
Definition common.h:430
gamepad_id_t id
Gamepad identifier for the event.
Definition common.h:427
Platform timer object used for precise frame pacing.
Definition common.h:1283
virtual void sleep_for(const std::chrono::nanoseconds &duration)=0
Sleep for the duration.
Captured frame buffer shared between capture and encode stages.
Definition common.h:502
std::int32_t row_pitch
Bytes between consecutive image rows.
Definition common.h:515
std::uint8_t * data
Pointer to the captured image buffer.
Definition common.h:511
std::int32_t pixel_pitch
Bytes per pixel in the image buffer.
Definition common.h:514
virtual ~img_t()=default
Destroy the image.
std::int32_t height
Image height in pixels.
Definition common.h:513
std::int32_t width
Image width in pixels.
Definition common.h:512
std::optional< std::chrono::steady_clock::time_point > frame_timestamp
Capture timestamp associated with the frame.
Definition common.h:517
NVENC-backed encode device state.
Definition common.h:631
virtual bool init_encoder(const video::config_t &client_config, const video::sunshine_colorspace_t &colorspace)=0
Initialize the platform encoder for the client stream configuration.
Destination address and payload data for one UDP send.
Definition common.h:1038
const char * payload
Payload bytes to send after the header.
Definition common.h:1041
std::uintptr_t native_socket
Platform socket handle used for the send operation.
Definition common.h:1044
boost::asio::ip::address & target_address
Destination IP address for outgoing packets.
Definition common.h:1045
size_t payload_size
Payload size in bytes for each packet block.
Definition common.h:1042
uint16_t target_port
Destination UDP port for outgoing packets.
Definition common.h:1046
size_t header_size
Header size in bytes.
Definition common.h:1040
const char * header
Optional header bytes prepended to the payload.
Definition common.h:1039
boost::asio::ip::address & source_address
Local source IP address for outgoing packets.
Definition common.h:1047
Optional virtual sink names for each supported channel layout.
Definition common.h:537
std::string surround51
Virtual sink name for 5.1 surround audio.
Definition common.h:539
std::string stereo
Virtual sink name for stereo audio.
Definition common.h:538
std::string surround71
Virtual sink name for 7.1 surround audio.
Definition common.h:540
Host and virtual audio sink names for audio routing.
Definition common.h:528
std::string host
Host playback sink name.
Definition common.h:530
std::optional< null_t > null
Optional virtual sink names for monitor capture.
Definition common.h:543
Gamepad type exposed to clients and why it may be disabled.
Definition common.h:104
std::string reason_disabled
Human-readable reason the gamepad type is disabled.
Definition common.h:107
std::string name
Human-readable name for this item.
Definition common.h:105
bool is_enabled
Whether this gamepad type is currently available.
Definition common.h:106
Touchscreen coordinate bounds used to scale absolute input.
Definition common.h:361
int logical_width
Logical width after display scaling.
Definition common.h:366
int height
Frame or display height in pixels.
Definition common.h:365
int offset_y
Vertical offset in physical pixels.
Definition common.h:363
int offset_x
Horizontal offset in physical pixels.
Definition common.h:362
int logical_height
Logical height after display scaling.
Definition common.h:367
int width
Frame or display width in pixels.
Definition common.h:364
Two-dimensional integer point.
Definition utility.h:1659
Encoding configuration requested by a remote client.
Definition video.h:28
Sunshine colorimetry values derived from stream configuration.
Definition video_colorspace.h:26
Declarations for thread-safe data structures.
Declarations for utility functions.
Declarations for colorspace functions.