2001-09-10 02:21:46 +00:00
|
|
|
#ifndef __SOURCE_H__
|
|
|
|
#define __SOURCE_H__
|
|
|
|
|
2003-07-21 01:58:54 +00:00
|
|
|
#include "cfgfile.h"
|
2003-02-02 14:33:17 +00:00
|
|
|
#include "yp.h"
|
2003-02-26 23:52:23 +00:00
|
|
|
#include "util.h"
|
2002-12-30 07:55:56 +00:00
|
|
|
#include "format.h"
|
|
|
|
|
2003-03-02 10:13:59 +00:00
|
|
|
#include <stdio.h>
|
|
|
|
|
2001-09-10 02:21:46 +00:00
|
|
|
typedef struct source_tag
|
|
|
|
{
|
2002-08-16 14:26:48 +00:00
|
|
|
client_t *client;
|
2003-03-15 02:10:19 +00:00
|
|
|
connection_t *con;
|
|
|
|
http_parser_t *parser;
|
|
|
|
|
|
|
|
char *mount;
|
2002-12-30 15:19:46 +00:00
|
|
|
|
|
|
|
/* If this source drops, try to move all clients to this fallback */
|
|
|
|
char *fallback_mount;
|
|
|
|
|
2003-02-06 13:10:48 +00:00
|
|
|
/* set to zero to request the source to shutdown without causing a global
|
|
|
|
* shutdown */
|
|
|
|
int running;
|
|
|
|
|
2003-03-15 02:10:19 +00:00
|
|
|
struct _format_plugin_tag *format;
|
2001-09-10 02:21:46 +00:00
|
|
|
|
2003-03-15 02:10:19 +00:00
|
|
|
avl_tree *client_tree;
|
|
|
|
avl_tree *pending_tree;
|
2001-09-10 02:21:46 +00:00
|
|
|
|
2003-03-15 02:10:19 +00:00
|
|
|
rwlock_t *shutdown_rwlock;
|
|
|
|
ypdata_t *ypdata[MAX_YP_DIRECTORIES];
|
2003-02-26 23:52:23 +00:00
|
|
|
util_dict *audio_info;
|
2003-03-02 10:13:59 +00:00
|
|
|
|
|
|
|
char *dumpfilename; /* Name of a file to dump incoming stream to */
|
|
|
|
FILE *dumpfile;
|
|
|
|
|
2003-03-15 02:10:19 +00:00
|
|
|
int num_yp_directories;
|
|
|
|
long listeners;
|
2003-02-11 14:23:34 +00:00
|
|
|
long max_listeners;
|
2003-06-26 13:32:04 +00:00
|
|
|
int yp_public;
|
2003-02-17 13:01:37 +00:00
|
|
|
int send_return;
|
2001-09-10 02:21:46 +00:00
|
|
|
} source_t;
|
|
|
|
|
2003-03-02 10:13:59 +00:00
|
|
|
source_t *source_create(client_t *client, connection_t *con,
|
|
|
|
http_parser_t *parser, const char *mount, format_type_t type,
|
|
|
|
mount_proxy *mountinfo);
|
2001-09-10 02:21:46 +00:00
|
|
|
source_t *source_find_mount(const char *mount);
|
2003-03-30 13:52:27 +00:00
|
|
|
client_t *source_find_client(source_t *source, int id);
|
2001-09-10 02:21:46 +00:00
|
|
|
int source_compare_sources(void *arg, void *a, void *b);
|
|
|
|
int source_free_source(void *key);
|
2003-03-14 07:59:58 +00:00
|
|
|
int source_remove_client(void *key);
|
2001-09-10 02:21:46 +00:00
|
|
|
void *source_main(void *arg);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|