1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2025-02-02 15:07:36 -05:00

Cleanup: Make use of "icecasttypes.h" in format*.[ch]

This commit is contained in:
Philipp Schafft 2018-06-17 10:26:34 +00:00
parent 65f5eb9771
commit e467f6e31b
3 changed files with 15 additions and 17 deletions

View File

@ -20,13 +20,11 @@
#include <vorbis/codec.h> #include <vorbis/codec.h>
#include "icecasttypes.h"
#include "client.h" #include "client.h"
#include "refbuf.h" #include "refbuf.h"
#include "common/httpp/httpp.h" #include "common/httpp/httpp.h"
struct source_tag;
struct _mount_proxy;
typedef enum _format_type_tag typedef enum _format_type_tag
{ {
FORMAT_ERROR, /* No format, source not processable */ FORMAT_ERROR, /* No format, source not processable */
@ -47,13 +45,13 @@ typedef struct _format_plugin_tag
uint64_t read_bytes; uint64_t read_bytes;
uint64_t sent_bytes; uint64_t sent_bytes;
refbuf_t *(*get_buffer)(struct source_tag *); refbuf_t *(*get_buffer)(source_t *);
int (*write_buf_to_client)(client_t *client); int (*write_buf_to_client)(client_t *client);
void (*write_buf_to_file)(struct source_tag *source, refbuf_t *refbuf); void (*write_buf_to_file)(source_t *source, refbuf_t *refbuf);
int (*create_client_data)(struct source_tag *source, client_t *client); int (*create_client_data)(source_t *source, client_t *client);
void (*set_tag)(struct _format_plugin_tag *plugin, const char *tag, const char *value, const char *charset); void (*set_tag)(struct _format_plugin_tag *plugin, const char *tag, const char *value, const char *charset);
void (*free_plugin)(struct _format_plugin_tag *self); void (*free_plugin)(struct _format_plugin_tag *self);
void (*apply_settings)(client_t *client, struct _format_plugin_tag *format, struct _mount_proxy *mount); void (*apply_settings)(client_t *client, struct _format_plugin_tag *format, mount_proxy *mount);
/* meta data */ /* meta data */
vorbis_comment vc; vorbis_comment vc;
@ -64,16 +62,16 @@ typedef struct _format_plugin_tag
format_type_t format_get_type(const char *contenttype); format_type_t format_get_type(const char *contenttype);
char *format_get_mimetype(format_type_t type); char *format_get_mimetype(format_type_t type);
int format_get_plugin(format_type_t type, struct source_tag *source); int format_get_plugin(format_type_t type, source_t *source);
int format_generic_write_to_client (client_t *client); int format_generic_write_to_client (client_t *client);
int format_advance_queue (struct source_tag *source, client_t *client); int format_advance_queue (source_t *source, client_t *client);
int format_check_http_buffer (struct source_tag *source, client_t *client); int format_check_http_buffer (source_t *source, client_t *client);
int format_check_file_buffer (struct source_tag *source, client_t *client); int format_check_file_buffer (source_t *source, client_t *client);
void format_send_general_headers(format_plugin_t *format, void format_send_general_headers(format_plugin_t *format,
struct source_tag *source, client_t *client); source_t *source, client_t *client);
void format_set_vorbiscomment(format_plugin_t *plugin, const char *tag, const char *value); void format_set_vorbiscomment(format_plugin_t *plugin, const char *tag, const char *value);

View File

@ -55,7 +55,7 @@ static refbuf_t *mp3_get_no_meta (source_t *source);
static int format_mp3_create_client_data (source_t *source, client_t *client); static int format_mp3_create_client_data (source_t *source, client_t *client);
static void free_mp3_client_data (client_t *client); static void free_mp3_client_data (client_t *client);
static int format_mp3_write_buf_to_client(client_t *client); static int format_mp3_write_buf_to_client(client_t *client);
static void write_mp3_to_file (struct source_tag *source, refbuf_t *refbuf); static void write_mp3_to_file (source_t *source, refbuf_t *refbuf);
static void mp3_set_tag (format_plugin_t *plugin, const char *tag, const char *in_value, const char *charset); static void mp3_set_tag (format_plugin_t *plugin, const char *tag, const char *in_value, const char *charset);
static void format_mp3_apply_settings(client_t *client, format_plugin_t *format, mount_proxy *mount); static void format_mp3_apply_settings(client_t *client, format_plugin_t *format, mount_proxy *mount);
@ -715,7 +715,7 @@ static void free_mp3_client_data (client_t *client)
} }
static void write_mp3_to_file (struct source_tag *source, refbuf_t *refbuf) static void write_mp3_to_file (source_t *source, refbuf_t *refbuf)
{ {
if (refbuf->len == 0) if (refbuf->len == 0)
return; return;

View File

@ -60,7 +60,7 @@ static void format_ogg_free_plugin(format_plugin_t *plugin);
static int create_ogg_client_data(source_t *source, client_t *client); static int create_ogg_client_data(source_t *source, client_t *client);
static void free_ogg_client_data(client_t *client); static void free_ogg_client_data(client_t *client);
static void write_ogg_to_file(struct source_tag *source, refbuf_t *refbuf); static void write_ogg_to_file(source_t *source, refbuf_t *refbuf);
static refbuf_t *ogg_get_buffer(source_t *source); static refbuf_t *ogg_get_buffer(source_t *source);
static int write_buf_to_client(client_t *client); static int write_buf_to_client(client_t *client);
@ -563,7 +563,7 @@ static int write_buf_to_client(client_t *client)
} }
static int write_ogg_data (struct source_tag *source, refbuf_t *refbuf) static int write_ogg_data (source_t *source, refbuf_t *refbuf)
{ {
int ret = 1; int ret = 1;
@ -578,7 +578,7 @@ static int write_ogg_data (struct source_tag *source, refbuf_t *refbuf)
} }
static void write_ogg_to_file (struct source_tag *source, refbuf_t *refbuf) static void write_ogg_to_file (source_t *source, refbuf_t *refbuf)
{ {
ogg_state_t *ogg_info = source->format->_state; ogg_state_t *ogg_info = source->format->_state;