Sunshine v2026.319.132152
Self-hosted game stream host for Moonlight.
common.h
Go to the documentation of this file.
1
5#pragma once
6
7// standard includes
8#include <bitset>
9#include <filesystem>
10#include <functional>
11#include <mutex>
12#include <string>
13
14// lib includes
15#include <boost/core/noncopyable.hpp>
16#ifndef _WIN32
17 #include <boost/asio.hpp>
18 #include <boost/process/v1.hpp>
19#endif
20
21// local includes
22#include "src/config.h"
23#include "src/logging.h"
24#include "src/thread_safe.h"
25#include "src/utility.h"
27
28extern "C" {
29#include <moonlight-common-c/src/Limelight.h>
30}
31
32using namespace std::literals;
33
34struct sockaddr;
35struct AVFrame;
36struct AVBufferRef;
37struct AVHWFramesContext;
38struct AVCodecContext;
39struct AVDictionary;
40
41#ifdef _WIN32
42// Forward declarations of boost classes to avoid having to include boost headers
43// here, which results in issues with Windows.h and WinSock2.h include order.
44namespace boost {
45 namespace asio {
46 namespace ip {
47 class address;
48 } // namespace ip
49 } // namespace asio
50
51 namespace filesystem {
52 class path;
53 }
54
55 namespace process::v1 {
56 class child;
57 class group;
58 template<typename Char>
61 } // namespace process::v1
62} // namespace boost
63#endif
64namespace video {
65 struct config_t;
66} // namespace video
67
68namespace nvenc {
69 class nvenc_base;
70}
71
72namespace platf {
73 // Limited by bits in activeGamepadMask
74 constexpr auto MAX_GAMEPADS = 16;
75
76 constexpr std::uint32_t DPAD_UP = 0x0001;
77 constexpr std::uint32_t DPAD_DOWN = 0x0002;
78 constexpr std::uint32_t DPAD_LEFT = 0x0004;
79 constexpr std::uint32_t DPAD_RIGHT = 0x0008;
80 constexpr std::uint32_t START = 0x0010;
81 constexpr std::uint32_t BACK = 0x0020;
82 constexpr std::uint32_t LEFT_STICK = 0x0040;
83 constexpr std::uint32_t RIGHT_STICK = 0x0080;
84 constexpr std::uint32_t LEFT_BUTTON = 0x0100;
85 constexpr std::uint32_t RIGHT_BUTTON = 0x0200;
86 constexpr std::uint32_t HOME = 0x0400;
87 constexpr std::uint32_t A = 0x1000;
88 constexpr std::uint32_t B = 0x2000;
89 constexpr std::uint32_t X = 0x4000;
90 constexpr std::uint32_t Y = 0x8000;
91 constexpr std::uint32_t PADDLE1 = 0x010000;
92 constexpr std::uint32_t PADDLE2 = 0x020000;
93 constexpr std::uint32_t PADDLE3 = 0x040000;
94 constexpr std::uint32_t PADDLE4 = 0x080000;
95 constexpr std::uint32_t TOUCHPAD_BUTTON = 0x100000;
96 constexpr std::uint32_t MISC_BUTTON = 0x200000;
97
99 std::string name;
100 bool is_enabled;
101 std::string reason_disabled;
102 };
103
111
113 static gamepad_feedback_msg_t make_rumble(std::uint16_t id, std::uint16_t lowfreq, std::uint16_t highfreq) {
115 msg.type = gamepad_feedback_e::rumble;
116 msg.id = id;
117 msg.data.rumble = {lowfreq, highfreq};
118 return msg;
119 }
120
121 static gamepad_feedback_msg_t make_rumble_triggers(std::uint16_t id, std::uint16_t left, std::uint16_t right) {
123 msg.type = gamepad_feedback_e::rumble_triggers;
124 msg.id = id;
125 msg.data.rumble_triggers = {left, right};
126 return msg;
127 }
128
129 static gamepad_feedback_msg_t make_motion_event_state(std::uint16_t id, std::uint8_t motion_type, std::uint16_t report_rate) {
131 msg.type = gamepad_feedback_e::set_motion_event_state;
132 msg.id = id;
133 msg.data.motion_event_state.motion_type = motion_type;
134 msg.data.motion_event_state.report_rate = report_rate;
135 return msg;
136 }
137
138 static gamepad_feedback_msg_t make_rgb_led(std::uint16_t id, std::uint8_t r, std::uint8_t g, std::uint8_t b) {
140 msg.type = gamepad_feedback_e::set_rgb_led;
141 msg.id = id;
142 msg.data.rgb_led = {r, g, b};
143 return msg;
144 }
145
146 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) {
148 msg.type = gamepad_feedback_e::set_adaptive_triggers;
149 msg.id = id;
150 msg.data.adaptive_triggers = {.event_flags = event_flags, .type_left = type_left, .type_right = type_right, .left = left, .right = right};
151 return msg;
152 }
153
155 std::uint16_t id;
156
157 union {
158 struct {
159 std::uint16_t lowfreq;
160 std::uint16_t highfreq;
161 } rumble;
162
163 struct {
164 std::uint16_t left_trigger;
165 std::uint16_t right_trigger;
166 } rumble_triggers;
167
168 struct {
169 std::uint16_t report_rate;
170 std::uint8_t motion_type;
171 } motion_event_state;
172
173 struct {
174 std::uint8_t r;
175 std::uint8_t g;
176 std::uint8_t b;
177 } rgb_led;
178
179 struct {
180 uint16_t controllerNumber;
181 uint8_t event_flags;
182 uint8_t type_left;
183 uint8_t type_right;
184 std::array<uint8_t, 10> left;
185 std::array<uint8_t, 10> right;
186 } adaptive_triggers;
187 } data;
188 };
189
190 using feedback_queue_t = safe::mail_raw_t::queue_t<gamepad_feedback_msg_t>;
191
192 namespace speaker {
204
205 constexpr std::uint8_t map_stereo[] {
206 FRONT_LEFT,
207 FRONT_RIGHT
208 };
209 constexpr std::uint8_t map_surround51[] {
210 FRONT_LEFT,
211 FRONT_RIGHT,
212 FRONT_CENTER,
213 LOW_FREQUENCY,
214 BACK_LEFT,
215 BACK_RIGHT,
216 };
217 constexpr std::uint8_t map_surround71[] {
222 BACK_LEFT,
224 SIDE_LEFT,
226 };
227 } // namespace speaker
228
229 enum class mem_type_e {
230 system,
231 vaapi,
232 dxgi,
233 cuda,
234 videotoolbox,
235 unknown
236 };
237
238 enum class pix_fmt_e {
239 yuv420p,
240 yuv420p10,
241 nv12,
242 p010,
243 ayuv,
244 yuv444p16,
245 y410,
246 unknown
247 };
248
249 inline std::string_view from_pix_fmt(pix_fmt_e pix_fmt) {
250 using namespace std::literals;
251#define _CONVERT(x) \
252 case pix_fmt_e::x: \
253 return #x##sv
254 switch (pix_fmt) {
255 _CONVERT(yuv420p);
256 _CONVERT(yuv420p10);
257 _CONVERT(nv12);
258 _CONVERT(p010);
259 _CONVERT(ayuv);
260 _CONVERT(yuv444p16);
261 _CONVERT(y410);
262 _CONVERT(unknown);
263 }
264#undef _CONVERT
265
266 return "unknown"sv;
267 }
268
269 // Dimensions for touchscreen input
271 int offset_x;
272 int offset_y;
273 int width;
274 int height;
275 int logical_width;
276 int logical_height;
277 };
278
279 // These values must match Limelight-internal.h's SS_FF_* constants!
280 namespace platform_caps {
281 typedef uint32_t caps_t;
282
283 constexpr caps_t pen_touch = 0x01; // Pen and touch events
284 constexpr caps_t controller_touch = 0x02; // Controller touch events
285 }; // namespace platform_caps
286
288 std::uint32_t buttonFlags;
289 std::uint8_t lt;
290 std::uint8_t rt;
291 std::int16_t lsX;
292 std::int16_t lsY;
293 std::int16_t rsX;
294 std::int16_t rsY;
295 };
296
298 // The global index is used when looking up gamepads in the platform's
299 // gamepad array. It identifies gamepads uniquely among all clients.
300 int globalIndex;
301
302 // The client-relative index is the controller number as reported by the
303 // client. It must be used when communicating back to the client via
304 // the input feedback queue.
305 std::uint8_t clientRelativeIndex;
306 };
307
309 std::uint8_t type;
310 std::uint16_t capabilities;
311 std::uint32_t supportedButtons;
312 };
313
315 gamepad_id_t id;
316 std::uint8_t eventType;
317 std::uint32_t pointerId;
318 float x;
319 float y;
320 float pressure;
321 };
322
324 gamepad_id_t id;
325 std::uint8_t motionType;
326
327 // Accel: m/s^2
328 // Gyro: deg/s
329 float x;
330 float y;
331 float z;
332 };
333
335 gamepad_id_t id;
336 std::uint8_t state;
337 std::uint8_t percentage;
338 };
339
341 std::uint8_t eventType;
342 std::uint16_t rotation; // Degrees (0..360) or LI_ROT_UNKNOWN
343 std::uint32_t pointerId;
344 float x;
345 float y;
346 float pressureOrDistance; // Distance for hover and pressure for contact
347 float contactAreaMajor;
348 float contactAreaMinor;
349 };
350
351 struct pen_input_t {
352 std::uint8_t eventType;
353 std::uint8_t toolType;
354 std::uint8_t penButtons;
355 std::uint8_t tilt; // Degrees (0..90) or LI_TILT_UNKNOWN
356 std::uint16_t rotation; // Degrees (0..360) or LI_ROT_UNKNOWN
357 float x;
358 float y;
359 float pressureOrDistance; // Distance for hover and pressure for contact
360 float contactAreaMajor;
361 float contactAreaMinor;
362 };
363
364 class deinit_t {
365 public:
366 virtual ~deinit_t() = default;
367 };
368
369 struct img_t: std::enable_shared_from_this<img_t> {
370 public:
371 img_t() = default;
372
373 img_t(img_t &&) = delete;
374 img_t(const img_t &) = delete;
375 img_t &operator=(img_t &&) = delete;
376 img_t &operator=(const img_t &) = delete;
377
378 std::uint8_t *data {};
379 std::int32_t width {};
380 std::int32_t height {};
381 std::int32_t pixel_pitch {};
382 std::int32_t row_pitch {};
383
384 std::optional<std::chrono::steady_clock::time_point> frame_timestamp;
385
386 virtual ~img_t() = default;
387 };
388
389 struct sink_t {
390 // Play on host PC
391 std::string host;
392
393 // On macOS and Windows, it is not possible to create a virtual sink
394 // Therefore, it is optional
395 struct null_t {
396 std::string stereo;
397 std::string surround51;
398 std::string surround71;
399 };
400
401 std::optional<null_t> null;
402 };
403
405 virtual ~encode_device_t() = default;
406
407 virtual int convert(platf::img_t &img) = 0;
408
410 };
411
413 void *data {};
414 AVFrame *frame {};
415
416 int convert(platf::img_t &img) override {
417 return -1;
418 }
419
420 virtual void apply_colorspace() {
421 }
422
427 virtual int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx) {
428 BOOST_LOG(error) << "Illegal call to hwdevice_t::set_frame(). Did you forget to override it?";
429 return -1;
430 };
431
436 virtual void init_hwframes(AVHWFramesContext *frames) {};
437
442 virtual void init_codec_options(AVCodecContext *ctx, AVDictionary **options) {};
443
448 virtual int prepare_to_derive_context(int hw_device_type) {
449 return 0;
450 };
451 };
452
454 virtual bool init_encoder(const video::config_t &client_config, const video::sunshine_colorspace_t &colorspace) = 0;
455
456 nvenc::nvenc_base *nvenc = nullptr;
457 };
458
459 enum class capture_e : int {
460 ok,
461 reinit,
462 timeout,
464 error
465 };
466
467 class display_t {
468 public:
476 using push_captured_image_cb_t = std::function<bool(std::shared_ptr<img_t> &&img, bool frame_captured)>;
477
485 using pull_free_image_cb_t = std::function<bool(std::shared_ptr<img_t> &img_out)>;
486
487 display_t() noexcept:
488 offset_x {0},
489 offset_y {0} {
490 }
491
504 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;
505
506 virtual std::shared_ptr<img_t> alloc_img() = 0;
507
508 virtual int dummy_img(img_t *img) = 0;
509
510 virtual std::unique_ptr<avcodec_encode_device_t> make_avcodec_encode_device(pix_fmt_e pix_fmt) {
511 return nullptr;
512 }
513
514 virtual std::unique_ptr<nvenc_encode_device_t> make_nvenc_encode_device(pix_fmt_e pix_fmt) {
515 return nullptr;
516 }
517
518 virtual bool is_hdr() {
519 return false;
520 }
521
522 virtual bool get_hdr_metadata(SS_HDR_METADATA &metadata) {
523 std::memset(&metadata, 0, sizeof(metadata));
524 return false;
525 }
526
533 virtual bool is_codec_supported(std::string_view name, const ::video::config_t &config) {
534 return true;
535 }
536
537 virtual bool is_event_driven() {
538 return false;
539 }
540
541 virtual ~display_t() = default;
542
543 // Offsets for when streaming a specific monitor. By default, they are 0.
544 int offset_x;
545 int offset_y;
546 int env_width;
547 int env_height;
548 int env_logical_width;
549 int env_logical_height;
550 int width;
551 int height;
552 int logical_width;
553 int logical_height;
554
555 protected:
556 // collect capture timing data (at loglevel debug)
557 logging::time_delta_periodic_logger sleep_overshoot_logger = {debug, "Frame capture sleep overshoot"};
558 };
559
560 class mic_t {
561 public:
562 virtual capture_e sample(std::vector<float> &frame_buffer) = 0;
563
564 virtual ~mic_t() = default;
565 };
566
568 public:
569 virtual int set_sink(const std::string &sink) = 0;
570
571 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) = 0;
572
578 virtual bool is_sink_available(const std::string &sink) = 0;
579
580 virtual std::optional<sink_t> sink_info() = 0;
581
582 virtual ~audio_control_t() = default;
583 };
584
585 void freeInput(void *);
586
588
589 std::filesystem::path appdata();
590
591 std::string get_mac_address(const std::string_view &address);
592
593 std::string from_sockaddr(const sockaddr *const);
594 std::pair<std::uint16_t, std::string> from_sockaddr_ex(const sockaddr *const);
595
596 std::unique_ptr<audio_control_t> audio_control();
597
606 std::shared_ptr<display_t> display(mem_type_e hwdevice_type, const std::string &display_name, const video::config_t &config);
607
608 // A list of names of displays accepted as display_name with the mem_type_e
609 std::vector<std::string> display_names(mem_type_e hwdevice_type);
610
616
617 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);
618
619 enum class thread_priority_e : int {
620 low,
621 normal,
622 high,
623 critical
624 };
625 void adjust_thread_priority(thread_priority_e priority);
626
631 void set_thread_name(const std::string &name);
632
633 void enable_mouse_keys();
634
635 // Allow OS-specific actions to be taken to prepare for streaming
636 void streaming_will_start();
637 void streaming_will_stop();
638
639 void restart();
640
647 int set_env(const std::string &name, const std::string &value);
648
654 int unset_env(const std::string &name);
655
657 const char *buffer;
658 size_t size;
659
660 // Constructors required for emplace_back() prior to C++20
661 buffer_descriptor_t(const char *buffer, size_t size):
662 buffer(buffer),
663 size(size) {
664 }
665
667 buffer(nullptr),
668 size(0) {
669 }
670 };
671
673 // Optional headers to be prepended to each packet
674 const char *headers;
675 size_t header_size;
676
677 // One or more data buffers to use for the payloads
678 //
679 // NB: Data buffers must be aligned to payload size!
680 std::vector<buffer_descriptor_t> &payload_buffers;
681 size_t payload_size;
682
683 // The offset (in header+payload message blocks) in the header and payload
684 // buffers to begin sending messages from
685 size_t block_offset;
686
687 // The number of header+payload message blocks to send
688 size_t block_count;
689
690 std::uintptr_t native_socket;
691 boost::asio::ip::address &target_address;
692 uint16_t target_port;
693 boost::asio::ip::address &source_address;
694
701 for (const auto &desc : payload_buffers) {
702 if (offset < desc.size) {
703 return {
704 desc.buffer + offset,
705 desc.size - offset,
706 };
707 } else {
708 offset -= desc.size;
709 }
710 }
711 return {};
712 }
713 };
714
715 bool send_batch(batched_send_info_t &send_info);
716
717 struct send_info_t {
718 const char *header;
719 size_t header_size;
720 const char *payload;
721 size_t payload_size;
722
723 std::uintptr_t native_socket;
724 boost::asio::ip::address &target_address;
725 uint16_t target_port;
726 boost::asio::ip::address &source_address;
727 };
728
729 bool send(send_info_t &send_info);
730
731 enum class qos_data_type_e : int {
732 audio,
733 video
734 };
735
744 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);
745
750 void open_url(const std::string &url);
751
757 bool request_process_group_exit(std::uintptr_t native_handle);
758
764 bool process_group_running(std::uintptr_t native_handle);
765
766 input_t input();
775 util::point_t get_mouse_loc(input_t &input);
776 void move_mouse(input_t &input, int deltaX, int deltaY);
777 void abs_mouse(input_t &input, const touch_port_t &touch_port, float x, float y);
778 void button_mouse(input_t &input, int button, bool release);
779 void scroll(input_t &input, int distance);
780 void hscroll(input_t &input, int distance);
781 void keyboard_update(input_t &input, uint16_t modcode, bool release, uint8_t flags);
782 void gamepad_update(input_t &input, int nr, const gamepad_state_t &gamepad_state);
783 void unicode(input_t &input, char *utf8, int size);
784
785 typedef deinit_t client_input_t;
786
792 std::unique_ptr<client_input_t> allocate_client_input_context(input_t &input);
793
800 void touch_update(client_input_t *input, const touch_port_t &touch_port, const touch_input_t &touch);
801
808 void pen_update(client_input_t *input, const touch_port_t &touch_port, const pen_input_t &pen);
809
815 void gamepad_touch(input_t &input, const gamepad_touch_t &touch);
816
822 void gamepad_motion(input_t &input, const gamepad_motion_t &motion);
823
829 void gamepad_battery(input_t &input, const gamepad_battery_t &battery);
830
839 int alloc_gamepad(input_t &input, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue);
840 void free_gamepad(input_t &input, int nr);
841
846 platform_caps::caps_t get_capabilities();
847
848 constexpr auto SERVICE_NAME = "Sunshine";
849 constexpr auto SERVICE_TYPE = "_nvstream._tcp";
850
851 namespace publish {
852 [[nodiscard]] std::unique_ptr<deinit_t> start();
853 }
854
855 [[nodiscard]] std::unique_ptr<deinit_t> init();
856
861 std::string get_host_name();
862
869 std::vector<supported_gamepad_t> &supported_gamepads(input_t *input);
870
871 struct high_precision_timer: private boost::noncopyable {
872 virtual ~high_precision_timer() = default;
873
878 virtual void sleep_for(const std::chrono::nanoseconds &duration) = 0;
879
884 virtual operator bool() = 0;
885 };
886
891 std::unique_ptr<high_precision_timer> create_high_precision_timer();
892
893} // namespace platf
A helper class for tracking and logging short time intervals across a period of time.
Definition logging.h:166
Abstract platform-agnostic base of standalone NVENC encoder. Derived classes perform platform-specifi...
Definition nvenc_base.h:26
Definition common.h:567
virtual bool is_sink_available(const std::string &sink)=0
Check if the audio sink is available in the system.
Definition common.h:364
Definition common.h:467
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:533
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:476
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:485
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.
Definition common.h:560
Definition utility.h:530
mem_type_e
Definition common.h:229
@ system
System memory.
speaker_e
Definition common.h:193
@ BACK_LEFT
Back left.
Definition common.h:198
@ LOW_FREQUENCY
Low frequency.
Definition common.h:197
@ SIDE_RIGHT
Side right.
Definition common.h:201
@ MAX_SPEAKERS
Maximum number of speakers.
Definition common.h:202
@ FRONT_LEFT
Front left.
Definition common.h:194
@ SIDE_LEFT
Side left.
Definition common.h:200
@ FRONT_CENTER
Front center.
Definition common.h:196
@ BACK_RIGHT
Back right.
Definition common.h:199
@ FRONT_RIGHT
Front right.
Definition common.h:195
std::vector< supported_gamepad_t > & supported_gamepads(input_t *input)
Gets the supported gamepads for this platform backend.
Definition inputtino.cpp:130
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:985
pix_fmt_e
Definition common.h:238
@ yuv420p10
YUV 4:2:0 10-bit.
@ yuv444p16
Planar 10-bit (shifted to 16-bit) YUV 4:4:4.
@ yuv420p
YUV 4:2:0.
std::filesystem::path appdata()
Performs migration if necessary, then returns the appdata directory.
Definition misc.cpp:126
qos_data_type_e
Definition common.h:731
std::unique_ptr< high_precision_timer > create_high_precision_timer()
Create platform-specific timer capable of high-precision sleep.
Definition misc.cpp:1096
bool needs_encoder_reenumeration()
Check if GPUs/drivers have changed since the last call to this function.
Definition misc.cpp:980
gamepad_feedback_e
Definition common.h:104
@ rumble_triggers
Rumble triggers.
@ set_adaptive_triggers
Set adaptive triggers.
@ set_motion_event_state
Set motion event state.
thread_priority_e
Definition common.h:619
@ critical
Critical priority.
@ high
High priority.
@ normal
Normal priority.
std::string get_host_name()
Returns the current computer name in UTF-8.
Definition misc.cpp:869
capture_e
Definition common.h:459
@ timeout
Timeout.
@ reinit
Need to reinitialize.
@ interrupted
Capture was interrupted.
Declarations for the configuration of Sunshine.
std::unique_ptr< platf::deinit_t > init(const std::filesystem::path &persistence_filepath, const config::video_t &video_config)
Initialize the implementation and perform the initial state recovery (if needed).
Definition display_device.cpp:704
Declarations for logging related functions.
Standalone NVENC encoder.
Definition nvenc_base.cpp:90
Definition common.h:412
virtual int prepare_to_derive_context(int hw_device_type)
Prepare to derive a context.
Definition common.h:448
virtual void init_codec_options(AVCodecContext *ctx, AVDictionary **options)
Provides a hook for allow platform-specific code to adjust codec options.
Definition common.h:442
virtual int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx)
Set the frame to be encoded.
Definition common.h:427
virtual void init_hwframes(AVHWFramesContext *frames)
Initialize the hwframes context.
Definition common.h:436
Definition common.h:672
buffer_descriptor_t buffer_for_payload_offset(ptrdiff_t offset)
Returns a payload buffer descriptor for the given payload offset.
Definition common.h:700
Definition common.h:656
Definition common.h:404
Definition common.h:308
Definition common.h:334
Definition common.h:112
Definition common.h:297
Definition common.h:323
Definition common.h:287
Definition common.h:314
Definition common.h:871
virtual void sleep_for(const std::chrono::nanoseconds &duration)=0
Sleep for the duration.
Definition common.h:369
Definition common.h:453
Definition common.h:351
Definition common.h:717
Definition common.h:395
Definition common.h:389
Definition common.h:98
Definition common.h:340
Definition common.h:270
Definition utility.h:966
Definition video.h:23
Definition video_colorspace.h:20
Declarations for thread-safe data structures.
Declarations for utility functions.
Declarations for colorspace functions.