Skip to main content

mlt_core/decoder/stream/
analyze.rs

1use crate::decoder::{RawStream, StreamMeta};
2use crate::{Analyze, StatType};
3
4impl Analyze for RawStream<'_> {
5    fn collect_statistic(&self, stat: StatType) -> usize {
6        self.data.collect_statistic(stat)
7    }
8
9    fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta)) {
10        cb(self.meta);
11    }
12}
13
14impl Analyze for StreamMeta {
15    fn collect_statistic(&self, stat: StatType) -> usize {
16        if stat == StatType::DecodedMetaSize {
17            size_of::<Self>()
18        } else {
19            0
20        }
21    }
22}