2004-12-07 16:06:26 -05:00
|
|
|
/* Icecast
|
|
|
|
*
|
|
|
|
* This program is distributed under the GNU General Public License, version 2.
|
|
|
|
* A copy of this license is included with this source.
|
|
|
|
*
|
|
|
|
* Copyright 2000-2004, Jack Moffitt <jack@xiph.org,
|
|
|
|
* Michael Smith <msmith@xiph.org>,
|
|
|
|
* oddsock <oddsock@xiph.org>,
|
|
|
|
* Karl Heyes <karl@xiph.org>
|
|
|
|
* and others (see AUTHORS for details).
|
2018-11-26 02:42:05 -05:00
|
|
|
* Copyright 2014, Philipp "ph3-der-loewe" Schafft <lion@lion.leolix.org>,
|
2004-12-07 16:06:26 -05:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* format_ogg.h
|
2014-11-30 15:32:30 -05:00
|
|
|
**
|
|
|
|
** vorbis format plugin header
|
|
|
|
**
|
|
|
|
*/
|
2004-12-07 16:06:26 -05:00
|
|
|
#ifndef __FORMAT_OGG_H__
|
|
|
|
#define __FORMAT_OGG_H__
|
|
|
|
|
|
|
|
#include <ogg/ogg.h>
|
|
|
|
#include "refbuf.h"
|
|
|
|
#include "format.h"
|
|
|
|
|
|
|
|
typedef struct ogg_state_tag
|
|
|
|
{
|
|
|
|
char *mount;
|
|
|
|
ogg_sync_state oy;
|
|
|
|
int error;
|
|
|
|
|
2005-08-07 10:50:59 -04:00
|
|
|
int codec_count;
|
2004-12-07 16:06:26 -05:00
|
|
|
struct ogg_codec_tag *codecs;
|
|
|
|
int log_metadata;
|
|
|
|
refbuf_t *file_headers;
|
|
|
|
refbuf_t *header_pages;
|
|
|
|
refbuf_t *header_pages_tail;
|
|
|
|
refbuf_t **bos_end;
|
|
|
|
int bos_completed;
|
|
|
|
long bitrate;
|
|
|
|
struct ogg_codec_tag *current;
|
|
|
|
struct ogg_codec_tag *codec_sync;
|
|
|
|
} ogg_state_t;
|
|
|
|
|
|
|
|
|
|
|
|
/* per codec/logical structure */
|
|
|
|
typedef struct ogg_codec_tag
|
|
|
|
{
|
|
|
|
struct ogg_codec_tag *next;
|
|
|
|
ogg_stream_state os;
|
|
|
|
unsigned headers;
|
2004-12-09 19:11:16 -05:00
|
|
|
const char *name;
|
2004-12-07 16:06:26 -05:00
|
|
|
void *specific;
|
|
|
|
refbuf_t *possible_start;
|
|
|
|
refbuf_t *page;
|
|
|
|
|
2014-12-09 11:08:27 -05:00
|
|
|
refbuf_t *(*process)(ogg_state_t *ogg_info, struct ogg_codec_tag *codec, format_plugin_t *plugin);
|
2004-12-07 16:06:26 -05:00
|
|
|
refbuf_t *(*process_page)(ogg_state_t *ogg_info,
|
2014-12-09 11:08:27 -05:00
|
|
|
struct ogg_codec_tag *codec, ogg_page *page, format_plugin_t *plugin);
|
2004-12-07 16:06:26 -05:00
|
|
|
void (*codec_free)(ogg_state_t *ogg_info, struct ogg_codec_tag *codec);
|
|
|
|
} ogg_codec_t;
|
|
|
|
|
|
|
|
|
|
|
|
refbuf_t *make_refbuf_with_page (ogg_page *page);
|
|
|
|
void format_ogg_attach_header (ogg_state_t *ogg_info, ogg_page *page);
|
|
|
|
void format_ogg_free_headers (ogg_state_t *ogg_info);
|
|
|
|
int format_ogg_get_plugin (source_t *source);
|
|
|
|
|
|
|
|
#endif /* __FORMAT_OGG_H__ */
|