aboutsummaryrefslogtreecommitdiffstats
path: root/nihav-core/src
diff options
context:
space:
mode:
authorKostya Shishkov <kostya.shishkov@gmail.com>2019-11-12 18:47:43 +0100
committerKostya Shishkov <kostya.shishkov@gmail.com>2019-11-12 18:47:43 +0100
commitf18bba90acb625ff6bdabc9a2ad7c68bd40e3313 (patch)
tree4d19e96b3dbaad3f3edaa2d67599ba7cedcf1f44 /nihav-core/src
parent6e24ec0bcf9d521c66551eebd198400c5342b0be (diff)
downloadnihav-f18bba90acb625ff6bdabc9a2ad7c68bd40e3313.tar.gz
frame: add ID field
Diffstat (limited to 'nihav-core/src')
-rw-r--r--nihav-core/src/frame.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/nihav-core/src/frame.rs b/nihav-core/src/frame.rs
index ae6d92f..091ba99 100644
--- a/nihav-core/src/frame.rs
+++ b/nihav-core/src/frame.rs
@@ -669,6 +669,7 @@ impl NATimeInfo {
#[derive(Clone)]
pub struct NAFrame {
ts: NATimeInfo,
+ id: i64,
buffer: NABufferType,
info: NACodecInfoRef,
ftype: FrameType,
@@ -694,7 +695,7 @@ impl NAFrame {
info: NACodecInfoRef,
options: HashMap<String, NAValue>,
buffer: NABufferType) -> Self {
- NAFrame { ts, buffer, info, ftype, key: keyframe, options }
+ NAFrame { ts, id: 0, buffer, info, ftype, key: keyframe, options }
}
pub fn get_info(&self) -> NACodecInfoRef { self.info.clone() }
pub fn get_frame_type(&self) -> FrameType { self.ftype }
@@ -704,9 +705,11 @@ impl NAFrame {
pub fn get_time_information(&self) -> NATimeInfo { self.ts }
pub fn get_pts(&self) -> Option<u64> { self.ts.get_pts() }
pub fn get_dts(&self) -> Option<u64> { self.ts.get_dts() }
+ pub fn get_id(&self) -> i64 { self.id }
pub fn get_duration(&self) -> Option<u64> { self.ts.get_duration() }
pub fn set_pts(&mut self, pts: Option<u64>) { self.ts.set_pts(pts); }
pub fn set_dts(&mut self, dts: Option<u64>) { self.ts.set_dts(dts); }
+ pub fn set_id(&mut self, id: i64) { self.id = id; }
pub fn set_duration(&mut self, dur: Option<u64>) { self.ts.set_duration(dur); }
pub fn get_buffer(&self) -> NABufferType { self.buffer.clone() }