4#include <c++utilities/conversion/binaryconversion.h>
17 Ar = 0x213C617263683E0A,
18 Asf1 = 0x3026B2758E66CF11ul,
19 Asf2 = 0xA6D900AA0062CE6Cul,
20 Png = 0x89504E470D0A1A0Aul,
29 Rar = 0x526172211A0700ul,
39 Xz = 0xFD377A585A00ul,
116 std::uint64_t sig = 0;
117 if (buffer.size() >= 8) {
118 sig = BE::toInt<std::uint64_t>(buffer.data());
119 }
else if (buffer.size() >= 4) {
120 sig = BE::toInt<std::uint32_t>(buffer.data());
122 }
else if (buffer.size() >= 2) {
123 sig = BE::toInt<std::uint16_t>(buffer.data());
141 if (buffer.size() >= 10 && buffer[8] == 0x32 && buffer[9] == 0x20) {
147 switch (sig & 0x00000000FFFFFFFF) {
197 if (buffer.size() >= 16 && BE::toInt<std::uint64_t>(buffer.data() + 8) ==
Sig64::RiffAvi) {
199 }
else if (buffer.size() >= 12 && BE::toInt<std::uint32_t>(buffer.data() + 8) ==
RiffWave) {
271 switch (containerFormat) {
397 switch (containerFormat) {
399 return "raw Dolby Digital";
401 return "Audio Data Transport Stream";
403 return "Archive (GNU ar)";
405 return "Advanced Systems Format";
409 return "Executable and Linkable Format";
411 return "raw Free Lossless Audio Codec frames";
413 return "Flash Video";
416 return "Graphics Interchange Format";
420 return "Java class file";
422 return "JPEG File Interchange Format";
424 return "LHA compressed file";
426 return "LZW compressed file";
428 return "MPEG-4 Part 14";
430 return "Ogg transport bitstream";
432 return "Photoshop document";
434 return "Portable Network Graphics";
436 return "Portable Executable";
438 return "RAR Archive";
446 return "MPEG-1 Layer 1/2/3 frames";
448 return "Resource Interchange File Format";
452 return "RIFF/Audio Video Interleave";
454 return "TAR archive";
457 return "Tagged Image File Format";
459 return "UTF-16 text";
461 return "UTF-32 text";
467 return "Microsoft Windows Bitmap";
469 return "Microsoft Windows Icon";
471 return "bzip2 compressed file";
473 return "gzip compressed file";
475 return "lzip compressed file";
481 return "xz compressed file";
485 return "ZIP archive";
487 return "Monkey's Audio";
491 return "Audio Interchange File Format";
493 return "Zstandard compressed file";
510 switch (containerFormat) {
518 return "little endian";
531 switch (containerFormat) {
535 return "video/x-ms-asf";
539 return "video/x-flv";
566 return "audio/x-matroska";
568 return "video/x-matroska";
573 return "application/x-bzip";
575 return "application/gzip";
577 return "application/x-lzh-compressed";
579 return "application/x-rar-compressed";
581 return "application/x-lzip";
583 return "video/quicktime";
585 return "application/zip";
587 return "application/x-7z-compressed";
589 return "application/x-xz";
593 return "image/vnd.microsoft.icon";
595 return "application/zstd";
606 switch (containerFormat) {
620 switch (containerFormat) {
Contains all classes and functions of the TagInfo library.
TAG_PARSER_EXPORT std::string_view containerFormatSubversion(ContainerFormat containerFormat)
Returns the subversion of the container format as C-style string.
Sig16
Holds 16-bit signatures.
TagTargetLevel
The TagTargetLevel enum specifies tag target levels.
TAG_PARSER_EXPORT std::string_view 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...
Sig24
Holds 24-bit signatures.
Sig48
Holds 48-bit signatures.
constexpr TAG_PARSER_EXPORT std::uint64_t matroskaTagTargetLevelValue(TagTargetLevel targetLevel)
Returns the Matroska specific target level value for the specified general targetLevel.
TAG_PARSER_EXPORT std::string_view containerFormatName(ContainerFormat containerFormat)
Returns the name of the specified container format as C-style string.
TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, std::size_t bufferSize)
TAG_PARSER_EXPORT std::string_view containerMimeType(ContainerFormat containerFormat, MediaType mediaType=MediaType::Unknown)
Returns the MIME-type of the container format as C-style string.
constexpr TAG_PARSER_EXPORT TagTargetLevel matroskaTagTargetLevel(std::uint64_t targetLevelValue)
Returns the general TagTargetLevel for the Matroska specific targetLevelValue.
Sig56
Holds 52-bit signatures.
TAG_PARSER_EXPORT TagTargetLevel containerTargetLevel(ContainerFormat containerFormat, std::uint64_t targetLevelValue)
Returns the general TagTargetLevel for the specified container format and raw targetLevelValue.
Sig32
Holds 32-bit signatures.
MediaType
The MediaType enum specifies the type of media data (audio, video, text, ...).
Sig64
Holds 64-bit signatures.
TAG_PARSER_EXPORT std::uint64_t containerTargetLevelValue(ContainerFormat containerFormat, TagTargetLevel targetLevel)
Returns the raw target level value for the specified containerFormat and general targetLevel.
ContainerFormat
Specifies the container format.
Sig40
Holds 40-bit signatures.