blob: e47e3d741863be7eef02db73f51f8aa7910e7181 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
/*
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) 2025 metamuffin <metamuffin.org>
*/
pub mod matroska;
use anyhow::Result;
use std::io::{Read, Seek};
use winter_matroska::{Attachments, Chapters, Cluster, Cues, Info, Tags, Tracks};
pub trait ReadSeek: Read + Seek {}
impl<T: Read + Seek> ReadSeek for T {}
pub trait DemuxerNew: Demuxer + Sized {
fn new(reader: Box<dyn ReadSeek>) -> Self;
}
pub trait Demuxer {
fn info(&mut self) -> Result<Info>;
fn tracks(&mut self) -> Result<Tracks>;
fn chapters(&mut self) -> Result<Chapters>;
fn attachments(&mut self) -> Result<Attachments>;
fn tags(&mut self) -> Result<Tags>;
fn cues(&mut self) -> Result<Cues>;
fn seek_cluster(&mut self, position: Option<u64>) -> Result<()>;
fn read_cluster(&mut self) -> Result<Option<(u64, Cluster)>>;
}
|