nomsg
[kugel-rb.git] / apps / codecs / libasf / asf.h
blobc15bf4edec58ed480410bf9bdef949664c1a8664
1 #ifndef _ASF_H
2 #define _ASF_H
4 #include <inttypes.h>
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
11 enum asf_error_e {
12 ASF_ERROR_INTERNAL = -1, /* incorrect input to API calls */
13 ASF_ERROR_OUTOFMEM = -2, /* some malloc inside program failed */
14 ASF_ERROR_EOF = -3, /* unexpected end of file */
15 ASF_ERROR_IO = -4, /* error reading or writing to file */
16 ASF_ERROR_INVALID_LENGTH = -5, /* length value conflict in input data */
17 ASF_ERROR_INVALID_VALUE = -6, /* other value conflict in input data */
18 ASF_ERROR_INVALID_OBJECT = -7, /* ASF object missing or in wrong place */
19 ASF_ERROR_OBJECT_SIZE = -8, /* invalid ASF object size (too small) */
20 ASF_ERROR_SEEKABLE = -9, /* file not seekable */
21 ASF_ERROR_SEEK = -10, /* file is seekable but seeking failed */
22 ASF_ERROR_ENCRYPTED = -11 /* file is encrypted */
25 struct asf_waveformatex_s {
26 uint32_t packet_size;
27 int audiostream;
28 uint16_t codec_id;
29 uint16_t channels;
30 uint32_t rate;
31 uint32_t bitrate;
32 uint16_t blockalign;
33 uint16_t bitspersample;
34 uint16_t datalen;
35 uint8_t data[6];
37 typedef struct asf_waveformatex_s asf_waveformatex_t;
39 int asf_read_packet(uint8_t** audiobuf, int* audiobufsize, int* packetlength,
40 asf_waveformatex_t* wfx);
42 int asf_get_timestamp(int *duration);
45 #endif /* _ASF_H */