61     "<CompositionPlaylist xmlns=\"http://www.smpte-ra.org/schemas/2067-3/2016\"" 
   62     " xmlns:cc=\"http://www.smpte-ra.org/schemas/2067-2/2016\"" 
   63     " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" 
   64     "<Id>urn:uuid:8713c020-2489-45f5-a9f7-87be539e20b5</Id>" 
   65     "<IssueDate>2021-07-13T17:06:22Z</IssueDate>" 
   66     "<Creator language=\"en\">FFMPEG</Creator>" 
   67     "<ContentTitle>FFMPEG sample content</ContentTitle>" 
   68     "<EssenceDescriptorList>" 
   69     "  <EssenceDescriptor>" 
   70     "    <Id>urn:uuid:8e097bb0-cff7-4969-a692-bad47bfb528f</Id>" 
   71     "  </EssenceDescriptor>" 
   72     "</EssenceDescriptorList>" 
   73     "<CompositionTimecode>" 
   74     "<TimecodeDropFrame>false</TimecodeDropFrame>" 
   75     "<TimecodeRate>24</TimecodeRate>" 
   76     "<TimecodeStartAddress>02:10:01.23</TimecodeStartAddress>" 
   77     "</CompositionTimecode>" 
   78     "<EditRate>24000 1001</EditRate>" 
   81     "<Id>urn:uuid:81fed4e5-9722-400a-b9d1-7f2bd21df4b6</Id>" 
   84     "<Id>urn:uuid:16327185-9205-47ef-a17b-ee28df251db7</Id>" 
   85     "<TrackId>urn:uuid:461f5424-8f6e-48a9-a385-5eda46fda381</TrackId>" 
   87     "<Resource xsi:type=\"MarkerResourceType\">" 
   88     "<Id>urn:uuid:ea3d0f23-55d6-4e03-86ec-cfe0666f0e6a</Id>" 
   89     "<IntrinsicDuration>24</IntrinsicDuration>" 
   97     "<cc:MainImageSequence>" 
   98     "<Id>urn:uuid:6ae100b0-92d1-41be-9321-85e0933dfc42</Id>" 
   99     "<TrackId>urn:uuid:e8ef9653-565c-479c-8039-82d4547973c5</TrackId>" 
  101     "<Resource xsi:type=\"TrackFileResourceType\">" 
  102     "<Id>urn:uuid:7d418acb-07a3-4e57-984c-b8ea2f7de4ec</Id>" 
  103     "<IntrinsicDuration>24</IntrinsicDuration>" 
  104     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  105     "<TrackFileId>urn:uuid:6f768ca4-c89e-4dac-9056-a29425d40ba1</TrackFileId>" 
  108     "</cc:MainImageSequence>" 
  109     "<cc:MainAudioSequence>" 
  110     "<Id>urn:uuid:754dae53-c25f-4f3c-97e4-2bfe5463f83b</Id>" 
  111     "<TrackId>urn:uuid:68e3fae5-d94b-44d2-92a6-b94877fbcdb5</TrackId>" 
  113     "<Resource xsi:type=\"TrackFileResourceType\">" 
  114     "<Id>urn:uuid:61ce2a70-10a2-4521-850b-4218755ff3c9</Id>" 
  115     "<IntrinsicDuration>24</IntrinsicDuration>" 
  116     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  117     "<TrackFileId>urn:uuid:381dadd2-061e-46cc-a63a-e3d58ce7f488</TrackFileId>" 
  120     "</cc:MainAudioSequence>" 
  121     "<cc:MainAudioSequence>" 
  122     "<Id>urn:uuid:d29b3884-6633-4dad-9c67-7154af342bc6</Id>" 
  123     "<TrackId>urn:uuid:6978c106-95bc-424b-a17c-628206a5892d</TrackId>" 
  125     "<Resource xsi:type=\"TrackFileResourceType\">" 
  126     "<Id>urn:uuid:001ea472-f5da-436c-86de-acaa68c1a7e4</Id>" 
  127     "<IntrinsicDuration>24</IntrinsicDuration>" 
  128     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  129     "<TrackFileId>urn:uuid:381dadd2-061e-46cc-a63a-e3d58ce7f488</TrackFileId>" 
  132     "</cc:MainAudioSequence>" 
  133     "<cc:SubtitlesSequence>" 
  134     "<Id>urn:uuid:02af22bf-f776-488a-b001-eb6e16953119</Id>" 
  135     "<TrackId>urn:uuid:19ff6da1-be79-4235-8d04-42201ad06e65</TrackId>" 
  137     "<Resource xsi:type=\"TrackFileResourceType\">" 
  138     "<Id>urn:uuid:dfa84292-0609-4097-824c-8e2e15e2ce4d</Id>" 
  139     "<IntrinsicDuration>24</IntrinsicDuration>" 
  140     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  141     "<TrackFileId>urn:uuid:bd6272b6-511e-47c1-93bc-d56ebd314a70</TrackFileId>" 
  144     "</cc:SubtitlesSequence>" 
  148     "<Id>urn:uuid:a94be493-cd55-4bf7-b496-ea87bfe38632</Id>" 
  151     "<Id>urn:uuid:20c6020b-1fc0-4080-bcf7-89f09f95bea8</Id>" 
  152     "<TrackId>urn:uuid:461f5424-8f6e-48a9-a385-5eda46fda381</TrackId>" 
  154     "<Resource xsi:type=\"MarkerResourceType\">" 
  155     "<Id>urn:uuid:d1f93845-d3e5-4c3b-aa67-8d96c45cfe9c</Id>" 
  156     "<IntrinsicDuration>36</IntrinsicDuration>" 
  158     "<Label>FFOA</Label>" 
  159     "<Offset>20</Offset>" 
  162     "<Label>LFOC</Label>" 
  163     "<Offset>24</Offset>" 
  168     "<cc:MainImageSequence>" 
  169     "<Id>urn:uuid:9b509f42-e4e8-4f78-8c2a-12ddd79ef3c5</Id>" 
  170     "<TrackId>urn:uuid:e8ef9653-565c-479c-8039-82d4547973c5</TrackId>" 
  172     "<Resource xsi:type=\"TrackFileResourceType\">" 
  173     "<Id>urn:uuid:a733d812-a3d7-45e9-ba50-13b856d5d35a</Id>" 
  174     "<IntrinsicDuration>36</IntrinsicDuration>" 
  175     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  176     "<TrackFileId>urn:uuid:f3b263b3-096b-4360-a952-b1a9623cd0ca</TrackFileId>" 
  179     "</cc:MainImageSequence>" 
  180     "<cc:MainAudioSequence>" 
  181     "<Id>urn:uuid:19a282e6-beac-4d99-a008-afa61378eb6c</Id>" 
  182     "<TrackId>urn:uuid:68e3fae5-d94b-44d2-92a6-b94877fbcdb5</TrackId>" 
  184     "<Resource xsi:type=\"TrackFileResourceType\">" 
  185     "<Id>urn:uuid:53de5ff9-f5f7-47c5-a2d8-117c36cce517</Id>" 
  186     "<IntrinsicDuration>36</IntrinsicDuration>" 
  187     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  188     "<TrackFileId>urn:uuid:2484d613-bb7d-4bcc-8b0f-2e65938f0535</TrackFileId>" 
  191     "</cc:MainAudioSequence>" 
  192     "<cc:MainAudioSequence>" 
  193     "<Id>urn:uuid:94b0ef77-0621-4086-95a2-85432fa97d40</Id>" 
  194     "<TrackId>urn:uuid:6978c106-95bc-424b-a17c-628206a5892d</TrackId>" 
  196     "<Resource xsi:type=\"TrackFileResourceType\">" 
  197     "<Id>urn:uuid:2ce499f2-59bc-4053-87bc-80f4b7e7b73e</Id>" 
  198     "<IntrinsicDuration>36</IntrinsicDuration>" 
  199     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  200     "<TrackFileId>urn:uuid:2484d613-bb7d-4bcc-8b0f-2e65938f0535</TrackFileId>" 
  203     "</cc:MainAudioSequence>" 
  204     "<cc:SubtitlesSequence>" 
  205     "<Id>urn:uuid:9ac3b905-c599-4da8-8f0f-fc07e619899d</Id>" 
  206     "<TrackId>urn:uuid:19ff6da1-be79-4235-8d04-42201ad06e65</TrackId>" 
  208     "<Resource xsi:type=\"TrackFileResourceType\">" 
  209     "<Id>urn:uuid:0239017b-2ad9-4235-b46d-c4c1126e29fc</Id>" 
  210     "<IntrinsicDuration>36</IntrinsicDuration>" 
  211     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  212     "<TrackFileId>urn:uuid:bd6272b6-511e-47c1-93bc-d56ebd314a70</TrackFileId>" 
  215     "</cc:SubtitlesSequence>" 
  219     "</CompositionPlaylist>";
 
  222     "<CompositionPlaylist xmlns=\"http://www.smpte-ra.org/schemas/2067-3/2016\"" 
  223     " xmlns:cc=\"http://www.smpte-ra.org/schemas/2067-2/2016\"" 
  224     " xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" 
  225     "<Id>urn:uuid:8713c020-2489-45f5-a9f7-87be539e20b5</Id>" 
  226     "<IssueDate>2021-07-13T17:06:22Z</IssueDate>" 
  227     "<Creator language=\"en\">FFMPEG</Creator>" 
  228     "<ContentTitle>FFMPEG sample content</ContentTitle>" 
  229     "<EssenceDescriptorList>" 
  230     "  <EssenceDescriptor>" 
  231     "    <Id>urn:uuid:8e097bb0-cff7-4969-a692-bad47bfb528f</Id>" 
  232     "  </EssenceDescriptor>" 
  233     "</EssenceDescriptorList>" 
  234     "<CompositionTimecode>" 
  235     "<TimecodeDropFrame>false</TimecodeDropFrame>" 
  236     "<TimecodeRate>24</TimecodeRate>" 
  237     "<TimecodeStartAddress>02:10:01.23</TimecodeStartAddress>" 
  238     "</CompositionTimecode>" 
  239     "<EditRate>24000 1001</EditRate>" 
  242     "<Id>urn:uuid:81fed4e5-9722-400a-b9d1-7f2bd21df4b6</Id>" 
  244     "<cc:MainImageSequence>" 
  245     "<Id>urn:uuid:6ae100b0-92d1-41be-9321-85e0933dfc42</Id>" 
  246     "<TrackId>urn:uuid:e8ef9653-565c-479c-8039-82d4547973c5</TrackId>" 
  248     "<Resource xsi:type=\"TrackFileResourceType\">" 
  249     "<Id>urn:uuid:7d418acb-07a3-4e57-984c-b8ea2f7de4ec</Id>" 
  250     "<IntrinsicDuration>24</IntrinsicDuration>" 
  251     "<SourceEncoding>urn:uuid:f00e49a8-0dec-4e6c-95e7-078df988b751</SourceEncoding>" 
  254     "</cc:MainImageSequence>" 
  258     "</CompositionPlaylist>";
 
  263     "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>" 
  264     "<am:AssetMap xmlns:am=\"http://www.smpte-ra.org/schemas/429-9/2007/AM\">" 
  265     "<am:Id>urn:uuid:68d9f591-8191-46b5-38b4-affb87a14132</am:Id>" 
  266     "<am:AnnotationText>IMF_TEST_ASSET_MAP</am:AnnotationText>" 
  267     "<am:Creator>Some tool</am:Creator>" 
  268     "<am:VolumeCount>1</am:VolumeCount>" 
  269     "<am:IssueDate>2021-06-07T12:00:00+00:00</am:IssueDate>" 
  270     "<am:Issuer>FFmpeg</am:Issuer>" 
  273     "<am:Id>urn:uuid:b5d674b8-c6ce-4bce-3bdf-be045dfdb2d0</am:Id>" 
  276     "<am:Path>IMF_TEST_ASSET_MAP_video.mxf</am:Path>" 
  277     "<am:VolumeIndex>1</am:VolumeIndex>" 
  278     "<am:Offset>0</am:Offset>" 
  279     "<am:Length>1234567</am:Length>" 
  284     "<am:Id>urn:uuid:ec3467ec-ab2a-4f49-c8cb-89caa3761f4a</am:Id>" 
  287     "<am:Path>IMF_TEST_ASSET_MAP_video_1.mxf</am:Path>" 
  288     "<am:VolumeIndex>1</am:VolumeIndex>" 
  289     "<am:Offset>0</am:Offset>" 
  290     "<am:Length>234567</am:Length>" 
  295     "<am:Id>urn:uuid:5cf5b5a7-8bb3-4f08-eaa6-3533d4b77fa6</am:Id>" 
  298     "<am:Path>IMF_TEST_ASSET_MAP_audio.mxf</am:Path>" 
  299     "<am:VolumeIndex>1</am:VolumeIndex>" 
  300     "<am:Offset>0</am:Offset>" 
  301     "<am:Length>34567</am:Length>" 
  306     "<am:Id>urn:uuid:559777d6-ec29-4375-f90d-300b0bf73686</am:Id>" 
  309     "<am:Path>CPL_IMF_TEST_ASSET_MAP.xml</am:Path>" 
  310     "<am:VolumeIndex>1</am:VolumeIndex>" 
  311     "<am:Offset>0</am:Offset>" 
  312     "<am:Length>12345</am:Length>" 
  317     "<am:Id>urn:uuid:dd04528d-9b80-452a-7a13-805b08278b3d</am:Id>" 
  318     "<am:PackingList>true</am:PackingList>" 
  321     "<am:Path>PKL_IMF_TEST_ASSET_MAP.xml</am:Path>" 
  322     "<am:VolumeIndex>1</am:VolumeIndex>" 
  323     "<am:Offset>0</am:Offset>" 
  324     "<am:Length>2345</am:Length>" 
  340         printf(
"XML parsing failed.\n");
 
  347         printf(
"CPL parsing failed.\n");
 
  358         printf(
"Marker resource %" PRIu32 
"\n", 
i);
 
  360             printf(
"  Marker %" PRIu32 
"\n", j);
 
  368         printf(
"Track file resource %" PRIu32 
"\n", 
i);
 
  374         printf(
"  Main audio virtual track %" PRIu32 
"\n", 
i);
 
  377             printf(
"  Track file resource %" PRIu32 
"\n", j);
 
  393         printf(
"XML parsing failed.\n");
 
  400         printf(
"CPL parsing failed.\n");
 
  402             printf(
"Improper cleanup after failed CPL parsing\n");
 
  421     for (uint32_t 
i = 0; 
i < 16; ++
i) {
 
  422         if (asset->
uuid[
i] != expected_asset->
uuid[
i]) {
 
  432         printf(
"Invalid asset locator URI: found %s instead of %s expected.\n",
 
  442     {.
uuid = {0xb5, 0xd6, 0x74, 0xb8, 0xc6, 0xce, 0x4b, 0xce, 0x3b, 0xdf, 0xbe, 0x04, 0x5d, 0xfd, 0xb2, 0xd0},
 
  443      .absolute_uri = (
char *)
"IMF_TEST_ASSET_MAP_video.mxf"},
 
  444     {.uuid = {0xec, 0x34, 0x67, 0xec, 0xab, 0x2a, 0x4f, 0x49, 0xc8, 0xcb, 0x89, 0xca, 0xa3, 0x76, 0x1f, 0x4a},
 
  445      .absolute_uri = (
char *)
"IMF_TEST_ASSET_MAP_video_1.mxf"},
 
  446     {.uuid = {0x5c, 0xf5, 0xb5, 0xa7, 0x8b, 0xb3, 0x4f, 0x08, 0xea, 0xa6, 0x35, 0x33, 0xd4, 0xb7, 0x7f, 0xa6},
 
  447      .absolute_uri = (
char *)
"IMF_TEST_ASSET_MAP_audio.mxf"},
 
  448     {.uuid = {0x55, 0x97, 0x77, 0xd6, 0xec, 0x29, 0x43, 0x75, 0xf9, 0x0d, 0x30, 0x0b, 0x0b, 0xf7, 0x36, 0x86},
 
  449      .absolute_uri = (
char *)
"CPL_IMF_TEST_ASSET_MAP.xml"},
 
  450     {.uuid = {0xdd, 0x04, 0x52, 0x8d, 0x9b, 0x80, 0x45, 0x2a, 0x7a, 0x13, 0x80, 0x5b, 0x08, 0x27, 0x8b, 0x3d},
 
  451      .absolute_uri = (
char *)
"PKL_IMF_TEST_ASSET_MAP.xml"},
 
  462         printf(
"Asset map XML parsing failed.\n");
 
  466     printf(
"Allocate asset map\n");
 
  469     printf(
"Parse asset map XML document\n");
 
  472         printf(
"Asset map parsing failed.\n");
 
  478         printf(
"Asset map parsing failed: found %d assets instead of 5 expected.\n",
 
  506     {.
path = 
"file://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  507     {.path = 
"http://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  508     {.path = 
"https://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  509     {.path = 
"s3://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  510     {.path = 
"ftp://path/to/somewhere", .is_url = 1, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  511     {.path = 
"/path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 1, .is_dos_absolute_path = 0},
 
  512     {.path = 
"path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  513     {.path = 
"C:\\path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
 
  514     {.path = 
"C:/path/to/somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
 
  515     {.path = 
"\\\\path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 1},
 
  516     {.path = 
"path\\to\\somewhere", .is_url = 0, .is_unix_absolute_path = 0, .is_dos_absolute_path = 0},
 
  522     for (uint32_t 
i = 0; 
i < 11; ++
i) {
 
  526                     "URL comparison test failed for '%s', got %d instead of expected %d\n",
 
  535                     "Unix absolute path comparison test failed for '%s', got %d instead of expected %d\n",
 
  544                     "DOS absolute path comparison test failed for '%s', got %d instead of expected %d\n",
 
  558 int main(
int argc, 
char *argv[])
 
  572     printf(
"#### The following should fail ####\n");
 
  575     printf(
"#### End failing test ####\n");
 
  577     printf(
"#### The following should emit errors ####\n");
 
  580     printf(
"#### End emission of errors ####\n");