Paraslash Audio Streaming | |
About News Download Documentation Development |
Functions for grabbing the audio stream. More...
#include <regex.h>
#include <sys/types.h>
#include <lopsub.h>
#include "audiod_cmd.lsg.h"
#include "para.h"
#include "list.h"
#include "sched.h"
#include "buffer_tree.h"
#include "grab_client.h"
#include "audiod.h"
#include "error.h"
#include "string.h"
#include "fd.h"
Enumerations | |
enum | grab_mode { GM_SLOPPY, GM_AGGRESSIVE, GM_PEDANTIC } |
How to handle blocking writes for the grab client fds. More... | |
enum | grab_flags { GF_ONE_SHOT = 1 } |
Flags specified as arguments to the grab command. More... | |
Functions | |
void | activate_grab_clients (struct sched *s) |
Activate inactive grab clients if possible. More... | |
int | grab_client_new (int fd, struct lls_parse_result *lpr, struct sched *s) |
Create and activate a grab client. More... | |
Functions for grabbing the audio stream.
enum grab_mode |
enum grab_flags |
void activate_grab_clients | ( | struct sched * | s | ) |
Activate inactive grab clients if possible.
s | Needed to schedule the grab client task. |
This is called from audiod.c when the current audio file changes. It loops over all inactive grab clients and checks each grab client's configuration to determine if the client in question wishes to grab the new stream. If yes, this grab client is moved from the inactive to the active grab client list.
This function also garbage collects all grab clients whose tasks have been unscheduled.
References list_for_each_entry_safe.
int grab_client_new | ( | int | fd, |
struct lls_parse_result * | lpr, | ||
struct sched * | s | ||
) |
Create and activate a grab client.
fd | The file descriptor of the client. |
lpr | The parsed command line of the grab command. |
s | The scheduler to register the grab client task to. |
This function semantically parses the arguments given as options to the grab command. On success it allocates a struct grab_client, associates it with the given file descriptor and activates it. If the new grab client can not be attached to an existing buffer tree node it is put into the inactive list for later activation.