#ifndef AVIFILE_ASFGUIDS_H
#define AVIFILE_ASFGUIDS_H

#include <com.h>
#include <cstring> //memcmp
#include <iostream>


enum asf_chunk_t
{
    ASF_CHUNK_ERROR,
    ASF_CHUNK_HEADER,
    ASF_CHUNK_DATA,
    ASF_CHUNK_INDEX,
    ASF_CHUNK_STREAM_HEADER,
    ASF_CHUNK_2_0_HEADER,
    ASF_CHUNK_FILE_HEADER
};

enum asf_guid_t
{
    ASF_GUID_AUDIO_STREAM,
    ASF_GUID_VIDEO_STREAM,
    ASF_GUID_AUDIO_CONCEAL_NONE,
    ASF_GUID_CONCEAL_INTERLAVE
};

static const GUID guid_audio_stream = {
    0xF8699E40, 0x5B4D, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}
};
static const GUID guid_video_stream = {
    0xBC19EFC0, 0x5B4D, 0x11CF, {0xA8, 0xFD, 0x00, 0x80, 0x5F, 0x5C, 0x44, 0x2B}
};
static const GUID guid_audio_conceal_none= {
    0x49f1A440, 0x4ECE, 0x11D0, {0xA3, 0xAC, 0x00, 0xA0, 0xC9, 0x03, 0x48, 0xF6}
};
static const GUID guid_audio_conceal_interleave= {
    0xBFC3CD50, 0x618F, 0x11CF, {0x8B, 0xB2, 0x00, 0xAA, 0x00, 0xB4, 0xE2, 0x20}
};


/* a few GUID-related functions and constants */

static std::ostream& operator<<(std::ostream& e, const GUID& guid)
{
    return e<<guid.f1<<"-"<<guid.f2<<"-"<<guid.f3<<"-"
	<< guid.f4[0] << guid.f4[1] << guid.f4[2] << guid.f4[3]
	<< guid.f4[4] << guid.f4[5] << guid.f4[6] << guid.f4[7];
}

static inline bool operator==(const GUID& left, const GUID& right)
{
    return !std::memcmp(&left, &right, sizeof(GUID));
}

asf_chunk_t LookupChunkType(const GUID& u);

#endif // AVIFILE_ASFGUIDS_H
