Detect zstd compressed files
This commit is contained in:
parent
21edf75047
commit
7d9d5c8408
|
@ -72,6 +72,7 @@ enum Sig32 : std::uint32_t {
|
||||||
Zip1 = 0x504B0304u,
|
Zip1 = 0x504B0304u,
|
||||||
Zip2 = 0x504B0506u,
|
Zip2 = 0x504B0506u,
|
||||||
Zip3 = 0x504B0708u,
|
Zip3 = 0x504B0708u,
|
||||||
|
Zstd = 0x28b52ffdu,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -213,6 +214,8 @@ ContainerFormat parseSignature(std::string_view buffer)
|
||||||
case Zip2:
|
case Zip2:
|
||||||
case Zip3:
|
case Zip3:
|
||||||
return ContainerFormat::Zip;
|
return ContainerFormat::Zip;
|
||||||
|
case Zstd:
|
||||||
|
return ContainerFormat::Zstd;
|
||||||
default:;
|
default:;
|
||||||
}
|
}
|
||||||
switch (sig >> 40) { // check 24-bit signatures
|
switch (sig >> 40) { // check 24-bit signatures
|
||||||
|
@ -374,6 +377,8 @@ std::string_view containerFormatAbbreviation(ContainerFormat containerFormat, Me
|
||||||
return "mid";
|
return "mid";
|
||||||
case ContainerFormat::Aiff:
|
case ContainerFormat::Aiff:
|
||||||
return "aiff";
|
return "aiff";
|
||||||
|
case ContainerFormat::Zstd:
|
||||||
|
return "zst";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -481,6 +486,8 @@ std::string_view containerFormatName(ContainerFormat containerFormat)
|
||||||
return "MIDI";
|
return "MIDI";
|
||||||
case ContainerFormat::Aiff:
|
case ContainerFormat::Aiff:
|
||||||
return "Audio Interchange File Format";
|
return "Audio Interchange File Format";
|
||||||
|
case ContainerFormat::Zstd:
|
||||||
|
return "Zstandard compressed file";
|
||||||
default:
|
default:
|
||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
@ -577,6 +584,8 @@ std::string_view containerMimeType(ContainerFormat containerFormat, MediaType me
|
||||||
return "image/bmp";
|
return "image/bmp";
|
||||||
case ContainerFormat::WindowsIcon:
|
case ContainerFormat::WindowsIcon:
|
||||||
return "image/vnd.microsoft.icon";
|
return "image/vnd.microsoft.icon";
|
||||||
|
case ContainerFormat::Zstd:
|
||||||
|
return "application/zstd";
|
||||||
default:
|
default:
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
|
@ -66,6 +66,7 @@ enum class ContainerFormat : unsigned int {
|
||||||
YUV4Mpeg2, /**< YUV4MPEG2 */
|
YUV4Mpeg2, /**< YUV4MPEG2 */
|
||||||
Zip, /**< ZIP archive */
|
Zip, /**< ZIP archive */
|
||||||
Aiff, /**< Audio Interchange File Format */
|
Aiff, /**< Audio Interchange File Format */
|
||||||
|
Zstd, /**< Zstandard-compressed data */
|
||||||
};
|
};
|
||||||
|
|
||||||
TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, std::size_t bufferSize);
|
TAG_PARSER_EXPORT ContainerFormat parseSignature(const char *buffer, std::size_t bufferSize);
|
||||||
|
|
Loading…
Reference in New Issue