timecode: allow specific rounding routines
This commit is contained in:
@@ -47,6 +47,12 @@ public:
|
||||
kMilliseconds
|
||||
};
|
||||
|
||||
enum Rounding {
|
||||
kCeil,
|
||||
kFloor,
|
||||
kRound
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Convert a timestamp (according to a rational timebase) to a user-friendly string representation
|
||||
*/
|
||||
@@ -55,10 +61,10 @@ public:
|
||||
static int64_t timecode_to_timestamp(const QString& timecode, const rational& timebase, const Display& display, bool *ok = nullptr);
|
||||
static rational timecode_to_time(const QString& timecode, const rational& timebase, const Display& display, bool *ok = nullptr);
|
||||
|
||||
static rational snap_time_to_timebase(const rational& time, const rational& timebase, bool floor = false);
|
||||
static rational snap_time_to_timebase(const rational& time, const rational& timebase, Rounding floor = kRound);
|
||||
|
||||
static int64_t time_to_timestamp(const rational& time, const rational& timebase, bool floor = false);
|
||||
static int64_t time_to_timestamp(const double& time, const rational& timebase, bool floor = false);
|
||||
static int64_t time_to_timestamp(const rational& time, const rational& timebase, Rounding floor = kRound);
|
||||
static int64_t time_to_timestamp(const double& time, const rational& timebase, Rounding floor = kRound);
|
||||
|
||||
static int64_t rescale_timestamp(const int64_t& ts, const rational& source, const rational& dest);
|
||||
static int64_t rescale_timestamp_ceil(const int64_t& ts, const rational& source, const rational& dest);
|
||||
|
||||
Reference in New Issue
Block a user