From 2167a32f3730e569a636d9b041122558aceb89f1 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 15 Jul 2021 08:14:40 +0200 Subject: matrix: mpeg video upload support --- src/FileAnalyzer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/FileAnalyzer.cpp b/src/FileAnalyzer.cpp index 32fbbdb..0178789 100644 --- a/src/FileAnalyzer.cpp +++ b/src/FileAnalyzer.cpp @@ -20,7 +20,7 @@ namespace QuickMedia { // https://mimesniff.spec.whatwg.org/ // TODO: Test all of these - static const std::array magic_numbers = { + static const std::array magic_numbers = { MagicNumber{ {'R', 'I', 'F', 'F', -1, -1, -1, -1, 'A', 'V', 'I', ' '}, 12, ContentType::VIDEO_AVI }, MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'p', 'i', 's', 'o', 'm'}, 12, ContentType::VIDEO_MP4 }, MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'p', 'm', 'p', '4', '2'}, 12, ContentType::VIDEO_MP4 }, @@ -29,6 +29,8 @@ namespace QuickMedia { MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'm', 'p', '4', '2'}, 11, ContentType::VIDEO_MP4 }, MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', '3', 'g', 'p', '5'}, 11, ContentType::VIDEO_MP4 }, MagicNumber{ {0x00, 0x00, 0x00, -1, 'f', 't', 'y', 'p', 'q', 't'}, 10, ContentType::VIDEO_MP4 }, + MagicNumber{ {0x00, 0x00, 0x01, 0xBA}, 4, ContentType::VIDEO_MPEG }, + MagicNumber{ {0x00, 0x00, 0x01, 0xB3}, 4, ContentType::VIDEO_MPEG }, MagicNumber{ {0x1A, 0x45, 0xDF, 0xA3}, 4, ContentType::VIDEO_WEBM }, MagicNumber{ {'F', 'L', 'V', 0x01}, 4, ContentType::VIDEO_FLV }, MagicNumber{ {'.', 's', 'n', 'd'}, 4, ContentType::AUDIO_BASIC }, @@ -69,6 +71,7 @@ namespace QuickMedia { case ContentType::UNKNOWN: return "application/octet-stream"; case ContentType::VIDEO_AVI: return "video/avi"; case ContentType::VIDEO_MP4: return "video/mp4"; + case ContentType::VIDEO_MPEG: return "video/mpeg"; case ContentType::VIDEO_WEBM: return "video/webm"; case ContentType::VIDEO_FLV: return "video/x-flv"; case ContentType::AUDIO_BASIC: return "audio/basic"; -- cgit v1.2.3