diff options
| author | Mohamed Tarek <mt@rockbox.org> | 2010-05-02 17:19:42 +0000 |
|---|---|---|
| committer | Mohamed Tarek <mt@rockbox.org> | 2010-05-02 17:19:42 +0000 |
| commit | 792ae6b1bd7ec85f2ab8eec34dad1d22b05a213e (patch) | |
| tree | 83a8976bba26b5252061334292bbf6e4e57fa628 /apps/codecs/libasf/asf.h | |
| parent | 13075dea876898afdb195056d22a921b18cd4450 (diff) | |
| download | rockbox-792ae6b1bd7ec85f2ab8eec34dad1d22b05a213e.zip rockbox-792ae6b1bd7ec85f2ab8eec34dad1d22b05a213e.tar.gz rockbox-792ae6b1bd7ec85f2ab8eec34dad1d22b05a213e.tar.bz2 rockbox-792ae6b1bd7ec85f2ab8eec34dad1d22b05a213e.tar.xz | |
- Factor out container specific code from apps/codecs/wma.c.
- Create an independent asf packet-parsing library in apps/codecs/libasf.
- Modify wma.c to use the newly created libasf.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25780 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/codecs/libasf/asf.h')
| -rw-r--r-- | apps/codecs/libasf/asf.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/apps/codecs/libasf/asf.h b/apps/codecs/libasf/asf.h new file mode 100644 index 0000000..03af2b0 --- /dev/null +++ b/apps/codecs/libasf/asf.h @@ -0,0 +1,42 @@ +#ifndef _ASF_H +#define _ASF_H + +#include <inttypes.h> + +/* ASF codec IDs */ +#define ASF_CODEC_ID_WMAV1 0x160 +#define ASF_CODEC_ID_WMAV2 0x161 + +enum asf_error_e { + ASF_ERROR_INTERNAL = -1, /* incorrect input to API calls */ + ASF_ERROR_OUTOFMEM = -2, /* some malloc inside program failed */ + ASF_ERROR_EOF = -3, /* unexpected end of file */ + ASF_ERROR_IO = -4, /* error reading or writing to file */ + ASF_ERROR_INVALID_LENGTH = -5, /* length value conflict in input data */ + ASF_ERROR_INVALID_VALUE = -6, /* other value conflict in input data */ + ASF_ERROR_INVALID_OBJECT = -7, /* ASF object missing or in wrong place */ + ASF_ERROR_OBJECT_SIZE = -8, /* invalid ASF object size (too small) */ + ASF_ERROR_SEEKABLE = -9, /* file not seekable */ + ASF_ERROR_SEEK = -10 /* file is seekable but seeking failed */ +}; + +struct asf_waveformatex_s { + uint32_t packet_size; + int audiostream; + uint16_t codec_id; + uint16_t channels; + uint32_t rate; + uint32_t bitrate; + uint16_t blockalign; + uint16_t bitspersample; + uint16_t datalen; + uint8_t data[6]; +}; +typedef struct asf_waveformatex_s asf_waveformatex_t; + +int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength, + asf_waveformatex_t* wfx, struct codec_api* ci); + +int asf_get_timestamp(int *duration, struct codec_api* ci); + +#endif |