UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
Loading...
Searching...
No Matches
host.h File Reference
#include "tv.h"
#include "utils/macros.h"
#include <string>
#include <unordered_map>
Include dependency graph for host.h:

Go to the source code of this file.

Classes

struct  common_opts
 

Macros

#define ADD_TO_PARAM(param, doc)
 
#define ADD_TO_PARAM_SALT(salt, param, doc)
 
#define COMMON_OPTS_INIT
 
#define DEFAULT_AUDIO_CAPTURE_CHANNELS   1
 
#define EXIT_FAIL_AUDIO   11
 
#define EXIT_FAIL_CAPTURE   5
 
#define EXIT_FAIL_COMPRESS   8
 
#define EXIT_FAIL_CONTROL_SOCK   9
 
#define EXIT_FAIL_DECODER   6
 
#define EXIT_FAIL_DISPLAY   4
 
#define EXIT_FAIL_NETWORK   10
 
#define EXIT_FAIL_TRANSMIT   7
 
#define EXIT_FAIL_UI   3
 
#define EXIT_FAIL_USAGE   2
 
#define INIT_NOERR   ((void*)1)
 
#define LABEL_(a)
 
#define MAX_CUDA_DEVICES   4
 
#define MERGE_(a, b)
 
#define MODE_RECEIVER   (1U<<1U)
 
#define MODE_SENDER   (1U<<0U)
 
#define RATE_AUTO   (-1)
 spread packets evenly across frame time (currently 3/4)
 
#define RATE_DEFAULT   (-3)
 imaginary value, must not be passed to trasmit module
 
#define RATE_DYNAMIC   (-2)
 same as RATE_AUTO but occasional excess frame allowed
 
#define RATE_FLAG_FIXED_RATE   (1ll<<62ll)
 use the bitrate as fixed, not capped
 
#define RATE_MIN   RATE_DYNAMIC
 
#define RATE_UNLIMITED   0
 
#define UNIQUE_LABEL   LABEL_(__COUNTER__)
 

Typedefs

typedef void(* mainloop_t) (void *)
 

Functions

void common_cleanup (struct init_data *init_data)
 
struct init_data * common_preinit (int argc, char *argv[])
 
void crash_signal_handler (int sig)
 
void exit_uv (int status)
 
int get_audio_delay (void)
 
const char * get_commandline_param (const char *key)
 
int get_exit_status (struct module *root_mod)
 
const char * get_version_details (void)
 
void handle_error (int status)
 
void hang_signal_handler (int sig)
 
void init_root_module (struct module *root_mod)
 
bool parse_bitrate (char *optarg, long long int *bitrate)
 
bool parse_params (const char *optarg, bool preinit)
 
void print_capabilities (const char *cfg)
 
void print_configuration (void)
 
void print_pixel_formats (void)
 
void print_version (void)
 
void print_video_codecs (void)
 
bool register_mainloop (mainloop_t, void *)
 
void register_param (const char *param, const char *doc)
 
void register_should_exit_callback (struct module *mod, void(*callback)(void *), void *udata)
 
bool running_in_debugger ()
 
int set_audio_capture_format (const char *optarg)
 
void set_audio_delay (int val)
 
void set_commandline_param (const char *key, const char *val)
 
int set_pixfmt_conv_policy (const char *optarg)
 
bool tok_in_argv (char **argv, const char *tok)
 
void unregister_should_exit_callback (struct module *mod, void(*callback)(void *), void *udata)
 

Variables

unsigned int audio_capture_bps
 
unsigned int audio_capture_channels
 
unsigned int audio_capture_sample_rate
 
volatile int audio_offset
 added audio delay in ms (non-negative), can be used to tune AV sync
 
std::unordered_map< std::string, std::string > commandline_params
 
unsigned int cuda_devices []
 
unsigned int cuda_devices_count
 
bool cuda_devices_explicit
 –cuda-device/-D specified expilcitly
 
int glfw_init_count
 0->1 - call glfwInit, 1->0 call glfwTerminate; glfw{Init,Terminate} should be called from main thr, thus no need to synchronize
 
mainloop_t mainloop
 mainloop to be run if display mainloop isn't run
 
void * mainloop_udata
 
char pixfmt_conv_pref []
 bitdepth, subsampling, color space
 
char * sage_network_device
 
int uv_argc
 
char ** uv_argv
 
volatile int video_offset
 added video delay in ms (non-negative), can be used to tune AV sync
 

Detailed Description

Macro Definition Documentation

◆ ADD_TO_PARAM

#define ADD_TO_PARAM ( param,
doc )
Value:
const char * doc
Definition host.cpp:923
#define UNIQUE_LABEL
Definition host.h:194
#define ADD_TO_PARAM_SALT(salt, param, doc)
Definition host.h:204
const char * param
Definition settings.cpp:195

Introduces new parameter. Without calling that, parameter from command-line would be rejected.

Parameters
paramparameter name
docdocumentation - string

Definition at line 203 of file host.h.

◆ ADD_TO_PARAM_SALT

#define ADD_TO_PARAM_SALT ( salt,
param,
doc )
Value:
static void MERGE_(add_to_param_doc_, salt)(void) __attribute__((constructor));\
\
static void MERGE_(add_to_param_doc_, salt)(void) \
{\
register_param(param, doc);\
}\
struct NOT_DEFINED_STRUCT_THAT_SWALLOWS_SEMICOLON
#define MERGE_(a, b)
Definition host.h:192
struct __attribute__((packed))
Definition rtp.h:88

Definition at line 204 of file host.h.

204#define ADD_TO_PARAM_SALT(salt, param, doc) static void MERGE_(add_to_param_doc_, salt)(void) __attribute__((constructor));\
205\
206static void MERGE_(add_to_param_doc_, salt)(void) \
207{\
208 register_param(param, doc);\
209}\
210struct NOT_DEFINED_STRUCT_THAT_SWALLOWS_SEMICOLON

◆ COMMON_OPTS_INIT

#define COMMON_OPTS_INIT
Value:
/* .parent = */ 0, \
/* .encryption = */ "", /* .mcast_if = */ "", /* .mtu = */ 1500, \
/* .ttl = */ -1, /* .force_ip_version = */ 0, /* .exporter = */ 0, \
/* .start_time = */ get_time_in_ns(),
static time_ns_t get_time_in_ns()
Definition tv.h:101

Definition at line 179 of file host.h.

179#define COMMON_OPTS_INIT \
180 /* .parent = */ 0, \
181 /* .encryption = */ "", /* .mcast_if = */ "", /* .mtu = */ 1500, \
182 /* .ttl = */ -1, /* .force_ip_version = */ 0, /* .exporter = */ 0, \
183 /* .start_time = */ get_time_in_ns(),

Referenced by writer().

◆ DEFAULT_AUDIO_CAPTURE_CHANNELS

◆ EXIT_FAIL_AUDIO

#define EXIT_FAIL_AUDIO   11

Definition at line 70 of file host.h.

Referenced by audio_cap_alsa_read(), audio_play_alsa_write_frame(), audio_start(), and main().

◆ EXIT_FAIL_CAPTURE

#define EXIT_FAIL_CAPTURE   5

Definition at line 64 of file host.h.

Referenced by main().

◆ EXIT_FAIL_COMPRESS

#define EXIT_FAIL_COMPRESS   8

Definition at line 67 of file host.h.

Referenced by main().

◆ EXIT_FAIL_CONTROL_SOCK

#define EXIT_FAIL_CONTROL_SOCK   9

Definition at line 68 of file host.h.

Referenced by main(), and main().

◆ EXIT_FAIL_DECODER

#define EXIT_FAIL_DECODER   6

Definition at line 65 of file host.h.

Referenced by main().

◆ EXIT_FAIL_DISPLAY

#define EXIT_FAIL_DISPLAY   4

Definition at line 63 of file host.h.

Referenced by main().

◆ EXIT_FAIL_NETWORK

#define EXIT_FAIL_NETWORK   10

Definition at line 69 of file host.h.

Referenced by rtp_video_rxtx::rtp_video_rxtx(), and set_sock_opts_and_bind().

◆ EXIT_FAIL_TRANSMIT

#define EXIT_FAIL_TRANSMIT   7

Definition at line 66 of file host.h.

Referenced by rtp_video_rxtx::rtp_video_rxtx().

◆ EXIT_FAIL_UI

#define EXIT_FAIL_UI   3

Definition at line 62 of file host.h.

◆ EXIT_FAIL_USAGE

#define EXIT_FAIL_USAGE   2

◆ INIT_NOERR

◆ LABEL_

#define LABEL_ ( a)
Value:
MERGE_(unique_name_, a)

Definition at line 193 of file host.h.

◆ MAX_CUDA_DEVICES

#define MAX_CUDA_DEVICES   4

Definition at line 97 of file host.h.

Referenced by parse_cuda_device().

◆ MERGE_

#define MERGE_ ( a,
b )
Value:
a##b

Definition at line 192 of file host.h.

◆ MODE_RECEIVER

◆ MODE_SENDER

◆ RATE_AUTO

#define RATE_AUTO   (-1)

spread packets evenly across frame time (currently 3/4)

Definition at line 123 of file host.h.

Referenced by get_packet_rate(), and parse_bitrate().

◆ RATE_DEFAULT

#define RATE_DEFAULT   (-3)

imaginary value, must not be passed to trasmit module

Definition at line 126 of file host.h.

Referenced by adjust_params(), and parse_options_internal().

◆ RATE_DYNAMIC

#define RATE_DYNAMIC   (-2)

same as RATE_AUTO but occasional excess frame allowed

Definition at line 124 of file host.h.

Referenced by adjust_params(), get_packet_rate(), and parse_bitrate().

◆ RATE_FLAG_FIXED_RATE

#define RATE_FLAG_FIXED_RATE   (1ll<<62ll)

use the bitrate as fixed, not capped

Definition at line 127 of file host.h.

Referenced by get_packet_rate(), and parse_bitrate().

◆ RATE_MIN

#define RATE_MIN   RATE_DYNAMIC

Definition at line 125 of file host.h.

Referenced by fec_check_messages(), and tx_init().

◆ RATE_UNLIMITED

#define RATE_UNLIMITED   0

Definition at line 122 of file host.h.

Referenced by adjust_params(), get_packet_rate(), parse_bitrate(), parse_fmt(), and writer().

◆ UNIQUE_LABEL

#define UNIQUE_LABEL   LABEL_(__COUNTER__)

Definition at line 194 of file host.h.

Typedef Documentation

◆ mainloop_t

typedef void(* mainloop_t) (void *)

Definition at line 105 of file host.h.

Function Documentation

◆ common_cleanup()

void common_cleanup ( struct init_data * init_data)

Definition at line 203 of file host.cpp.

204{
205 if (init) {
206#if defined BUILD_LIBRARIES
207 for (auto a : init->opened_libs) {
208 dlclose(a);
209 }
210#endif
211 com_uninitialize(&init->com_initialized);
212 }
213 delete init;
214
215#ifdef __linux__
216 muntrace();
217#endif
218
219#ifdef _WIN32
220 WSACleanup();
221#endif
222
223#if defined CUDA_DEVICE_RESET
224 // to allow "cuda-memcheck --leak-check full"
226#endif
227
229}
static af_result_code init(struct module *parent, const char *cfg, void **state)
void cuda_wrapper_device_reset(void)
static bool unexpected_exit_called
Definition host.cpp:202
void com_uninitialize(bool *com_initialized)
Definition windows.c:94

References com_uninitialize(), cuda_wrapper_device_reset(), init(), and unexpected_exit_called.

Referenced by main(), and main().

Here is the call graph for this function:

◆ common_preinit()

struct init_data * common_preinit ( int argc,
char * argv[] )

Definition at line 435 of file host.cpp.

436{
437 uv_argc = argc;
438 uv_argv = argv;
439
440 if (!parse_opts_set_logging(argc, argv)) {
441 return nullptr;
442 }
443
444 if (!set_output_buffering()) {
445 LOG(LOG_LEVEL_WARNING) << "Cannot set console output buffering!\n";
446 return nullptr;
447 }
448 std::clog.rdbuf(std::cout.rdbuf()); // use stdout for logs by default
450
451#ifdef HAVE_X
452 void *handle = dlopen(X11_LIB_NAME, RTLD_NOW);
453
454 if (handle) {
455 Status (*XInitThreadsProc)();
456 XInitThreadsProc = (Status (*)()) dlsym(handle, "XInitThreads");
457 if (XInitThreadsProc) {
458 Status s = XInitThreadsProc();
459 if (s != True) {
460 log_msg(LOG_LEVEL_WARNING, "XInitThreads failed.\n");
461 }
462 } else {
463 log_msg(LOG_LEVEL_WARNING, "Unable to load symbol XInitThreads: %s\n", dlerror());
464 }
465
466 typedef int (*XSetErrorHandler_t(int (*handler)(Display *, XErrorEvent *)))();
467 XSetErrorHandler_t *XSetErrorHandlerProc;
468 XSetErrorHandlerProc = (XSetErrorHandler_t *) dlsym(handle, "XSetErrorHandler");
469 if (XSetErrorHandlerProc) {
470 XSetErrorHandlerProc(x11_error_handler);
471 } else {
472 log_msg(LOG_LEVEL_WARNING, "Unable to load symbol XSetErrorHandler: %s\n", dlerror());
473 }
474
475 dlclose(handle);
476 } else {
477 log_msg(LOG_LEVEL_WARNING, "Unable open " X11_LIB_NAME " library: %s\n", dlerror());
478 }
479#endif
480
481 struct init_data init{};
482#ifdef _WIN32
483 WSADATA wsaData;
484 int err = WSAStartup(MAKEWORD(2, 2), &wsaData);
485 if(err != 0) {
486 fprintf(stderr, "WSAStartup failed with error %d.", err);
487 return nullptr;
488 }
489 if(LOBYTE(wsaData.wVersion) != 2 || HIBYTE(wsaData.wVersion) != 2) {
490 fprintf(stderr, "Counld not found usable version of Winsock.\n");
491 WSACleanup();
492 return nullptr;
493 }
494
495 SetConsoleOutputCP(CP_UTF8); // see also https://stackoverflow.com/questions/1660492/utf-8-output-on-windows-console
496
497 // Initialize COM on main thread - otherwise Portaudio would initialize it as COINIT_APARTMENTTHREADED but MULTITHREADED
498 // is perhaps better variant (Portaudio would accept that).
499 const bool init_com = !tok_in_argv(argv, "screen:unregister_elevated");
500 if (init_com) {
501 com_initialize(&init.com_initialized, nullptr);
502 }
503
504 // warn in W10 "legacy" terminal emulators
505 if (getenv("TERM") == nullptr &&
506 _isatty(fileno(stdout)) &&
507 get_windows_build() < BUILD_WINDOWS_11_OR_LATER &&
508 (win_has_ancestor_process("powershell.exe") ||
509 win_has_ancestor_process("cmd.exe")) &&
510 !win_has_ancestor_process("WindowsTerminal.exe")) {
511 MSG(WARNING, "Running inside PS/cmd terminal is not recommended "
512 "because scrolling the output freezes the process, "
513 "consider using Windows Terminal instead!\n");
514 Sleep(1000);
515 }
516#endif
517
518 if (strstr(argv[0], "run_tests") == nullptr) {
519 open_all("ultragrid_*.so", init.opened_libs); // load modules
520 }
521
522 ug_rand_init();
523
524#ifdef __linux__
525 mtrace();
526#endif
527
528 load_libgcc();
529
530#ifdef HAVE_FEC_INIT
531 fec_init();
532#endif
533
535
536 return new init_data{ std::move(init) };
537}
bool color_output_init()
sets internal variable color_stdout and retunrs its contents
void log_msg(int level, const char *format,...)
Definition debug.cpp:130
#define MSG(l, fmt,...)
Definition debug.h:96
#define LOG(level)
Definition debug.h:313
#define LOG_LEVEL_WARNING
less severe errors
Definition debug.h:60
static bool parse_opts_set_logging(int argc, char *argv[])
Definition host.cpp:357
static void echeck_unexpected_exit(void)
Definition host.cpp:428
bool tok_in_argv(char **argv, const char *tok)
Definition host.cpp:417
static void load_libgcc()
Definition host.cpp:300
static bool set_output_buffering()
Definition host.cpp:237
char ** uv_argv
Definition host.cpp:174
int uv_argc
Definition host.cpp:173
void open_all(const char *pattern, list< void * > &libs)
void ug_rand_init(void)
Definition random.c:64
bool com_initialize(bool *com_initialized, const char *err_prefix)
Definition windows.c:65
@ BUILD_WINDOWS_11_OR_LATER
Definition windows.h:46

References BUILD_WINDOWS_11_OR_LATER, color_output_init(), com_initialize(), echeck_unexpected_exit(), init(), load_libgcc(), LOG, LOG_LEVEL_WARNING, log_msg(), MSG, open_all(), parse_opts_set_logging(), set_output_buffering(), tok_in_argv(), ug_rand_init(), uv_argc, and uv_argv.

Referenced by main(), and main().

Here is the call graph for this function:

◆ crash_signal_handler()

void crash_signal_handler ( int sig)

Definition at line 1253 of file host.cpp.

1254{
1256
1257 char buf[1024];
1258 char *ptr = buf;
1259 char *ptr_end = buf + sizeof buf;
1260 strappend(&ptr, ptr_end, "\n" PACKAGE_NAME " has crashed");
1261
1262 append_sig_desc(&ptr, ptr_end, sig);
1263
1264 strappend(&ptr, ptr_end, ".\n\nPlease send a bug report to address " PACKAGE_BUGREPORT ".\n");
1265 strappend(&ptr, ptr_end, "You may find some tips how to report bugs in file doc/REPORTING_BUGS.md distributed with " PACKAGE_NAME "\n");
1266 strappend(&ptr, ptr_end, "(or available online at https://github.com/CESNET/UltraGrid/blob/master/doc/REPORTING-BUGS.md).\n");
1267
1268 write_all(STDERR_FILENO, ptr - buf, buf);
1269
1271
1272 signal(sig, SIG_DFL);
1273 raise(sig);
1274}
static ssize_t write_all(fd_t fd, const void *buf, size_t count)
static void print_backtrace()
Definition host.cpp:1205
void restore_old_tio(void)
static void strappend(char **dst, size_t *dst_alloc_len, const char *src)
Definition sdp.c:366
void append_sig_desc(char **ptr, const char *ptr_end, int signum)

References append_sig_desc(), print_backtrace(), restore_old_tio(), strappend(), and write_all().

Referenced by main(), and main().

Here is the call graph for this function:

◆ exit_uv()

void exit_uv ( int status)

Exit function that sets return value and brodcasts registered modules should_exit.

Should be called after init_root_module() is called.

Definition at line 625 of file host.cpp.

625 {
626 if (!state_root_static) {
627 log_msg(LOG_LEVEL_WARNING, "%s called witout state registered.\n", __func__);
628 }
631}
static state_root *volatile state_root_static
used by exit_uv() called from signal handler
Definition host.cpp:602
void broadcast_should_exit(bool quit_watcher=false)
Definition host.cpp:579
volatile int exit_status
Definition host.cpp:587

References state_root::broadcast_should_exit(), state_root::exit_status, LOG_LEVEL_WARNING, log_msg(), and state_root_static.

Referenced by audio_cap_alsa_read(), audio_decoder_reconfigure(), audio_play_alsa_write_frame(), audio_receiver_thread(), audio_sender_process_message(), audio_sender_thread(), audio_start(), configure_with(), display_dummy_putf(), display_gl_process_key(), display_panogl_run(), display_reconfigure_audio(), display_sage_run(), display_sdl2_process_key(), display_sdl2_run(), display_sdl_run(), display_xrgl_run(), export_video(), fec_thread(), get_usable_decoders(), glfw_close_callback(), handle_error(), handle_events(), handle_keyboard_event(), initialize(), keep_alive_thread(), main(), ultragrid_rtp_video_rxtx::new_video_decoder(), process_msg(), rtp_video_rxtx::process_sender_message(), ultragrid_rtp_video_rxtx::receiver_loop(), reconfigure(), reconfigure_slave_rendering(), restartAcquisition(), h264_sdp_video_rxtx::send_frame(), signal_handler(), signal_handler(), slave_worker(), tx_send_jpeg(), validate_hwacc_param(), vidcap_file_process_messages(), vidcap_import_grab(), vidcap_screen_x11_grab(), and worker().

Here is the call graph for this function:

◆ get_audio_delay()

int get_audio_delay ( void )

Definition at line 909 of file host.cpp.

910{
911 return audio_offset > 0 ? audio_offset : -video_offset;
912}
volatile int audio_offset
added audio delay in ms (non-negative), can be used to tune AV sync
Definition host.cpp:178
volatile int video_offset
added video delay in ms (non-negative), can be used to tune AV sync
Definition host.cpp:179

References audio_offset, and video_offset.

Referenced by keyboard_control::impl::info(), and keyboard_control::impl::run().

◆ get_commandline_param()

const char * get_commandline_param ( const char * key)

Definition at line 894 of file host.cpp.

895{
896 auto it = commandline_params.find(key);
897 if (it != commandline_params.end()) {
898 return it->second.c_str();
899 } else {
900 return NULL;
901 }
902}
std::unordered_map< std::string, std::string > commandline_params
Definition host.cpp:184
const char * key
Definition cineform.cpp:125

References commandline_params, and key.

Referenced by am_participant::am_participant(), audio_frame2_resampler::audio_frame2_resampler(), ultragrid_rtp_video_rxtx::ultragrid_rtp_video_rxtx(), audio_cap_ca_init(), audio_decoder_init(), audio_decoder_reconfigure(), audio_play_alsa_init(), audio_play_alsa_reconfigure(), audio_play_ca_init(), audio_play_ca_reconfigure(), audio_play_jack_reconfigure(), audio_play_portaudio_reconfigure(), audio_play_wasapi_reconfigure(), audio_receiver_thread(), check_packet_size(), configure_with(), control_init(), control_thread(), decklink_help(), display_decklink_putf(), display_decklink_reconfigure(), display_gl_init_opengl(), display_gl_set_window_hints(), display_sdl2_reconfigure_real(), display_sdl_reconfigure_real(), echo_cancellation_init(), get_format_callback(), get_sine_signal(), get_usable_decoders(), gl_substitute_compile_link(), handle_error(), vidcap_state_aja::Init(), ldgm::init(), init_common(), init_decoder(), init_encoder(), is_output_color(), j2k_decompress_init(), libavcodec_decompress_get_property(), libavcodec_decompress_reconfigure(), libavcodec_init(), ndi_disp_format_video_metadata(), parse_params(), postprocess_frame(), reconfigure_echo(), vidcap_decklink_state::set_codec(), set_codec_context_params(), set_device_buffer(), set_mac_color_space(), set_output_buffering(), set_postprocess_convert(), show_help(), keyboard_control::impl::start(), udp_init_if(), ug_set_av_logging(), validate_hwacc_param(), vdp_interop_supported(), and video_decoder_register_display().

◆ get_exit_status()

int get_exit_status ( struct module * root_mod)

Definition at line 633 of file host.cpp.

633 {
634 assert(root_mod->cls == MODULE_CLASS_ROOT);
635 return static_cast<state_root *>(root_mod->priv_data)->exit_status;
636}
@ MODULE_CLASS_ROOT
Definition module.h:83
enum module_class cls
Definition module.h:115
void * priv_data
Definition module.h:126

References module::cls, MODULE_CLASS_ROOT, and module::priv_data.

Referenced by main().

◆ get_version_details()

const char * get_version_details ( void )

Definition at line 856 of file host.cpp.

857{
858 return
859#ifdef GIT_BRANCH
860 GIT_BRANCH " "
861#endif
862#ifdef GIT_REV
863 "rev " GIT_REV " "
864#endif
865 "built " __DATE__ " " __TIME__;
866}

Referenced by keyboard_control::impl::info(), and print_version().

◆ handle_error()

void handle_error ( int status)

Soft version of exit_uv() checks errors-fatal command-line parameters and if set, exit UltraGrid. Otherwise error is ignored.

Caller code normally continues after this function so the error must not have been fatal and UltraGrid must remain in a consistent state.

Definition at line 1184 of file host.cpp.

1184 {
1185 if (get_commandline_param("errors-fatal") || getenv("ULTRAGRID_ERRORS_FATAL")) {
1186 exit_uv(status);
1187 }
1188}
void exit_uv(int status)
Definition host.cpp:625
const char * get_commandline_param(const char *key)
Definition host.cpp:894

References exit_uv(), and get_commandline_param().

Referenced by decode_video_frame(), display_gl_init_opengl(), init_decoder(), and set_sock_opts_and_bind().

Here is the call graph for this function:

◆ hang_signal_handler()

void hang_signal_handler ( int sig)

Definition at line 1276 of file host.cpp.

1277{
1278 UNUSED(sig);
1279#ifndef _WIN32
1280 assert(sig == SIGALRM);
1281 char msg[] = "Hang detected - you may continue waiting or kill UltraGrid. Please report if UltraGrid doesn't exit after reasonable amount of time.\n";
1282 write_all(STDERR_FILENO, sizeof msg - 1, msg);
1283 signal(SIGALRM, SIG_DFL);
1284#endif // ! defined _WIN32
1285}
#define UNUSED(x)

References UNUSED, and write_all().

Referenced by main(), and main().

Here is the call graph for this function:

◆ init_root_module()

void init_root_module ( struct module * root_mod)

Initializes root module

This the root module is also responsible for regiestering and broadcasting should_exit events (see register_should_exit_callback) called by exit_uv().

Definition at line 610 of file host.cpp.

610 {
611 module_init_default(root_mod);
612 root_mod->cls = MODULE_CLASS_ROOT;
613 root_mod->new_message = nullptr; // note that the root mod messages
614 // processes also the reflector
615 root_mod->deleter = state_root::deleter;
617 root_mod->priv_data = state_root_static;
618}
void module_init_default(struct module *module_data)
Definition module.c:48
notify_t new_message
if set, notifies module that new message is in queue, receiver lock is hold during the call
Definition module.h:119
module_deleter_t deleter
Definition module.h:118
static void deleter(struct module *m)
Definition host.cpp:557

References module::cls, module::deleter, state_root::deleter(), MODULE_CLASS_ROOT, module_init_default(), module::new_message, module::priv_data, and state_root_static.

Referenced by hd_rum_translator_state::hd_rum_translator_state(), and state_uv::state_uv().

Here is the call graph for this function:

◆ parse_bitrate()

bool parse_bitrate ( char * optarg,
long long int * bitrate )

Definition at line 1012 of file host.cpp.

1013{
1014 unordered_map<string, long long int> bitrate_spec_map = {
1015 {"auto", RATE_AUTO },
1016 { "dynamic", RATE_DYNAMIC },
1017 { "unlimited", RATE_UNLIMITED},
1018 };
1019
1020 if (auto it = bitrate_spec_map.find(optarg);
1021 it != bitrate_spec_map.end()) {
1022 *bitrate = it->second;
1023 return true;
1024 }
1025 if (strcmp(optarg, "help") == 0) {
1026 constexpr char const *NUMERIC_PATTERN = "{1-9}{0-9}*[kMG][!][E]";
1027 col()
1028 << "Usage:\n"
1029 << "\tuv " << TERM_BOLD "-l [auto | dynamic | unlimited | "
1030 << NUMERIC_PATTERN << "]\n" TERM_RESET
1031 << "where\n"
1032 "\t"
1033 << TBOLD("auto")
1034 << " - spread packets across frame time\n"
1035 "\t"
1036 << TBOLD("dynamic")
1037 << " - similar to \"auto\" but more relaxed - occasional "
1038 "huge frame can spread 1.5x frame time (default)\n"
1039 "\t"
1040 << TBOLD("unlimited")
1041 << " - send packets at a wire speed (in bursts)\n"
1042 "\t"
1043 << SBOLD(NUMERIC_PATTERN)
1044 << " - send packets at most at specified bitrate\n\n"
1045 << TBOLD("Notes: ")
1046 << "Use an exclamation mark to indicate intentionally very "
1047 "low bitrate. 'E' to use the value as a fixed bitrate, "
1048 "not cap /i. e. even the frames that may be sent at "
1049 "lower bitrate are sent at the nominal bitrate)\n"
1050 << "\n";
1051 return true;
1052 }
1053 bool force = false;
1054 bool fixed = false;
1055 for (int i = 0; i < 2; ++i) {
1056 if (optarg[strlen(optarg) - 1] == '!' ||
1057 optarg[strlen(optarg) - 1] == 'E') {
1058 if (optarg[strlen(optarg) - 1] == '!') {
1059 force = true;
1060 optarg[strlen(optarg) - 1] = '\0';
1061 }
1062 if (optarg[strlen(optarg) - 1] == 'E') {
1063 fixed = true;
1064 optarg[strlen(optarg) - 1] = '\0';
1065 }
1066 }
1067 }
1068 *bitrate = unit_evaluate(optarg, nullptr);
1069 if (*bitrate <= 0) {
1070 log_msg(LOG_LEVEL_ERROR, "Invalid bitrate %s!\n", optarg);
1071 return false;
1072 }
1073 constexpr long long mb5 =
1074 5ll * 1000 *
1075 1000; // it'll take 6.4 sec to send 4 MB frame at 5 Mbps
1076 constexpr long long gb100 =
1077 100ll * 1000 * 1000 *
1078 1000; // traffic shaping to eg. 40 Gbps may make sense
1079 if ((*bitrate < mb5 || *bitrate > gb100) && !force) {
1081 "Bitrate %lld bps seems to be too %s, use \"-l %s!\" "
1082 "to force if this is not a mistake.\n",
1083 *bitrate, *bitrate < mb5 ? "low" : "high", optarg);
1084 return false;
1085 }
1086 if (fixed) {
1087 *bitrate |= RATE_FLAG_FIXED_RATE;
1088 }
1089 return true;
1090}
#define TERM_BOLD
Definition color_out.h:48
#define TERM_RESET
Definition color_out.h:47
#define SBOLD(x)
Definition color_out.h:80
#define TBOLD(x)
Definition color_out.h:70
#define LOG_LEVEL_ERROR
general errors
Definition debug.h:59
#define RATE_AUTO
spread packets evenly across frame time (currently 3/4)
Definition host.h:123
#define RATE_FLAG_FIXED_RATE
use the bitrate as fixed, not capped
Definition host.h:127
#define RATE_UNLIMITED
Definition host.h:122
#define RATE_DYNAMIC
same as RATE_AUTO but occasional excess frame allowed
Definition host.h:124
long long unit_evaluate(const char *str, const char **endptr)
Definition misc.cpp:81

References LOG_LEVEL_ERROR, LOG_LEVEL_WARNING, log_msg(), RATE_AUTO, RATE_DYNAMIC, RATE_FLAG_FIXED_RATE, RATE_UNLIMITED, SBOLD, TBOLD, TERM_BOLD, TERM_RESET, and unit_evaluate().

Referenced by parse_fmt(), and parse_options_internal().

Here is the call graph for this function:

◆ parse_params()

bool parse_params ( const char * optarg,
bool preinit )

Parses command-line parameters given as "--param <key>=<val>[...".

Parameters
optargcommand-line arguments given to "--param", must not be NULL
preinittrue - only parse/set known parameters (notably output buffer setting), ignore help false - set also remaining parameters including full check and "help" output
Note
This function will be usually called twice - first with preinit=true and then with false. It is because the bufffering parameter need to be set early (prior to any output). On the other hand not all params can be set immediately – modules are not yet registered, so it is called once more the preinit is done.

Definition at line 976 of file host.cpp.

977{
978 if (!preinit && strcmp(optarg, "help") == 0) {
979 puts("Use of params below is experimental and should be used with a caution and a knowledge of consequences and affected functionality!\n");
980 puts("Params can be one or more (separated by comma) of following:");
982 return false;
983 }
984 char *tmp = strdupa(optarg);
985 char *item = nullptr;
986 char *save_ptr = nullptr;
987 while ((item = strtok_r(tmp, ",", &save_ptr)) != nullptr) {
988 tmp = nullptr;
989 char *key_cstr = item;
990 const char *val_cstr = "";
991 if (char *delim = strchr(item, '=')) {
992 val_cstr = delim + 1;
993 *delim = '\0';
994 }
995 if (!validate_param(key_cstr)) {
996 if (preinit) {
997 continue;
998 }
999 LOG(LOG_LEVEL_ERROR) << "Unknown parameter: " << key_cstr << "\n";
1000 LOG(LOG_LEVEL_INFO) << "Type '" << uv_argv[0] << " --param help' for list.\n";
1001 if (get_commandline_param("allow-unknown-params") ==
1002 nullptr) {
1003 return false;
1004 }
1005 }
1006 commandline_params[key_cstr] = val_cstr;
1007 }
1008 return true;
1009}
#define LOG_LEVEL_INFO
normal reporting
Definition debug.h:62
static bool validate_param(const char *param)
Definition host.cpp:949
static void print_param_doc(void)
Definition host.cpp:1092
#define strdupa(s)
Definition strings.h:77
Definition hd-rum.c:27

References commandline_params, get_commandline_param(), LOG, LOG_LEVEL_ERROR, LOG_LEVEL_INFO, print_param_doc(), strdupa, uv_argv, and validate_param().

Referenced by parse_global_opts(), parse_options_internal(), and parse_opts_set_logging().

Here is the call graph for this function:

◆ print_capabilities()

void print_capabilities ( const char * cfg)

Definition at line 801 of file host.cpp.

802{
803 std::string_view conf(cfg);
804
805 std::cout << "[capability][start] version 4" << endl;
806
807 std::map<enum library_class, module_info_map> class_mod_map;
808 for(const auto& mod_class: mod_classes){
809 class_mod_map.emplace(mod_class.cls,
810 get_libraries_for_class(mod_class.cls, mod_class.abi_ver));
811 }
813 for(const auto& codec : codecs){
814 class_mod_map[LIBRARY_CLASS_AUDIO_COMPRESS].emplace(get<0>(codec).name, nullptr);
815 }
816
817 if(conf == "noprobe"){
818 print_modules(class_mod_map);
819 } else if(conf.empty()){
820 print_modules(class_mod_map);
821 probe_all(class_mod_map);
822 } else {
823 auto class_sv = tokenize(conf, ':');
824 auto mod_sv = tokenize(conf, ':');
825
827 void (*probe_print)(std::string name, const void *) = nullptr;
828 for(const auto& i : mod_classes){
829 if(i.cap_str == class_sv){
830 cls = i.cls;
831 probe_print = i.probe_print;
832 }
833 }
834
836 log_msg(LOG_LEVEL_FATAL, "Unknown library class\n");
837 return;
838 }
839
840 auto& modmap = class_mod_map[cls];
841
842 auto modinfo = modmap.find(std::string(mod_sv));
843 if(modinfo == modmap.end()){
844 log_msg(LOG_LEVEL_FATAL, "Module not found\n");
845 return;
846 }
847
848 if(probe_print)
849 probe_print(std::string(mod_sv), modinfo->second);
850
851 }
852
853 cout << "[capability][end]" << endl;
854}
vector< tuple< audio_codec_info_t, bool, string > > get_audio_codec_list()
Definition codec.cpp:109
#define LOG_LEVEL_FATAL
errors that prevent UG run
Definition debug.h:58
static void print_modules(std::map< enum library_class, module_info_map > &class_mod_map)
Definition host.cpp:791
enum library_class cls
Definition host.cpp:749
static const struct @18 mod_classes[]
void(* probe_print)(std::string name, const void *)
Definition host.cpp:751
static void probe_all(std::map< enum library_class, module_info_map > &class_mod_map)
Definition host.cpp:780
map< string, const void * > get_libraries_for_class(enum library_class cls, int abi_version, bool include_hidden)
library_class
Definition lib_common.h:73
@ LIBRARY_CLASS_UNDEFINED
Definition lib_common.h:74
@ LIBRARY_CLASS_AUDIO_COMPRESS
Definition lib_common.h:80
const char * name
Definition settings.cpp:193
std::string_view tokenize(std::string_view &str, char delim, char quot)
Tokenizer for string_view.
static struct @76 codecs[]

References cls, codecs, get_audio_codec_list(), get_libraries_for_class(), LIBRARY_CLASS_AUDIO_COMPRESS, LIBRARY_CLASS_UNDEFINED, LOG_LEVEL_FATAL, log_msg(), mod_classes, name, print_modules(), probe_all(), probe_print, and tokenize().

Referenced by main(), and parse_global_opts().

Here is the call graph for this function:

◆ print_configuration()

void print_configuration ( void )

Definition at line 882 of file host.cpp.

883{
884 const char *config_flags = CONFIG_FLAGS;
885 if (strlen(config_flags) == 0) {
886 config_flags = "(none)";
887 }
888 printf("configuration flags: %s", config_flags);
889 printf("\n\n");
890 printf(PACKAGE_NAME " was compiled with following features:\n");
891 printf(AUTOCONF_RESULT);
892}

Referenced by parse_options_internal().

◆ print_pixel_formats()

void print_pixel_formats ( void )

Definition at line 1103 of file host.cpp.

1103 {
1104 cout << "codec RGB/YCbCr depth description\n";
1105 for (codec_t c = VIDEO_CODEC_FIRST; c != VIDEO_CODEC_COUNT; c = static_cast<codec_t>(static_cast<int>(c) + 1)) {
1106 if (is_codec_opaque(c)) {
1107 continue;
1108 }
1109
1110 char tag = codec_is_a_rgb(c) ? 'R' : 'Y';
1111 col() << " " << left << setw(12) << SBOLD(get_codec_name(c)) << setw(0) << " " << tag << " " << setw(2) << get_bits_per_component(c) << setw(0) << " " << get_codec_name_long(c) << "\n";
1112 }
1113}
const char * get_codec_name(codec_t codec)
codec_t
Definition types.h:65
@ VIDEO_CODEC_FIRST
Definition types.h:68
@ VIDEO_CODEC_COUNT
count of known video codecs (including VIDEO_CODEC_NONE)
Definition types.h:108
bool is_codec_opaque(codec_t codec)
bool codec_is_a_rgb(codec_t codec)
Returns TRUE if specified pixelformat is some form of RGB (not YUV).
const char * get_codec_name_long(codec_t codec)
int get_bits_per_component(codec_t codec)

References codec_is_a_rgb(), get_bits_per_component(), get_codec_name(), get_codec_name_long(), is_codec_opaque(), SBOLD, VIDEO_CODEC_COUNT, and VIDEO_CODEC_FIRST.

Referenced by parse_options_internal().

Here is the call graph for this function:

◆ print_version()

void print_version ( void )

Definition at line 868 of file host.cpp.

869{
870 bool is_release = true;
871#ifdef GIT_BRANCH
872 if (strstr(GIT_BRANCH, "release") == nullptr &&
873 strstr(GIT_BRANCH, "tags/v") == nullptr) {
874 is_release = false;
875 }
876#endif
877 col() << SBOLD(S256_FG(T_PEACH_FUZZ, PACKAGE_STRING <<
878 (is_release ? "" : "+"))) <<
879 " (" << get_version_details() << ")\n";
880}
#define T_PEACH_FUZZ
Definition color_out.h:65
#define S256_FG(col, x)
Definition color_out.h:68
const char * get_version_details()
Definition host.cpp:856

References get_version_details(), S256_FG, SBOLD, and T_PEACH_FUZZ.

Referenced by main(), and main().

Here is the call graph for this function:

◆ print_video_codecs()

void print_video_codecs ( void )

Definition at line 1115 of file host.cpp.

1115 {
1116 for (codec_t c = VIDEO_CODEC_FIRST; c != VIDEO_CODEC_COUNT; c = static_cast<codec_t>(static_cast<int>(c) + 1)) {
1117 if (!is_codec_opaque(c)) {
1118 continue;
1119 }
1120
1121 char tag = is_codec_interframe(c) ? 'I' : '.';
1122 col() << " " << left << setw(12) << SBOLD(get_codec_name(c)) << setw(0) << " " << tag << " " << " " << get_codec_name_long(c) << "\n";
1123 }
1124 cout << "\nLegend:\n" << " I - interframe codec\n";
1125}
bool is_codec_interframe(codec_t codec)

References get_codec_name(), get_codec_name_long(), is_codec_interframe(), is_codec_opaque(), SBOLD, VIDEO_CODEC_COUNT, and VIDEO_CODEC_FIRST.

Referenced by parse_options_internal().

Here is the call graph for this function:

◆ register_mainloop()

bool register_mainloop ( mainloop_t m,
void * u )

Registers mainloop that will be run if display-owned mainloop isn't run. Currently this is only used by Syphon, that either connects to display event loop and if there isn't any, it runs its own.

Definition at line 1132 of file host.cpp.

1133{
1134 if (mainloop) {
1135 return false;
1136 }
1137
1138 mainloop = m;
1139 mainloop_udata = u;
1140
1141 return true;
1142}
void * mainloop_udata
Definition host.cpp:187
mainloop_t mainloop
mainloop to be run if display mainloop isn't run
Definition host.cpp:186

References mainloop, and mainloop_udata.

Referenced by vidcap_syphon_init().

◆ register_param()

void register_param ( const char * param,
const char * doc )

Registers param to param database ("--param"). If param given multiple times, only first value is stored.

Definition at line 930 of file host.cpp.

931{
932 assert(param != NULL && doc != NULL);
933 for (unsigned int i = 0; i < sizeof params / sizeof params[0]; ++i) {
934 if (params[i].param == NULL) {
935 params[i].param = param;
936 params[i].doc = doc;
937 return;
938 }
939 if (strcmp(params[i].param, param) == 0) {
940 if (strcmp(params[i].doc, doc) != 0) {
941 log_msg(LOG_LEVEL_WARNING, "Param \"%s\" as it is already registered but with different documentation.\n", param);
942 }
943 return;
944 }
945 }
946 log_msg(LOG_LEVEL_WARNING, "Cannot register param \"%s\", maxmimum number of parameters reached.\n", param);
947}
const char * param
Definition host.cpp:922

References doc, LOG_LEVEL_WARNING, log_msg(), and param.

Here is the call graph for this function:

◆ register_should_exit_callback()

void register_should_exit_callback ( struct module * mod,
void(* callback )(void *),
void * udata )

Definition at line 594 of file host.cpp.

1145{
1146 auto *s = (state_root *) get_root_module(mod)->priv_data;
1147 unique_lock<mutex> lk(s->lock);
1148 s->should_exit_callbacks.emplace_back(callback, udata);
1149}
struct module * get_root_module(struct module *node)
Definition module.c:203
Option::Callback::fcn_type callback
Definition settings.cpp:251

Referenced by state_uv::state_uv(), audio_cap_jack_init(), audio_init(), main(), video_rxtx::start(), vidcap_dshow_init(), vidcap_file_init(), and vidcap_syphon_init().

◆ running_in_debugger()

bool running_in_debugger ( )

Definition at line 1190 of file host.cpp.

1190 {
1191#ifdef __linux__
1192 ifstream ppid_f("/proc/" + to_string(getppid()) + "/comm", ifstream::in);
1193 if (ppid_f.is_open()) {
1194 string comm;
1195 ppid_f >> comm;
1196 if (comm == "gdb") {
1197 return true;
1198 }
1199 }
1200#endif
1201 return false;
1202}

Referenced by set_output_buffering(), and keyboard_control::impl::start().

◆ set_audio_capture_format()

int set_audio_capture_format ( const char * optarg)
Return values
-1invalid usage
0success
1help was printed

Definition at line 313 of file host.cpp.

314{
315 struct audio_desc desc = {};
316 if (int ret = parse_audio_format(optarg, &desc)) {
317 return ret;
318 }
319
323
324 return 0;
325}
unsigned int audio_capture_bps
Definition host.cpp:164
unsigned int audio_capture_sample_rate
Definition host.cpp:165
std::string_view desc
Definition host.cpp:747
unsigned int audio_capture_channels
Definition host.cpp:163
#define IF_NOT_NULL_ELSE(val, default_val)
Definition macros.h:51
int parse_audio_format(const char *str, struct audio_desc *ret)
Definition utils.cpp:655

References audio_capture_bps, audio_capture_channels, audio_capture_sample_rate, desc, IF_NOT_NULL_ELSE, and parse_audio_format().

Referenced by adjust_params(), and parse_options_internal().

Here is the call graph for this function:

◆ set_audio_delay()

void set_audio_delay ( int val)

Definition at line 914 of file host.cpp.

915{
916 log_msg(LOG_LEVEL_NOTICE, "Setting A/V delay: %d\n", audio_delay);
917 audio_offset = max(audio_delay, 0);
918 video_offset = audio_delay < 0 ? abs(audio_delay) : 0;
919}
static __device__ vec2 abs(const vec2 &v)
Definition cuda_dxt.cu:118
#define LOG_LEVEL_NOTICE
information that may be interesting
Definition debug.h:61
#define max(a, b)
Definition rtp.c:98

References abs(), audio_offset, LOG_LEVEL_NOTICE, log_msg(), max, and video_offset.

Referenced by parse_options_internal(), process_msg(), and keyboard_control::impl::run().

Here is the call graph for this function:

◆ set_commandline_param()

void set_commandline_param ( const char * key,
const char * val )

Definition at line 904 of file host.cpp.

905{
907}
int void * val

References commandline_params, key, and val.

Referenced by display_caca_init(), and init_common().

◆ set_pixfmt_conv_policy()

int set_pixfmt_conv_policy ( const char * optarg)

Definition at line 327 of file host.cpp.

327 {
328 if (strcmp(optarg, "help") == 0) {
329 char desc[] =
330 TBOLD("--conv-policy") " specifies the order in which various pixfmt properties are to be evaluated "
331 "if some pixel format needs conversion to another suitable pixel format.";
332 color_printf("%s\n\n", wrap_paragraph(desc));
333 color_printf("\t" TBOLD("c") " - color space\n");
334 color_printf("\t" TBOLD("d") " - bit depth\n");
335 color_printf("\t" TBOLD("s") " - subsampling\n");
336 color_printf("\nDefault: \"" TBOLD("dsc") "\" - first is respected bit-depth, then subsampling and finally color space\n\n"
337 "Permute the above letters to change the default order, eg. \"" TBOLD("cds") "\" to attempt to keep colorspace.\n");
338 return 1;
339 }
340 if (strlen(optarg) != strlen(pixfmt_conv_pref)) {
341 log_msg(LOG_LEVEL_ERROR, "Wrong pixfmt conversion policy length (exactly 3 letters need to be used)!\n");
342 return -1;
343 }
344 if (strchr(optarg, 'd') == NULL || strchr(optarg, 's') == NULL || strchr(optarg, 'c') == NULL) {
345 log_msg(LOG_LEVEL_ERROR, "Wrong pixfmt conversion policy - use exactly the set 'dsc'!\n");
346 return -1;
347 }
348 memcpy(pixfmt_conv_pref, optarg, strlen(pixfmt_conv_pref));
349 return 0;
350}
int color_printf(const char *format,...)
char pixfmt_conv_pref[]
bitdepth, subsampling, color space
Definition video_codec.c:80
char * wrap_paragraph(char *text)
Definition text.c:204

References color_printf(), desc, LOG_LEVEL_ERROR, log_msg(), pixfmt_conv_pref, TBOLD, and wrap_paragraph().

Referenced by parse_options_internal().

Here is the call graph for this function:

◆ tok_in_argv()

bool tok_in_argv ( char ** argv,
const char * tok )

Definition at line 417 of file host.cpp.

418{
419 while (*argv != nullptr) {
420 if (strstr(*argv, tok) != nullptr) {
421 return true;
422 }
423 argv++;
424 }
425 return false;
426}

Referenced by common_preinit(), and main().

◆ unregister_should_exit_callback()

void unregister_should_exit_callback ( struct module * mod,
void(* callback )(void *),
void * udata )

Unregisters should_exit callback registered with register_should_exit_callback

The callback must have been registered (and not unregistered), otherwise abort is (currently) called.

Definition at line 597 of file host.cpp.

1160{
1161 auto *s = (state_root *) get_root_module(mod)->priv_data;
1162 unique_lock<mutex> lk(s->lock);
1163 for (auto it = s->should_exit_callbacks.begin();
1164 it != s->should_exit_callbacks.end(); ++it) {
1165 if (get<0>(*it) == callback && get<1>(*it) == udata) {
1166 s->should_exit_callbacks.erase(it);
1167 return;
1168 }
1169 }
1170 abort();
1171}

Referenced by audio_cap_jack_done(), audio_done(), video_rxtx::join(), main(), vidcap_dshow_done(), vidcap_file_done(), and vidcap_syphon_done().

Variable Documentation

◆ audio_capture_bps

◆ audio_capture_channels

◆ audio_capture_sample_rate

◆ audio_offset

volatile int audio_offset
extern

added audio delay in ms (non-negative), can be used to tune AV sync

Definition at line 178 of file host.cpp.

Referenced by audio_init(), get_audio_delay(), and set_audio_delay().

◆ commandline_params

◆ cuda_devices

◆ cuda_devices_count

◆ cuda_devices_explicit

bool cuda_devices_explicit
extern

–cuda-device/-D specified expilcitly

Definition at line 169 of file host.cpp.

Referenced by cuda_conv_enabled(), cuda_conv_enabled(), and parse_cuda_device().

◆ glfw_init_count

int glfw_init_count
extern

0->1 - call glfwInit, 1->0 call glfwTerminate; glfw{Init,Terminate} should be called from main thr, thus no need to synchronize

Definition at line 182 of file host.cpp.

Referenced by state_gl::~state_gl(), display_gl_init_opengl(), and gl_print_monitors().

◆ mainloop

mainloop_t mainloop
extern

mainloop to be run if display mainloop isn't run

Definition at line 186 of file host.cpp.

Referenced by display_run_mainloop(), and register_mainloop().

◆ mainloop_udata

void* mainloop_udata
extern

Definition at line 187 of file host.cpp.

Referenced by display_run_mainloop(), and register_mainloop().

◆ pixfmt_conv_pref

char pixfmt_conv_pref[]
extern

bitdepth, subsampling, color space

Definition at line 80 of file video_codec.c.

Referenced by compare_pixdesc(), and set_pixfmt_conv_policy().

◆ sage_network_device

char* sage_network_device
extern

◆ uv_argc

int uv_argc
extern

Definition at line 173 of file host.cpp.

Referenced by ihdtv_video_rxtx::ihdtv_video_rxtx(), common_preinit(), and run_child_process().

◆ uv_argv

◆ video_offset

volatile int video_offset
extern

added video delay in ms (non-negative), can be used to tune AV sync

Definition at line 179 of file host.cpp.

Referenced by rtp_video_rxtx::rtp_video_rxtx(), get_audio_delay(), and set_audio_delay().