format.h 957 Bytes
Newer Older
Jack Moffitt's avatar
Jack Moffitt committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
/* format.h
**
** format plugin header
**
*/
#ifndef __FORMAT_H__
#define __FORMAT_H__

typedef enum _format_type_tag
{
	FORMAT_TYPE_VORBIS,
	FORMAT_TYPE_MP3
} format_type_t;

typedef struct _format_plugin_tag
{
	format_type_t type;

Jack Moffitt's avatar
Jack Moffitt committed
19 20 21
	/* we need to know the mount to report statistics */
	char *mount;

22 23
    char *format_description;

Jack Moffitt's avatar
Jack Moffitt committed
24 25 26 27 28
	/* set this is the data format has a header that
	** we must send before regular data
	*/
	int has_predata;

Michael Smith's avatar
Michael Smith committed
29 30
    int (*get_buffer)(struct _format_plugin_tag *self, char *data, unsigned long
            len, refbuf_t **buffer);
Jack Moffitt's avatar
Jack Moffitt committed
31
	refbuf_queue_t *(*get_predata)(struct _format_plugin_tag *self);
32
	void (*free_plugin)(struct _format_plugin_tag *self);
Jack Moffitt's avatar
Jack Moffitt committed
33 34 35 36 37

	/* for internal state management */
	void *_state;
} format_plugin_t;

Michael Smith's avatar
Michael Smith committed
38
format_type_t format_get_type(char *contenttype);
39
char *format_get_mimetype(format_type_t type);
Jack Moffitt's avatar
Jack Moffitt committed
40
format_plugin_t *format_get_plugin(format_type_t type, char *mount);
Jack Moffitt's avatar
Jack Moffitt committed
41 42 43 44 45 46 47 48 49

#endif  /* __FORMAT_H__ */