Skip to main content

oa/video/
type.gen.rs

1// @generated by tool/gen/fn/generate.py; DO NOT EDIT.
2// schema=video_types.json schema_version=1 generator_version=64
3// schema_sha256=08b9cef957568d4bba3d28a87870d8634b4810721ae15be9f8b580aeb27ee4f9
4use super::{
5	Av1ChromaSamplePosition, Av1ColorDescription, VideoChromaSubsampling, VideoCodec,
6	VideoColorMatrix, VideoColorRange, VideoComponentBitDepth, VideoContainerKind, VideoDecodeLevel,
7	VideoDecodeProfile, VideoEncodeCodecCapabilities, VideoEncodeProfile, VideoExtent,
8	VideoRateControl, VideoTimeBase,
9};
10use crate::audio::AudioEncodeProfile;
11#[derive(Clone, Copy, Debug, PartialEq, Eq)]
12pub struct Av1TimingInfo {
13	pub num_units_in_display_tick: u32,
14	pub time_scale: u32,
15	pub equal_picture_interval: bool,
16	pub num_ticks_per_picture_minus_1: Option<u32>,
17}
18
19#[derive(Clone, Copy, Debug, PartialEq, Eq)]
20pub struct Av1ColorConfig {
21	pub bit_depth: VideoComponentBitDepth,
22	pub monochrome: bool,
23	pub color_description: Option<Av1ColorDescription>,
24	pub full_range: bool,
25	pub chroma_subsampling: VideoChromaSubsampling,
26	pub chroma_sample_position: Av1ChromaSamplePosition,
27	pub separate_uv_delta_q: bool,
28}
29
30#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
31pub struct Av1AccessUnitInfo {
32	pub sequence_headers: u32,
33	pub frames: u32,
34	pub frame_headers: u32,
35	pub tile_groups: u32,
36	pub ivf_timestamp: Option<u64>,
37}
38
39#[derive(Clone, Copy, Debug, PartialEq, Eq)]
40pub struct VideoDecodeCapabilities {
41	pub(crate) profile: VideoDecodeProfile,
42	pub(crate) min_coded_extent: VideoExtent,
43	pub(crate) max_coded_extent: VideoExtent,
44	pub(crate) picture_access_granularity: VideoExtent,
45	pub(crate) min_bitstream_offset_alignment: u64,
46	pub(crate) min_bitstream_size_alignment: u64,
47	pub(crate) max_dpb_slots: u32,
48	pub(crate) max_active_reference_pictures: u32,
49	pub(crate) level: VideoDecodeLevel,
50	pub(crate) field_offset_granularity: Option<(i32, i32)>,
51	pub(crate) dpb_and_output_coincide: bool,
52	pub(crate) dpb_and_output_distinct: bool,
53	pub(crate) protected_content: bool,
54	pub(crate) separate_reference_images: bool,
55}
56
57#[derive(Clone, Copy, Debug, PartialEq, Eq)]
58pub struct VideoEncodeCapabilities {
59	pub(crate) profile: VideoEncodeProfile,
60	pub(crate) min_coded_extent: VideoExtent,
61	pub(crate) max_coded_extent: VideoExtent,
62	pub(crate) picture_access_granularity: VideoExtent,
63	pub(crate) input_picture_granularity: VideoExtent,
64	pub(crate) min_bitstream_offset_alignment: u64,
65	pub(crate) min_bitstream_size_alignment: u64,
66	pub(crate) max_dpb_slots: u32,
67	pub(crate) max_active_reference_pictures: u32,
68	pub(crate) max_rate_control_layers: u32,
69	pub(crate) max_bitrate: u64,
70	pub(crate) max_quality_levels: u32,
71	pub(crate) constant_qp: bool,
72	pub(crate) cbr: bool,
73	pub(crate) vbr: bool,
74	pub(crate) feedback_offset: bool,
75	pub(crate) feedback_bytes_written: bool,
76	pub(crate) feedback_overrides: bool,
77	pub(crate) protected_content: bool,
78	pub(crate) separate_reference_images: bool,
79	pub(crate) codec: VideoEncodeCodecCapabilities,
80}
81
82#[derive(Clone, Copy, Debug, PartialEq, Eq)]
83pub struct VideoDeviceCapabilities {
84	pub(crate) decode_queue_family: Option<u32>,
85	pub(crate) encode_queue_family: Option<u32>,
86	pub(crate) decode_result_status_queries: bool,
87	pub(crate) encode_result_status_queries: bool,
88	pub(crate) h264_decode: bool,
89	pub(crate) h265_decode: bool,
90	pub(crate) av1_decode: bool,
91	pub(crate) vp9_decode: bool,
92	pub(crate) h264_encode: bool,
93	pub(crate) h265_encode: bool,
94	pub(crate) av1_encode: bool,
95	pub(crate) video_queues_enabled: bool,
96	pub(crate) decoder_sessions_available: bool,
97	pub(crate) encoder_sessions_available: bool,
98}
99
100#[derive(Clone, Copy, Debug, PartialEq, Eq)]
101pub struct VideoContainerInfo {
102	pub(super) kind: VideoContainerKind,
103	pub(super) codec: VideoCodec,
104	pub(super) width: u32,
105	pub(super) height: u32,
106	pub(super) time_base: VideoTimeBase,
107	pub(super) duration: u64,
108	pub(super) sample_count: u32,
109	pub(super) track_id: u32,
110	pub(super) track_count: u32,
111	pub(super) decode_profile: Option<VideoDecodeProfile>,
112}
113
114#[derive(Clone, Copy, Debug, PartialEq, Eq)]
115pub struct H264TimingInfo {
116	pub num_units_in_tick: u32,
117	pub time_scale: u32,
118	pub fixed_frame_rate: bool,
119}
120
121#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
122pub struct H265TimingInfo {
123	pub num_units_in_tick: u32,
124	pub time_scale: u32,
125	pub num_ticks_poc_diff_one_minus_1: Option<u32>,
126}
127
128#[derive(Clone, Copy, Debug, PartialEq, Eq)]
129pub struct VideoColorInfo {
130	pub(super) matrix: VideoColorMatrix,
131	pub(super) range: VideoColorRange,
132}
133
134#[derive(Clone, Copy, Debug, PartialEq, Eq)]
135pub struct VideoMuxerAudioConfig {
136	/// Audio sample rate in hertz.
137	pub sample_rate: u32,
138	/// Number of interleaved channels.
139	pub channel_count: u32,
140	/// Encoder-delay frames omitted from presentation through an edit list.
141	pub priming_frames: u32,
142}
143
144#[derive(Clone, Copy, Debug, PartialEq, Eq)]
145pub struct VideoMuxerConfig {
146	/// Elementary video codec. Only H.264 and H.265 are admitted.
147	pub codec: VideoCodec,
148	/// Coded width in pixels.
149	pub width: u32,
150	/// Coded height in pixels.
151	pub height: u32,
152	/// Nominal frame rate used for the final sample duration.
153	pub frame_rate: u32,
154	/// MP4 video-track time base. Its numerator must currently be one.
155	pub time_base: VideoTimeBase,
156	/// Optional native PCM-S16 audio track.
157	pub audio: Option<VideoMuxerAudioConfig>,
158}
159
160#[derive(Clone, Copy, Debug, PartialEq)]
161pub struct VideoPlayerConfig {
162	/// Restart at the beginning after the final display-order frame.
163	pub loop_playback: bool,
164	/// Override the container average frame rate when pacing [`VideoPlayer::tick`](crate::video::VideoPlayer::tick).
165	pub frame_rate_override: Option<f64>,
166	/// Begin in the playing state. Manual [`VideoPlayer::advance`](crate::video::VideoPlayer::advance) calls ignore this.
167	pub start_playing: bool,
168	/// Maximum display-order frames retained for exact backward/forward stepping.
169	pub presentation_cache_frames: usize,
170	/// Maximum retained pixel-storage bytes across presentation history. GPU textures charge both packed RGBA and sampled image payloads; native decoder slots are never cached.
171	pub presentation_cache_bytes: usize,
172}
173
174#[derive(Clone, Copy, Debug, PartialEq, Eq)]
175pub struct VideoEncodeConfig {
176	pub profile: VideoEncodeProfile,
177	pub width: u32,
178	pub height: u32,
179	pub frame_rate: u32,
180	pub gop_size: u32,
181	pub rate_control: VideoRateControl,
182	pub bitrate: u32,
183	pub max_bitrate: u32,
184	pub constant_qp: u32,
185	pub quality_level: u32,
186	pub async_depth: u32,
187	pub max_b_frames: u32,
188	/// Requested DPB ring depth. `0` selects the donor's two-slot ping-pong.
189	pub max_dpb_slots: u32,
190}
191
192#[derive(Clone, Debug)]
193pub struct VideoRecorderConfig {
194	/// Container output path.
195	pub output_path: String,
196	/// Hardware encode profile: codec, extent, rate control, and GOP cadence.
197	pub encode: VideoEncodeConfig,
198	/// Input RGBA→NV12 conversion matrix. `Unspecified` selects BT.709.
199	pub color_space: VideoColorMatrix,
200	/// Use full (PC) component range instead of limited (TV) range.
201	pub full_range: bool,
202	/// Optional interleaved F32 audio track encoded to PCM-S16.
203	pub audio: Option<AudioEncodeProfile>,
204}