This file is indexed.

/usr/include/MediaInfo/MediaInfo_Events.h is in libmediainfo-dev 17.12-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
/*  Copyright (c) MediaArea.net SARL. All Rights Reserved.
 *
 *  Use of this source code is governed by a BSD-style license that can
 *  be found in the License.html file in the root of the source tree.
 */

/*Structures for MediaInfo events */

#ifndef MediaInfo_EventsH
#define MediaInfo_EventsH

#ifdef __cplusplus
#include <stdlib.h>
#include <string.h>
#include <sstream>
#endif //__cplusplus

/***************************************************************************/
/* 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;
    typedef   signed long long  MediaInfo_int64s;
#elif defined(__WIN32__) || defined(_WIN32)
    #undef  MAXTYPE_INT
    #define MAXTYPE_INT 64
    typedef unsigned __int64    MediaInfo_int64u;
    typedef   signed __int64    MediaInfo_int64s;
#else
    #pragma message This machine has no 64-bit integer type?
#endif
/*-------------------------------------------------------------------------*/


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

#if !defined(__WINDOWS__) && !defined(__stdcall)
    #define __stdcall
#endif //!defined(__WINDOWS__)

#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)    )

/***************************************************************************/
/* Global                                                                  */
/***************************************************************************/

/*-------------------------------------------------------------------------*/
/* Time code                                                               */
typedef struct MediaInfo_time_code
{
    MediaInfo_int8u     Hours;
    MediaInfo_int8u     Minutes;
    MediaInfo_int8u     Seconds;
    MediaInfo_int8u     Frames;
    MediaInfo_int8u     FramesPerSecond;
    MediaInfo_int8u     DropFrame; //0= No, 1=Yes
    MediaInfo_int8u     Reserved[2];
} MediaInfo_time_code;

/*-------------------------------------------------------------------------*/
/* Generic                                                                 */
#define MEDIAINFO_EVENT_GENERIC \
    MediaInfo_int32u        EventCode; \
    MediaInfo_int32u        ReservedI32; \
    size_t                  EventSize; \
    size_t                  StreamIDs_Size; \
    MediaInfo_int64u        StreamIDs[16]; \
    MediaInfo_int8u         StreamIDs_Width[16]; \
    MediaInfo_int8u         ParserIDs[16]; \
    MediaInfo_int64u        StreamOffset; \
    MediaInfo_int64u        FrameNumber; \
    MediaInfo_int64u        PCR; \
    MediaInfo_int64u        PTS; \
    MediaInfo_int64u        DTS; \
    MediaInfo_int64u        DUR; \
    MediaInfo_int64u        FrameNumber_PresentationOrder; \
    MediaInfo_int64u        ReservedI64[1]; \
    MediaInfo_time_code     TimeCode_Container; \
    MediaInfo_time_code     TimeCode_SDTI; \
    MediaInfo_time_code     TimeCode_RawStream; \
    MediaInfo_time_code     ReservedT[5]; \

typedef struct MediaInfo_Event_Generic
{
    MEDIAINFO_EVENT_GENERIC
} MediaInfo_Event_Generic;

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Log_0                                                   */
#define MediaInfo_Event_Log 0x0F00
struct MediaInfo_Event_Log_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int8u         Type;
    MediaInfo_int8u         Severity;
    MediaInfo_int8u         Reserved2;
    MediaInfo_int8u         Reserved3;
    MediaInfo_int32u        MessageCode;
    MediaInfo_int32u        Reserved4;
    const wchar_t*          MessageString;
    const wchar_t*          MessageStringU;
    const char*             MessageStringA;
};

/*-------------------------------------------------------------------------*/
/* Demux                                                                   */
#define MediaInfo_Event_Global_Demux 0xAF00
enum MediaInfo_Event_Global_Demux_0_contenttype
{
    MediaInfo_Event_Global_Demux_0_ContentType_MainStream,
    MediaInfo_Event_Global_Demux_0_ContentType_SubStream,
    MediaInfo_Event_Global_Demux_0_ContentType_Header,
    MediaInfo_Event_Global_Demux_0_ContentType_Synchro
};

struct MediaInfo_Event_Global_Demux_4
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int8u         Content_Type; /*MediaInfo_Event_Global_Demux_0_contenttype*/
    size_t                  Content_Size;
    const MediaInfo_int8u*  Content;
    MediaInfo_int64u        Flags; /*bit0=random_access*/
    size_t                  Offsets_Size;
    const MediaInfo_int64u* Offsets_Stream; /* From the begin of the stream */
    const MediaInfo_int64u* Offsets_Content; /* From the begin of the demuxed content */
    size_t                  OriginalContent_Size; /* In case of decoded content inside MediaInfo, OriginalContent contain the not-decoded stream */
    const MediaInfo_int8u*  OriginalContent; /* In case of decoded content inside MediaInfo, OriginalContent contain the not-decoded stream */
};

/*-------------------------------------------------------------------------*/
/* Simple text                                                             */
#define MediaInfo_Event_Global_SimpleText 0xAF01
struct MediaInfo_Event_Global_SimpleText_0
{
    MEDIAINFO_EVENT_GENERIC
    const wchar_t*      Content;
    MediaInfo_int8u     Flags;
    MediaInfo_int8u     MuxingMode;
    MediaInfo_int8u     Service;
    MediaInfo_int32u    Row_Max;
    MediaInfo_int32u    Column_Max;
    wchar_t**           Row_Values; //First indice is the row number, second indice is the column number. Row ends with \0
    MediaInfo_int8u**   Row_Attributes;
};

/*-------------------------------------------------------------------------*/
/* BytesRead                                                               */
#define MediaInfo_Event_Global_BytesRead 0xAF02
struct MediaInfo_Event_Global_BytesRead_0
{
    MEDIAINFO_EVENT_GENERIC
    size_t                  Content_Size;
    const MediaInfo_int8u*  Content;
};

/*-------------------------------------------------------------------------*/
/* Decoded                                                                 */
#define MediaInfo_Event_Global_Decoded 0xAF03

struct MediaInfo_Event_Global_Decoded_0
{
    MEDIAINFO_EVENT_GENERIC
    size_t                  Content_Size;
    const MediaInfo_int8u*  Content;
    MediaInfo_int64u        Flags;
};

/*-------------------------------------------------------------------------*/
/* AttachedFile                                                            */
#define MediaInfo_Event_Global_AttachedFile 0xAF04

struct MediaInfo_Event_Global_AttachedFile_0
{
    MEDIAINFO_EVENT_GENERIC
    size_t                  Content_Size;
    const MediaInfo_int8u*  Content;
    MediaInfo_int64u        Flags;
    const char*             Name;
    const char*             MimeType;
    const char*             Description;
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Video_SliceInfo_0                                       */
#define MediaInfo_Event_Video_SliceInfo 0x7801
struct MediaInfo_Event_Video_SliceInfo_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int64u        FieldPosition;
    MediaInfo_int64u        SlicePosition;
    MediaInfo_int8u         SliceType;
    MediaInfo_int64u        Flags;
};

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

#define MediaInfo_Parser_None           0x00
#define MediaInfo_Parser_General        0x00
#define MediaInfo_Parser_Global         0x00
#define MediaInfo_Parser_Video          0x01

/*-------------------------------------------------------------------------*/
/* SubFile_Missing                                                         */
#define MediaInfo_Event_General_SubFile_Missing 0x1F01
struct MediaInfo_Event_General_SubFile_Missing_0
{
    MEDIAINFO_EVENT_GENERIC
    const char*             FileName_Relative;
    const wchar_t*          FileName_Relative_Unicode;
    const char*             FileName_Absolute;
    const wchar_t*          FileName_Absolute_Unicode;
};

/*-------------------------------------------------------------------------*/
/* Start                                                                   */
#define MediaInfo_Event_General_Start 0x7001
struct MediaInfo_Event_General_Start_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int64u        Stream_Size;
    const char*             FileName;
    const wchar_t*          FileName_Unicode;
};

/*-------------------------------------------------------------------------*/
/* End                                                                     */
#define MediaInfo_Event_General_End 0x7002
struct MediaInfo_Event_General_End_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int64u        Stream_Bytes_Analyzed;
    MediaInfo_int64u        Stream_Size;
    MediaInfo_int64u        Stream_Bytes_Padding;
    MediaInfo_int64u        Stream_Bytes_Junk;
};

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

/*-------------------------------------------------------------------------*/
/* Move request                                                            */
#define MediaInfo_Event_General_Move_Request 0x7004
struct MediaInfo_Event_General_Move_Request_0
{
    MEDIAINFO_EVENT_GENERIC
};

/*-------------------------------------------------------------------------*/
/* Move done                                                               */
#define MediaInfo_Event_General_Move_Done 0x7005
struct MediaInfo_Event_General_Move_Done_0
{
    MEDIAINFO_EVENT_GENERIC
};

/*-------------------------------------------------------------------------*/
/* SubFile_Start                                                           */
#define MediaInfo_Event_General_SubFile_Start 0x7006
struct MediaInfo_Event_General_SubFile_Start_0
{
    MEDIAINFO_EVENT_GENERIC
    const char*             FileName_Relative;
    const wchar_t*          FileName_Relative_Unicode;
    const char*             FileName_Absolute;
    const wchar_t*          FileName_Absolute_Unicode;
};

/*-------------------------------------------------------------------------*/
/* SubFile_End                                                             */
#define MediaInfo_Event_General_SubFile_End 0x7007
struct MediaInfo_Event_General_SubFile_End_0
{
    MEDIAINFO_EVENT_GENERIC
};

/*-------------------------------------------------------------------------*/
/* WaitForMoreData_Start                                                   */
#define MediaInfo_Event_General_WaitForMoreData_Start 0x7008
struct MediaInfo_Event_General_WaitForMoreData_Start_0
{
    MEDIAINFO_EVENT_GENERIC
    double                  Duration_Max;       //In seconds
};
/*-------------------------------------------------------------------------*/
/* WaitForMoreData_End                                                     */
#define MediaInfo_Event_General_WaitForMoreData_End 0x7009
struct MediaInfo_Event_General_WaitForMoreData_End_0
{
    MEDIAINFO_EVENT_GENERIC
    double                  Duration_Max;       //In seconds
    double                  Duration_Actual;    //In seconds
    MediaInfo_int8u         Flags;              //bit 0: Outcome (1 is giving up)
};

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

#define MediaInfo_Parser_SideCar        0x72

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

#define MediaInfo_Parser_MpegTs         0x01

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

#define MediaInfo_Parser_MpegPs         0x02
#define MediaInfo_Parser_MpegPs_Ext     0x70

/***************************************************************************/
/* DV / DIF                                                                 */
/***************************************************************************/

#define MediaInfo_Parser_DvDif          0x03

/*-------------------------------------------------------------------------*/
/* Analysis                                                                */
#define MediaInfo_Event_DvDif_Analysis_Frame 0xB001
struct MediaInfo_Event_DvDif_Analysis_Frame_0
{
    MediaInfo_int32u        EventCode;
    MediaInfo_int32u        TimeCode;
    MediaInfo_int32u        RecordedDateTime1;
    MediaInfo_int16u        RecordedDateTime2;
    MediaInfo_int8u         Arb;
    MediaInfo_int8u         Verbosity;
    char*                   Errors;
};

/***************************************************************************/
/* CDXA                                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Cdxa           0x04

/***************************************************************************/
/* FLV                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Flv            0x06

/***************************************************************************/
/* GXF                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Gxf            0x07

/***************************************************************************/
/* Matroska                                                                */
/***************************************************************************/

#define MediaInfo_Parser_Matroska       0x08

/***************************************************************************/
/* MPEG-4                                                                  */
/***************************************************************************/

#define MediaInfo_Parser_Mpeg4          0x09
#define MediaInfo_Parser_Mpeg4_Desc     0x71

/***************************************************************************/
/* MXF                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Mxf            0x0A

/***************************************************************************/
/* OGG                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Ogg            0x0B

/***************************************************************************/
/* RIFF                                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Riff           0x0C

/***************************************************************************/
/* WM                                                                      */
/***************************************************************************/

#define MediaInfo_Parser_Wm             0x0D

/***************************************************************************/
/* LXF                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Lxf            0x0E

/***************************************************************************/
/* HLS                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Hls            0x60

/***************************************************************************/
/* HLS Index                                                               */
/***************************************************************************/

#define MediaInfo_Parser_HlsIndex       0x61

/***************************************************************************/
/* Internet Streaming Media                                                */
/***************************************************************************/

#define MediaInfo_Parser_Ism            0x62

/***************************************************************************/
/* DASH MPD                                                                */
/***************************************************************************/

#define MediaInfo_Parser_DashMpd        0x63

/***************************************************************************/
/* HDS F4M                                                                 */
/***************************************************************************/

#define MediaInfo_Parser_HdsF4m         0x64

/***************************************************************************/
/* DCP Composition Asset Map                                               */
/***************************************************************************/

#define MediaInfo_Parser_DcpAm          0x65

/***************************************************************************/
/* DCP Composition Playlist                                                */
/***************************************************************************/

#define MediaInfo_Parser_DcpCpl         0x66

/***************************************************************************/
/* DCP Package List                                                        */
/***************************************************************************/

#define MediaInfo_Parser_DcpPkl         0x67

/***************************************************************************/
/* DCP Output List                                                        */
/***************************************************************************/

#define MediaInfo_Parser_DcpOpl         0x68

/***************************************************************************/
/* Pro Tools session 10                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Ptx            0x69

/***************************************************************************/
/* AAF                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Aaf            0x6A

/***************************************************************************/
/* DXW                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Dxw            0x6B

/***************************************************************************/
/* MediaInfo XML                                                           */
/***************************************************************************/

#define MediaInfo_Parser_MiXml          0x6C

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

#define MediaInfo_Parser_Mpegv          0x80

/***************************************************************************/
/* AVC                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Avc            0x81

/***************************************************************************/
/* AVC                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Hevc            0x83

/***************************************************************************/
/* VC-1                                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Vc1            0x82

/***************************************************************************/
/* Active Format Description (AFD)                                         */
/***************************************************************************/

#define MediaInfo_Parser_Afd            0x83

/***************************************************************************/
/* Bar Data                                                                */
/***************************************************************************/

#define MediaInfo_Parser_BarData        0x84

/***************************************************************************/
/* MPEG-4 Visual                                                           */
/***************************************************************************/

#define MediaInfo_Parser_Mpeg4v         0x85

/***************************************************************************/
/* DTS                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Dts            0xA0

/***************************************************************************/
/* AC-3                                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Ac3            0xA1

/***************************************************************************/
/* AAC                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Aac            0xA2

/***************************************************************************/
/* MPEG Audio                                                              */
/***************************************************************************/

#define MediaInfo_Parser_Mpega          0xA3

/***************************************************************************/
/* PCM                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Pcm            0xA4

/***************************************************************************/
/* AES-3                                                                   */
/***************************************************************************/

#define MediaInfo_Parser_Aes3           0xA5

/***************************************************************************/
/* Dolby E                                                                 */
/***************************************************************************/

#define MediaInfo_Parser_DolbyE         0xA6

/***************************************************************************/
/* Channel grouping intermediate module                                    */
/***************************************************************************/

#define MediaInfo_Parser_ChannelGrouping 0xA7

/***************************************************************************/
/* JPEG                                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Jpeg           0xC0

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

#define MediaInfo_Parser_Eia608         0xF0

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_Eia608_Content                                          */
#define MediaInfo_Event_Eia608_CC_Content 0xA000
struct MediaInfo_Event_Eia608_CC_Content_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int8u     Field;
    MediaInfo_int8u     MuxingMode;
    MediaInfo_int8u     Service;
    wchar_t             Row_Values[15][33]; /*offset 32 is for \0*/
    MediaInfo_int8u     Row_Attributes[15][32];
};

/***************************************************************************/
/* DTVCC Transport (CEA-708, formely IEA-708)                              */
/***************************************************************************/

#define MediaInfo_Parser_DtvccTransport 0xF1
#define MediaInfo_Parser_Eia708         0xF1 /*Deprecated*/

/***************************************************************************/
/* DTVCC Caption (CEA-708, formely IEA-708)                                */
/***************************************************************************/

#define MediaInfo_Parser_DtvccCaption   0xF2

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_DtvccCaption_Content_Minimal                            */
#define MediaInfo_Event_DtvccCaption_Content_Minimal 0xA000
struct MediaInfo_Event_DtvccCaption_Content_Minimal_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int8u     MuxingMode;
    MediaInfo_int8u     Service;
    wchar_t             Row_Values[15][65]; /*offset 32 (4:3) or 42 (16:9) is for \0, reserving data after 42 for future extensions*/
    MediaInfo_int8u     Row_Attributes[15][64];
};

/*-------------------------------------------------------------------------*/
/* MediaInfo_Event_DtvccCaption_Window_Content_Minimal                     */
#define MediaInfo_Event_DtvccCaption_Window_Content_Minimal 0xA001
struct MediaInfo_Event_DtvccCaption_Window_Content_Minimal_0
{
    MEDIAINFO_EVENT_GENERIC
    MediaInfo_int8u     MuxingMode;
    MediaInfo_int8u     Service;
    MediaInfo_int8u     Window;
    wchar_t             Row_Values[15][33]; /*offset 32 is for \0*/
    MediaInfo_int8u     Row_Attributes[15][32];
};

/***************************************************************************/
/* CDP                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Cdp            0xF3

/***************************************************************************/
/* DVD CC                                                                  */
/***************************************************************************/

#define MediaInfo_Parser_DvdCc          0xF4

/***************************************************************************/
/* SCTE 20                                                                 */
/***************************************************************************/

#define MediaInfo_Parser_Scte20         0xF5

/***************************************************************************/
/* DVB Subtitle                                                            */
/***************************************************************************/

#define MediaInfo_Parser_DvbSubtitle    0xF6

/***************************************************************************/
/* Teletext                                                                */
/***************************************************************************/

#define MediaInfo_Parser_Teletext       0xF7

/***************************************************************************/
/* SCC                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Scc            0xF8

/***************************************************************************/
/* ARIB STD B24/B37                                                        */
/***************************************************************************/

#define MediaInfo_Parser_AribStdB24B37  0xF9

/***************************************************************************/
/* TTML                                                                    */
/***************************************************************************/

#define MediaInfo_Parser_Ttml           0xFA

/***************************************************************************/
/* SubRip                                                                  */
/***************************************************************************/

#define MediaInfo_Parser_SubRip         0xFB

/***************************************************************************/
/* N19                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_N19            0xFC

/***************************************************************************/
/* SDP                                                                     */
/***************************************************************************/

#define MediaInfo_Parser_Sdp            0xFD

/*-------------------------------------------------------------------------*/
/* Utilities                                                               */
/*-------------------------------------------------------------------------*/

// Flags: bit 0 = has ID containing 2 numbers (e.g. 0x00010002, main ID is 1 and subID is 2) 
#define MediaInfo_ID_FromEvent_int MediaInfo_ID_FromEvent_intA
inline MediaInfo_int64u MediaInfo_ID_FromEvent_intA (MediaInfo_Event_Generic* Event, int) // Flags)
{
    if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_MpegPs && Event->ParserIDs[1]==MediaInfo_Parser_MpegPs_Ext)   // DVD-Video
        return (Event->StreamIDs[0]<<16) | Event->StreamIDs[1];
    if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_HdsF4m && Event->StreamIDs_Width[1])                          // HDS F4M having more than one stream per referenced file
        return Event->StreamIDs[0]<<16 | Event->StreamIDs[1];
    if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_HlsIndex)                                                     // HLS Index
    {
        if (Event->ParserIDs[1]==MediaInfo_Parser_Hls)
            return (Event->StreamIDs[0]<<16) | Event->StreamIDs[2];
        else
            return (Event->StreamIDs[0]<<16) | Event->StreamIDs[1];
    }
    if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_Hls)                                                          // HLS Sequence
        return Event->StreamIDs[1];
    if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_Ism && Event->StreamIDs_Width[1])                             // ISM having more than one stream per referenced file
        return Event->StreamIDs[0]<<16 | Event->StreamIDs[1];
    if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_Dxw && Event->ParserIDs[1]==MediaInfo_Parser_MpegTs)          // DXW with MPEG-TS
        return (Event->StreamIDs[0]<<16) | Event->StreamIDs[1];
    if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_DcpAm)                                                        // DCP/IMF AM
        return (Event->StreamIDs[0]<<24) | (Event->StreamIDs[1]<<16) | Event->StreamIDs[2];
    if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_DcpPkl)                                                       // DCP/IMF PKL
        return (Event->StreamIDs[0]<<24) | (Event->StreamIDs[1]<<16) | Event->StreamIDs[2];
    if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_DcpCpl)                                                       // DCP/IMF CPL
        return (Event->StreamIDs[0]<<16) | Event->StreamIDs[1];
    if (Event->StreamIDs_Size)
        return Event->StreamIDs[0];
    return (MediaInfo_int64u)-1; // No identifier
}

#ifdef __cplusplus
#define MediaInfo_ID_FromEvent_string MediaInfo_ID_FromEvent_stringA
inline std::string MediaInfo_ID_FromEvent_stringA (MediaInfo_Event_Generic* Event, int) // Flags)
{
    std::stringstream ToReturn;

    if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_MpegPs && Event->ParserIDs[1]==MediaInfo_Parser_MpegPs_Ext)        // DVD-Video
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_HdsF4m && Event->StreamIDs_Width[1])                          // HDS F4M having more than one stream per referenced file
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_HlsIndex)                                                     // HLS Index
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        if (Event->ParserIDs[1]==MediaInfo_Parser_Hls)
            ToReturn<<Event->StreamIDs[2];
        else
            ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_Hls)                                                          // HLS Sequence
    {
        ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size>=2 && Event->ParserIDs[0]==MediaInfo_Parser_Ism && Event->StreamIDs_Width[1])                             // ISM having more than one stream per referenced file
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_Dxw && Event->ParserIDs[1]==MediaInfo_Parser_MpegTs)          // DXW with MPEG-TS
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_DcpAm)                                                        // DCP/IMF AM
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[2];
    }
    else if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_DcpPkl)                                                       // DCP/IMF PKL
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[2];
    }
    else if (Event->StreamIDs_Size>=3 && Event->ParserIDs[0]==MediaInfo_Parser_DcpCpl)                                                       // DCP/IMF CPL
    {
        ToReturn<<Event->StreamIDs[0];
        ToReturn<<'-';
        ToReturn<<Event->StreamIDs[1];
    }
    else if (Event->StreamIDs_Size)
    {
        ToReturn<<Event->StreamIDs[0];
    }
    return ToReturn.str();
}
#endif //__cplusplus

#define MediaInfo_ID_FromGet_int MediaInfo_ID_FromGet_intA
inline MediaInfo_int64u MediaInfo_ID_FromGet_intA (const char* ID, const char* ContainerFormat, const char* MuxingMode)
{
    MediaInfo_int64u ToReturn;
    const char* SubID;

    ToReturn=(MediaInfo_int64u)atoi(ID);
    SubID= strchr(ID, '-');
    if (SubID)
    {
        MediaInfo_int64u ToReturn2;

        ToReturn2=atoi(SubID+1);

        SubID= strchr(SubID+1, '-');
        if (SubID)
        {
            MediaInfo_int64u ToReturn3;

            ToReturn3=atoi(SubID+1);
            if (strcmp(ContainerFormat, "DCP AM")==0                                            // DCP AM
             || strcmp(ContainerFormat, "DCP PKL")==0                                           // DCP PKL
             || strcmp(ContainerFormat, "IMF AM")==0                                            // IMF AM
             || strcmp(ContainerFormat, "IMF PKL")==0)                                          // IMF PKL
                ToReturn=(ToReturn<<24) | (ToReturn2<<16) | ToReturn3;
        }
        else if (
            strcmp(MuxingMode, "DVD-Video")==0                                                  // DVD-Video
         || strcmp(ContainerFormat, "HDS F4M")==0                                               // HDS F4M having more than one stream per referenced file
         || (strcmp(ContainerFormat, "HLS")==0 && strstr(MuxingMode, "HLS")==MuxingMode)        // HLS Index
         || (strcmp(ContainerFormat, "HLS")==0 && strstr(MuxingMode, "MPEG-TS")==MuxingMode)    // HLS Index
         || strcmp(ContainerFormat, "ISM")==0                                                   // ISM having more than one stream per referenced file
         || (strcmp(ContainerFormat, "DXW")==0 && strstr(MuxingMode, "MPEG-TS")==MuxingMode)    // DXW with MPEG-TS
         || strcmp(ContainerFormat, "DCP CPL")==0                                               // DCP CPL
         || strcmp(ContainerFormat, "IMF CPL")==0)                                              // IMF CPL
            ToReturn=(ToReturn<<16) | ToReturn2;
    }

    return ToReturn;
}

#endif //MediaInfo_EventsH