![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|
#include <atomic>#include <cassert>#include <cctype>#include <cinttypes>#include <climits>#include <csignal>#include <cstdio>#include <cstdlib>#include <cstring>#include <ctime>#include <getopt.h>#include <memory>#include <pthread.h>#include <stdexcept>#include <string>#include <thread>#include <unistd.h>#include <utility>#include <vector>#include "control_socket.h"#include "debug.h"#include "hd-rum-translator/hd-rum-decompress.h"#include "hd-rum-translator/hd-rum-recompress.h"#include "host.h"#include "lib_common.h"#include "messaging.h"#include "module.h"#include "rtp/net_udp.h"#include "tv.h"#include "ug_runtime_error.hpp"#include "utils/color_out.h"#include "utils/misc.h"#include "utils/net.h"
Go to the source code of this file.
Classes | |
| struct | cmdline_parameters |
| struct | Conf_participant |
| struct | hd_rum_translator_state |
| struct | host_opts |
| struct | item |
| class | Participant_manager |
| struct | replica |
Macros | |
| #define | EXIT(retval) |
| #define | MAX_PKT_SIZE 10000 |
| #define | MOD_NAME "[hd-rum-trans] " |
| #define | prefix_matches(x, y) |
| #define | REPLICA_MAGIC 0xd2ff3323 |
| #define | SIZE MAX_PKT_SIZE |
Functions | |
| static struct response * | change_replica_type (struct hd_rum_translator_state *s, struct module *mod, struct message *msg, int index) |
| static int | create_output_port (struct hd_rum_translator_state *s, const char *addr, int rx_port, int tx_port, int bufsize, struct common_opts *common, const char *compression, const char *fec, int bitrate, bool use_server_sock=false) |
| static char * | get_replica_mod_name (const char *addr, uint16_t tx_port) |
| static void | hd_rum_translator_deinit (struct hd_rum_translator_state *s) |
| static void | hd_rum_translator_should_exit_callback (void *arg) |
| int | main (int argc, char **argv) |
| static int | parse_fmt (int argc, char **argv, struct cmdline_parameters *parsed) noexcept(false) |
| static int | parse_global_opts (int argc, char **argv, struct cmdline_parameters *parsed) noexcept(false) |
| static int | parse_size (const char *sz_str) noexcept(false) |
| unit_evaluate() is similar but uses SI prefixes | |
| static void | qdestroy (struct item *queue) |
| static struct item * | qinit (int qsize) |
| static void | signal_handler (int signum) |
| static bool | sockaddr_equal (struct sockaddr_storage *a, struct sockaddr_storage *b) |
| static void | usage (const char *progname) |
| static void * | writer (void *arg) |
Main part of transcoding reflector. This component provides a runtime for the reflector. Componets are following:
Definition in file hd-rum-translator.cpp.
| #define EXIT | ( | retval | ) |
Definition at line 973 of file hd-rum-translator.cpp.
Referenced by main().
| #define MAX_PKT_SIZE 10000 |
Definition at line 221 of file hd-rum-translator.cpp.
| #define MOD_NAME "[hd-rum-trans] " |
Definition at line 89 of file hd-rum-translator.cpp.
| #define prefix_matches | ( | x, | |
| y ) |
Definition at line 282 of file hd-rum-translator.cpp.
Referenced by change_replica_type().
| #define REPLICA_MAGIC 0xd2ff3323 |
Definition at line 91 of file hd-rum-translator.cpp.
Referenced by replica::replica(), and replica::~replica().
| #define SIZE MAX_PKT_SIZE |
Definition at line 232 of file hd-rum-translator.cpp.
|
static |
Definition at line 283 of file hd-rum-translator.cpp.
References LOG_LEVEL_ERROR, LOG_LEVEL_NOTICE, log_msg(), replica::mod, new_response(), prefix_matches, module::priv_data, hd_rum_translator_state::recompress, recompress_port_change_compress(), recompress_port_set_active(), RESPONSE_BAD_REQUEST, RESPONSE_OK, msg_universal::text, and replica::type.
Referenced by writer().

|
static |
Definition at line 325 of file hd-rum-translator.cpp.
References replica::replica(), common_opts::force_ip_version, LOG_LEVEL_ERROR, log_msg(), hd_rum_translator_state::mod, replica::mod, common_opts::parent, hd_rum_translator_state::recompress, recompress_add_port(), recompress_port_set_active(), hd_rum_translator_state::replicas, hd_rum_translator_state::server_socket, replica::sock, and replica::type.
Referenced by main(), and writer().

|
static |
Definition at line 93 of file hd-rum-translator.cpp.
Referenced by replica::replica(), and Participant_manager::tick().
|
static |
Definition at line 822 of file hd-rum-translator.cpp.
References control_done(), hd_rum_translator_state::control_state, hd_rum_translator_state::decompress, hd_rum_decompress_done(), qdestroy(), hd_rum_translator_state::queue, hd_rum_translator_state::recompress, recompress_done(), and hd_rum_translator_state::replicas.
Referenced by main().

|
static |
Definition at line 968 of file hd-rum-translator.cpp.
Referenced by main().
| int main | ( | int | argc, |
| char ** | argv ) |
Definition at line 983 of file hd-rum-translator.cpp.
References common_cleanup(), common_preinit(), CONFERENCE, control_init(), control_start(), crash_signal_handler(), create_output_port(), EXIT, EXIT_FAIL_COMPRESS, EXIT_FAIL_CONTROL_SOCK, EXIT_FAIL_DECODER, format_in_si_units(), hang_signal_handler(), hd_rum_decompress_init(), hd_rum_translator_deinit(), hd_rum_translator_should_exit_callback(), init(), invalid_arg_is_numeric(), log_level, LOG_LEVEL_INFO, log_msg(), MSG, parse_fmt(), params::port, print_version(), qinit(), recompress_init(), register_should_exit_callback(), Participant_manager::run_async(), signal_handler(), SIZE, state, Participant_manager::tick(), tv_diff(), udp_exit(), udp_get_udp_rx_port(), udp_init(), udp_init_if(), udp_recvfrom_timeout(), udp_set_recv_buf(), unregister_should_exit_callback(), and writer().

|
static |
| -1 | failure |
| 0 | success |
| 1 | help shown |
Definition at line 728 of file hd-rum-translator.cpp.
References MSG, parse_bitrate(), parse_global_opts(), parse_size(), RATE_UNLIMITED, and usage().
Referenced by main().

|
static |
Definition at line 643 of file hd-rum-translator.cpp.
References BLEND, CONFERENCE, list_all_modules(), MSG, parse_params(), print_capabilities(), and usage().
Referenced by parse_fmt().

|
static |
unit_evaluate() is similar but uses SI prefixes
Definition at line 614 of file hd-rum-translator.cpp.
Referenced by parse_fmt().
|
static |
Definition at line 268 of file hd-rum-translator.cpp.
References item::buf, item::next, and queue.
Referenced by hd_rum_translator_deinit().
|
static |
Definition at line 241 of file hd-rum-translator.cpp.
Referenced by main().
|
static |
Definition at line 188 of file hd-rum-translator.cpp.
References item::buf, exit_uv(), log_level, and LOG_LEVEL_DEBUG.
Referenced by main().

|
static |
Definition at line 839 of file hd-rum-translator.cpp.
Referenced by Participant_manager::tick().
|
static |
Definition at line 537 of file hd-rum-translator.cpp.
References SBOLD, SRED, and SUNDERLINE.
|
static |
Definition at line 366 of file hd-rum-translator.cpp.
References item::buf, hd_rum_translator_state::bufsize, change_replica_type(), check_message(), COMMON_OPTS_INIT, create_output_port(), hd_rum_translator_state::decompress, free_message(), hd_rum_decompress_write(), LOG_LEVEL_ERROR, LOG_LEVEL_NOTICE, LOG_LEVEL_WARNING, log_msg(), hd_rum_translator_state::mod, msg, new_response(), item::next, hd_rum_translator_state::qempty, hd_rum_translator_state::qempty_cond, hd_rum_translator_state::qempty_mtx, hd_rum_translator_state::qfull, hd_rum_translator_state::qfull_cond, hd_rum_translator_state::qfull_mtx, hd_rum_translator_state::qhead, hd_rum_translator_state::qtail, RATE_UNLIMITED, hd_rum_translator_state::recompress, recompress_get_num_active_ports(), recompress_get_port_ssrc(), recompress_remove_port(), hd_rum_translator_state::replicas, RESPONSE_BAD_REQUEST, RESPONSE_INT_SERV_ERR, RESPONSE_OK, hd_rum_translator_state::server_socket, SIZE, item::size, TRUE, and udp_sendto().
Referenced by main().
