From 3867d436b51515207e0035e2c6cb127de3935c57 Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 4 Nov 2022 18:25:46 +0100 Subject: [PATCH] core: introduce NAStream::make_ts() --- nihav-core/src/frame.rs | 4 ++++ 1 file changed, 4 insertions(+) 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, dts: Option, duration: Option) -> 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) } } -- 2.39.5