mediaextract/mpg123.h
Mathias Panzenböck 63e3faffc0 MPEG -> MPG123
2012-12-29 17:48:36 +01:00

24 lines
678 B
C

#ifndef AUDIOEXTRACT_MPG123_H__
#define AUDIOEXTRACT_MPG123_H__
#include "audioextract.h"
#define IS_MPG123_MAGIC(hdr) \
( ( ((uint8_t)(hdr)[0] & 0xFF) == 0xFF) \
&& ( ((uint8_t)(hdr)[1] & 0xE0) == 0xE0) /* 3 sync bits */ \
&& ( ((uint8_t)(hdr)[1] & 0x18) != 0x08) /* Version rsvd */ \
&& ( ((uint8_t)(hdr)[1] & 0x06) != 0x00) /* Layer rsvd */ \
&& ( ((uint8_t)(hdr)[2] & 0xF0) != 0xF0)) /* Bitrate rsvd */
#define MPG123_HEADER_SIZE 4
struct mpg123_info {
uint16_t frame_size;
uint8_t version;
uint8_t layer;
};
int mpg123_isframe(const unsigned char *start, const unsigned char *end, struct mpg123_info *info);
#endif /* AUDIOEXTRACT_MPG123_H__ */