Paraslash Audio Streaming | |
About News Download Documentation Development |
Symbols exported from audiod.c. More...
Functions | |
struct btr_node * | audiod_get_btr_root (void) |
Return the root node of the current buffer tree. More... | |
__malloc char * | audiod_get_decoder_flags (void) |
Return the flags for the decoder_flags status item. More... | |
void | clear_and_dump_items (void) |
Flush and send all status items. More... | |
__malloc char * | get_time_string (void) |
Compute the play time based on information of the current slot. More... | |
bool | uid_is_whitelisted (uid_t uid) |
Lookup the given UID in the whitelist. More... | |
void | audiod_status_dump (bool force) |
Send the current audiod status to all connected stat clients. More... | |
void | close_stat_clients (void) |
Empty the status clients list. More... | |
int | dispatch_local_connection (int accept_fd) |
Handle arriving connections on the local socket. More... | |
void | stat_client_write_item (int item_num) |
Write a message to all connected status clients. More... | |
Variables | |
int | audiod_status |
The current mode of operation (AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY). More... | |
Symbols exported from audiod.c.
struct btr_node* audiod_get_btr_root | ( | void | ) |
Return the root node of the current buffer tree.
This is only used for stream grabbing.
NULL
if no slot is currently active. If more than one buffer tree exists, the node corresponding to the most recently started receiver is returned. References btr_get_node_start(), FOR_EACH_SLOT, slot, and tv_diff().
__malloc char* audiod_get_decoder_flags | ( | void | ) |
Return the flags for the decoder_flags status item.
Allocates a string which contains one octal digit per slot. Bit zero (value 1) is set if a receiver is active. Bit one (value 2) and bit three (value 4) have the analogous meaning for filter and writer, respectively.
References FOR_EACH_SLOT, MAX_STREAM_SLOTS, para_strdup(), and slot.
void clear_and_dump_items | ( | void | ) |
Flush and send all status items.
Send to each connected client the full status item list with empty values.
References FOR_EACH_STATUS_ITEM, stat_client_write_item(), and stat_item_values.
__malloc char* get_time_string | ( | void | ) |
Compute the play time based on information of the current slot.
This computes a string of the form "0:07 [3:33] (3%/3:40)" using information from the status items received from para_server and the start time of the (first) writer of the current slot.
It has to take into account that the stream was probably not started at the beginning of the file, that the clock between the server and the client host may differ and that playback of the stream was delayed, e.g. because the prebuffer filter is used in the filter configuration.
If no writer is active, for example because para_audiod runs in standby mode, an approximation based only on the status items is computed and the returned string is prefixed with "~".
Referenced by audiod_status_dump().
bool uid_is_whitelisted | ( | uid_t | uid | ) |
Lookup the given UID in the whitelist.
The whitelist is the array of arguments to the –user-allow opion. If the option was not given, the array is empty, in which case the check succeeds.
uid | User ID to look up. |
References OPT_GIVEN.
void audiod_status_dump | ( | bool | force | ) |
Send the current audiod status to all connected stat clients.
force | Whether to write unchanged items. |
References daemon_get_uptime_str(), get_time_string(), now, stat_client_write_item(), and stat_item_values.
void close_stat_clients | ( | void | ) |
Empty the status clients list.
This iterates over the list of connected status clients, closes each client file descriptor and frees the resources.
References list_for_each_entry_safe.
int dispatch_local_connection | ( | int | accept_fd | ) |
Handle arriving connections on the local socket.
accept_fd | The fd to accept connections on. |
This is called in each iteration of the main loop of the scheduler. If there is an incoming connection, the function reads the command sent by the peer, checks the connecting user's permissions by using unix socket credentials (if supported by the OS) and calls the corresponding command handler if permissions are OK.
References MAXLINE.
void stat_client_write_item | ( | int | item_num | ) |
Write a message to all connected status clients.
item_num | The number of the status item of msg. |
On write errors, remove the status client from the client list and close its file descriptor.
References para_buffer::flags, list_for_each_entry_safe, PBF_SIZE_PREFIX, and stat_item_values.
Referenced by audiod_status_dump(), and clear_and_dump_items().
|
extern |
The current mode of operation (AUDIOD_OFF, AUDIOD_ON or AUDIOD_STANDBY).
Set by the on/off/cycle commands.