Skip to main content

media_pp/elements/
video_format.rs

1use ffmpeg_next as ffmpeg;
2
3/// A complete uncompressed-video geometry/timing description.
4///
5/// Unlike a `(width, height, time_base)` tuple, this can be passed directly
6/// from a capture source such as `DxgiCaptureSource` to a
7/// downstream [`crate::elements::SwScaler`]/[`crate::elements::SwEncoder`]/
8/// [`crate::elements::FileMuxer`] without the caller re-threading three
9/// separate values by hand — same role [`crate::elements::AudioFormat`]
10/// plays for uncompressed audio. Kept directly under `elements` rather than
11/// under any one of those (same reasoning as [`crate::elements::RtspTransport`]'s
12/// own placement): it crosses source/filter/sink, not owned by any single one.
13#[derive(Debug, Clone, Copy, PartialEq, Eq)]
14pub struct VideoFormat {
15    /// Frame width in pixels.
16    pub width: u32,
17    /// Frame height in pixels.
18    pub height: u32,
19    /// Unit used by frame presentation timestamps.
20    pub time_base: ffmpeg::Rational,
21}