![]() |
UltraGrid
UltraGrid Low-Latency High-Resolution Transmission System
|


Go to the source code of this file.
Classes | |
| struct | message |
| struct | msg_change_compress_data |
| struct | msg_receiver |
| struct | msg_sender |
| struct | msg_stats |
| struct | msg_universal |
Macros | |
| #define | MSG_UNIVERSAL_TAG_TX "TX_msg " |
| #define | RESPONSE_ACCEPTED 202 |
| #define | RESPONSE_BAD_REQUEST 400 |
| #define | RESPONSE_INT_SERV_ERR 500 |
| #define | RESPONSE_NO_CONTENT 204 |
| #define | RESPONSE_NOT_FOUND 404 |
| #define | RESPONSE_NOT_IMPL 501 |
| #define | RESPONSE_OK 200 |
| #define | RESPONSE_REQ_TIMEOUT 408 |
| #define | RESPONSE_SUCCESSFUL(code) |
| #define | SEND_MESSAGE_FLAG_NO_STORE (1<<1) |
| if receiver doesn't exist, doesn't store it and retur 404 instead | |
| #define | SEND_MESSAGE_FLAG_QUIET (1<<0) |
| do not print error messages on console (recv not found/queue full) | |
Functions | |
| struct message * | check_message (struct module *) |
| void | free_message (struct message *m, struct response *r) |
| void | free_message_for_child (void *m, struct response *r) |
| void | free_response (struct response *r) |
| void | module_check_undelivered_messages (struct module *) |
| Sends message with waiting for response. | |
| void | module_store_message (struct module *node, struct message *m) |
| struct message * | new_message (size_t length) __attribute__((warn_unused_result)) |
| struct response * | new_response (int status, const char *optional_message) |
| int | response_get_status (struct response *r) |
| const char * | response_get_text (struct response *r) |
| const char * | response_status_to_text (int status) |
| struct response * | send_message (struct module *, const char *path, struct message *msg) __attribute__((warn_unused_result)) |
| Sends message without waiting for response. | |
| struct response * | send_message_sync (struct module *, const char *path, struct message *msg, int timeout_ms, int flags) __attribute__((warn_unused_result)) |
| Sends message without waiting for response. | |
| struct response * | send_message_to_receiver (struct module *, struct message *msg) __attribute__((warn_unused_result)) |
Definition in file messaging.h.
| #define MSG_UNIVERSAL_TAG_TX "TX_msg " |
Definition at line 160 of file messaging.h.
Referenced by fec_check_messages(), and process_msg().
| #define RESPONSE_ACCEPTED 202 |
Definition at line 58 of file messaging.h.
Referenced by response_status_to_text(), send_message_common(), send_message_to_receiver(), Participant_manager::tick(), and vidcap_import_new_message().
| #define RESPONSE_BAD_REQUEST 400 |
Definition at line 60 of file messaging.h.
Referenced by audio_sender_process_message(), change_replica_type(), display_conference_worker(), display_sdl2_run(), display_sdl_run(), fec_check_messages(), filter(), filter(), gl_process_frames(), process_audio_message(), process_message(), process_message(), process_msg(), response_status_to_text(), vidcap_file_process_messages(), vidcap_switcher_grab(), and writer().
| #define RESPONSE_INT_SERV_ERR 500 |
Definition at line 63 of file messaging.h.
Referenced by audio_receiver_process_message(), audio_sender_process_message(), compress_process_message(), fec_check_messages(), Filter_chain::filter(), process_message(), process_messages(), process_msg(), rtp_video_rxtx::process_sender_message(), ultragrid_rtp_video_rxtx::receiver_process_messages(), response_status_to_text(), send_message_common(), and writer().
| #define RESPONSE_NO_CONTENT 204 |
Definition at line 59 of file messaging.h.
Referenced by rtp_video_rxtx::process_sender_message(), and response_status_to_text().
| #define RESPONSE_NOT_FOUND 404 |
Definition at line 61 of file messaging.h.
Referenced by audio_decoder_process_message(), decoder_process_message(), process_messages(), process_msg(), response_status_to_text(), and send_message_common().
| #define RESPONSE_NOT_IMPL 501 |
Definition at line 64 of file messaging.h.
Referenced by process_messages(), and response_status_to_text().
| #define RESPONSE_OK 200 |
Definition at line 57 of file messaging.h.
Referenced by audio_decoder_process_message(), audio_receiver_process_message(), audio_sender_process_message(), change_replica_type(), compress_process_message(), decoder_process_message(), display_conference_worker(), display_sdl2_run(), display_sdl_run(), keyboard_control::impl::exec_external_commands(), fec_check_messages(), filter(), filter(), Filter_chain::filter(), gl_process_frames(), keyboard_control::impl::info(), keycontrol_register_key(), keycontrol_send_key(), keyboard_control::impl::msg_received(), process_message(), process_message(), process_message(), process_messages(), process_messages(), process_msg(), rtp_video_rxtx::process_sender_message(), ultragrid_rtp_video_rxtx::receiver_process_messages(), response_status_to_text(), sdp_send_change_address_message(), vidcap_file_process_messages(), vidcap_switcher_grab(), vidcap_switcher_register_keyboard_ctl(), and writer().
| #define RESPONSE_REQ_TIMEOUT 408 |
Definition at line 62 of file messaging.h.
Referenced by response_status_to_text().
| #define RESPONSE_SUCCESSFUL | ( | code | ) |
Definition at line 66 of file messaging.h.
Referenced by AudioDriftFixer::update().
| #define SEND_MESSAGE_FLAG_NO_STORE (1<<1) |
if receiver doesn't exist, doesn't store it and retur 404 instead
Definition at line 172 of file messaging.h.
Referenced by keyboard_control::impl::exec_external_commands(), keyboard_control::impl::info(), keycontrol_register_key(), keycontrol_send_key(), send_message_common(), AudioDriftFixer::update(), and vidcap_switcher_register_keyboard_ctl().
| #define SEND_MESSAGE_FLAG_QUIET (1<<0) |
do not print error messages on console (recv not found/queue full)
Definition at line 171 of file messaging.h.
Referenced by keyboard_control::impl::exec_external_commands(), keyboard_control::impl::info(), keycontrol_register_key(), keycontrol_send_key(), send_message_common(), and vidcap_switcher_register_keyboard_ctl().
| enum compress_change_type |
| Enumerator | |
|---|---|
| CHANGE_COMPRESS | |
| CHANGE_PARAMS | |
Definition at line 128 of file messaging.h.
| enum msg_receiver_type |
Definition at line 108 of file messaging.h.
| enum msg_sender_type |
Definition at line 83 of file messaging.h.
Definition at line 394 of file messaging.cpp.
References module::msg_queue, module::msg_queue_lock, simple_linked_list_pop(), and simple_linked_list_size().
Referenced by audio_decoder_process_message(), audio_done(), audio_receiver_thread(), audio_sender_thread(), capture_filter(), video_rxtx::check_sender_messages(), compress_frame(), decoder_process_message(), display_conference_worker(), display_get_frame(), display_sdl2_run(), display_sdl_run(), fec_check_messages(), filter(), filter(), filter(), Filter_chain::filter(), gl_process_frames(), module_done(), keyboard_control::impl::msg_received(), process_messages(), process_messages(), ultragrid_rtp_video_rxtx::receiver_process_messages(), vidcap_file_process_messages(), vidcap_import_new_message(), vidcap_switcher_grab(), and writer().

Frees message
Additionally, it enforces user to pass response to be sent to sender.
Definition at line 318 of file messaging.cpp.
References free_response().
Referenced by audio_decoder_process_message(), audio_done(), audio_receiver_thread(), audio_sender_thread(), capture_filter(), video_rxtx::check_sender_messages(), compress_process_message(), decoder_process_message(), display_conference_worker(), display_get_frame(), display_sdl2_run(), display_sdl_run(), fec_check_messages(), filter(), filter(), filter(), Filter_chain::filter(), free_message_for_child(), gl_process_frames(), module_done(), keyboard_control::impl::msg_received(), process_audio_message(), process_messages(), process_messages(), ultragrid_rtp_video_rxtx::receiver_process_messages(), send_message_common(), set_fec(), vidcap_file_process_messages(), vidcap_import_new_message(), vidcap_switcher_grab(), and writer().

| void free_message_for_child | ( | void * | m, |
| struct response * | r ) |
Definition at line 99 of file messaging.cpp.
References free_message().
Referenced by module_done(), and send_message_common().

| void free_response | ( | struct response * | r | ) |
Definition at line 361 of file messaging.cpp.
Referenced by compress_process_message(), BasicRTSPOnlySubsession::deleteStream(), keyboard_control::impl::exec_external_commands(), free_message(), keyboard_control::impl::info(), keycontrol_register_key(), keycontrol_send_key(), module_check_undelivered_messages(), process_msg(), reconfigure_decoder(), keyboard_control::impl::run(), sdp_send_change_address_message(), h264_sdp_video_rxtx::send_frame(), send_response(), set_fec(), BasicRTSPOnlySubsession::startStream(), Participant_manager::tick(), tx_update(), AudioDriftFixer::update(), and vidcap_switcher_register_keyboard_ctl().
| void module_check_undelivered_messages | ( | struct module * | node | ) |
Sends message with waiting for response.
Stores message to module message box. If new_message callback is present it is called. Otherwise it may take a long time until module reads the message therefore setting timeout_ms is strongly recommended to prevent freeze (unless knowing that module implements synchronnous message processing via module::new_message callback).
If not set otherwise, when receiver doesn't exist, message is stored by nearest existing parent until it starts (this may be disabled with flag SEND_MESSAGE_FLAG_NO_STORE).
| sync | wait for response timeout_ms milliseconds, if false, 202 is immediately returned (or 404 if NO_STORE flag is set and receiver doesn't exist) |
| timeout_ms | if sync==true number of ms to wait for response (-1 means infinitely), ignored if sync is false, @params flags bit mask of SEND_MESSAGE_FLAG_NO_STORE and SEND_MESSAGE_FLAG_QUIET |
Definition at line 265 of file messaging.cpp.
References free_response(), get_matching_child(), module::lock, module::msg_queue_children, send_message_to_receiver(), simple_linked_list_it_init(), simple_linked_list_it_next(), and simple_linked_list_remove().
Referenced by module_register().

Definition at line 283 of file messaging.cpp.
References module::msg_queue, module::msg_queue_lock, and simple_linked_list_append().

| struct message * new_message | ( | size_t | length | ) |
Definition at line 303 of file messaging.cpp.
References len.
| struct response * new_response | ( | int | status, |
| const char * | text ) |
Creates new response
| status | status |
| text | optional text contained in message |
Definition at line 349 of file messaging.cpp.
References response::status, and response::text.
Referenced by audio_decoder_process_message(), audio_receiver_process_message(), audio_sender_process_message(), change_replica_type(), compress_process_message(), decoder_process_message(), display_conference_worker(), display_sdl2_run(), display_sdl_run(), fec_check_messages(), filter(), filter(), Filter_chain::filter(), gl_process_frames(), keyboard_control::impl::msg_received(), process_audio_message(), process_message(), process_message(), process_message(), process_messages(), process_messages(), process_msg(), rtp_video_rxtx::process_sender_message(), ultragrid_rtp_video_rxtx::receiver_process_messages(), send_message_common(), send_message_to_receiver(), vidcap_file_process_messages(), vidcap_import_new_message(), vidcap_switcher_grab(), and writer().
| int response_get_status | ( | struct response * | r | ) |
Definition at line 365 of file messaging.cpp.
References response::status.
Referenced by keyboard_control::impl::exec_external_commands(), keyboard_control::impl::info(), keycontrol_register_key(), keycontrol_send_key(), sdp_send_change_address_message(), send_response(), Participant_manager::tick(), AudioDriftFixer::update(), and vidcap_switcher_register_keyboard_ctl().
| const char * response_get_text | ( | struct response * | r | ) |
Definition at line 369 of file messaging.cpp.
References response::text.
Referenced by keyboard_control::impl::info(), send_response(), and AudioDriftFixer::update().
| const char * response_status_to_text | ( | int | status | ) |
Definition at line 373 of file messaging.cpp.
References mapping, RESPONSE_ACCEPTED, RESPONSE_BAD_REQUEST, RESPONSE_INT_SERV_ERR, RESPONSE_NO_CONTENT, RESPONSE_NOT_FOUND, RESPONSE_NOT_IMPL, RESPONSE_OK, and RESPONSE_REQ_TIMEOUT.
Referenced by send_response().
| struct response * send_message | ( | struct module * | root, |
| const char * | const_path, | ||
| struct message * | msg ) |
Sends message without waiting for response.
Stores message to module message box. If new_message callback is present it is called. Otherwise it may take a long time until module reads the message therefore setting timeout_ms is strongly recommended to prevent freeze (unless knowing that module implements synchronnous message processing via module::new_message callback).
If not set otherwise, when receiver doesn't exist, message is stored by nearest existing parent until it starts (this may be disabled with flag SEND_MESSAGE_FLAG_NO_STORE).
| sync | wait for response timeout_ms milliseconds, if false, 202 is immediately returned (or 404 if NO_STORE flag is set and receiver doesn't exist) |
| timeout_ms | if sync==true number of ms to wait for response (-1 means infinitely), ignored if sync is false, @params flags bit mask of SEND_MESSAGE_FLAG_NO_STORE and SEND_MESSAGE_FLAG_QUIET |
Definition at line 249 of file messaging.cpp.
References send_message_common().
Referenced by BasicRTSPOnlySubsession::deleteStream(), process_audio_message(), process_msg(), keyboard_control::impl::run(), sdp_send_change_address_message(), h264_sdp_video_rxtx::send_frame(), and BasicRTSPOnlySubsession::startStream().

| struct response * send_message_sync | ( | struct module * | root, |
| const char * | const_path, | ||
| struct message * | msg, | ||
| int | timeout_ms, | ||
| int | flags ) |
Sends message without waiting for response.
Stores message to module message box. If new_message callback is present it is called. Otherwise it may take a long time until module reads the message therefore setting timeout_ms is strongly recommended to prevent freeze (unless knowing that module implements synchronnous message processing via module::new_message callback).
If not set otherwise, when receiver doesn't exist, message is stored by nearest existing parent until it starts (this may be disabled with flag SEND_MESSAGE_FLAG_NO_STORE).
| sync | wait for response timeout_ms milliseconds, if false, 202 is immediately returned (or 404 if NO_STORE flag is set and receiver doesn't exist) |
| timeout_ms | if sync==true number of ms to wait for response (-1 means infinitely), ignored if sync is false, @params flags bit mask of SEND_MESSAGE_FLAG_NO_STORE and SEND_MESSAGE_FLAG_QUIET |
Definition at line 257 of file messaging.cpp.
References flags, and send_message_common().
Referenced by keyboard_control::impl::exec_external_commands(), keyboard_control::impl::info(), keycontrol_register_key(), keycontrol_send_key(), AudioDriftFixer::update(), and vidcap_switcher_register_keyboard_ctl().

Definition at line 289 of file messaging.cpp.
References module::lock, module::msg_queue, module::msg_queue_lock, module::new_message, new_response(), RESPONSE_ACCEPTED, and simple_linked_list_append().
Referenced by compress_process_message(), module_check_undelivered_messages(), reconfigure_decoder(), set_fec(), Participant_manager::tick(), and tx_update().
