X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=disk_space_estimator.h;h=f02cb9c616f804003818e522ff4aa001eb72ff8c;hb=3795723be95f2fe82f3c8b8b45b1a905b2c811fd;hp=c7f1df5ce058d573175a54a5b014bd13563c68cc;hpb=cfe82eb664cda969e745449dee37bac2e723d609;p=nageru diff --git a/disk_space_estimator.h b/disk_space_estimator.h index c7f1df5..f02cb9c 100644 --- a/disk_space_estimator.h +++ b/disk_space_estimator.h @@ -9,28 +9,24 @@ // // The bitrate is measured over a simple 30-second sliding window. -#include -#include +#include "timebase.h" + #include #include +#include #include +#include -#include "timebase.h" - -class DiskSpaceEstimator -{ +class DiskSpaceEstimator { public: typedef std::function 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. // 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;