From e544782623caf1eb4b2429e9c4f35d6b627accba Mon Sep 17 00:00:00 2001 From: Peter Ross Date: Sat, 20 Apr 2013 13:36:45 +0200 Subject: riff: Move guid structs and helper functions into riff Signed-off-by: Luca Barbato Signed-off-by: Diego Biurrun --- libavformat/riff.h | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) (limited to 'libavformat/riff.h') diff --git a/libavformat/riff.h b/libavformat/riff.h index 761f92ed8f..b4f1cacad3 100644 --- a/libavformat/riff.h +++ b/libavformat/riff.h @@ -68,4 +68,35 @@ void ff_riff_write_info(AVFormatContext *s); */ void ff_riff_write_info_tag(AVIOContext *pb, const char *tag, const char *str); +typedef uint8_t ff_asf_guid[16]; + +typedef struct AVCodecGuid { + enum AVCodecID id; + ff_asf_guid guid; +} AVCodecGuid; + +extern const AVCodecGuid ff_codec_wav_guids[]; + +#define FF_PRI_GUID \ + "%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x" + +#define FF_ARG_GUID(g) \ + g[0], g[1], g[2], g[3], g[4], g[5], g[6], g[7], \ + g[8], g[9], g[10], g[11], g[12], g[13], g[14], g[15] + +#define FF_MEDIASUBTYPE_BASE_GUID \ + 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0xAA, 0x00, 0x38, 0x9B, 0x71 + +static av_always_inline int ff_guidcmp(const void *g1, const void *g2) +{ + return memcmp(g1, g2, sizeof(ff_asf_guid)); +} + +static av_always_inline int ff_get_guid(AVIOContext *s, ff_asf_guid *g) +{ + return avio_read(s, *g, sizeof(*g)); +} + +enum AVCodecID ff_codec_guid_get_id(const AVCodecGuid *guids, ff_asf_guid guid); + #endif /* AVFORMAT_RIFF_H */ -- cgit v1.2.3