av_data/
params.rs

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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//! Video and audio definitions.

use crate::audiosample::{ChannelMap, Soniton};
use crate::pixel::Formaton;
use std::sync::Arc;

/// Video stream information.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct VideoInfo {
    /// Picture width.
    pub width: usize,
    /// Picture height.
    pub height: usize,
    /// Picture pixel format.
    pub format: Option<Arc<Formaton>>,
}

/// Audio stream information.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct AudioInfo {
    /// Audio sample rate.
    pub rate: usize,
    /// Audio sequence of channels.
    pub map: Option<ChannelMap>,
    /// Audio sample format.
    pub format: Option<Arc<Soniton>>,
}

/// Possible stream information types.
#[derive(Clone, Debug, PartialEq, Eq)]
pub enum MediaKind {
    /// Video codec information.
    Video(VideoInfo),
    /// Audio codec information.
    Audio(AudioInfo),
}

/// Possible codec parameters.
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct CodecParams {
    /// Stream information type.
    pub kind: Option<MediaKind>,
    /// Codec id.
    pub codec_id: Option<String>,
    /// Codec additional data.
    pub extradata: Option<Vec<u8>>,
    /// Codec bit-rate.
    pub bit_rate: usize,
    /// Number of samples the decoder must process
    /// before outputting valid data.
    pub convergence_window: usize,
    /// Number of samples the codec needs to process
    /// before returning data.
    pub delay: usize,
}