1 /** \file audiod.h symbols exported from audiod.c */
2 int num_filters(int audio_format_num
);
3 int get_audio_format_num(char *name
);
5 /** enum of audio formats supported by para_audiod */
6 enum {AUDIOD_AUDIO_FORMATS_ENUM
};
8 /** array of audio format names supported by para_audiod */
9 extern const char *audio_formats
[];
11 /** maximal number of simultaneous instances */
12 #define MAX_STREAM_SLOTS 5
15 * the possible modes of operation
17 * - off: disconnect from para_server
18 * - on: receive status information from para_server and play the audio stream
19 * - sb: only receive status information but not the audio stream
21 enum {AUDIOD_OFF
, AUDIOD_ON
, AUDIOD_STANDBY
};
24 * describes one instance of a receiver-filter-writer chain
26 * \sa receier_node, receiver, filter, filter_node, filter_chain, writer,
27 * writer_node, writer_node_group.
30 /** number of the audio format in this slot */
32 /** writer start time */
33 struct timeval wstime
;
34 /** the receiver info associated with this slot */
35 struct receiver_node
*receiver_node
;
36 /** the active filter chain */
37 struct filter_chain
*fc
;
38 /** the active writer node group */
39 struct writer_node_group
*wng
;
43 * the main task of audiod
45 * \sa struct task, struct sched
53 * the task for obtaining para_server's status (para_client stat)
55 * \sa struct task, struct sched
58 /** the associated task structure of audiod */
60 /** client data associated with the stat task */
61 struct private_client_data
*pcd
;
62 /** the array of status items sent by para_server */
63 char *stat_item_values
[NUM_STAT_ITEMS
];
64 /** do not restart client command until this time */
65 struct timeval restart_barrier
;
66 /** last time we received status data from para_server */
67 struct timeval last_status_read
;
68 /** the offset value announced by para_server */
70 /** the length of the current audio file as announced by para_server */
72 /** the start of the current stream from the view of para_server */
73 struct timeval server_stream_start
;
74 /** the average time deviation between para_server and para_audiod */
75 struct timeval sa_time_diff
;
76 /** whether client time is ahead of server time */
77 int sa_time_diff_sign
;
78 /** non-zero if para_server's status is "playing" */
82 extern struct status_task
*stat_task
;
83 extern struct slot_info slot
[MAX_STREAM_SLOTS
];
84 extern struct audiod_args_info conf
;
85 extern int audiod_status
;
86 extern const char *status_item_list
[NUM_STAT_ITEMS
];
88 void __noreturn
clean_exit(int status
, const char *msg
);
89 int handle_connect(int accept_fd
);
90 void audiod_status_dump(void);
91 void dump_empty_status(void);
93 /** iterate over all slots */
94 #define FOR_EACH_SLOT(_slot) for (_slot = 0; _slot < MAX_STREAM_SLOTS; _slot++)