diff options
author | Peter Ross <pross@xvid.org> | 2013-04-20 13:36:45 +0200 |
---|---|---|
committer | Diego Biurrun <diego@biurrun.de> | 2013-04-21 18:20:30 +0200 |
commit | e544782623caf1eb4b2429e9c4f35d6b627accba (patch) | |
tree | f60545cdf524f0db3b0e4675c5b96962dc3aac9a /libavformat/riff.h | |
parent | 8e329dba378cef0ff6400c7df9c51da167d5a1f0 (diff) | |
download | ffmpeg-e544782623caf1eb4b2429e9c4f35d6b627accba.tar.gz |
riff: Move guid structs and helper functions into riff
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
Signed-off-by: Diego Biurrun <diego@biurrun.de>
Diffstat (limited to 'libavformat/riff.h')
-rw-r--r-- | libavformat/riff.h | 31 |
1 files changed, 31 insertions, 0 deletions
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 */ |