]> git.sesse.net Git - nageru/blobdiff - disk_space_estimator.h
Allow symlinked frame files. Useful for testing.
[nageru] / disk_space_estimator.h
index c7f1df5ce058d573175a54a5b014bd13563c68cc..f02cb9c616f804003818e522ff4aa001eb72ff8c 100644 (file)
@@ -9,28 +9,24 @@
 //
 // The bitrate is measured over a simple 30-second sliding window.
 
-#include <stdint.h>
-#include <sys/types.h>
+#include "timebase.h"
+
 #include <deque>
 #include <functional>
+#include <stdint.h>
 #include <string>
+#include <sys/types.h>
 
-#include "timebase.h"
-
-class DiskSpaceEstimator
-{
+class DiskSpaceEstimator {
 public:
        typedef std::function<void(off_t free_bytes, double estimated_seconds_left)> callback_t;
        DiskSpaceEstimator(callback_t callback);
 
-       // Report that a video frame with the given pts has just been written
-       // to the given file, so the estimator should stat the file and see
-       // by big it is. (The file is assumed to hold only that single frame,
-       // unlike in Nageru, where it is a growing file.)
+       // Report that a video frame with the given pts and size has just been
+       // written (possibly appended) to the given file.
        //
-       // If the filename changed since last time, the estimation is reset.
        // <pts> is taken to be in TIMEBASE units (see timebase.h).
-       void report_write(const std::string &filename, uint64_t pts);
+       void report_write(const std::string &filename, size_t bytes, uint64_t pts);
 
 private:
        static constexpr int64_t window_length = 30 * TIMEBASE;