diff options
Diffstat (limited to 'plugins/liboggedit/oggedit_internal.h')
-rw-r--r-- | plugins/liboggedit/oggedit_internal.h | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/plugins/liboggedit/oggedit_internal.h b/plugins/liboggedit/oggedit_internal.h new file mode 100644 index 00000000..46a84345 --- /dev/null +++ b/plugins/liboggedit/oggedit_internal.h @@ -0,0 +1,59 @@ +/* + This file is part of Deadbeef Player source code + http://deadbeef.sourceforge.net + + DeaDBeeF Ogg Edit library internal headers + + Copyright (C) 2014 Ian Nartowicz <deadbeef@nartowicz.co.uk> + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +*/ + +#ifndef __OGGEDIT_INT_H +#define __OGGEDIT_INT_H + +#define OPUSNAME "Opus" +#define VORBISNAME "Vorbis" +#define FLACNAME "Flac" + +#define CHUNKSIZE 4096 +#define MAXPAGE 65536 +#define MAXPAYLOAD 65025 + +void _oggpack_chars(oggpack_buffer *opb, const char *s, size_t length); +void _oggpack_string(oggpack_buffer *opb, const char *s); +void _oggpackB_string(oggpack_buffer *opb, const char *s); +int open_temp_file(const char *fname, char *tempname, FILE **out); +FILE *open_new_file(const char *outname); +off_t file_size(const char *fname); +void cleanup(DB_FILE *in, FILE *out, ogg_sync_state *oy, void *buffer); +int copy_up_to_codec(DB_FILE *in, FILE *out, ogg_sync_state *oy, ogg_page *og, const off_t start_offset, const off_t link_offset, const char *codec); +int copy_up_to_header(DB_FILE *in, FILE *out, ogg_sync_state *oy, ogg_page *og, const int codec_serial); +long flush_stream(FILE *out, ogg_stream_state *os); +char *codec_names(DB_FILE *in, ogg_sync_state *oy, const off_t link_offset, int *res); +off_t codec_stream_size(DB_FILE *in, ogg_sync_state *oy, const off_t start_offset, const off_t end_offset, const char *codec); +char *parse_vendor(const ogg_packet *op, const size_t magic_length); +int init_read_stream(DB_FILE *in, ogg_sync_state *oy, ogg_stream_state *os, ogg_page *og, const off_t offset, const char *codec); +int read_packet(DB_FILE *in, ogg_sync_state *oy, ogg_stream_state *os, ogg_page *og, ogg_packet *header, int pages); +ogg_packet *fill_vc_packet(const char *magic, const size_t magic_length, const char *vendor, const size_t num_tags, char **tags, const bool framing, const size_t padding, ogg_packet *op); +size_t vc_size(const char *vendor, size_t num_tags, char **tags); +int copy_remaining_pages(DB_FILE *in, FILE *out, ogg_sync_state *oy, const int codec_serial, uint32_t pageno); +int write_all_streams(DB_FILE *in, FILE *out, ogg_sync_state *oy, const off_t offset); +int write_one_stream(DB_FILE *in, FILE *out, ogg_sync_state *oy, const off_t offset, const char *codec); + +#endif /* __OGGEDIT_INT_H */ |