Sunshine v2026.213.34323
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, offset_y;
272 int width, height;
273 int logical_width, logical_height;
274 };
275
276 // These values must match Limelight-internal.h's SS_FF_* constants!
277 namespace platform_caps {
278 typedef uint32_t caps_t;
279
280 constexpr caps_t pen_touch = 0x01; // Pen and touch events
281 constexpr caps_t controller_touch = 0x02; // Controller touch events
282 }; // namespace platform_caps
283
285 std::uint32_t buttonFlags;
286 std::uint8_t lt;
287 std::uint8_t rt;
288 std::int16_t lsX;
289 std::int16_t lsY;
290 std::int16_t rsX;
291 std::int16_t rsY;
292 };
293
295 // The global index is used when looking up gamepads in the platform's
296 // gamepad array. It identifies gamepads uniquely among all clients.
297 int globalIndex;
298
299 // The client-relative index is the controller number as reported by the
300 // client. It must be used when communicating back to the client via
301 // the input feedback queue.
302 std::uint8_t clientRelativeIndex;
303 };
304
306 std::uint8_t type;
307 std::uint16_t capabilities;
308 std::uint32_t supportedButtons;
309 };
310
312 gamepad_id_t id;
313 std::uint8_t eventType;
314 std::uint32_t pointerId;
315 float x;
316 float y;
317 float pressure;
318 };
319
321 gamepad_id_t id;
322 std::uint8_t motionType;
323
324 // Accel: m/s^2
325 // Gyro: deg/s
326 float x;
327 float y;
328 float z;
329 };
330
332 gamepad_id_t id;
333 std::uint8_t state;
334 std::uint8_t percentage;
335 };
336
338 std::uint8_t eventType;
339 std::uint16_t rotation; // Degrees (0..360) or LI_ROT_UNKNOWN
340 std::uint32_t pointerId;
341 float x;
342 float y;
343 float pressureOrDistance; // Distance for hover and pressure for contact
344 float contactAreaMajor;
345 float contactAreaMinor;
346 };
347
348 struct pen_input_t {
349 std::uint8_t eventType;
350 std::uint8_t toolType;
351 std::uint8_t penButtons;
352 std::uint8_t tilt; // Degrees (0..90) or LI_TILT_UNKNOWN
353 std::uint16_t rotation; // Degrees (0..360) or LI_ROT_UNKNOWN
354 float x;
355 float y;
356 float pressureOrDistance; // Distance for hover and pressure for contact
357 float contactAreaMajor;
358 float contactAreaMinor;
359 };
360
361 class deinit_t {
362 public:
363 virtual ~deinit_t() = default;
364 };
365
366 struct img_t: std::enable_shared_from_this<img_t> {
367 public:
368 img_t() = default;
369
370 img_t(img_t &&) = delete;
371 img_t(const img_t &) = delete;
372 img_t &operator=(img_t &&) = delete;
373 img_t &operator=(const img_t &) = delete;
374
375 std::uint8_t *data {};
376 std::int32_t width {};
377 std::int32_t height {};
378 std::int32_t pixel_pitch {};
379 std::int32_t row_pitch {};
380
381 std::optional<std::chrono::steady_clock::time_point> frame_timestamp;
382
383 virtual ~img_t() = default;
384 };
385
386 struct sink_t {
387 // Play on host PC
388 std::string host;
389
390 // On macOS and Windows, it is not possible to create a virtual sink
391 // Therefore, it is optional
392 struct null_t {
393 std::string stereo;
394 std::string surround51;
395 std::string surround71;
396 };
397
398 std::optional<null_t> null;
399 };
400
402 virtual ~encode_device_t() = default;
403
404 virtual int convert(platf::img_t &img) = 0;
405
407 };
408
410 void *data {};
411 AVFrame *frame {};
412
413 int convert(platf::img_t &img) override {
414 return -1;
415 }
416
417 virtual void apply_colorspace() {
418 }
419
424 virtual int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx) {
425 BOOST_LOG(error) << "Illegal call to hwdevice_t::set_frame(). Did you forget to override it?";
426 return -1;
427 };
428
433 virtual void init_hwframes(AVHWFramesContext *frames) {};
434
439 virtual void init_codec_options(AVCodecContext *ctx, AVDictionary **options) {};
440
445 virtual int prepare_to_derive_context(int hw_device_type) {
446 return 0;
447 };
448 };
449
451 virtual bool init_encoder(const video::config_t &client_config, const video::sunshine_colorspace_t &colorspace) = 0;
452
453 nvenc::nvenc_base *nvenc = nullptr;
454 };
455
456 enum class capture_e : int {
457 ok,
458 reinit,
459 timeout,
461 error
462 };
463
464 class display_t {
465 public:
473 using push_captured_image_cb_t = std::function<bool(std::shared_ptr<img_t> &&img, bool frame_captured)>;
474
482 using pull_free_image_cb_t = std::function<bool(std::shared_ptr<img_t> &img_out)>;
483
484 display_t() noexcept:
485 offset_x {0},
486 offset_y {0} {
487 }
488
501 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;
502
503 virtual std::shared_ptr<img_t> alloc_img() = 0;
504
505 virtual int dummy_img(img_t *img) = 0;
506
507 virtual std::unique_ptr<avcodec_encode_device_t> make_avcodec_encode_device(pix_fmt_e pix_fmt) {
508 return nullptr;
509 }
510
511 virtual std::unique_ptr<nvenc_encode_device_t> make_nvenc_encode_device(pix_fmt_e pix_fmt) {
512 return nullptr;
513 }
514
515 virtual bool is_hdr() {
516 return false;
517 }
518
519 virtual bool get_hdr_metadata(SS_HDR_METADATA &metadata) {
520 std::memset(&metadata, 0, sizeof(metadata));
521 return false;
522 }
523
530 virtual bool is_codec_supported(std::string_view name, const ::video::config_t &config) {
531 return true;
532 }
533
534 virtual ~display_t() = default;
535
536 // Offsets for when streaming a specific monitor. By default, they are 0.
537 int offset_x, offset_y;
538 int env_width, env_height;
539 int env_logical_width, env_logical_height;
540
541 int width, height;
542 int logical_width, logical_height;
543
544 protected:
545 // collect capture timing data (at loglevel debug)
546 logging::time_delta_periodic_logger sleep_overshoot_logger = {debug, "Frame capture sleep overshoot"};
547 };
548
549 class mic_t {
550 public:
551 virtual capture_e sample(std::vector<float> &frame_buffer) = 0;
552
553 virtual ~mic_t() = default;
554 };
555
557 public:
558 virtual int set_sink(const std::string &sink) = 0;
559
560 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;
561
567 virtual bool is_sink_available(const std::string &sink) = 0;
568
569 virtual std::optional<sink_t> sink_info() = 0;
570
571 virtual ~audio_control_t() = default;
572 };
573
574 void freeInput(void *);
575
577
578 std::filesystem::path appdata();
579
580 std::string get_mac_address(const std::string_view &address);
581
582 std::string from_sockaddr(const sockaddr *const);
583 std::pair<std::uint16_t, std::string> from_sockaddr_ex(const sockaddr *const);
584
585 std::unique_ptr<audio_control_t> audio_control();
586
595 std::shared_ptr<display_t> display(mem_type_e hwdevice_type, const std::string &display_name, const video::config_t &config);
596
597 // A list of names of displays accepted as display_name with the mem_type_e
598 std::vector<std::string> display_names(mem_type_e hwdevice_type);
599
605
606 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);
607
608 enum class thread_priority_e : int {
609 low,
610 normal,
611 high,
612 critical
613 };
614 void adjust_thread_priority(thread_priority_e priority);
615
620 void set_thread_name(const std::string &name);
621
622 void enable_mouse_keys();
623
624 // Allow OS-specific actions to be taken to prepare for streaming
625 void streaming_will_start();
626 void streaming_will_stop();
627
628 void restart();
629
636 int set_env(const std::string &name, const std::string &value);
637
643 int unset_env(const std::string &name);
644
646 const char *buffer;
647 size_t size;
648
649 // Constructors required for emplace_back() prior to C++20
650 buffer_descriptor_t(const char *buffer, size_t size):
651 buffer(buffer),
652 size(size) {
653 }
654
656 buffer(nullptr),
657 size(0) {
658 }
659 };
660
662 // Optional headers to be prepended to each packet
663 const char *headers;
664 size_t header_size;
665
666 // One or more data buffers to use for the payloads
667 //
668 // NB: Data buffers must be aligned to payload size!
669 std::vector<buffer_descriptor_t> &payload_buffers;
670 size_t payload_size;
671
672 // The offset (in header+payload message blocks) in the header and payload
673 // buffers to begin sending messages from
674 size_t block_offset;
675
676 // The number of header+payload message blocks to send
677 size_t block_count;
678
679 std::uintptr_t native_socket;
680 boost::asio::ip::address &target_address;
681 uint16_t target_port;
682 boost::asio::ip::address &source_address;
683
690 for (const auto &desc : payload_buffers) {
691 if (offset < desc.size) {
692 return {
693 desc.buffer + offset,
694 desc.size - offset,
695 };
696 } else {
697 offset -= desc.size;
698 }
699 }
700 return {};
701 }
702 };
703
704 bool send_batch(batched_send_info_t &send_info);
705
706 struct send_info_t {
707 const char *header;
708 size_t header_size;
709 const char *payload;
710 size_t payload_size;
711
712 std::uintptr_t native_socket;
713 boost::asio::ip::address &target_address;
714 uint16_t target_port;
715 boost::asio::ip::address &source_address;
716 };
717
718 bool send(send_info_t &send_info);
719
720 enum class qos_data_type_e : int {
721 audio,
722 video
723 };
724
733 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);
734
739 void open_url(const std::string &url);
740
746 bool request_process_group_exit(std::uintptr_t native_handle);
747
753 bool process_group_running(std::uintptr_t native_handle);
754
755 input_t input();
764 util::point_t get_mouse_loc(input_t &input);
765 void move_mouse(input_t &input, int deltaX, int deltaY);
766 void abs_mouse(input_t &input, const touch_port_t &touch_port, float x, float y);
767 void button_mouse(input_t &input, int button, bool release);
768 void scroll(input_t &input, int distance);
769 void hscroll(input_t &input, int distance);
770 void keyboard_update(input_t &input, uint16_t modcode, bool release, uint8_t flags);
771 void gamepad_update(input_t &input, int nr, const gamepad_state_t &gamepad_state);
772 void unicode(input_t &input, char *utf8, int size);
773
774 typedef deinit_t client_input_t;
775
781 std::unique_ptr<client_input_t> allocate_client_input_context(input_t &input);
782
789 void touch_update(client_input_t *input, const touch_port_t &touch_port, const touch_input_t &touch);
790
797 void pen_update(client_input_t *input, const touch_port_t &touch_port, const pen_input_t &pen);
798
804 void gamepad_touch(input_t &input, const gamepad_touch_t &touch);
805
811 void gamepad_motion(input_t &input, const gamepad_motion_t &motion);
812
818 void gamepad_battery(input_t &input, const gamepad_battery_t &battery);
819
828 int alloc_gamepad(input_t &input, const gamepad_id_t &id, const gamepad_arrival_t &metadata, feedback_queue_t feedback_queue);
829 void free_gamepad(input_t &input, int nr);
830
835 platform_caps::caps_t get_capabilities();
836
837#define SERVICE_NAME "Sunshine"
838#define SERVICE_TYPE "_nvstream._tcp"
839
840 namespace publish {
841 [[nodiscard]] std::unique_ptr<deinit_t> start();
842 }
843
844 [[nodiscard]] std::unique_ptr<deinit_t> init();
845
850 std::string get_host_name();
851
858 std::vector<supported_gamepad_t> &supported_gamepads(input_t *input);
859
860 struct high_precision_timer: private boost::noncopyable {
861 virtual ~high_precision_timer() = default;
862
867 virtual void sleep_for(const std::chrono::nanoseconds &duration) = 0;
868
873 virtual operator bool() = 0;
874 };
875
880 std::unique_ptr<high_precision_timer> create_high_precision_timer();
881
882} // 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:556
virtual bool is_sink_available(const std::string &sink)=0
Check if the audio sink is available in the system.
Definition common.h:361
Definition common.h:464
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:530
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:473
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:482
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:549
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:720
std::unique_ptr< high_precision_timer > create_high_precision_timer()
Create platform-specific timer capable of high-precision sleep.
Definition misc.cpp:1095
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:608
@ 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:456
@ 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:409
virtual int prepare_to_derive_context(int hw_device_type)
Prepare to derive a context.
Definition common.h:445
virtual void init_codec_options(AVCodecContext *ctx, AVDictionary **options)
Provides a hook for allow platform-specific code to adjust codec options.
Definition common.h:439
virtual int set_frame(AVFrame *frame, AVBufferRef *hw_frames_ctx)
Set the frame to be encoded.
Definition common.h:424
virtual void init_hwframes(AVHWFramesContext *frames)
Initialize the hwframes context.
Definition common.h:433
Definition common.h:661
buffer_descriptor_t buffer_for_payload_offset(ptrdiff_t offset)
Returns a payload buffer descriptor for the given payload offset.
Definition common.h:689
Definition common.h:645
Definition common.h:401
Definition common.h:305
Definition common.h:331
Definition common.h:112
Definition common.h:294
Definition common.h:320
Definition common.h:284
Definition common.h:311
Definition common.h:860
virtual void sleep_for(const std::chrono::nanoseconds &duration)=0
Sleep for the duration.
Definition common.h:366
Definition common.h:450
Definition common.h:348
Definition common.h:706
Definition common.h:392
Definition common.h:386
Definition common.h:98
Definition common.h:337
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.