4 #include <c++utilities/conversion/binaryconversion.h> 14 Ar = 0x213C617263683E0A,
15 Asf1 = 0x3026B2758E66CF11ul,
16 Asf2 = 0xA6D900AA0062CE6Cul,
17 Png = 0x89504E470D0A1A0Aul,
26 Rar = 0x526172211A0700ul,
36 Xz = 0xFD377A585A00ul,
106 if (bufferSize >= 8) {
107 sig = ConversionUtilities::BE::toUInt64(buffer);
108 }
else if (bufferSize >= 4) {
109 sig = ConversionUtilities::BE::toUInt32(buffer);
111 }
else if (bufferSize >= 2) {
112 sig = ConversionUtilities::BE::toUInt16(buffer);
115 return ContainerFormat::Unknown;
122 return ContainerFormat::Asf;
124 return ContainerFormat::Asf;
128 if (bufferSize >= 10 && buffer[8] == 0x32 && buffer[9] == 0x20) {
134 switch (sig & 0x00000000FFFFFFFF) {
179 if (bufferSize >= 16 && ConversionUtilities::BE::toUInt64(buffer + 8) ==
Sig64::RiffAvi) {
181 }
else if (bufferSize >= 12 && ConversionUtilities::BE::toUInt32(buffer + 8) ==
RiffWave) {
201 return ContainerFormat::Zip;
208 return ContainerFormat::FlashVideo;
212 return ContainerFormat::Id2v2Tag;
218 return ContainerFormat::Ac3Frames;
240 return ContainerFormat::Unknown;
251 switch (containerFormat) {
252 case ContainerFormat::Ac3Frames:
256 case ContainerFormat::Asf:
264 case ContainerFormat::FlashVideo:
292 case static_cast<unsigned int>(GeneralMediaFormat::Opus):
294 case static_cast<unsigned int>(GeneralMediaFormat::Speex):
308 case ContainerFormat::Matroska:
330 case ContainerFormat::Tar:
347 case ContainerFormat::Zip:
373 switch (containerFormat) {
374 case ContainerFormat::Ac3Frames:
375 return "raw Dolby Digital";
377 return "Audio Data Transport Stream";
379 return "Archive (GNU ar)";
380 case ContainerFormat::Asf:
381 return "Advanced Systems Format";
385 return "Executable and Linkable Format";
387 return "raw Free Lossless Audio Codec frames";
388 case ContainerFormat::FlashVideo:
389 return "Flash Video";
392 return "Graphics Interchange Format";
396 return "Java class file";
398 return "JPEG File Interchange Format";
400 return "LHA compressed file";
402 return "LZW compressed file";
404 return "MPEG-4 Part 14";
406 return "Ogg transport bitstream";
408 return "Photoshop document";
410 return "Portable Network Graphics";
412 return "Portable Executable";
414 return "RAR Archive";
417 case ContainerFormat::Matroska:
419 case ContainerFormat::Webm:
422 return "MPEG-1 Layer 1/2/3 frames";
424 return "Resource Interchange File Format";
428 return "RIFF/Audio Video Interleave";
429 case ContainerFormat::Tar:
430 return "TAR archive";
433 return "Tagged Image File Format";
435 return "UTF-16 text";
437 return "UTF-32 text";
443 return "Microsoft Windows Bitmap";
445 return "Microsoft Windows Icon";
447 return "bzip2 compressed file";
449 return "gzip compressed file";
451 return "lzip compressed file";
457 return "xz compressed file";
460 case ContainerFormat::Zip:
461 return "ZIP archive";
463 return "Monkey's Audio";
478 switch (containerFormat) {
486 return "little endian";
499 switch (containerFormat) {
500 case ContainerFormat::Ac3Frames:
502 case ContainerFormat::Asf:
503 return "video/x-ms-asf";
506 case ContainerFormat::FlashVideo:
507 return "video/x-flv";
531 case ContainerFormat::Matroska:
534 return "audio/x-matroska";
536 return "video/x-matroska";
541 return "application/x-bzip";
543 return "application/gzip";
545 return "application/x-lzh-compressed";
547 return "application/x-rar-compressed";
549 return "application/x-lzip";
551 return "video/quicktime";
552 case ContainerFormat::Zip:
553 return "application/zip";
555 return "application/x-7z-compressed";
557 return "application/x-xz";
561 return "image/vnd.microsoft.icon";
572 switch (containerFormat) {
573 case ContainerFormat::Matroska:
574 case ContainerFormat::Webm:
577 return TagTargetLevel::Unspecified;
586 switch (containerFormat) {
587 case ContainerFormat::Matroska:
588 case ContainerFormat::Webm:
constexpr TAG_PARSER_EXPORT TagTargetLevel matroskaTagTargetLevel(uint64 targetLevelValue)
Returns the general TagTargetLevel for the Matroska specific targetLevelValue.
TAG_PARSER_EXPORT uint64 containerTargetLevelValue(ContainerFormat containerFormat, TagTargetLevel targetLevel)
Returns the raw target level value for the specified containerFormat and general targetLevel.
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
Sig56
Holds 52-bit signatures.
TAG_PARSER_EXPORT TagTargetLevel containerTargetLevel(ContainerFormat containerFormat, uint64 targetLevelValue)
Returns the general TagTargetLevel for the specified container format and raw targetLevelValue.
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
TAG_PARSER_EXPORT const char * containerMimeType(ContainerFormat containerFormat, MediaType mediaType=MediaType::Unknown)
Returns the MIME-type of the container format as C-style string.
Sig32
Holds 32-bit signatures.
constexpr TAG_PARSER_EXPORT uint64 matroskaTagTargetLevelValue(TagTargetLevel targetLevel)
Returns the Matroska specific target level value for the specified general targetLevel.
Sig48
Holds 48-bit signatures.
Sig16
Holds 16-bit signatures.
ContainerFormat
Specifies the container format.
TAG_PARSER_EXPORT const char * containerFormatName(ContainerFormat containerFormat)
Returns the name of the specified container format as C-style string.
Sig24
Holds 24-bit signatures.
Sig64
Holds 64-bit signatures.
TAG_PARSER_EXPORT const char * containerFormatAbbreviation(ContainerFormat containerFormat, MediaType mediaType=MediaType::Unknown, unsigned int version=0)
Returns the abbreviation of the container format as C-style string considering the specified media ty...
TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, int bufferSize)
Parses the signature read from the specified buffer.
TAG_PARSER_EXPORT const char * containerFormatSubversion(ContainerFormat containerFormat)
Returns the subversion of the container format as C-style string.
Contains all classes and functions of the TagInfo library.