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,
104 if (bufferSize >= 8) {
105 sig = ConversionUtilities::BE::toUInt64(buffer);
106 }
else if (bufferSize >= 4) {
107 sig = ConversionUtilities::BE::toUInt32(buffer);
109 }
else if (bufferSize >= 2) {
110 sig = ConversionUtilities::BE::toUInt16(buffer);
113 return ContainerFormat::Unknown;
120 return ContainerFormat::Asf;
122 return ContainerFormat::Asf;
126 if (bufferSize >= 10 && buffer[8] == 0x32 && buffer[9] == 0x20) {
132 switch (sig & 0x00000000FFFFFFFF) {
173 if (bufferSize >= 16 && ConversionUtilities::BE::toUInt64(buffer + 8) ==
Sig64::RiffAvi) {
175 }
else if (bufferSize >= 12 && ConversionUtilities::BE::toUInt32(buffer + 8) ==
RiffWave) {
195 return ContainerFormat::Zip;
202 return ContainerFormat::FlashVideo;
206 return ContainerFormat::Id2v2Tag;
212 return ContainerFormat::Ac3Frames;
234 return ContainerFormat::Unknown;
245 switch (containerFormat) {
246 case ContainerFormat::Ac3Frames:
250 case ContainerFormat::Asf:
258 case ContainerFormat::FlashVideo:
284 case static_cast<unsigned int>(GeneralMediaFormat::Opus):
286 case static_cast<unsigned int>(GeneralMediaFormat::Speex):
300 case ContainerFormat::Matroska:
322 case ContainerFormat::Tar:
339 case ContainerFormat::Zip:
363 switch (containerFormat) {
364 case ContainerFormat::Ac3Frames:
365 return "raw Dolby Digital";
367 return "Audio Data Transport Stream";
369 return "Archive (GNU ar)";
370 case ContainerFormat::Asf:
371 return "Advanced Systems Format";
375 return "Executable and Linkable Format";
377 return "raw Free Lossless Audio Codec frames";
378 case ContainerFormat::FlashVideo:
379 return "Flash Video";
382 return "Graphics Interchange Format";
384 return "Java class file";
386 return "JPEG File Interchange Format";
388 return "LHA compressed file";
390 return "LZW compressed file";
392 return "MPEG-4 Part 14";
394 return "Ogg transport bitstream";
396 return "Photoshop document";
398 return "Portable Network Graphics";
400 return "Portable Executable";
402 return "RAR Archive";
405 case ContainerFormat::Matroska:
407 case ContainerFormat::Webm:
410 return "MPEG-1 Layer 1/2/3 frames";
412 return "Resource Interchange File Format";
416 return "RIFF/Audio Video Interleave";
417 case ContainerFormat::Tar:
418 return "TAR archive";
421 return "Tagged Image File Format";
423 return "UTF-16 text";
425 return "UTF-32 text";
431 return "Microsoft Windows Bitmap";
433 return "Microsoft Windows Icon";
435 return "bzip2 compressed file";
437 return "gzip compressed file";
439 return "lzip compressed file";
445 return "xz compressed file";
448 case ContainerFormat::Zip:
449 return "ZIP archive";
451 return "Monkey's Audio";
464 switch (containerFormat) {
472 return "little endian";
485 switch (containerFormat) {
486 case ContainerFormat::Ac3Frames:
488 case ContainerFormat::Asf:
489 return "video/x-ms-asf";
492 case ContainerFormat::FlashVideo:
493 return "video/x-flv";
517 case ContainerFormat::Matroska:
520 return "audio/x-matroska";
522 return "video/x-matroska";
525 return "application/x-bzip";
527 return "application/gzip";
529 return "application/x-lzh-compressed";
531 return "application/x-rar-compressed";
533 return "application/x-lzip";
535 return "video/quicktime";
536 case ContainerFormat::Zip:
537 return "application/zip";
539 return "application/x-7z-compressed";
541 return "application/x-xz";
545 return "image/vnd.microsoft.icon";
556 switch (containerFormat) {
557 case ContainerFormat::Matroska:
558 case ContainerFormat::Webm:
561 return TagTargetLevel::Unspecified;
570 switch (containerFormat) {
571 case ContainerFormat::Matroska:
572 case ContainerFormat::Webm:
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.
Sig48
Holds 48-bit signatures.
TAG_PARSER_EXPORT uint64 matroskaTagTargetLevelValue(TagTargetLevel targetLevel)
Returns the Matroska specific target level value for the specified general targetLevel.
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.
TAG_PARSER_EXPORT TagTargetLevel matroskaTagTargetLevel(uint64 targetLevelValue)
Returns the general TagTargetLevel for the Matroska specific targetLevelValue.
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.