aboutsummaryrefslogtreecommitdiff
path: root/tests/m4a/shim/codecs.h
blob: e2215ce324b0547f9349045865c78a4978c56571 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/* Host stand-in for the parts of codecs.h that libm4a/demux.c uses */
#ifndef CODECS_H
#define CODECS_H
#include <stddef.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/types.h>
enum { AFMT_MP4_AAC = 1, AFMT_MP4_AAC_HE, AFMT_MP4_ALAC };
struct mp3entry { unsigned long length; int codectype; };
#define CODEC_SIZE (128 * 1024)     /* yp3.h, near enough */
struct codec_api {
    size_t filesize, curpos;
    struct mp3entry *id3;
    size_t (*read_filebuf)(void *ptr, size_t size);
    void (*advance_buffer)(size_t amount);
    bool (*seek_buffer)(size_t newpos);
    void (*yield)(void);
    void (*debugf)(const char *fmt, ...);
    bool (*load_progress)(int percent);
};
extern struct codec_api *ci;
#define ROCKBOX_LITTLE_ENDIAN 1
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#endif