]> git.sesse.net Git - nageru/blobdiff - db.h
Allow symlinked frame files. Useful for testing.
[nageru] / db.h
diff --git a/db.h b/db.h
index 13a7e510535fc0cdb2421cc7ce011d5ef982fe73..88196c7526407e1df24e80d5f6b4c4bd4122d74a 100644 (file)
--- a/db.h
+++ b/db.h
@@ -4,15 +4,26 @@
 #include "state.pb.h"
 
 #include <sqlite3.h>
+#include <string>
+#include <vector>
+
+#include "frame_on_disk.h"
 
 class DB {
 public:
-       explicit DB(const char *filename);
+       explicit DB(const std::string &filename);
        DB(const DB &) = delete;
 
        StateProto get_state();
        void store_state(const StateProto &state);
 
+       struct FrameOnDiskAndStreamIdx {
+               FrameOnDisk frame;
+               unsigned stream_idx;
+       };
+       std::vector<FrameOnDiskAndStreamIdx> load_frame_file(const std::string &filename, size_t size, unsigned frame_idx);  // Empty = none found, or there were no frames.
+       void store_frame_file(const std::string &filename, size_t size, const std::vector<FrameOnDiskAndStreamIdx> &frames);
+
 private:
        StateProto state;
        sqlite3 *db;