|
|
Paraslash Audio Streaming |
| About News Download Documentation Development |
Data Fields | |
| const char *const * | suffixes |
| int(* | get_file_info )(char *map, size_t numbytes, struct afh_info *afhi) |
| void(* | get_header )(void *map, size_t mapsize, char **buf, size_t *len) |
| int(* | open )(const void *map, size_t mapsize, void **afh_context) |
| int(* | get_chunk )(uint32_t chunk_num, void *afh_context, const char **buf, uint32_t *len) |
| void(* | close )(void *afh_context) |
| int(* | rewrite_tags )(const char *map, size_t mapsize, struct taginfo *tags, int output_fd) |
Definition of an audio format handler.
Each audio format defines a constant instance of this structure, and this is usually the only non-static symbol of the corresponding _afh.c file.
| const char* const* suffixes |
Typical file endings, often only one.
| int(* get_file_info) (char *map, size_t numbytes, struct afh_info *afhi) |
Check if this audio format handler can handle the file.
A negative return value indicates that this audio format handler is unable to handle the file. On success, the function must fill in the given afh_info structure.
| void(* get_header) (void *map, size_t mapsize, char **buf, size_t *len) |
Optional, used for header-rewriting.
See afh_get_header().
Referenced by afh_free_header(), and afh_get_header().
| int(* open) (const void *map, size_t mapsize, void **afh_context) |
An audio format handler may signify support for dynamic chunks by defining ->get_chunk below.
In this case the vss calls ->open() at BOS, ->get_chunk() for each chunk while streaming, and ->close() at EOS. The chunk table is not accessed at all.
The function may return its (opaque) context through the last argument. The returned pointer is passed to subsequent calls to ->get_chunk() and ->close().
Referenced by afh_get_chunk().
| int(* get_chunk) (uint32_t chunk_num, void *afh_context, const char **buf, uint32_t *len) |
Return a reference to one chunk.
The returned pointer points to a portion of the memory mapped audio file. The caller must not call free() on it.
Referenced by afh_get_chunk(), and afh_supports_dynamic_chunks().
| void(* close) (void *afh_context) |
Deallocate the resources occupied by ->open().
Referenced by afh_close(), and afh_get_chunk().
| int(* rewrite_tags) (const char *map, size_t mapsize, struct taginfo *tags, int output_fd) |
Write audio file with altered tags.
This function shall create a copy of the memory-mapped file, but with altered metadata tags according to the tags argument. The output file descriptor has been opened by the caller and must not be closed in this function.
Referenced by afh_rewrite_tags().