aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2022-11-04 18:25:46 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2022-11-04 18:25:46 +0100
commit3867d436b51515207e0035e2c6cb127de3935c57 (patch)
tree0304d899ba7f43d5afe7eee87861b4c9e69fa12a
parentaa5efa8a68f625b21180a53c17c2cfaa79eb3500 (diff)
downloadnihav-3867d436b51515207e0035e2c6cb127de3935c57.tar.gz
core: introduce NAStream::make_ts()
-rw-r--r--nihav-core/src/frame.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs
index fbdbdf5..c93a921 100644
--- a/nihav-core/src/frame.rs
+++ b/nihav-core/src/frame.rs
@@ -1345,6 +1345,10 @@ impl NAStream {
}
/// Returns stream duration.
pub fn get_duration(&self) -> u64 { self.duration }
+ /// Constructs a new timestamp.
+ pub fn make_ts(&self, pts: Option<u64>, dts: Option<u64>, duration: Option<u64>) -> NATimeInfo {
+ NATimeInfo::new(pts, dts, duration, self.tb_num, self.tb_den)
+ }
/// Converts current instance into a reference-counted one.
pub fn into_ref(self) -> NAStreamRef { Arc::new(self) }
}