From d4cd63129ae5dff8fd69525424e0f8cb9ae1a905 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 16 Feb 2022 21:54:47 +0100 Subject: Wip: fix video duration not working for some analyzed files, get frame in middle of video instead of first frame for thumbnail --- include/FileAnalyzer.hpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'include/FileAnalyzer.hpp') diff --git a/include/FileAnalyzer.hpp b/include/FileAnalyzer.hpp index b06ef91..acc62d7 100644 --- a/include/FileAnalyzer.hpp +++ b/include/FileAnalyzer.hpp @@ -5,6 +5,8 @@ #include namespace QuickMedia { + class FileAnalyzer; + struct Dimensions { int width; int height; @@ -17,6 +19,7 @@ namespace QuickMedia { VIDEO_MPEG, VIDEO_WEBM, VIDEO_FLV, + VIDEO_WMV, AUDIO_BASIC, AUDIO_AIFF, AUDIO_MPEG, @@ -40,13 +43,15 @@ namespace QuickMedia { bool is_video_ext(const char *ext); // Set |width| or |height| to 0 to disable scaling. - // This function is async. - bool video_get_first_frame(const char *filepath, const char *destination_path, int width = 0, int height = 0); + // TODO: Make this async + bool video_get_first_frame(const FileAnalyzer &file, const char *destination_path, int width = 0, int height = 0); class FileAnalyzer { public: FileAnalyzer(); bool load_file(const char *filepath, bool load_file_metadata = true); + + const std::string& get_filepath() const; ContentType get_content_type() const; size_t get_file_size() const; std::optional get_dimensions() const; @@ -55,6 +60,7 @@ namespace QuickMedia { FileAnalyzer(FileAnalyzer&) = delete; FileAnalyzer& operator=(FileAnalyzer&) = delete; private: + std::string filepath; ContentType content_type; size_t file_size; std::optional dimensions; -- cgit v1.2.3