aboutsummaryrefslogtreecommitdiff
path: root/include/FileAnalyzer.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-16 21:54:47 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-17 19:18:34 +0100
commitd4cd63129ae5dff8fd69525424e0f8cb9ae1a905 (patch)
tree957c957f0ca1796105318b7595545dcfc7e04af7 /include/FileAnalyzer.hpp
parent5061e1ad912bccf89df25258e7dd8b386b0a7239 (diff)
Wip: fix video duration not working for some analyzed files, get frame in middle of video instead of first frame for thumbnail
Diffstat (limited to 'include/FileAnalyzer.hpp')
-rw-r--r--include/FileAnalyzer.hpp10
1 files changed, 8 insertions, 2 deletions
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 <string>
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<Dimensions> 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> dimensions;