From b15fb338de55df177948a7fdf9704efa4374816b Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 30 Sep 2023 18:15:16 +0200 Subject: refactor common crate --- common/src/seek_index.rs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 common/src/seek_index.rs (limited to 'common/src/seek_index.rs') diff --git a/common/src/seek_index.rs b/common/src/seek_index.rs new file mode 100644 index 0000000..98afcca --- /dev/null +++ b/common/src/seek_index.rs @@ -0,0 +1,32 @@ +/* + This file is part of jellything (https://codeberg.org/metamuffin/jellything) + which is licensed under the GNU Affero General Public License (version 3); see /COPYING. + Copyright (C) 2023 metamuffin +*/ +use bincode::{Decode, Encode}; + +pub const SEEK_INDEX_VERSION: u32 = 0x5eef1de4; + +#[derive(Debug, Clone, Decode, Encode)] +pub struct SeekIndex { + pub version: u32, + pub blocks: Vec, + pub keyframes: Vec, +} + +#[derive(Debug, Clone, Decode, Encode)] +pub struct BlockIndex { + pub pts: u64, + pub source_off: usize, + pub size: usize, +} + +impl Default for SeekIndex { + fn default() -> Self { + Self { + version: SEEK_INDEX_VERSION, + blocks: Vec::new(), + keyframes: Vec::new(), + } + } +} -- cgit v1.2.3-70-g09d2