From 814896238c9b3928709f27606816ab6de60abdf3 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Wed, 25 Jan 2023 07:42:27 +0100 Subject: generate seek index --- common/Cargo.toml | 1 + common/src/lib.rs | 18 +++++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) (limited to 'common') diff --git a/common/Cargo.toml b/common/Cargo.toml index de089d6..0557282 100644 --- a/common/Cargo.toml +++ b/common/Cargo.toml @@ -5,3 +5,4 @@ edition = "2021" [dependencies] serde = { version = "1.0.152", features = ["derive"] } +bincode = { version = "2.0.0-rc.2", features = ["derive"] } diff --git a/common/src/lib.rs b/common/src/lib.rs index 0587613..08517c3 100644 --- a/common/src/lib.rs +++ b/common/src/lib.rs @@ -1,7 +1,11 @@ pub mod r#impl; +use bincode::{Decode, Encode}; use serde::{Deserialize, Serialize}; -use std::{collections::BTreeMap, path::PathBuf}; +use std::{ + collections::{BTreeMap, HashMap}, + path::PathBuf, +}; #[derive(Debug, Clone, Deserialize, Serialize)] pub struct DirectoryInfo { @@ -45,3 +49,15 @@ pub enum SourceTrackKind { }, Subtitles, } + +#[derive(Debug, Clone, Decode, Encode)] +pub struct SeekIndex { + pub blocks: Vec, +} + +#[derive(Debug, Clone, Decode, Encode)] +pub struct BlockIndex { + pub pts: u64, + pub source_off: usize, + pub size: usize, +} -- cgit v1.2.3-70-g09d2