diff options
author | Sean Bartell <wingedtachikoma@gmail.com> | 2011-06-25 21:32:25 -0400 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2012-04-25 22:13:20 +0200 |
commit | f40bfc9267b13b54e6379dfe7539447662879d24 (patch) | |
tree | 9b20069d5e62809ff434061ad730096836f916f2 /lib/rbcodec/codecs/libasf/asf.h | |
parent | a0009907de7a0107d49040d8a180f140e2eff299 (diff) | |
download | rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.tar.gz rockbox-f40bfc9267b13b54e6379dfe7539447662879d24.zip |
Add codecs to librbcodec.
Change-Id: Id7f4717d51ed02d67cb9f9cb3c0ada4a81843f97
Reviewed-on: http://gerrit.rockbox.org/137
Reviewed-by: Nils Wallménius <nils@rockbox.org>
Tested-by: Nils Wallménius <nils@rockbox.org>
Diffstat (limited to 'lib/rbcodec/codecs/libasf/asf.h')
-rw-r--r-- | lib/rbcodec/codecs/libasf/asf.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libasf/asf.h b/lib/rbcodec/codecs/libasf/asf.h new file mode 100644 index 0000000000..a7d384cf3d --- /dev/null +++ b/lib/rbcodec/codecs/libasf/asf.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _ASF_H | ||
2 | #define _ASF_H | ||
3 | |||
4 | #include <inttypes.h> | ||
5 | |||
6 | /* ASF codec IDs */ | ||
7 | #define ASF_CODEC_ID_WMAV1 0x160 | ||
8 | #define ASF_CODEC_ID_WMAV2 0x161 | ||
9 | #define ASF_CODEC_ID_WMAPRO 0x162 | ||
10 | #define ASF_CODEC_ID_WMAVOICE 0x00A | ||
11 | |||
12 | enum asf_error_e { | ||
13 | ASF_ERROR_INTERNAL = -1, /* incorrect input to API calls */ | ||
14 | ASF_ERROR_OUTOFMEM = -2, /* some malloc inside program failed */ | ||
15 | ASF_ERROR_EOF = -3, /* unexpected end of file */ | ||
16 | ASF_ERROR_IO = -4, /* error reading or writing to file */ | ||
17 | ASF_ERROR_INVALID_LENGTH = -5, /* length value conflict in input data */ | ||
18 | ASF_ERROR_INVALID_VALUE = -6, /* other value conflict in input data */ | ||
19 | ASF_ERROR_INVALID_OBJECT = -7, /* ASF object missing or in wrong place */ | ||
20 | ASF_ERROR_OBJECT_SIZE = -8, /* invalid ASF object size (too small) */ | ||
21 | ASF_ERROR_SEEKABLE = -9, /* file not seekable */ | ||
22 | ASF_ERROR_SEEK = -10, /* file is seekable but seeking failed */ | ||
23 | ASF_ERROR_ENCRYPTED = -11 /* file is encrypted */ | ||
24 | }; | ||
25 | |||
26 | struct asf_waveformatex_s { | ||
27 | uint32_t packet_size; | ||
28 | int audiostream; | ||
29 | uint16_t codec_id; | ||
30 | uint16_t channels; | ||
31 | uint32_t rate; | ||
32 | uint32_t bitrate; | ||
33 | uint16_t blockalign; | ||
34 | uint16_t bitspersample; | ||
35 | uint16_t datalen; | ||
36 | uint16_t numpackets; | ||
37 | uint8_t data[46]; | ||
38 | }; | ||
39 | typedef struct asf_waveformatex_s asf_waveformatex_t; | ||
40 | |||
41 | int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength, | ||
42 | asf_waveformatex_t* wfx); | ||
43 | |||
44 | int asf_get_timestamp(int *duration); | ||
45 | |||
46 | int asf_seek(int ms, asf_waveformatex_t* wfx); | ||
47 | |||
48 | |||
49 | #endif /* _ASF_H */ | ||