/*Structures for MediaInfo events */

#ifndef MediaInfo_EventsH
#define MediaInfo_EventsH

/***************************************************************************/
/* Platforms (from libzen)                                                 */
/***************************************************************************/

/*-------------------------------------------------------------------------*/
/*Win32*/
#if defined(__NT__) || defined(_WIN32) || defined(WIN32)
    #ifndef WIN32
        #define WIN32
    #endif
    #ifndef _WIN32
        #define _WIN32
    #endif
    #ifndef __WIN32__
        #define __WIN32__ 1
    #endif
#endif

/*-------------------------------------------------------------------------*/
/*Win64*/
#if defined(_WIN64) || defined(WIN64)
    #ifndef WIN64
        #define WIN64
    #endif
    #ifndef _WIN64
        #define _WIN64
    #endif
    #ifndef __WIN64__
        #define __WIN64__ 1
    #endif
#endif

/*-------------------------------------------------------------------------*/
/*Windows*/
#if defined(WIN32) || defined(WIN64)
    #ifndef WINDOWS
        #define WINDOWS
    #endif
    #ifndef _WINDOWS
        #define _WINDOWS
    #endif
    #ifndef __WINDOWS__
        #define __WINDOWS__ 1
    #endif
#endif

/*-------------------------------------------------------------------------*/
/*Unix (Linux, HP, Sun, BeOS...)*/
#if defined(UNIX) || defined(_UNIX) || defined(__UNIX__) \
    || defined(__unix) || defined(__unix__) \
    || defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) \
    || defined(__hpux) || defined(sun) || defined(__SUN__) || defined(_AIX) \
    || defined(__EMX__) || defined(__VMS) || defined(__BEOS__)
    #ifndef UNIX
        #define UNIX
    #endif
    #ifndef _UNIX
        #define _UNIX
    #endif
    #ifndef __UNIX__
        #define __UNIX__ 1
    #endif
#endif

/*-------------------------------------------------------------------------*/
/*MacOS Classic*/
#if defined(macintosh)
    #ifndef MACOS
        #define MACOS
    #endif
    #ifndef _MACOS
        #define _MACOS
    #endif
    #ifndef __MACOS__
        #define __MACOS__ 1
    #endif
#endif

/*-------------------------------------------------------------------------*/
/*MacOS X*/
#if defined(__APPLE__) && defined(__MACH__)
    #ifndef MACOSX
        #define MACOSX
    #endif
    #ifndef _MACOSX
        #define _MACOSX
    #endif
    #ifndef __MACOSX__
        #define __MACOSX__ 1
    #endif
#endif

/*Test of targets*/
#if defined(WINDOWS) && defined(UNIX) && defined(MACOS) && defined(MACOSX)
    #pragma message Multiple platforms???
#endif

#if !defined(WIN32) && !defined(UNIX) && !defined(MACOS) && !defined(MACOSX)
    #pragma message No known platforms, assume default
#endif

/*-------------------------------------------------------------------------*/
/*8-bit int                                                                */
#if UCHAR_MAX==0xff
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 8
    typedef signed   char       MediaInfo_int8s;
    typedef unsigned char       MediaInfo_int8u;
#else
    #pragma message This machine has no 8-bit integertype?
#endif

/*-------------------------------------------------------------------------*/
/*16-bit int                                                               */
#if UINT_MAX == 0xffff
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 16
    typedef signed   int        MediaInfo_int16s;
    typedef unsigned int        MediaInfo_int16u;
#elif USHRT_MAX == 0xffff
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 16
    typedef signed   short      MediaInfo_int16s;
    typedef unsigned short      MediaInfo_int16u;
#else
    #pragma message This machine has no 16-bit integertype?
#endif

/*-------------------------------------------------------------------------*/
/*32-bit int                                                               */
#if UINT_MAX == 0xfffffffful
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 32
    typedef signed   int        MediaInfo_int32s;
    typedef unsigned int        MediaInfo_int32u;
#elif ULONG_MAX == 0xfffffffful
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 32
    typedef signed   long       MediaInfo_int32s;
    typedef unsigned long       MediaInfo_int32u;
#elif USHRT_MAX == 0xfffffffful
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 32
    typedef signed   short      MediaInfo_int32s;
    typedef unsigned short      MediaInfo_int32u;
#else
    #pragma message This machine has no 32-bit integer type?
#endif

/*-------------------------------------------------------------------------*/
/*64-bit int                                                               */
#if defined(__MINGW32__) || defined(__CYGWIN32__) || defined(__UNIX__) || defined(__MACOSX__)
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 64
    typedef unsigned long long  MediaInfo_int64u;
#elif defined(__WIN32__) || defined(_WIN32)
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 64
    typedef unsigned __int64    MediaInfo_int64u;
#else
    #pragma message This machine has no 64-bit integer type?
#endif
/*-------------------------------------------------------------------------*/


/***************************************************************************/
/* The callback function
/***************************************************************************/

#ifdef __cplusplus
extern "C"
{
#endif /* __cplusplus */

    typedef void (__stdcall MediaInfo_Event_CallBackFunction)(unsigned char* Data_Content, size_t Data_Size, void* UserHandler);

#ifdef __cplusplus
}
#endif /* __cplusplus */

/***************************************************************************/
/* EventCode management
/***************************************************************************/

#define MediaInfo_EventCode_Create(ParserID, EventID, EventVersion) \
  (  ((MediaInfo_int32u)ParserID    )<<24 \
   | ((MediaInfo_int32u)EventID     )<< 8 \
   | ((MediaInfo_int32u)EventVersion)    )

/***************************************************************************/
/* General                                                                 */
/***************************************************************************/

#define MediaInfo_Parser_None           0x00 

/*-------------------------------------------------------------------------*/
/* Generic                                                                 */
struct MediaInfo_Event_Generic
{
    MediaInfo_int32u    EventCode;
};

/*-------------------------------------------------------------------------*/
/* Start                                                                   */
#define MediaInfo_Event_General_Start 0x7001 
struct MediaInfo_Event_General_Start_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Size;
};

/*-------------------------------------------------------------------------*/
/* End                                                                     */
#define MediaInfo_Event_General_End 0x7002
struct MediaInfo_Event_General_End_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Bytes_Analyzed;
};

/*-------------------------------------------------------------------------*/
/* Parser_Selected                                                         */
#define MediaInfo_Event_General_Parser_Selected 0x7003
struct MediaInfo_Event_General_Parser_Selected_0
{
    MediaInfo_int32u    EventCode;
    char                Name[16];
};

/*-------------------------------------------------------------------------*/
/* Move request                                                            */
#define MediaInfo_Event_General_Move_Request 0x7004 
struct MediaInfo_Event_General_Move_Request_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
};

/*-------------------------------------------------------------------------*/
/* Move done                                                               */
#define MediaInfo_Event_General_Move_Done 0x7005 
struct MediaInfo_Event_General_Move_Done_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
};

/***************************************************************************/
/* MPEG-TS / BDAV / TSP                                                    */
/***************************************************************************/

#define MediaInfo_Parser_MpegTs         0x01 

/*-------------------------------------------------------------------------*/
/* continuity_counter_Check_NoPayload                                      */
#define MediaInfo_Event_MpegTs_continuity_counter_Check_NoPayload 0x1002
struct MediaInfo_Event_MpegTs_continuity_counter_Check_NoPayload_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
};

/*-------------------------------------------------------------------------*/
/* continuity_counter_Check_Payload                                        */
#define MediaInfo_Event_MpegTs_continuity_counter_Check_Payload 0x1003
struct MediaInfo_Event_MpegTs_continuity_counter_Check_Payload_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegTs_profile_level_NoMatch                            */
#define MediaInfo_Event_MpegTs_profile_level_NoMatch 0x1005
struct MediaInfo_Event_MpegTs_profile_level_NoMatch_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     profile_and_level_indication_FromDescriptor;
    MediaInfo_int8u     profile_and_level_indication_FromStream;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegTs_SampleRate_NotConstant_Audio                     */
#define MediaInfo_Event_MpegTs_SampleRate_NotConstant_Audio 0x1006
struct MediaInfo_Event_MpegTs_SampleRate_NotConstant_Audio_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int32u    SampleRate_Before;
    MediaInfo_int32u    SampleRate_After;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegTs_SampleRate_NotConstant_Video                     */
#define MediaInfo_Event_MpegTs_SampleRate_NotConstant_Video 0x1007
struct MediaInfo_Event_MpegTs_SampleRate_NotConstant_Video_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int32u    SampleRate_Before;
    MediaInfo_int32u    SampleRate_After;
};

/*-------------------------------------------------------------------------*/
/* continuity_counter_Duplicate                                            */
#define MediaInfo_Event_MpegTs_continuity_counter_Duplicate 0x100A
struct MediaInfo_Event_MpegTs_continuity_counter_Duplicate_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
};

/*-------------------------------------------------------------------------*/
/* TS_program_map_section_NonExistentPID                                   */
#define MediaInfo_Event_MpegTs_TS_program_map_section_NonExistentPID 0x1011
struct MediaInfo_Event_MpegTs_TS_program_map_section_NonExistentPID_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int16u    program_number;
};

/*-------------------------------------------------------------------------*/
/* transport_error_indicator_Check                                         */
#define MediaInfo_Event_MpegTs_transport_error_indicator_Check 0x1012
struct MediaInfo_Event_MpegTs_transport_error_indicator_Check_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
};

/*-------------------------------------------------------------------------*/
/* PID_Reserved                                                            */
#define MediaInfo_Event_MpegTs_PID_Reserved 0x4001 
struct MediaInfo_Event_MpegTs_PID_Reserved_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
};

/*-------------------------------------------------------------------------*/
/* splice_type_Reserved                                                    */
#define MediaInfo_Event_MpegTs_splice_type_Reserved 0x4004
struct MediaInfo_Event_MpegTs_splice_type_Reserved_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     splice_type;
};

/*-------------------------------------------------------------------------*/
/* PAT_MultiplePrograms                                                    */
#define MediaInfo_Event_MpegTs_PAT_MultiplePrograms 0x7101
struct MediaInfo_Event_MpegTs_PAT_MultiplePrograms_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int64u    Count;
};

/*-------------------------------------------------------------------------*/
/* PMT_NoAudioStreams                                                       */
#define MediaInfo_Event_MpegTs_PMT_NoAudioStreams 0x7102
struct MediaInfo_Event_MpegTs_PMT_NoAudioStreams_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
};

/*-------------------------------------------------------------------------*/
/* PacketSize_Not188                                                       */
#define MediaInfo_Event_MpegTs_PacketSize_Not188 0x7103
struct MediaInfo_Event_MpegTs_PacketSize_Not188_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Packet_Size;
};

/*-------------------------------------------------------------------------*/
/* Junk_Begin                                                              */
#define MediaInfo_Event_MpegTs_Junk_Begin 0x7104
struct MediaInfo_Event_MpegTs_Junk_Begin_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Junk_Size;
};

/*-------------------------------------------------------------------------*/
/* Junk_End                                                                */
#define MediaInfo_Event_MpegTs_Junk_End 0x7105
struct MediaInfo_Event_MpegTs_Junk_End_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Junk_Size;
};

/*-------------------------------------------------------------------------*/
/* PCR_NotWithVideo                                                        */
#define MediaInfo_Event_MpegTs_PCR_NotWithVideo 0x7107
struct MediaInfo_Event_MpegTs_PCR_NotWithVideo_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
    MediaInfo_int16u    PCR_PID;
};

/*-------------------------------------------------------------------------*/
/* PES_Video_PCR_NotAtStart                                                */
#define MediaInfo_Event_MpegTs_PES_Video_PCR_NotAtStart 0x7108
struct MediaInfo_Event_MpegTs_PES_Video_PCR_NotAtStart_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
};

/*-------------------------------------------------------------------------*/
/* discontinuity_indicator_NotInFirstPCR                                   */
#define MediaInfo_Event_MpegTs_discontinuity_indicator_NotInFirstPCR 0x7109
struct MediaInfo_Event_MpegTs_discontinuity_indicator_NotInFirstPCR_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
};

/*-------------------------------------------------------------------------*/
/* PID_Detected                                                            */
#define MediaInfo_Event_MpegTs_PID_Detected 0x710A
struct MediaInfo_Event_MpegTs_PID_Detected_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int8u     Kind;
    MediaInfo_int8u     table_id;
};

/*-------------------------------------------------------------------------*/
/* PAT_PMT_NotPresent                                                      */
#define MediaInfo_Event_MpegTs_PAT_PMT_NotPresent 0x710B
struct MediaInfo_Event_MpegTs_PAT_PMT_NotPresent_0
{
    MediaInfo_int32u    EventCode;
};

/*-------------------------------------------------------------------------*/
/* PAT_transport_stream_id_IllegalForCustomer0                             */
#define MediaInfo_Event_MpegTs_PAT_transport_stream_id_IllegalForCustomer0 0x710C
struct MediaInfo_Event_MpegTs_PAT_transport_stream_id_IllegalForCustomer0_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    transport_stream_id;
};

/*-------------------------------------------------------------------------*/
/* PMT_program_number_IllegalForCustomer0                                  */
#define MediaInfo_Event_MpegTs_PMT_program_number_IllegalForCustomer0 0x710D
struct MediaInfo_Event_MpegTs_PMT_program_number_IllegalForCustomer0_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
};

/*-------------------------------------------------------------------------*/
/* PES_Information                                                         */
#define MediaInfo_Event_MpegTs_PES_Information 0x710E
struct MediaInfo_Event_MpegTs_PES_Information_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    transport_stream_id;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
    MediaInfo_int32u    registration_format_identifier;
    MediaInfo_int8u     stream_type;
};

/*-------------------------------------------------------------------------*/
/* random_access_indicator_NotWithPictureI                                 */
#define MediaInfo_Event_MpegTs_random_access_indicator_NotWithPictureI 0x7110
struct MediaInfo_Event_MpegTs_random_access_indicator_NotWithPictureI_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
};

/*-------------------------------------------------------------------------*/
/* PCR_Accuracy_Not500ns                                                   */
#define MediaInfo_Event_MpegTs_PCR_Accuracy_Not500ns 0x7111
struct MediaInfo_Event_MpegTs_PCR_Accuracy_Not500ns_0
{
    MediaInfo_int32u    EventCode;
};

/*-------------------------------------------------------------------------*/
/* BitRate_NotMultipleOf100Kbps                                            */
#define MediaInfo_Event_MpegTs_BitRate_NotMultipleOf100Kbps 0x7113
struct MediaInfo_Event_MpegTs_BitRate_NotMultipleOf100Kbps_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    BitRate;
    MediaInfo_int64u    PayLoad_BitRate;
};

/*-------------------------------------------------------------------------*/
/* PID_Detected_IllegalForCustomer0                                        */
#define MediaInfo_Event_MpegTs_PID_IllegalForCustomer0 0x7114
struct MediaInfo_Event_MpegTs_PID_IllegalForCustomer0_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int8u     table_id;
    MediaInfo_int8u     stream_type;
};

/*-------------------------------------------------------------------------*/
/* PAT_TooLate                                                             */
#define MediaInfo_Event_MpegTs_PAT_TooLate 0x7116
struct MediaInfo_Event_MpegTs_PAT_TooLate_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int16u    program_number;
    MediaInfo_int64u    Stream_Offset_PAT_Begin;
    MediaInfo_int64u    Stream_Offset_PAT_End;
    MediaInfo_int64u    Stream_Offset_PMT_Begin;
    MediaInfo_int64u    Stream_Offset_PMT_End;
};

/*-------------------------------------------------------------------------*/
/* PAT_Repetition_Not100ms                                                 */
#define MediaInfo_Event_MpegTs_PAT_Repetition_Not100ms 0x7117
struct MediaInfo_Event_MpegTs_PAT_Repetition_Not100ms_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int64u    Interval;
};

/*-------------------------------------------------------------------------*/
/* PAT_New                                                                 */
#define MediaInfo_Event_MpegTs_PAT_New 0x7118
struct MediaInfo_Event_MpegTs_PAT_New_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int8u     version_number_Old;
    MediaInfo_int8u     version_number_New ;
};

/*-------------------------------------------------------------------------*/
/* PAT_NoPAS                                                               */
#define MediaInfo_Event_MpegTs_PAT_NoPAS 0x7119
struct MediaInfo_Event_MpegTs_PAT_NoPAS_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int8u     table_id;
};

/*-------------------------------------------------------------------------*/
/* PAT_current_next_indicator_NotSet                                           */
#define MediaInfo_Event_MpegTs_PAT_current_next_indicator_NotSet 0x7120
struct MediaInfo_Event_MpegTs_PAT_current_next_indicator_NotSet_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
};

/*-------------------------------------------------------------------------*/
/* network_PID_InUse                                                       */
#define MediaInfo_Event_MpegTs_network_PID_InUse 0x7121
struct MediaInfo_Event_MpegTs_network_PID_InUse_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
};

/*-------------------------------------------------------------------------*/
/* PMT_TooLate                                                             */
#define MediaInfo_Event_MpegTs_PMT_TooLate 0x7122
struct MediaInfo_Event_MpegTs_PMT_TooLate_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    Stream_Offset_PMT_Begin;
    MediaInfo_int64u    Stream_Offset_PMT_End;
    MediaInfo_int64u    Stream_Offset_PID_Begin;
    MediaInfo_int64u    Stream_Offset_PID_End;
};

/*-------------------------------------------------------------------------*/
/* PMT_Repetition_Not100ms                                                 */
#define MediaInfo_Event_MpegTs_PMT_Repetition_Not100ms 0x7123
struct MediaInfo_Event_MpegTs_PMT_Repetition_Not100ms_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int64u    Interval;
};

/*-------------------------------------------------------------------------*/
/* PMT_New                                                                 */
#define MediaInfo_Event_MpegTs_PMT_New 0x7124
struct MediaInfo_Event_MpegTs_PMT_New_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int8u     version_number_Old;
    MediaInfo_int8u     version_number_New ;
};

/*-------------------------------------------------------------------------*/
/* PMT_NoPMS                                                               */
#define MediaInfo_Event_MpegTs_PMT_NoPMS 0x7125
struct MediaInfo_Event_MpegTs_PMT_NoPMS_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int8u     table_id;
};

/*-------------------------------------------------------------------------*/
/* PES_stream_type_IllegalForCustomer0                                     */
#define MediaInfo_Event_MpegTs_PES_stream_type_IllegalForCustomer0 0x7126
struct MediaInfo_Event_MpegTs_PES_stream_type_IllegalForCustomer0_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int16u    PID;
    MediaInfo_int32u    registration_format_identifier;
    MediaInfo_int8u     stream_type;
};

/*-------------------------------------------------------------------------*/
/* PMT_descriptor_tag_IllegalForCustomer0                                     */
#define MediaInfo_Event_MpegTs_PMT_descriptor_tag_IllegalForCustomer0 0x7127
struct MediaInfo_Event_MpegTs_PMT_descriptor_tag_IllegalForCustomer0_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    program_number;
    MediaInfo_int8u     Kind;
    MediaInfo_int16u    PID;
    MediaInfo_int32u    registration_format_identifier;
    MediaInfo_int8u     stream_type;
    MediaInfo_int8u     IsUsed;
    MediaInfo_int8u     descriptor_tag;
};

/*-------------------------------------------------------------------------*/
/* PES_Start_NotAligned                                                    */
#define MediaInfo_Event_MpegTs_PES_Start_NotAligned 0x7162
struct MediaInfo_Event_MpegTs_PES_Start_NotAligned_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
};

/*-------------------------------------------------------------------------*/
/* PES_NoCompleteFrame                                                     */
#define MediaInfo_Event_MpegTs_PES_NoCompleteFrame 0x7163
struct MediaInfo_Event_MpegTs_PES_NoCompleteFrame_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
};

/*-------------------------------------------------------------------------*/
/* IFrame_WithoutStart                                                     */
#define MediaInfo_Event_MpegTs_IFrame_WithoutStart 0x7164
struct MediaInfo_Event_MpegTs_IFrame_WithoutStart_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
};

/*-------------------------------------------------------------------------*/
/* Stream_Start_TooLate                                                    */
#define MediaInfo_Event_MpegTs_Stream_Start_TooLate 0x7165
struct MediaInfo_Event_MpegTs_Stream_Start_TooLate_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
};

/*-------------------------------------------------------------------------*/
/* PES_IFrame_NoTimeStamps                                                 */
#define MediaInfo_Event_MpegTs_PES_IFrame_NoTimeStamps 0x7166
struct MediaInfo_Event_MpegTs_PES_IFrame_NoTimeStamps_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    Frame_Number;
};

/***************************************************************************/
/* MPEG-PS                                                                 */
/***************************************************************************/

#define MediaInfo_Parser_MpegPs         0x02 

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegPs_SampleRate_NotConstant_Audio                     */
#define MediaInfo_Event_MpegPs_SampleRate_NotConstant_Audio 0x1051
struct MediaInfo_Event_MpegPs_SampleRate_NotConstant_Audio_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int32u    SampleRate_Before;
    MediaInfo_int32u    SampleRate_After;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegPs_SampleRate_NotConstant_Video                     */
#define MediaInfo_Event_MpegPs_SampleRate_NotConstant_Video 0x1052
struct MediaInfo_Event_MpegPs_SampleRate_NotConstant_Video_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int32u    SampleRate_Before;
    MediaInfo_int32u    SampleRate_After;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegPs_program_stream_map_NonExistentESID               */
#define MediaInfo_Event_MpegPs_program_stream_map_NonExistentESID 0x1053
struct MediaInfo_Event_MpegPs_program_stream_map_NonExistentESID_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int8u     Origin;
};

/***************************************************************************/
/* MPEG Video                                                              */
/***************************************************************************/

#define MediaInfo_Parser_Mpegv      0x80

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_MpegPs_SampleRate_NotConstant_TS_Video                  */
#define MediaInfo_Event_Mpegv_group_start_closed_gop 0x7013
struct MediaInfo_Event_Mpegv_group_start_closed_gop_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     closed_gop;
};

/***************************************************************************/
/* CEA-608 (formely IEA-608)                                               */
/***************************************************************************/

#define MediaInfo_Parser_Eia608         0xF0

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_ControlCode_NotTwice                             */
#define MediaInfo_Event_Eia608_ControlCode_NotTwice 0x1001
struct MediaInfo_Event_Eia608_ControlCode_NotTwice_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Character_1;
    MediaInfo_int8u     Character_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_NoFieldMatch                                     */
#define MediaInfo_Event_Eia608_NoFieldMatch 0x1002
struct MediaInfo_Event_Eia608_NoFieldMatch_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_CC_MoreThan32Chars                               */
#define MediaInfo_Event_Eia608_CC_MoreThan32Chars 0x1003
struct MediaInfo_Event_Eia608_CC_MoreThan32Chars_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Service;
    wchar_t             Row_Values[15][33]; /*offset 32 is for \0*/
    MediaInfo_int8u     Row_Attributes[15][32];
    wchar_t             NewChar;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_MPA_USTV             */
#define MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_MPA_USTV 0x1004
struct MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_MPA_USTV_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Character_1;
    MediaInfo_int8u     Character_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_USTV_MPA             */
#define MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_USTV_MPA 0x1005
struct MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_USTV_MPA_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Character_1;
    MediaInfo_int8u     Character_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_IllegalCharacter                                 */
#define MediaInfo_Event_Eia608_IllegalCharacter 0x1008
struct MediaInfo_Event_Eia608_IllegalCharacter_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Character_1;
    MediaInfo_int8u     Character_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_CC_MoreThan15Rows                                */
#define MediaInfo_Event_Eia608_CC_MoreThan15Rows 0x1015
struct MediaInfo_Event_Eia608_CC_MoreThan15Rows_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Service;
    wchar_t             Row_Values[15][33]; /*offset 32 is for \0*/
    MediaInfo_int8u     Row_Attributes[15][32];
    MediaInfo_int8u     Row_Number;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_XDS_Field1                                       */
#define MediaInfo_Event_Eia608_XDS_Field1 0x1016
struct MediaInfo_Event_Eia608_XDS_Field1_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Character_1;
    MediaInfo_int8u     Character_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_XDS_Current_CopyAndRedistributionControlPacket   */
#define MediaInfo_Event_Eia608_XDS_Current_CopyAndRedistributionControlPacket 0x7006
struct MediaInfo_Event_Eia608_XDS_Current_CopyAndRedistributionControlPacket_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Byte_1;
    MediaInfo_int8u     Byte_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_XDS_PublicService_NationalWeather                */
#define MediaInfo_Event_Eia608_XDS_PublicService_NationalWeather 0x7007
struct MediaInfo_Event_Eia608_XDS_PublicService_NationalWeather_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_End                                              */
#define MediaInfo_Event_Eia608_End 0x7014
struct MediaInfo_Event_Eia608_End_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     ContentDetected; /*per service*/
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_Content              */
#define MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_Content 0x7027
struct MediaInfo_Event_Eia608_XDS_Current_ContentAdvisory_Content_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Character_1;
    MediaInfo_int8u     Character_2;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_Content                                          */
#define MediaInfo_Event_Eia608_CC_Content 0xA000
struct MediaInfo_Event_Eia608_CC_Content_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
    MediaInfo_int8u     Field;
    MediaInfo_int8u     Service;
    wchar_t             Row_Values[15][33]; /*offset 32 is for \0*/
    MediaInfo_int8u     Row_Attributes[15][32];
};

/***************************************************************************/
/* CEA-708 (formely IEA-708)                                               */
/***************************************************************************/

#define MediaInfo_Parser_Eia708         0xF1

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia708_Transport_additional_data_flag                   */
#define MediaInfo_Event_Eia708_Transport_additional_data_flag 0x7051
struct MediaInfo_Event_Eia708_Transport_additional_data_flag_0
{
    MediaInfo_int32u    EventCode;
    MediaInfo_int64u    Stream_Offset;
    MediaInfo_int16u    PID;
    MediaInfo_int64u    PCR;
    char                PCR_HR[13];
    MediaInfo_int8u     stream_id;
    MediaInfo_int64u    PTS;
    char                PTS_HR[13];
    MediaInfo_int64u    Frame_Number;
};

#endif //MediaInfo_EventsH
