Skip to main content

ff_sys/
docsrs_stubs.rs

1// Shape-compatible stubs used by docs.rs builds (DOCS_RS=1).
2//
3// These definitions mirror the real bindgen-generated FFmpeg bindings in type
4// and name, but contain no actual FFmpeg code.  All functions are no-op stubs
5// that never run; they exist only to make the dependent crates compile so that
6// rustdoc can render their public APIs.
7//
8// Maintenance note: add entries here whenever a new ff_sys symbol is referenced
9// in ff-probe, ff-decode, or ff-encode.  The values of integer constants are
10// taken from the FFmpeg 7.x headers for reference accuracy, but correctness at
11// runtime is irrelevant — docs.rs never executes this code.
12
13use std::os::raw::{c_char, c_int, c_uint, c_void};
14use std::ptr;
15
16// Type aliases
17
18pub type AVCodecID = c_uint;
19pub type AVPixelFormat = c_int;
20pub type AVSampleFormat = c_int;
21pub type AVMediaType = c_int;
22pub type AVColorPrimaries = c_uint;
23pub type AVColorRange = c_uint;
24pub type AVColorSpace = c_uint;
25pub type AVHWDeviceType = c_int;
26pub type AVChannelOrder = c_uint;
27pub type AVPictureType = c_int;
28
29// Opaque types (only ever used behind raw pointers)
30
31pub struct AVDictionary(());
32pub struct SwsContext(());
33pub struct SwrContext(());
34pub struct AVBufferRef(());
35pub struct AVIOContext(());
36pub struct AVOutputFormat {
37    pub flags: c_int,
38}
39pub struct AVAudioFifo(());
40
41pub struct AVInputFormat {
42    pub name: *const c_char,
43    pub long_name: *const c_char,
44    pub flags: c_int,
45}
46
47// Structs with field-level access
48
49#[derive(Copy, Clone)]
50#[repr(C)]
51pub union AVChannelLayout__bindgen_ty_1 {
52    pub mask: u64,
53}
54
55impl Default for AVChannelLayout__bindgen_ty_1 {
56    fn default() -> Self {
57        Self { mask: 0 }
58    }
59}
60
61#[derive(Copy, Clone)]
62pub struct AVChannelLayout {
63    pub order: AVChannelOrder,
64    pub nb_channels: c_int,
65    pub u: AVChannelLayout__bindgen_ty_1,
66}
67
68impl Default for AVChannelLayout {
69    fn default() -> Self {
70        Self {
71            order: 0,
72            nb_channels: 0,
73            u: AVChannelLayout__bindgen_ty_1::default(),
74        }
75    }
76}
77
78#[derive(Copy, Clone)]
79pub struct AVRational {
80    pub num: c_int,
81    pub den: c_int,
82}
83
84pub struct AVDictionaryEntry {
85    pub key: *mut c_char,
86    pub value: *mut c_char,
87}
88
89pub struct AVChapter {
90    pub id: i64,
91    pub time_base: AVRational,
92    pub start: i64,
93    pub end: i64,
94    pub metadata: *mut AVDictionary,
95}
96
97pub struct AVCodecParameters {
98    pub codec_type: AVMediaType,
99    pub codec_id: AVCodecID,
100    pub codec_tag: c_uint,
101    pub extradata: *mut u8,
102    pub extradata_size: c_int,
103    pub format: c_int,
104    pub bit_rate: i64,
105    pub width: c_int,
106    pub height: c_int,
107    pub sample_rate: c_int,
108    pub ch_layout: AVChannelLayout,
109    pub sample_fmt: AVSampleFormat,
110    pub color_space: AVColorSpace,
111    pub color_range: AVColorRange,
112    pub color_primaries: AVColorPrimaries,
113}
114
115pub struct AVBSFContext {
116    pub par_in: *mut AVCodecParameters,
117    pub par_out: *mut AVCodecParameters,
118    pub time_base_in: AVRational,
119    pub time_base_out: AVRational,
120}
121
122pub struct AVStream {
123    pub index: c_int,
124    pub codecpar: *mut AVCodecParameters,
125    pub nb_frames: i64,
126    pub duration: i64,
127    pub time_base: AVRational,
128    pub avg_frame_rate: AVRational,
129    pub r_frame_rate: AVRational,
130    pub start_time: i64,
131    pub disposition: c_int,
132    pub metadata: *mut AVDictionary,
133}
134
135pub struct AVFormatContext {
136    pub nb_streams: c_uint,
137    pub streams: *mut *mut AVStream,
138    pub duration: i64,
139    pub metadata: *mut AVDictionary,
140    pub nb_chapters: c_uint,
141    pub chapters: *mut *mut AVChapter,
142    pub iformat: *mut AVInputFormat,
143    pub oformat: *const AVOutputFormat,
144    pub bit_rate: i64,
145    pub pb: *mut AVIOContext,
146    pub priv_data: *mut c_void,
147}
148
149pub struct AVFrame {
150    pub data: [*mut u8; 8],
151    pub linesize: [c_int; 8],
152    pub width: c_int,
153    pub height: c_int,
154    pub nb_samples: c_int,
155    pub format: c_int,
156    pub key_frame: c_int,
157    pub pict_type: AVPictureType,
158    pub pts: i64,
159    pub pkt_dts: i64,
160    pub sample_rate: c_int,
161    pub ch_layout: AVChannelLayout,
162    pub duration: i64,
163    pub time_base: AVRational,
164    pub hw_frames_ctx: *mut AVBufferRef,
165    pub metadata: *mut AVDictionary,
166}
167
168pub struct AVPacket {
169    pub pts: i64,
170    pub dts: i64,
171    pub data: *mut u8,
172    pub size: c_int,
173    pub stream_index: c_int,
174    pub flags: c_int,
175    pub duration: i64,
176}
177
178pub type AVColorTransferCharacteristic = c_uint;
179
180pub struct AVCodecContext {
181    pub codec_id: AVCodecID,
182    pub bit_rate: i64,
183    pub width: c_int,
184    pub height: c_int,
185    pub pix_fmt: AVPixelFormat,
186    pub sample_rate: c_int,
187    pub ch_layout: AVChannelLayout,
188    pub sample_fmt: AVSampleFormat,
189    pub time_base: AVRational,
190    pub framerate: AVRational,
191    pub gop_size: c_int,
192    pub max_b_frames: c_int,
193    pub qmin: c_int,
194    pub qmax: c_int,
195    pub thread_count: c_int,
196    pub hw_device_ctx: *mut AVBufferRef,
197    pub hw_frames_ctx: *mut AVBufferRef,
198    pub priv_data: *mut c_void,
199    pub color_primaries: AVColorPrimaries,
200    pub color_trc: AVColorTransferCharacteristic,
201    pub colorspace: AVColorSpace,
202    // Fields added for v0.7.0 feature coverage
203    pub frame_size: c_int,
204    pub color_range: AVColorRange,
205    pub refs: c_int,
206    pub rc_max_rate: i64,
207    pub rc_buffer_size: c_int,
208    pub flags: c_int,
209    pub stats_out: *mut c_char,
210    pub stats_in: *mut c_char,
211}
212
213pub struct AVCodec {
214    pub id: AVCodecID,
215    pub sample_fmts: *const AVSampleFormat,
216    pub capabilities: c_int,
217}
218
219// Constants
220
221pub const AV_DICT_IGNORE_SUFFIX: u32 = 2;
222pub const AV_NUM_DATA_POINTERS: usize = 8;
223pub const AV_TIME_BASE: u32 = 1_000_000;
224
225pub const AVMediaType_AVMEDIA_TYPE_VIDEO: AVMediaType = 0;
226pub const AVMediaType_AVMEDIA_TYPE_AUDIO: AVMediaType = 1;
227pub const AVMediaType_AVMEDIA_TYPE_SUBTITLE: AVMediaType = 3;
228pub const AVMediaType_AVMEDIA_TYPE_ATTACHMENT: AVMediaType = 4;
229
230pub const AV_DISPOSITION_FORCED: u32 = 0x0040;
231pub const AV_DISPOSITION_ATTACHED_PIC: u32 = 0x0400;
232pub const AV_INPUT_BUFFER_PADDING_SIZE: u32 = 64;
233
234pub const AVChannelOrder_AV_CHANNEL_ORDER_UNSPEC: AVChannelOrder = 0;
235pub const AVChannelOrder_AV_CHANNEL_ORDER_NATIVE: AVChannelOrder = 1;
236
237// AVCodecID — video
238pub const AVCodecID_AV_CODEC_ID_NONE: AVCodecID = 0;
239pub const AVCodecID_AV_CODEC_ID_MPEG2VIDEO: AVCodecID = 2;
240pub const AVCodecID_AV_CODEC_ID_MJPEG: AVCodecID = 7;
241pub const AVCodecID_AV_CODEC_ID_MPEG4: AVCodecID = 13;
242pub const AVCodecID_AV_CODEC_ID_H264: AVCodecID = 27;
243pub const AVCodecID_AV_CODEC_ID_THEORA: AVCodecID = 30;
244pub const AVCodecID_AV_CODEC_ID_VP8: AVCodecID = 139;
245pub const AVCodecID_AV_CODEC_ID_PRORES: AVCodecID = 147;
246pub const AVCodecID_AV_CODEC_ID_VP9: AVCodecID = 167;
247pub const AVCodecID_AV_CODEC_ID_HEVC: AVCodecID = 173;
248pub const AVCodecID_AV_CODEC_ID_AV1: AVCodecID = 226;
249pub const AVCodecID_AV_CODEC_ID_DNXHD: AVCodecID = 99;
250pub const AVCodecID_AV_CODEC_ID_FFV1: AVCodecID = 33;
251
252// AVCodecID — image (still image)
253pub const AVCodecID_AV_CODEC_ID_PNG: AVCodecID = 61;
254pub const AVCodecID_AV_CODEC_ID_BMP: AVCodecID = 76;
255pub const AVCodecID_AV_CODEC_ID_TIFF: AVCodecID = 90;
256pub const AVCodecID_AV_CODEC_ID_WEBP: AVCodecID = 219;
257pub const AVCodecID_AV_CODEC_ID_EXR: AVCodecID = 178;
258
259// AVCodecID — animation
260pub const AVCodecID_AV_CODEC_ID_GIF: AVCodecID = 97;
261
262// AVCodecID — subtitle
263pub const AVCodecID_AV_CODEC_ID_DVB_SUBTITLE: AVCodecID = 94209;
264pub const AVCodecID_AV_CODEC_ID_SSA: AVCodecID = 94212;
265pub const AVCodecID_AV_CODEC_ID_HDMV_PGS_SUBTITLE: AVCodecID = 94214;
266pub const AVCodecID_AV_CODEC_ID_SRT: AVCodecID = 94216;
267pub const AVCodecID_AV_CODEC_ID_SUBRIP: AVCodecID = 94248;
268pub const AVCodecID_AV_CODEC_ID_WEBVTT: AVCodecID = 94249;
269pub const AVCodecID_AV_CODEC_ID_ASS: AVCodecID = 94253;
270
271// AVCodecID — attachment / data
272pub const AVCodecID_AV_CODEC_ID_BIN_DATA: AVCodecID = 98314;
273
274// AVCodecID — audio
275pub const AVCodecID_AV_CODEC_ID_PCM_S16LE: AVCodecID = 65536;
276pub const AVCodecID_AV_CODEC_ID_PCM_S16BE: AVCodecID = 65537;
277pub const AVCodecID_AV_CODEC_ID_PCM_U8: AVCodecID = 65542;
278pub const AVCodecID_AV_CODEC_ID_PCM_S24LE: AVCodecID = 65544;
279pub const AVCodecID_AV_CODEC_ID_PCM_S24BE: AVCodecID = 65545;
280pub const AVCodecID_AV_CODEC_ID_PCM_S32LE: AVCodecID = 65556;
281pub const AVCodecID_AV_CODEC_ID_PCM_S32BE: AVCodecID = 65557;
282pub const AVCodecID_AV_CODEC_ID_PCM_F32LE: AVCodecID = 65558;
283pub const AVCodecID_AV_CODEC_ID_PCM_F32BE: AVCodecID = 65559;
284pub const AVCodecID_AV_CODEC_ID_PCM_F64LE: AVCodecID = 65560;
285pub const AVCodecID_AV_CODEC_ID_PCM_F64BE: AVCodecID = 65561;
286pub const AVCodecID_AV_CODEC_ID_MP3: AVCodecID = 86017;
287pub const AVCodecID_AV_CODEC_ID_AAC: AVCodecID = 86018;
288pub const AVCodecID_AV_CODEC_ID_AC3: AVCodecID = 86019;
289pub const AVCodecID_AV_CODEC_ID_DTS: AVCodecID = 86020;
290pub const AVCodecID_AV_CODEC_ID_VORBIS: AVCodecID = 86021;
291pub const AVCodecID_AV_CODEC_ID_FLAC: AVCodecID = 86028;
292pub const AVCodecID_AV_CODEC_ID_ALAC: AVCodecID = 86032;
293pub const AVCodecID_AV_CODEC_ID_WMAV2: AVCodecID = 86047;
294pub const AVCodecID_AV_CODEC_ID_EAC3: AVCodecID = 86056;
295pub const AVCodecID_AV_CODEC_ID_OPUS: AVCodecID = 86076;
296
297// AVPixelFormat
298pub const AVPixelFormat_AV_PIX_FMT_NONE: AVPixelFormat = -1;
299pub const AVPixelFormat_AV_PIX_FMT_YUV420P: AVPixelFormat = 0;
300pub const AVPixelFormat_AV_PIX_FMT_RGB24: AVPixelFormat = 2;
301pub const AVPixelFormat_AV_PIX_FMT_BGR24: AVPixelFormat = 3;
302pub const AVPixelFormat_AV_PIX_FMT_YUV422P: AVPixelFormat = 4;
303pub const AVPixelFormat_AV_PIX_FMT_YUV444P: AVPixelFormat = 5;
304pub const AVPixelFormat_AV_PIX_FMT_GRAY8: AVPixelFormat = 8;
305pub const AVPixelFormat_AV_PIX_FMT_PAL8: AVPixelFormat = 77;
306pub const AVPixelFormat_AV_PIX_FMT_NV12: AVPixelFormat = 23;
307pub const AVPixelFormat_AV_PIX_FMT_NV21: AVPixelFormat = 24;
308pub const AVPixelFormat_AV_PIX_FMT_RGBA: AVPixelFormat = 26;
309pub const AVPixelFormat_AV_PIX_FMT_BGRA: AVPixelFormat = 28;
310pub const AVPixelFormat_AV_PIX_FMT_YUVJ420P: AVPixelFormat = 12;
311pub const AVPixelFormat_AV_PIX_FMT_YUVJ422P: AVPixelFormat = 13;
312pub const AVPixelFormat_AV_PIX_FMT_YUVJ444P: AVPixelFormat = 14;
313pub const AVPixelFormat_AV_PIX_FMT_VAAPI: AVPixelFormat = 51;
314pub const AVPixelFormat_AV_PIX_FMT_DXVA2_VLD: AVPixelFormat = 53;
315pub const AV_OPT_SEARCH_CHILDREN: u32 = 1;
316pub const AVPixelFormat_AV_PIX_FMT_YUV420P10LE: AVPixelFormat = 66;
317pub const AVPixelFormat_AV_PIX_FMT_YUV422P10LE: AVPixelFormat = 64;
318pub const AVPixelFormat_AV_PIX_FMT_YUV444P10LE: AVPixelFormat = 68;
319pub const AVPixelFormat_AV_PIX_FMT_YUVA444P10LE: AVPixelFormat = 91;
320pub const AVPixelFormat_AV_PIX_FMT_VDPAU: AVPixelFormat = 101;
321pub const AVPixelFormat_AV_PIX_FMT_CUDA: AVPixelFormat = 119;
322pub const AVPixelFormat_AV_PIX_FMT_QSV: AVPixelFormat = 123;
323pub const AVPixelFormat_AV_PIX_FMT_VIDEOTOOLBOX: AVPixelFormat = 135;
324pub const AVPixelFormat_AV_PIX_FMT_MEDIACODEC: AVPixelFormat = 165;
325pub const AVPixelFormat_AV_PIX_FMT_P010LE: AVPixelFormat = 161;
326pub const AVPixelFormat_AV_PIX_FMT_GBRPF32LE: AVPixelFormat = 175;
327pub const AVPixelFormat_AV_PIX_FMT_D3D11: AVPixelFormat = 174;
328pub const AVPixelFormat_AV_PIX_FMT_OPENCL: AVPixelFormat = 180;
329pub const AVPixelFormat_AV_PIX_FMT_VULKAN: AVPixelFormat = 193;
330
331// AVSampleFormat
332pub const AVSampleFormat_AV_SAMPLE_FMT_NONE: AVSampleFormat = -1;
333pub const AVSampleFormat_AV_SAMPLE_FMT_U8: AVSampleFormat = 0;
334pub const AVSampleFormat_AV_SAMPLE_FMT_S16: AVSampleFormat = 1;
335pub const AVSampleFormat_AV_SAMPLE_FMT_S32: AVSampleFormat = 2;
336pub const AVSampleFormat_AV_SAMPLE_FMT_FLT: AVSampleFormat = 3;
337pub const AVSampleFormat_AV_SAMPLE_FMT_DBL: AVSampleFormat = 4;
338pub const AVSampleFormat_AV_SAMPLE_FMT_U8P: AVSampleFormat = 5;
339pub const AVSampleFormat_AV_SAMPLE_FMT_S16P: AVSampleFormat = 6;
340pub const AVSampleFormat_AV_SAMPLE_FMT_S32P: AVSampleFormat = 7;
341pub const AVSampleFormat_AV_SAMPLE_FMT_FLTP: AVSampleFormat = 8;
342pub const AVSampleFormat_AV_SAMPLE_FMT_DBLP: AVSampleFormat = 9;
343pub const AVSampleFormat_AV_SAMPLE_FMT_S64: AVSampleFormat = 10;
344pub const AVSampleFormat_AV_SAMPLE_FMT_S64P: AVSampleFormat = 11;
345
346// AVColorPrimaries
347pub const AVColorPrimaries_AVCOL_PRI_BT709: AVColorPrimaries = 1;
348pub const AVColorPrimaries_AVCOL_PRI_UNSPECIFIED: AVColorPrimaries = 2;
349pub const AVColorPrimaries_AVCOL_PRI_BT470BG: AVColorPrimaries = 5;
350pub const AVColorPrimaries_AVCOL_PRI_SMPTE170M: AVColorPrimaries = 6;
351pub const AVColorPrimaries_AVCOL_PRI_SMPTE240M: AVColorPrimaries = 7;
352pub const AVColorPrimaries_AVCOL_PRI_FILM: AVColorPrimaries = 8;
353pub const AVColorPrimaries_AVCOL_PRI_BT2020: AVColorPrimaries = 9;
354pub const AVColorPrimaries_AVCOL_PRI_SMPTE431: AVColorPrimaries = 11;
355pub const AVColorPrimaries_AVCOL_PRI_SMPTE432: AVColorPrimaries = 12;
356
357// AVColorRange
358pub const AVColorRange_AVCOL_RANGE_UNSPECIFIED: AVColorRange = 0;
359pub const AVColorRange_AVCOL_RANGE_MPEG: AVColorRange = 1;
360pub const AVColorRange_AVCOL_RANGE_JPEG: AVColorRange = 2;
361
362// AVColorSpace
363pub const AVColorSpace_AVCOL_SPC_RGB: AVColorSpace = 0;
364pub const AVColorSpace_AVCOL_SPC_BT709: AVColorSpace = 1;
365pub const AVColorSpace_AVCOL_SPC_UNSPECIFIED: AVColorSpace = 2;
366pub const AVColorSpace_AVCOL_SPC_FCC: AVColorSpace = 4;
367pub const AVColorSpace_AVCOL_SPC_BT470BG: AVColorSpace = 5;
368pub const AVColorSpace_AVCOL_SPC_SMPTE170M: AVColorSpace = 6;
369pub const AVColorSpace_AVCOL_SPC_SMPTE240M: AVColorSpace = 7;
370pub const AVColorSpace_AVCOL_SPC_YCGCO: AVColorSpace = 8;
371pub const AVColorSpace_AVCOL_SPC_BT2020_NCL: AVColorSpace = 9;
372pub const AVColorSpace_AVCOL_SPC_BT2020_CL: AVColorSpace = 10;
373
374// AVColorTransferCharacteristic
375pub const AVColorTransferCharacteristic_AVCOL_TRC_BT709: AVColorTransferCharacteristic = 1;
376pub const AVColorTransferCharacteristic_AVCOL_TRC_UNSPECIFIED: AVColorTransferCharacteristic = 2;
377pub const AVColorTransferCharacteristic_AVCOL_TRC_GAMMA22: AVColorTransferCharacteristic = 4;
378pub const AVColorTransferCharacteristic_AVCOL_TRC_GAMMA28: AVColorTransferCharacteristic = 5;
379pub const AVColorTransferCharacteristic_AVCOL_TRC_SMPTE170M: AVColorTransferCharacteristic = 6;
380pub const AVColorTransferCharacteristic_AVCOL_TRC_SMPTE240M: AVColorTransferCharacteristic = 7;
381pub const AVColorTransferCharacteristic_AVCOL_TRC_LINEAR: AVColorTransferCharacteristic = 8;
382pub const AVColorTransferCharacteristic_AVCOL_TRC_IEC61966_2_1: AVColorTransferCharacteristic = 13;
383pub const AVColorTransferCharacteristic_AVCOL_TRC_BT2020_10: AVColorTransferCharacteristic = 14;
384pub const AVColorTransferCharacteristic_AVCOL_TRC_BT2020_12: AVColorTransferCharacteristic = 15;
385pub const AVColorTransferCharacteristic_AVCOL_TRC_SMPTEST2084: AVColorTransferCharacteristic = 16;
386pub const AVColorTransferCharacteristic_AVCOL_TRC_ARIB_STD_B67: AVColorTransferCharacteristic = 18;
387
388// AVPacketSideDataType
389pub type AVPacketSideDataType = c_uint;
390pub const AVPacketSideDataType_AV_PKT_DATA_MASTERING_DISPLAY_METADATA: AVPacketSideDataType = 20;
391pub const AVPacketSideDataType_AV_PKT_DATA_CONTENT_LIGHT_LEVEL: AVPacketSideDataType = 22;
392
393// AVHWDeviceType
394pub const AVHWDeviceType_AV_HWDEVICE_TYPE_CUDA: AVHWDeviceType = 2;
395pub const AVHWDeviceType_AV_HWDEVICE_TYPE_VAAPI: AVHWDeviceType = 4;
396pub const AVHWDeviceType_AV_HWDEVICE_TYPE_QSV: AVHWDeviceType = 5;
397pub const AVHWDeviceType_AV_HWDEVICE_TYPE_VIDEOTOOLBOX: AVHWDeviceType = 7;
398pub const AVHWDeviceType_AV_HWDEVICE_TYPE_D3D11VA: AVHWDeviceType = 8;
399
400// AVPictureType constants
401pub const AVPictureType_AV_PICTURE_TYPE_NONE: AVPictureType = 0;
402pub const AVPictureType_AV_PICTURE_TYPE_I: AVPictureType = 1;
403
404// Raw FFmpeg functions (bindgen-generated counterparts)
405//
406// These mirror what bindgen would emit from the real FFmpeg headers.
407// All bodies are stubs; the code is compiled but never executed on docs.rs.
408
409// SAFETY: docs.rs stubs — never called at runtime.
410pub unsafe fn av_strerror(_errnum: c_int, _errbuf: *mut c_char, _errbuf_size: usize) -> c_int {
411    0
412}
413
414// av_log bridge (see log_bridge.rs)
415
416pub type va_list = *mut c_char;
417
418pub const AV_LOG_QUIET: i32 = -8;
419pub const AV_LOG_PANIC: u32 = 0;
420pub const AV_LOG_FATAL: u32 = 8;
421pub const AV_LOG_ERROR: u32 = 16;
422pub const AV_LOG_WARNING: u32 = 24;
423pub const AV_LOG_INFO: u32 = 32;
424pub const AV_LOG_VERBOSE: u32 = 40;
425pub const AV_LOG_DEBUG: u32 = 48;
426pub const AV_LOG_TRACE: u32 = 56;
427
428pub unsafe fn av_log_set_callback(
429    _callback: Option<unsafe extern "C" fn(*mut c_void, c_int, *const c_char, va_list)>,
430) {
431}
432
433pub unsafe fn av_log_set_level(_level: c_int) {}
434
435pub unsafe fn av_log_get_level() -> c_int {
436    AV_LOG_INFO as c_int
437}
438
439pub unsafe fn av_log_format_line2(
440    _ptr: *mut c_void,
441    _level: c_int,
442    _fmt: *const c_char,
443    _vl: va_list,
444    _line: *mut c_char,
445    _line_size: c_int,
446    _print_prefix: *mut c_int,
447) -> c_int {
448    0
449}
450
451pub unsafe fn av_dict_get(
452    _m: *const AVDictionary,
453    _key: *const c_char,
454    _prev: *const AVDictionaryEntry,
455    _flags: c_int,
456) -> *mut AVDictionaryEntry {
457    std::ptr::null_mut()
458}
459
460pub unsafe fn av_dict_set(
461    _pm: *mut *mut AVDictionary,
462    _key: *const c_char,
463    _value: *const c_char,
464    _flags: c_int,
465) -> c_int {
466    0
467}
468
469pub unsafe fn av_dict_free(_m: *mut *mut AVDictionary) {}
470
471pub unsafe fn av_find_input_format(_short_name: *const c_char) -> *const AVInputFormat {
472    std::ptr::null()
473}
474
475pub unsafe fn avcodec_get_name(_id: AVCodecID) -> *const c_char {
476    std::ptr::null()
477}
478
479pub unsafe fn av_frame_alloc() -> *mut AVFrame {
480    std::ptr::null_mut()
481}
482
483pub unsafe fn av_frame_free(_frame: *mut *mut AVFrame) {}
484
485pub unsafe fn av_frame_get_buffer(_frame: *mut AVFrame, _align: c_int) -> c_int {
486    0
487}
488
489pub unsafe fn av_frame_move_ref(_dst: *mut AVFrame, _src: *mut AVFrame) {}
490
491pub unsafe fn av_frame_unref(_frame: *mut AVFrame) {}
492
493pub unsafe fn av_packet_alloc() -> *mut AVPacket {
494    std::ptr::null_mut()
495}
496
497pub unsafe fn av_packet_free(_pkt: *mut *mut AVPacket) {}
498
499pub unsafe fn av_packet_unref(_pkt: *mut AVPacket) {}
500
501pub unsafe fn av_packet_new_side_data(
502    _pkt: *mut AVPacket,
503    _type_: AVPacketSideDataType,
504    _size: usize,
505) -> *mut u8 {
506    std::ptr::null_mut()
507}
508
509pub unsafe fn av_buffer_ref(_buf: *mut AVBufferRef) -> *mut AVBufferRef {
510    std::ptr::null_mut()
511}
512
513pub unsafe fn av_buffer_unref(_buf: *mut *mut AVBufferRef) {}
514
515pub unsafe fn av_hwdevice_ctx_create(
516    _device_ctx: *mut *mut AVBufferRef,
517    _type_: AVHWDeviceType,
518    _device: *const c_char,
519    _opts: *mut AVDictionary,
520    _flags: c_int,
521) -> c_int {
522    -1
523}
524
525pub unsafe fn av_hwframe_transfer_data(
526    _dst: *mut AVFrame,
527    _src: *const AVFrame,
528    _flags: c_int,
529) -> c_int {
530    -1
531}
532
533pub unsafe fn av_opt_set(
534    _obj: *mut c_void,
535    _name: *const c_char,
536    _val: *const c_char,
537    _search_flags: c_int,
538) -> c_int {
539    0
540}
541
542pub unsafe fn av_read_frame(_s: *mut AVFormatContext, _pkt: *mut AVPacket) -> c_int {
543    -1
544}
545
546pub unsafe fn av_write_trailer(_s: *mut AVFormatContext) -> c_int {
547    0
548}
549
550pub unsafe fn av_interleaved_write_frame(
551    _s: *mut AVFormatContext,
552    _pkt: *mut AVPacket,
553) -> c_int {
554    0
555}
556
557pub unsafe fn avcodec_receive_frame(_avctx: *mut AVCodecContext, _frame: *mut AVFrame) -> c_int {
558    -1
559}
560
561pub unsafe fn avcodec_send_packet(
562    _avctx: *mut AVCodecContext,
563    _avpkt: *const AVPacket,
564) -> c_int {
565    -1
566}
567
568pub unsafe fn avformat_alloc_output_context2(
569    _ctx: *mut *mut AVFormatContext,
570    _oformat: *mut AVOutputFormat,
571    _format_name: *const c_char,
572    _filename: *const c_char,
573) -> c_int {
574    -1
575}
576
577pub unsafe fn avformat_free_context(_s: *mut AVFormatContext) {}
578
579pub unsafe fn avformat_new_stream(
580    _s: *mut AVFormatContext,
581    _c: *const AVCodec,
582) -> *mut AVStream {
583    std::ptr::null_mut()
584}
585
586pub unsafe fn avformat_write_header(
587    _s: *mut AVFormatContext,
588    _options: *mut *mut AVDictionary,
589) -> c_int {
590    -1
591}
592
593pub unsafe fn swr_alloc_set_opts2(
594    _ps: *mut *mut SwrContext,
595    _out_ch_layout: *const AVChannelLayout,
596    _out_sample_fmt: AVSampleFormat,
597    _out_sample_rate: c_int,
598    _in_ch_layout: *const AVChannelLayout,
599    _in_sample_fmt: AVSampleFormat,
600    _in_sample_rate: c_int,
601    _log_offset: c_int,
602    _log_ctx: *mut c_void,
603) -> c_int {
604    -1
605}
606
607pub unsafe fn swr_convert(
608    _s: *mut SwrContext,
609    _out: *mut *mut u8,
610    _out_count: c_int,
611    _in_: *const *const u8,
612    _in_count: c_int,
613) -> c_int {
614    -1
615}
616
617pub unsafe fn swr_free(_s: *mut *mut SwrContext) {}
618
619pub unsafe fn swr_get_out_samples(_s: *mut SwrContext, _in_samples: c_int) -> c_int {
620    0
621}
622
623pub unsafe fn swr_init(_s: *mut SwrContext) -> c_int {
624    -1
625}
626
627pub unsafe fn av_channel_layout_default(_ch_layout: *mut AVChannelLayout, _nb_channels: c_int) {}
628
629pub unsafe fn av_channel_layout_uninit(_ch_layout: *mut AVChannelLayout) {}
630
631pub unsafe fn av_rescale_q(_a: i64, _bq: AVRational, _cq: AVRational) -> i64 {
632    0
633}
634
635pub unsafe fn av_mallocz(_size: usize) -> *mut c_void {
636    std::ptr::null_mut()
637}
638
639pub unsafe fn av_malloc(_size: usize) -> *mut c_void {
640    std::ptr::null_mut()
641}
642
643pub unsafe fn av_free(_ptr: *mut c_void) {}
644
645pub unsafe fn av_new_packet(_pkt: *mut AVPacket, _size: c_int) -> c_int {
646    -1
647}
648
649pub unsafe fn avcodec_parameters_copy(
650    _dst: *mut AVCodecParameters,
651    _src: *const AVCodecParameters,
652) -> c_int {
653    0
654}
655
656pub unsafe fn av_packet_rescale_ts(
657    _pkt: *mut AVPacket,
658    _tb_src: AVRational,
659    _tb_dst: AVRational,
660) {
661}
662
663// Wrapper module stubs
664//
665// These mirror the safe wrapper modules in avformat.rs, avcodec.rs,
666// swresample.rs, and swscale.rs.  Signatures must exactly match those files.
667
668// libavfilter opaque types
669
670pub struct AVFilterGraph(());
671pub struct AVFilter(());
672
673pub struct AVFilterContext {
674    pub hw_device_ctx: *mut AVBufferRef,
675}
676
677/// An unconnected pad of a parsed filter graph, as returned by
678/// `avfilter_graph_parse2`.
679pub struct AVFilterInOut {
680    pub filter_ctx: *mut AVFilterContext,
681    pub pad_idx: c_int,
682    pub next: *mut AVFilterInOut,
683}
684
685// libavfilter constants
686
687/// Flag for `av_buffersrc_add_frame_flags`: keep a reference to the frame.
688pub const AV_BUFFERSRC_FLAG_KEEP_REF: c_int = 8;
689
690// libavfilter functions
691
692// SAFETY: docs.rs stubs — never called at runtime.
693
694pub unsafe fn avfilter_graph_alloc() -> *mut AVFilterGraph {
695    ptr::null_mut()
696}
697
698pub unsafe fn avfilter_graph_free(_graph: *mut *mut AVFilterGraph) {}
699
700pub unsafe fn avfilter_get_by_name(_name: *const c_char) -> *const AVFilter {
701    ptr::null()
702}
703
704pub unsafe fn avfilter_graph_create_filter(
705    _filt_ctx: *mut *mut AVFilterContext,
706    _filt: *const AVFilter,
707    _name: *const c_char,
708    _args: *const c_char,
709    _opaque: *mut c_void,
710    _graph_ctx: *mut AVFilterGraph,
711) -> c_int {
712    0
713}
714
715pub unsafe fn avfilter_link(
716    _src: *mut AVFilterContext,
717    _srcpad: c_uint,
718    _dst: *mut AVFilterContext,
719    _dstpad: c_uint,
720) -> c_int {
721    0
722}
723
724pub unsafe fn avfilter_graph_config(
725    _graphctx: *mut AVFilterGraph,
726    _log_ctx: *mut c_void,
727) -> c_int {
728    0
729}
730
731pub unsafe fn avfilter_graph_parse2(
732    _graph: *mut AVFilterGraph,
733    _filters: *const c_char,
734    _inputs: *mut *mut AVFilterInOut,
735    _outputs: *mut *mut AVFilterInOut,
736) -> c_int {
737    0
738}
739
740pub unsafe fn avfilter_inout_free(_inout: *mut *mut AVFilterInOut) {}
741
742pub unsafe fn avfilter_graph_set_auto_convert(_graph: *mut AVFilterGraph, _flags: c_uint) {}
743
744pub unsafe fn avfilter_graph_send_command(
745    _graph: *mut AVFilterGraph,
746    _target: *const c_char,
747    _cmd: *const c_char,
748    _arg: *const c_char,
749    _res: *mut c_char,
750    _res_len: c_int,
751    _flags: c_int,
752) -> c_int {
753    0
754}
755
756pub unsafe fn av_buffersrc_add_frame_flags(
757    _ctx: *mut AVFilterContext,
758    _frame: *mut AVFrame,
759    _flags: c_int,
760) -> c_int {
761    0
762}
763
764pub unsafe fn av_buffersrc_close(
765    _ctx: *mut AVFilterContext,
766    _pts: i64,
767    _flags: c_uint,
768) -> c_int {
769    0
770}
771
772pub unsafe fn av_buffersink_get_frame(
773    _ctx: *mut AVFilterContext,
774    _frame: *mut AVFrame,
775) -> c_int {
776    // Return EAGAIN to signal no frame available
777    -11
778}
779
780pub unsafe fn av_buffersink_get_time_base(_ctx: *const AVFilterContext) -> AVRational {
781    AVRational { num: 0, den: 1 }
782}
783
784pub unsafe fn av_image_get_linesize(
785    _pix_fmt: AVPixelFormat,
786    _width: c_int,
787    _plane: c_int,
788) -> c_int {
789    0
790}
791
792/// Stub `avformat` wrapper module.
793pub mod avformat {
794    use std::os::raw::c_int;
795    use std::path::Path;
796
797    use super::{AVFormatContext, AVIOContext, AVPacket};
798
799    pub fn srt_available() -> bool {
800        false
801    }
802
803    pub unsafe fn open_input(_path: &Path) -> Result<*mut AVFormatContext, c_int> {
804        Err(-1)
805    }
806
807    pub unsafe fn open_input_url(
808        _url: &str,
809        _connect_timeout: std::time::Duration,
810        _read_timeout: std::time::Duration,
811    ) -> Result<*mut AVFormatContext, c_int> {
812        Err(-1)
813    }
814
815    pub unsafe fn open_input_image_sequence(
816        _path: &Path,
817        _framerate: u32,
818    ) -> Result<*mut AVFormatContext, c_int> {
819        Err(-1)
820    }
821
822    pub unsafe fn close_input(_ctx: *mut *mut AVFormatContext) {}
823
824    pub unsafe fn find_stream_info(_ctx: *mut AVFormatContext) -> Result<(), c_int> {
825        Err(-1)
826    }
827
828    pub unsafe fn seek_frame(
829        _ctx: *mut AVFormatContext,
830        _stream_index: c_int,
831        _timestamp: i64,
832        _flags: c_int,
833    ) -> Result<(), c_int> {
834        Err(-1)
835    }
836
837    pub unsafe fn seek_file(
838        _ctx: *mut AVFormatContext,
839        _stream_index: c_int,
840        _min_ts: i64,
841        _ts: i64,
842        _max_ts: i64,
843        _flags: c_int,
844    ) -> Result<(), c_int> {
845        Err(-1)
846    }
847
848    pub unsafe fn read_frame(
849        _ctx: *mut AVFormatContext,
850        _pkt: *mut AVPacket,
851    ) -> Result<(), c_int> {
852        Err(-1)
853    }
854
855    pub unsafe fn write_frame(
856        _ctx: *mut AVFormatContext,
857        _pkt: *mut AVPacket,
858    ) -> Result<(), c_int> {
859        Err(-1)
860    }
861
862    pub unsafe fn open_output(_path: &Path, _flags: c_int) -> Result<*mut AVIOContext, c_int> {
863        Err(-1)
864    }
865
866    pub unsafe fn close_output(_pb: *mut *mut AVIOContext) {}
867
868    pub mod avio_flags {
869        use std::os::raw::c_int;
870        pub const READ: c_int = 1;
871        pub const WRITE: c_int = 2;
872        pub const READ_WRITE: c_int = 3;
873    }
874
875    pub mod seek_flags {
876        pub const BACKWARD: i32 = 1;
877        pub const BYTE: i32 = 2;
878        pub const ANY: i32 = 4;
879        pub const FRAME: i32 = 8;
880    }
881}
882
883/// Stub `avcodec` wrapper module.
884pub mod avcodec {
885    use std::os::raw::c_int;
886
887    use super::{AVCodec, AVCodecContext, AVCodecID, AVCodecParameters, AVDictionary, AVFrame, AVPacket};
888
889    pub unsafe fn find_decoder(_codec_id: AVCodecID) -> Option<*const AVCodec> {
890        None
891    }
892
893    pub unsafe fn find_decoder_by_name(_name: *const i8) -> Option<*const AVCodec> {
894        None
895    }
896
897    pub unsafe fn find_encoder(_codec_id: AVCodecID) -> Option<*const AVCodec> {
898        None
899    }
900
901    pub unsafe fn find_encoder_by_name(_name: *const i8) -> Option<*const AVCodec> {
902        None
903    }
904
905    pub unsafe fn alloc_context3(_codec: *const AVCodec) -> Result<*mut AVCodecContext, c_int> {
906        Err(-1)
907    }
908
909    pub unsafe fn parameters_to_context(
910        _codec_ctx: *mut AVCodecContext,
911        _par: *const AVCodecParameters,
912    ) -> Result<(), c_int> {
913        Err(-1)
914    }
915
916    pub unsafe fn open2(
917        _avctx: *mut AVCodecContext,
918        _codec: *const AVCodec,
919        _options: *mut *mut AVDictionary,
920    ) -> Result<(), c_int> {
921        Err(-1)
922    }
923
924    pub unsafe fn send_packet(
925        _ctx: *mut AVCodecContext,
926        _pkt: *const AVPacket,
927    ) -> Result<(), c_int> {
928        Err(-1)
929    }
930
931    pub unsafe fn receive_frame(
932        _ctx: *mut AVCodecContext,
933        _frame: *mut AVFrame,
934    ) -> Result<(), c_int> {
935        Err(-1)
936    }
937
938    pub unsafe fn send_frame(
939        _ctx: *mut AVCodecContext,
940        _frame: *const AVFrame,
941    ) -> Result<(), c_int> {
942        Err(-1)
943    }
944
945    pub unsafe fn receive_packet(
946        _ctx: *mut AVCodecContext,
947        _pkt: *mut AVPacket,
948    ) -> Result<(), c_int> {
949        Err(-1)
950    }
951
952    pub unsafe fn flush_buffers(_ctx: *mut AVCodecContext) {}
953
954    pub unsafe fn parameters_from_context(
955        _par: *mut AVCodecParameters,
956        _ctx: *const AVCodecContext,
957    ) -> Result<(), c_int> {
958        Err(-1)
959    }
960
961    pub mod codec_caps {
962        pub const EXPERIMENTAL: u32 = 1 << 9;
963        pub const HARDWARE: u32 = 1 << 10;
964        pub const HYBRID: u32 = 1 << 11;
965        pub const VARIABLE_FRAME_SIZE: u32 = 1 << 16;
966        pub const AVOID_PROBING: u32 = 1 << 17;
967    }
968}
969
970/// Stub `swresample` wrapper module.
971pub mod swresample {
972    use std::os::raw::c_int;
973
974    use super::{AVChannelLayout, AVSampleFormat, SwrContext};
975
976    pub unsafe fn alloc() -> Result<*mut SwrContext, c_int> {
977        Err(-1)
978    }
979
980    pub unsafe fn alloc_set_opts2(
981        _out_ch_layout: *const AVChannelLayout,
982        _out_sample_fmt: AVSampleFormat,
983        _out_sample_rate: c_int,
984        _in_ch_layout: *const AVChannelLayout,
985        _in_sample_fmt: AVSampleFormat,
986        _in_sample_rate: c_int,
987    ) -> Result<*mut SwrContext, c_int> {
988        Err(-1)
989    }
990
991    pub unsafe fn init(_ctx: *mut SwrContext) -> Result<(), c_int> {
992        Err(-1)
993    }
994
995    pub unsafe fn is_initialized(_ctx: *const SwrContext) -> bool {
996        false
997    }
998
999    pub unsafe fn convert(
1000        _s: *mut SwrContext,
1001        _out: *mut *mut u8,
1002        _out_count: c_int,
1003        _in_: *const *const u8,
1004        _in_count: c_int,
1005    ) -> Result<c_int, c_int> {
1006        Err(-1)
1007    }
1008
1009    pub unsafe fn get_delay(_ctx: *mut SwrContext, _base: i64) -> i64 {
1010        0
1011    }
1012
1013    pub fn estimate_output_samples(
1014        _out_sample_rate: i32,
1015        _in_sample_rate: i32,
1016        _in_samples: i32,
1017    ) -> i32 {
1018        0
1019    }
1020
1021    pub mod channel_layout {
1022        use super::super::AVChannelLayout;
1023
1024        pub unsafe fn set_default(_ch_layout: *mut AVChannelLayout, _nb_channels: i32) {}
1025        pub unsafe fn uninit(_ch_layout: *mut AVChannelLayout) {}
1026        pub unsafe fn copy(
1027            _dst: *mut AVChannelLayout,
1028            _src: *const AVChannelLayout,
1029        ) -> Result<(), crate::AvError> {
1030            Err(crate::AvError::new(-1))
1031        }
1032        pub unsafe fn is_equal(
1033            _chl: *const AVChannelLayout,
1034            _chl1: *const AVChannelLayout,
1035        ) -> bool {
1036            false
1037        }
1038        pub fn mono() -> AVChannelLayout {
1039            AVChannelLayout::default()
1040        }
1041        pub fn stereo() -> AVChannelLayout {
1042            AVChannelLayout::default()
1043        }
1044        pub fn with_channels(_nb_channels: i32) -> AVChannelLayout {
1045            AVChannelLayout::default()
1046        }
1047        pub fn is_valid(ch_layout: &AVChannelLayout) -> bool {
1048            ch_layout.nb_channels > 0
1049        }
1050        pub fn nb_channels(ch_layout: &AVChannelLayout) -> i32 {
1051            ch_layout.nb_channels
1052        }
1053        pub fn is_native_order(_ch_layout: &AVChannelLayout) -> bool {
1054            false
1055        }
1056    }
1057
1058    pub mod audio_fifo {
1059        use std::ffi::c_void;
1060        use std::os::raw::c_int;
1061
1062        use super::super::{AVAudioFifo, AVSampleFormat};
1063
1064        pub unsafe fn alloc(
1065            _sample_fmt: AVSampleFormat,
1066            _channels: c_int,
1067            _nb_samples: c_int,
1068        ) -> Result<*mut AVAudioFifo, crate::AvError> {
1069            Err(crate::AvError::new(-1))
1070        }
1071
1072        pub unsafe fn free(_fifo: *mut AVAudioFifo) {}
1073
1074        pub unsafe fn write(
1075            _fifo: *mut AVAudioFifo,
1076            _data: *const *mut c_void,
1077            _nb_samples: c_int,
1078        ) -> Result<c_int, crate::AvError> {
1079            Err(crate::AvError::new(-1))
1080        }
1081
1082        pub unsafe fn read(
1083            _fifo: *mut AVAudioFifo,
1084            _data: *const *mut c_void,
1085            _nb_samples: c_int,
1086        ) -> Result<c_int, crate::AvError> {
1087            Err(crate::AvError::new(-1))
1088        }
1089
1090        pub unsafe fn size(_fifo: *mut AVAudioFifo) -> c_int {
1091            0
1092        }
1093
1094        pub unsafe fn write_frame(
1095            _fifo: *mut AVAudioFifo,
1096            _src: &super::super::Frame,
1097            _nb_samples: c_int,
1098        ) -> Result<c_int, crate::AvError> {
1099            Err(crate::AvError::new(-1))
1100        }
1101
1102        pub unsafe fn read_frame(
1103            _fifo: *mut AVAudioFifo,
1104            _dst: &mut super::super::Frame,
1105            _nb_samples: c_int,
1106        ) -> Result<c_int, crate::AvError> {
1107            Err(crate::AvError::new(-1))
1108        }
1109    }
1110
1111    pub mod sample_format {
1112        use super::super::{
1113            AVSampleFormat, AVSampleFormat_AV_SAMPLE_FMT_NONE, AVSampleFormat_AV_SAMPLE_FMT_U8,
1114            AVSampleFormat_AV_SAMPLE_FMT_S16, AVSampleFormat_AV_SAMPLE_FMT_S32,
1115            AVSampleFormat_AV_SAMPLE_FMT_FLT, AVSampleFormat_AV_SAMPLE_FMT_DBL,
1116            AVSampleFormat_AV_SAMPLE_FMT_U8P, AVSampleFormat_AV_SAMPLE_FMT_S16P,
1117            AVSampleFormat_AV_SAMPLE_FMT_S32P, AVSampleFormat_AV_SAMPLE_FMT_FLTP,
1118            AVSampleFormat_AV_SAMPLE_FMT_DBLP, AVSampleFormat_AV_SAMPLE_FMT_S64,
1119            AVSampleFormat_AV_SAMPLE_FMT_S64P,
1120        };
1121
1122        pub const NONE: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_NONE;
1123        pub const U8: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_U8;
1124        pub const S16: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_S16;
1125        pub const S32: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_S32;
1126        pub const FLT: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_FLT;
1127        pub const DBL: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_DBL;
1128        pub const U8P: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_U8P;
1129        pub const S16P: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_S16P;
1130        pub const S32P: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_S32P;
1131        pub const FLTP: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_FLTP;
1132        pub const DBLP: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_DBLP;
1133        pub const S64: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_S64;
1134        pub const S64P: AVSampleFormat = AVSampleFormat_AV_SAMPLE_FMT_S64P;
1135
1136        pub fn bytes_per_sample(_sample_fmt: AVSampleFormat) -> i32 {
1137            0
1138        }
1139        pub fn is_planar(_sample_fmt: AVSampleFormat) -> bool {
1140            false
1141        }
1142    }
1143}
1144
1145/// Stub `swscale` wrapper module.
1146pub mod swscale {
1147    use std::os::raw::c_int;
1148
1149    use super::{AVPixelFormat, SwsContext};
1150
1151    pub unsafe fn get_context(
1152        _src_w: c_int,
1153        _src_h: c_int,
1154        _src_fmt: AVPixelFormat,
1155        _dst_w: c_int,
1156        _dst_h: c_int,
1157        _dst_fmt: AVPixelFormat,
1158        _flags: c_int,
1159    ) -> Result<*mut SwsContext, c_int> {
1160        Err(-1)
1161    }
1162
1163    pub unsafe fn scale(
1164        _ctx: *mut SwsContext,
1165        _src: *const *const u8,
1166        _src_stride: *const c_int,
1167        _src_slice_y: c_int,
1168        _src_slice_h: c_int,
1169        _dst: *const *mut u8,
1170        _dst_stride: *const c_int,
1171    ) -> Result<c_int, c_int> {
1172        Err(-1)
1173    }
1174
1175    pub unsafe fn is_supported_input(_pix_fmt: AVPixelFormat) -> bool {
1176        false
1177    }
1178
1179    pub unsafe fn is_supported_output(_pix_fmt: AVPixelFormat) -> bool {
1180        false
1181    }
1182
1183    pub unsafe fn is_supported_endianness_conversion(_pix_fmt: AVPixelFormat) -> bool {
1184        false
1185    }
1186
1187    pub mod scale_flags {
1188        pub const FAST_BILINEAR: i32 = 1;
1189        pub const BILINEAR: i32 = 2;
1190        pub const BICUBIC: i32 = 4;
1191        pub const X: i32 = 8;
1192        pub const POINT: i32 = 16;
1193        pub const AREA: i32 = 32;
1194        pub const BICUBLIN: i32 = 64;
1195        pub const GAUSS: i32 = 128;
1196        pub const SINC: i32 = 256;
1197        pub const LANCZOS: i32 = 512;
1198        pub const SPLINE: i32 = 1024;
1199    }
1200}
1201
1202// RAII owner stub (mirrors crate::codec_context::CodecContext)
1203// Under DOCS_RS the real `codec_context` module is cfg'd out (it depends on the
1204// docsrs-gated `avcodec` wrapper); this shape-compatible stub keeps
1205// `ff_sys::CodecContext` available so ff-decode compiles for docs.rs.
1206
1207/// Stub mirror of `crate::codec_context::ReceiveOutcome`.
1208#[derive(Debug, Clone, Copy, PartialEq, Eq)]
1209pub enum ReceiveOutcome {
1210    Frame,
1211    NeedInput,
1212    Drained,
1213}
1214
1215#[derive(Debug)]
1216pub struct CodecContext {
1217    _ptr: std::ptr::NonNull<AVCodecContext>,
1218}
1219
1220impl CodecContext {
1221    /// # Errors
1222    /// Stub; never executed on docs.rs.
1223    pub fn new(_codec: Option<Codec>) -> Result<Self, crate::AvError> {
1224        Err(crate::AvError::new(-1))
1225    }
1226
1227    pub fn set_thread_count(&mut self, _thread_count: c_int) {}
1228
1229    pub fn set_width(&mut self, _width: c_int) {}
1230    pub fn set_height(&mut self, _height: c_int) {}
1231    pub fn set_pix_fmt(&mut self, _pix_fmt: AVPixelFormat) {}
1232    pub fn set_time_base(&mut self, _time_base: AVRational) {}
1233
1234    #[must_use]
1235    pub fn pix_fmt(&self) -> AVPixelFormat {
1236        0
1237    }
1238    #[must_use]
1239    pub fn sample_fmt(&self) -> AVSampleFormat {
1240        0
1241    }
1242    #[must_use]
1243    pub fn width(&self) -> c_int {
1244        0
1245    }
1246    #[must_use]
1247    pub fn height(&self) -> c_int {
1248        0
1249    }
1250
1251    pub fn set_codec_id(&mut self, _codec_id: AVCodecID) {}
1252    pub fn set_framerate(&mut self, _framerate: AVRational) {}
1253    pub fn set_bit_rate(&mut self, _bit_rate: i64) {}
1254    #[must_use]
1255    pub fn bit_rate(&self) -> i64 {
1256        0
1257    }
1258    pub fn set_rc_max_rate(&mut self, _rc_max_rate: i64) {}
1259    pub fn set_rc_buffer_size(&mut self, _rc_buffer_size: c_int) {}
1260    pub fn set_color_primaries(&mut self, _color_primaries: AVColorPrimaries) {}
1261    pub fn set_color_trc(&mut self, _color_trc: AVColorTransferCharacteristic) {}
1262    pub fn set_colorspace(&mut self, _colorspace: AVColorSpace) {}
1263    pub fn set_color_range(&mut self, _color_range: AVColorRange) {}
1264    pub fn set_sample_rate(&mut self, _sample_rate: c_int) {}
1265    pub fn set_sample_fmt(&mut self, _sample_fmt: AVSampleFormat) {}
1266    pub fn set_max_b_frames(&mut self, _max_b_frames: c_int) {}
1267    pub fn set_gop_size(&mut self, _gop_size: c_int) {}
1268    pub fn set_refs(&mut self, _refs: c_int) {}
1269    pub fn set_qmin(&mut self, _qmin: c_int) {}
1270    pub fn set_qmax(&mut self, _qmax: c_int) {}
1271    pub fn set_ch_layout_default(&mut self, _nb_channels: c_int) {}
1272    pub fn set_flags(&mut self, _flags: c_int) {}
1273
1274    #[must_use]
1275    pub fn flags(&self) -> c_int {
1276        0
1277    }
1278    #[must_use]
1279    pub fn time_base(&self) -> AVRational {
1280        AVRational { num: 0, den: 1 }
1281    }
1282    #[must_use]
1283    pub fn codec_id(&self) -> AVCodecID {
1284        0
1285    }
1286    #[must_use]
1287    pub fn frame_size(&self) -> c_int {
1288        0
1289    }
1290    #[must_use]
1291    pub fn sample_rate(&self) -> c_int {
1292        0
1293    }
1294    #[must_use]
1295    pub fn channels(&self) -> c_int {
1296        0
1297    }
1298    #[must_use]
1299    pub fn ch_layout(&self) -> &AVChannelLayout {
1300        Box::leak(Box::new(AVChannelLayout::default()))
1301    }
1302
1303    /// # Errors
1304    /// Stub; never executed on docs.rs.
1305    pub fn set_opt(&mut self, _key: &str, _value: &str) -> Result<(), crate::AvError> {
1306        Err(crate::AvError::new(-1))
1307    }
1308
1309    /// # Errors
1310    /// Stub; never executed on docs.rs.
1311    pub fn set_opt_cstr(
1312        &mut self,
1313        _key: &str,
1314        _value: &core::ffi::CStr,
1315    ) -> Result<(), crate::AvError> {
1316        Err(crate::AvError::new(-1))
1317    }
1318
1319    /// # Errors
1320    /// Stub; never executed on docs.rs.
1321    pub fn set_opt_search_children(
1322        &mut self,
1323        _key: &str,
1324        _value: &str,
1325    ) -> Result<(), crate::AvError> {
1326        Err(crate::AvError::new(-1))
1327    }
1328
1329    pub fn set_stats_in(&mut self, _stats: &std::ffi::CStr) {}
1330
1331    pub fn clear_stats_in(&mut self) {}
1332
1333    #[must_use]
1334    pub fn stats_out(&self) -> Option<std::ffi::CString> {
1335        None
1336    }
1337
1338    /// # Errors
1339    /// Stub; never executed on docs.rs.
1340    pub fn apply_parameters(
1341        &mut self,
1342        _params: &CodecParameters<'_>,
1343    ) -> Result<(), crate::AvError> {
1344        Err(crate::AvError::new(-1))
1345    }
1346
1347    /// # Errors
1348    /// Stub; never executed on docs.rs.
1349    pub fn open_codec(&mut self, _codec: Codec) -> Result<(), crate::AvError> {
1350        Err(crate::AvError::new(-1))
1351    }
1352
1353    /// # Errors
1354    /// Stub; never executed on docs.rs.
1355    pub fn send_packet(&mut self, _pkt: &Packet) -> Result<(), crate::AvError> {
1356        Err(crate::AvError::new(-1))
1357    }
1358
1359    /// # Safety
1360    /// Stub; never executed on docs.rs.
1361    pub unsafe fn send_eof(&mut self) -> Result<(), crate::AvError> {
1362        Err(crate::AvError::new(-1))
1363    }
1364
1365    /// # Errors
1366    /// Stub; never executed on docs.rs.
1367    pub fn receive_frame(&mut self, _frame: &mut Frame) -> Result<ReceiveOutcome, crate::AvError> {
1368        Err(crate::AvError::new(-1))
1369    }
1370
1371    /// # Safety
1372    /// Stub; never executed on docs.rs.
1373    pub unsafe fn flush_buffers(&mut self) {}
1374
1375    /// # Errors
1376    /// Stub; never executed on docs.rs.
1377    pub fn send_frame(&mut self, _frame: Option<&Frame>) -> Result<(), crate::AvError> {
1378        Err(crate::AvError::new(-1))
1379    }
1380
1381    /// # Errors
1382    /// Stub; never executed on docs.rs.
1383    pub fn set_hw_device_ctx(
1384        &mut self,
1385        _device: &HwDeviceContext,
1386    ) -> Result<(), crate::AvError> {
1387        Err(crate::AvError::new(-1))
1388    }
1389
1390    /// # Errors
1391    /// Stub; never executed on docs.rs.
1392    pub fn receive_packet(
1393        &mut self,
1394        _pkt: &mut Packet,
1395    ) -> Result<ReceiveOutcome, crate::AvError> {
1396        Err(crate::AvError::new(-1))
1397    }
1398
1399    /// # Safety
1400    /// Stub; never executed on docs.rs.
1401    pub(crate) unsafe fn parameters_from_context(
1402        &self,
1403        _par: *mut AVCodecParameters,
1404    ) -> Result<(), crate::AvError> {
1405        Err(crate::AvError::new(-1))
1406    }
1407}
1408
1409impl Drop for CodecContext {
1410    fn drop(&mut self) {}
1411}
1412
1413// SAFETY: stub; never executed on docs.rs.
1414unsafe impl Send for CodecContext {}
1415
1416// RAII owner stub (mirrors crate::format_context::InputFormatContext)
1417// Under DOCS_RS the real `format_context` module is cfg'd out (it depends on the
1418// docsrs-gated `avformat` wrapper); this shape-compatible stub keeps
1419// `ff_sys::InputFormatContext` available so ff-decode compiles for docs.rs.
1420
1421#[derive(Debug)]
1422pub struct InputFormatContext {
1423    _ptr: std::ptr::NonNull<AVFormatContext>,
1424}
1425
1426impl InputFormatContext {
1427    /// # Errors
1428    /// Stub; never executed on docs.rs.
1429    pub fn open(_path: &std::path::Path) -> Result<Self, crate::AvError> {
1430        Err(crate::AvError::new(-1))
1431    }
1432
1433    /// # Errors
1434    /// Stub; never executed on docs.rs.
1435    pub fn open_url(
1436        _url: &str,
1437        _connect_timeout: std::time::Duration,
1438        _read_timeout: std::time::Duration,
1439    ) -> Result<Self, crate::AvError> {
1440        Err(crate::AvError::new(-1))
1441    }
1442
1443    /// # Errors
1444    /// Stub; never executed on docs.rs.
1445    pub fn open_image_sequence(
1446        _path: &std::path::Path,
1447        _framerate: u32,
1448    ) -> Result<Self, crate::AvError> {
1449        Err(crate::AvError::new(-1))
1450    }
1451
1452    /// # Errors
1453    /// Stub; never executed on docs.rs.
1454    pub fn open_custom(
1455        _source: impl crate::IoSource + 'static,
1456    ) -> Result<Self, crate::AvError> {
1457        Err(crate::AvError::new(-1))
1458    }
1459
1460    #[must_use]
1461    pub fn nb_streams(&self) -> u32 {
1462        0
1463    }
1464
1465    #[must_use]
1466    pub fn duration(&self) -> i64 {
1467        0
1468    }
1469
1470    #[must_use]
1471    pub fn iformat_flags(&self) -> c_int {
1472        0
1473    }
1474
1475    #[must_use]
1476    pub fn bit_rate(&self) -> i64 {
1477        0
1478    }
1479
1480    #[must_use]
1481    pub fn iformat_name(&self) -> Option<String> {
1482        None
1483    }
1484
1485    #[must_use]
1486    pub fn iformat_long_name(&self) -> Option<String> {
1487        None
1488    }
1489
1490    #[must_use]
1491    pub fn metadata(&self) -> std::collections::HashMap<String, String> {
1492        std::collections::HashMap::new()
1493    }
1494
1495    #[must_use]
1496    pub fn nb_chapters(&self) -> u32 {
1497        0
1498    }
1499
1500    #[must_use]
1501    pub fn chapter(&self, _index: usize) -> Option<ChapterRef<'_>> {
1502        None
1503    }
1504
1505    pub fn chapters(&self) -> impl Iterator<Item = ChapterRef<'_>> + '_ {
1506        std::iter::empty()
1507    }
1508
1509    #[must_use]
1510    pub fn stream(&self, _index: usize) -> Option<StreamRef<'_>> {
1511        None
1512    }
1513
1514    pub fn streams(&self) -> impl Iterator<Item = StreamRef<'_>> + '_ {
1515        std::iter::empty()
1516    }
1517
1518    /// # Errors
1519    /// Stub; never executed on docs.rs.
1520    pub fn find_stream_info(&mut self) -> Result<(), crate::AvError> {
1521        Err(crate::AvError::new(-1))
1522    }
1523
1524    /// # Errors
1525    /// Stub; never executed on docs.rs.
1526    pub fn seek_frame(
1527        &mut self,
1528        _stream_index: c_int,
1529        _timestamp: i64,
1530        _flags: c_int,
1531    ) -> Result<(), crate::AvError> {
1532        Err(crate::AvError::new(-1))
1533    }
1534
1535    /// # Errors
1536    /// Stub; never executed on docs.rs.
1537    pub fn seek_file(
1538        &mut self,
1539        _stream_index: c_int,
1540        _min_ts: i64,
1541        _ts: i64,
1542        _max_ts: i64,
1543        _flags: c_int,
1544    ) -> Result<(), crate::AvError> {
1545        Err(crate::AvError::new(-1))
1546    }
1547
1548    /// # Errors
1549    /// Stub; never executed on docs.rs.
1550    pub fn read_frame(&mut self, _pkt: &mut Packet) -> Result<(), crate::AvError> {
1551        Err(crate::AvError::new(-1))
1552    }
1553}
1554
1555impl Drop for InputFormatContext {
1556    fn drop(&mut self) {}
1557}
1558
1559// SAFETY: stub; never executed on docs.rs.
1560unsafe impl Send for InputFormatContext {}
1561
1562// RAII owner stub (mirrors crate::format_context::OutputFormatContext)
1563// Keeps `ff_sys::OutputFormatContext` available so the mux consumers compile for
1564// docs.rs while the real `format_context` module is cfg'd out.
1565
1566#[derive(Debug)]
1567pub struct OutputFormatContext {
1568    _ptr: std::ptr::NonNull<AVFormatContext>,
1569}
1570
1571impl OutputFormatContext {
1572    /// # Errors
1573    /// Stub; never executed on docs.rs.
1574    pub fn new(
1575        _format_name: Option<&str>,
1576        _filename: &std::path::Path,
1577    ) -> Result<Self, crate::AvError> {
1578        Err(crate::AvError::new(-1))
1579    }
1580
1581    #[must_use]
1582    pub fn nb_streams(&self) -> u32 {
1583        0
1584    }
1585
1586    #[must_use]
1587    pub fn oformat_flags(&self) -> c_int {
1588        0
1589    }
1590
1591    #[must_use]
1592    pub fn is_nofile(&self) -> bool {
1593        false
1594    }
1595
1596    /// # Errors
1597    /// Stub; never executed on docs.rs.
1598    pub fn open_io(&mut self, _path: &std::path::Path) -> Result<(), crate::AvError> {
1599        Err(crate::AvError::new(-1))
1600    }
1601
1602    /// # Errors
1603    /// Stub; never executed on docs.rs.
1604    pub fn set_custom_io(
1605        &mut self,
1606        _sink: impl crate::IoSink + 'static,
1607    ) -> Result<(), crate::AvError> {
1608        Err(crate::AvError::new(-1))
1609    }
1610
1611    /// # Errors
1612    /// Stub; never executed on docs.rs.
1613    pub fn write_header(&mut self) -> Result<(), crate::AvError> {
1614        Err(crate::AvError::new(-1))
1615    }
1616
1617    /// # Errors
1618    /// Stub; never executed on docs.rs.
1619    pub fn write_trailer(&mut self) -> Result<(), crate::AvError> {
1620        Err(crate::AvError::new(-1))
1621    }
1622
1623    pub fn close_io(&mut self) {}
1624
1625    /// # Errors
1626    /// Stub; never executed on docs.rs.
1627    pub fn new_stream(&mut self, _codec: Option<&Codec>) -> Result<usize, crate::AvError> {
1628        Err(crate::AvError::new(-1))
1629    }
1630
1631    #[must_use]
1632    pub fn stream_time_base(&self, _idx: usize) -> AVRational {
1633        AVRational { num: 0, den: 0 }
1634    }
1635
1636    pub fn set_stream_time_base(&mut self, _idx: usize, _time_base: AVRational) {}
1637
1638    /// # Errors
1639    /// Stub; never executed on docs.rs.
1640    pub fn apply_stream_params_from_context(
1641        &mut self,
1642        _idx: usize,
1643        _ctx: &CodecContext,
1644    ) -> Result<(), crate::AvError> {
1645        Err(crate::AvError::new(-1))
1646    }
1647
1648    /// # Errors
1649    /// Stub; never executed on docs.rs.
1650    pub fn copy_stream_params(
1651        &mut self,
1652        _idx: usize,
1653        _src: CodecParameters<'_>,
1654    ) -> Result<(), crate::AvError> {
1655        Err(crate::AvError::new(-1))
1656    }
1657
1658    /// # Errors
1659    /// Stub; never executed on docs.rs.
1660    pub fn set_opt(
1661        &mut self,
1662        _key: &std::ffi::CStr,
1663        _value: &std::ffi::CStr,
1664    ) -> Result<(), crate::AvError> {
1665        Err(crate::AvError::new(-1))
1666    }
1667
1668    /// # Errors
1669    /// Stub; never executed on docs.rs.
1670    pub fn write_interleaved(&mut self, _pkt: &mut Packet) -> Result<(), crate::AvError> {
1671        Err(crate::AvError::new(-1))
1672    }
1673
1674    /// # Errors
1675    /// Stub; never executed on docs.rs.
1676    pub fn set_metadata(&mut self, _key: &str, _value: &str) -> Result<(), crate::AvError> {
1677        Err(crate::AvError::new(-1))
1678    }
1679
1680    /// # Errors
1681    /// Stub; never executed on docs.rs.
1682    pub fn add_attachment_stream(
1683        &mut self,
1684        _data: &[u8],
1685        _mime_type: &str,
1686        _filename: &str,
1687    ) -> Result<usize, crate::AvError> {
1688        Err(crate::AvError::new(-1))
1689    }
1690
1691    /// # Errors
1692    /// Stub; never executed on docs.rs.
1693    pub fn set_chapters(&mut self, _chapters: &[ChapterSpec<'_>]) -> Result<(), crate::AvError> {
1694        Err(crate::AvError::new(-1))
1695    }
1696}
1697
1698impl Drop for OutputFormatContext {
1699    fn drop(&mut self) {}
1700}
1701
1702// SAFETY: stub; never executed on docs.rs.
1703unsafe impl Send for OutputFormatContext {}
1704
1705#[derive(Clone, Copy, Debug)]
1706pub struct ChapterSpec<'a> {
1707    pub id: i64,
1708    pub start_us: i64,
1709    pub end_us: i64,
1710    pub title: Option<&'a str>,
1711}
1712
1713// Borrowed stream / params stubs (mirror crate::format_context)
1714
1715#[derive(Clone, Copy, Debug)]
1716pub struct StreamRef<'a> {
1717    _ptr: std::ptr::NonNull<AVStream>,
1718    _marker: std::marker::PhantomData<&'a InputFormatContext>,
1719}
1720
1721impl<'a> StreamRef<'a> {
1722    #[must_use]
1723    pub fn index(&self) -> c_int {
1724        0
1725    }
1726
1727    #[must_use]
1728    pub fn time_base(&self) -> AVRational {
1729        AVRational { num: 0, den: 1 }
1730    }
1731
1732    #[must_use]
1733    pub fn avg_frame_rate(&self) -> AVRational {
1734        AVRational { num: 0, den: 1 }
1735    }
1736
1737    #[must_use]
1738    pub fn r_frame_rate(&self) -> AVRational {
1739        AVRational { num: 0, den: 1 }
1740    }
1741
1742    #[must_use]
1743    pub fn nb_frames(&self) -> i64 {
1744        0
1745    }
1746
1747    #[must_use]
1748    pub fn codecpar(&self) -> CodecParameters<'a> {
1749        // SAFETY: stub; never executed on docs.rs.
1750        unsafe {
1751            CodecParameters {
1752                _ptr: std::ptr::NonNull::new_unchecked(ptr::null_mut()),
1753                _marker: std::marker::PhantomData,
1754            }
1755        }
1756    }
1757
1758    #[must_use]
1759    pub fn duration(&self) -> i64 {
1760        0
1761    }
1762
1763    #[must_use]
1764    pub fn disposition(&self) -> c_int {
1765        0
1766    }
1767
1768    #[must_use]
1769    pub fn metadata(&self) -> std::collections::HashMap<String, String> {
1770        std::collections::HashMap::new()
1771    }
1772}
1773
1774#[derive(Clone, Copy, Debug)]
1775pub struct CodecParameters<'a> {
1776    _ptr: std::ptr::NonNull<AVCodecParameters>,
1777    _marker: std::marker::PhantomData<&'a ()>,
1778}
1779
1780impl CodecParameters<'_> {
1781    #[must_use]
1782    pub fn codec_type(&self) -> AVMediaType {
1783        0
1784    }
1785
1786    #[must_use]
1787    pub fn codec_id(&self) -> AVCodecID {
1788        0
1789    }
1790
1791    #[must_use]
1792    pub fn width(&self) -> c_int {
1793        0
1794    }
1795
1796    #[must_use]
1797    pub fn height(&self) -> c_int {
1798        0
1799    }
1800
1801    #[must_use]
1802    pub fn sample_rate(&self) -> c_int {
1803        0
1804    }
1805
1806    #[must_use]
1807    pub fn color_space(&self) -> AVColorSpace {
1808        0
1809    }
1810
1811    #[must_use]
1812    pub fn color_range(&self) -> AVColorRange {
1813        0
1814    }
1815
1816    #[must_use]
1817    pub fn color_primaries(&self) -> AVColorPrimaries {
1818        0
1819    }
1820
1821    #[must_use]
1822    pub fn ch_layout(&self) -> AVChannelLayout {
1823        AVChannelLayout::default()
1824    }
1825
1826    #[must_use]
1827    pub fn format(&self) -> c_int {
1828        0
1829    }
1830
1831    #[must_use]
1832    pub fn bit_rate(&self) -> i64 {
1833        0
1834    }
1835}
1836
1837#[derive(Clone, Copy, Debug)]
1838pub struct ChapterRef<'a> {
1839    _ptr: std::ptr::NonNull<AVChapter>,
1840    _marker: std::marker::PhantomData<&'a InputFormatContext>,
1841}
1842
1843impl ChapterRef<'_> {
1844    #[must_use]
1845    pub fn id(&self) -> i64 {
1846        0
1847    }
1848
1849    #[must_use]
1850    pub fn time_base(&self) -> AVRational {
1851        AVRational { num: 0, den: 1 }
1852    }
1853
1854    #[must_use]
1855    pub fn start(&self) -> i64 {
1856        0
1857    }
1858
1859    #[must_use]
1860    pub fn end(&self) -> i64 {
1861        0
1862    }
1863
1864    #[must_use]
1865    pub fn metadata(&self) -> std::collections::HashMap<String, String> {
1866        std::collections::HashMap::new()
1867    }
1868}
1869
1870// Owned Frame / Packet / Codec stubs (mirror crate::{frame,packet,codec})
1871// Under DOCS_RS the real modules are cfg'd out; these shape-compatible stubs keep
1872// `ff_sys::{Frame, Packet, Codec}` available for docs.rs.
1873
1874#[derive(Debug)]
1875pub struct Frame {
1876    _ptr: std::ptr::NonNull<AVFrame>,
1877}
1878
1879impl Frame {
1880    /// # Errors
1881    /// Stub; never executed on docs.rs.
1882    pub fn new() -> Result<Self, crate::AvError> {
1883        Err(crate::AvError::new(-1))
1884    }
1885
1886    #[must_use]
1887    pub(crate) const fn as_ptr(&self) -> *const AVFrame {
1888        self._ptr.as_ptr()
1889    }
1890
1891    #[must_use]
1892    pub(crate) fn as_mut_ptr(&mut self) -> *mut AVFrame {
1893        self._ptr.as_ptr()
1894    }
1895
1896    #[must_use]
1897    pub fn width(&self) -> c_int {
1898        0
1899    }
1900    pub fn set_width(&mut self, _width: c_int) {}
1901    #[must_use]
1902    pub fn height(&self) -> c_int {
1903        0
1904    }
1905    pub fn set_height(&mut self, _height: c_int) {}
1906    #[must_use]
1907    pub fn format(&self) -> c_int {
1908        0
1909    }
1910    pub fn set_format(&mut self, _format: c_int) {}
1911    pub fn set_pict_type(&mut self, _pict_type: AVPictureType) {}
1912
1913    #[must_use]
1914    pub fn pict_type(&self) -> AVPictureType {
1915        0
1916    }
1917    #[must_use]
1918    pub fn pts(&self) -> i64 {
1919        0
1920    }
1921    pub fn set_pts(&mut self, _pts: i64) {}
1922    #[must_use]
1923    pub fn pkt_dts(&self) -> i64 {
1924        0
1925    }
1926    pub fn set_pkt_dts(&mut self, _pkt_dts: i64) {}
1927    #[must_use]
1928    pub fn duration(&self) -> i64 {
1929        0
1930    }
1931    pub fn set_duration(&mut self, _duration: i64) {}
1932    #[must_use]
1933    pub fn time_base(&self) -> AVRational {
1934        AVRational { num: 0, den: 1 }
1935    }
1936    pub fn set_time_base(&mut self, _time_base: AVRational) {}
1937    #[must_use]
1938    pub fn nb_samples(&self) -> c_int {
1939        0
1940    }
1941    pub fn set_nb_samples(&mut self, _nb_samples: c_int) {}
1942    #[must_use]
1943    pub fn sample_rate(&self) -> c_int {
1944        0
1945    }
1946    pub fn set_sample_rate(&mut self, _sample_rate: c_int) {}
1947    /// # Errors
1948    /// Stub; never executed on docs.rs.
1949    pub fn set_ch_layout(&mut self, _layout: &AVChannelLayout) -> Result<(), crate::AvError> {
1950        Ok(())
1951    }
1952    #[must_use]
1953    pub fn channels(&self) -> c_int {
1954        0
1955    }
1956
1957    #[must_use]
1958    pub fn video_plane(&self, _i: usize) -> Option<&[u8]> {
1959        None
1960    }
1961
1962    pub fn video_plane_mut(&mut self, _i: usize) -> Option<&mut [u8]> {
1963        None
1964    }
1965
1966    #[must_use]
1967    pub fn linesize(&self, _i: usize) -> c_int {
1968        0
1969    }
1970
1971    /// # Safety
1972    ///
1973    /// Docs.rs stub; never called.
1974    pub unsafe fn copy_plane_rows(
1975        &self,
1976        _i: usize,
1977        _dst: &mut [u8],
1978        _dst_stride: usize,
1979        _rows: usize,
1980        _row_bytes: usize,
1981    ) -> Option<()> {
1982        None
1983    }
1984
1985    #[must_use]
1986    pub fn audio_plane(&self, _i: usize) -> Option<&[u8]> {
1987        None
1988    }
1989
1990    pub fn audio_plane_mut(&mut self, _i: usize) -> Option<&mut [u8]> {
1991        None
1992    }
1993
1994    pub fn unref(&mut self) {}
1995
1996    /// # Errors
1997    /// Stub; never executed on docs.rs.
1998    pub fn get_buffer(&mut self, _align: c_int) -> Result<(), crate::AvError> {
1999        Err(crate::AvError::new(-1))
2000    }
2001
2002    pub fn move_ref(&mut self, _src: &mut Frame) {}
2003
2004    /// # Errors
2005    /// Stub; never executed on docs.rs.
2006    pub fn hwframe_transfer_data(
2007        &mut self,
2008        _src: &Frame,
2009        _flags: c_int,
2010    ) -> Result<(), crate::AvError> {
2011        Err(crate::AvError::new(-1))
2012    }
2013
2014    /// # Errors
2015    /// Stub; never executed on docs.rs.
2016    pub fn try_clone(&self) -> Result<Self, crate::AvError> {
2017        Err(crate::AvError::new(-1))
2018    }
2019}
2020
2021impl Drop for Frame {
2022    fn drop(&mut self) {}
2023}
2024
2025// SAFETY: stub; never executed on docs.rs.
2026unsafe impl Send for Frame {}
2027
2028#[derive(Debug)]
2029pub struct Packet {
2030    _ptr: std::ptr::NonNull<AVPacket>,
2031}
2032
2033impl Packet {
2034    /// # Errors
2035    /// Stub; never executed on docs.rs.
2036    pub fn new() -> Result<Self, crate::AvError> {
2037        Err(crate::AvError::new(-1))
2038    }
2039
2040    #[must_use]
2041    pub(crate) const fn as_ptr(&self) -> *const AVPacket {
2042        self._ptr.as_ptr()
2043    }
2044
2045    #[must_use]
2046    pub(crate) fn as_mut_ptr(&mut self) -> *mut AVPacket {
2047        self._ptr.as_ptr()
2048    }
2049
2050    #[must_use]
2051    pub fn stream_index(&self) -> c_int {
2052        0
2053    }
2054
2055    #[must_use]
2056    pub fn pts(&self) -> i64 {
2057        0
2058    }
2059
2060    #[must_use]
2061    pub fn dts(&self) -> i64 {
2062        0
2063    }
2064
2065    #[must_use]
2066    pub fn size(&self) -> c_int {
2067        0
2068    }
2069
2070    #[must_use]
2071    pub fn flags(&self) -> c_int {
2072        0
2073    }
2074
2075    #[must_use]
2076    pub fn duration(&self) -> i64 {
2077        0
2078    }
2079
2080    pub fn set_stream_index(&mut self, _stream_index: c_int) {}
2081
2082    pub fn set_pts(&mut self, _pts: i64) {}
2083
2084    pub fn set_dts(&mut self, _dts: i64) {}
2085
2086    pub fn set_duration(&mut self, _duration: i64) {}
2087
2088    pub fn rescale_ts(&mut self, _src_tb: AVRational, _dst_tb: AVRational) {}
2089
2090    pub fn new_side_data(
2091        &mut self,
2092        _kind: AVPacketSideDataType,
2093        _size: usize,
2094    ) -> Option<&mut [u8]> {
2095        None
2096    }
2097
2098    pub fn unref(&mut self) {}
2099
2100    /// # Errors
2101    /// Stub; never executed on docs.rs.
2102    pub fn try_clone(&self) -> Result<Self, crate::AvError> {
2103        Err(crate::AvError::new(-1))
2104    }
2105}
2106
2107impl Drop for Packet {
2108    fn drop(&mut self) {}
2109}
2110
2111// SAFETY: stub; never executed on docs.rs.
2112unsafe impl Send for Packet {}
2113
2114#[derive(Clone, Copy, Debug)]
2115pub struct Codec {
2116    _ptr: std::ptr::NonNull<AVCodec>,
2117}
2118
2119impl Codec {
2120    #[must_use]
2121    pub fn find_decoder(_codec_id: AVCodecID) -> Option<Self> {
2122        None
2123    }
2124
2125    #[must_use]
2126    pub fn find_encoder(_codec_id: AVCodecID) -> Option<Self> {
2127        None
2128    }
2129
2130    #[must_use]
2131    pub fn find_encoder_by_name(_name: &str) -> Option<Self> {
2132        None
2133    }
2134
2135    #[must_use]
2136    pub const fn as_ptr(&self) -> *const AVCodec {
2137        self._ptr.as_ptr()
2138    }
2139}
2140
2141// RAII owner stub (mirrors crate::hwdevice::HwDeviceContext)
2142// Under DOCS_RS the real `hwdevice` module is cfg'd out; this shape-compatible
2143// stub keeps `ff_sys::HwDeviceContext` available for docs.rs.
2144
2145#[derive(Debug)]
2146pub struct HwDeviceContext {
2147    _ptr: std::ptr::NonNull<AVBufferRef>,
2148}
2149
2150impl HwDeviceContext {
2151    /// # Errors
2152    /// Stub; never executed on docs.rs.
2153    pub fn new(_device_type: AVHWDeviceType) -> Result<Self, crate::AvError> {
2154        Err(crate::AvError::new(-1))
2155    }
2156}
2157
2158impl Drop for HwDeviceContext {
2159    fn drop(&mut self) {}
2160}
2161
2162// SAFETY: stub; never executed on docs.rs.
2163unsafe impl Send for HwDeviceContext {}
2164
2165// RAII owner stub (mirrors crate::scale_context::ScaleContext)
2166// Under DOCS_RS the real `scale_context` module is cfg'd out; this
2167// shape-compatible stub keeps `ff_sys::ScaleContext` available for docs.rs.
2168
2169#[derive(Debug)]
2170pub struct ScaleContext {
2171    _ptr: std::ptr::NonNull<SwsContext>,
2172}
2173
2174impl ScaleContext {
2175    /// # Errors
2176    /// Stub; never executed on docs.rs.
2177    pub fn new(
2178        _src_w: c_int,
2179        _src_h: c_int,
2180        _src_fmt: AVPixelFormat,
2181        _dst_w: c_int,
2182        _dst_h: c_int,
2183        _dst_fmt: AVPixelFormat,
2184        _flags: c_int,
2185    ) -> Result<Self, crate::AvError> {
2186        Err(crate::AvError::new(-1))
2187    }
2188
2189    /// # Errors
2190    /// Stub; never executed on docs.rs.
2191    /// # Safety
2192    /// Stub; never executed on docs.rs.
2193    pub unsafe fn scale_frames(
2194        &mut self,
2195        _src: &Frame,
2196        _dst: &mut Frame,
2197    ) -> Result<c_int, crate::AvError> {
2198        Err(crate::AvError::new(-1))
2199    }
2200
2201    /// # Errors
2202    /// Stub; never executed on docs.rs.
2203    /// # Safety
2204    /// Stub; never executed on docs.rs.
2205    pub unsafe fn scale_planes(
2206        &mut self,
2207        _src: &[&[u8]],
2208        _src_strides: &[c_int],
2209        _src_h: c_int,
2210        _dst: &mut Frame,
2211    ) -> Result<c_int, crate::AvError> {
2212        Err(crate::AvError::new(-1))
2213    }
2214
2215    /// # Errors
2216    /// Stub; never executed on docs.rs.
2217    /// # Safety
2218    /// Stub; never executed on docs.rs.
2219    pub unsafe fn scale_slices(
2220        &mut self,
2221        _src: &[&[u8]],
2222        _src_strides: &[c_int],
2223        _src_h: c_int,
2224        _dst: &mut [&mut [u8]],
2225        _dst_strides: &[c_int],
2226    ) -> Result<c_int, crate::AvError> {
2227        Err(crate::AvError::new(-1))
2228    }
2229
2230}
2231
2232impl Drop for ScaleContext {
2233    fn drop(&mut self) {}
2234}
2235
2236// SAFETY: stub; never executed on docs.rs.
2237unsafe impl Send for ScaleContext {}
2238
2239// RAII owner stub (mirrors crate::resample_context::ResampleContext)
2240// Under DOCS_RS the real `resample_context` module is cfg'd out; this
2241// shape-compatible stub keeps `ff_sys::ResampleContext` available for docs.rs.
2242
2243#[derive(Debug)]
2244pub struct ResampleContext {
2245    _ptr: std::ptr::NonNull<SwrContext>,
2246}
2247
2248impl ResampleContext {
2249    /// # Errors
2250    /// Stub; never executed on docs.rs.
2251    /// # Safety
2252    /// Stub; never executed on docs.rs.
2253    pub unsafe fn new(
2254        _out_ch_layout: *const AVChannelLayout,
2255        _out_sample_fmt: AVSampleFormat,
2256        _out_sample_rate: c_int,
2257        _in_ch_layout: *const AVChannelLayout,
2258        _in_sample_fmt: AVSampleFormat,
2259        _in_sample_rate: c_int,
2260    ) -> Result<Self, crate::AvError> {
2261        Err(crate::AvError::new(-1))
2262    }
2263
2264    /// # Errors
2265    /// Stub; never executed on docs.rs.
2266    /// # Safety
2267    /// Stub; never executed on docs.rs.
2268    pub unsafe fn convert_into_planes(
2269        &mut self,
2270        _dst: &mut [&mut [u8]],
2271        _dst_count: c_int,
2272        _src: &Frame,
2273    ) -> Result<c_int, crate::AvError> {
2274        Err(crate::AvError::new(-1))
2275    }
2276
2277    /// # Errors
2278    /// Stub; never executed on docs.rs.
2279    /// # Safety
2280    /// Stub; never executed on docs.rs.
2281    pub unsafe fn convert_into_frame(
2282        &mut self,
2283        _dst: &mut Frame,
2284        _in_planes: &[&[u8]],
2285        _in_count: c_int,
2286    ) -> Result<c_int, crate::AvError> {
2287        Err(crate::AvError::new(-1))
2288    }
2289
2290    /// # Errors
2291    /// Stub; never executed on docs.rs.
2292    /// # Safety
2293    /// Stub; never executed on docs.rs.
2294    pub unsafe fn flush_into_frame(&mut self, _dst: &mut Frame) -> Result<c_int, crate::AvError> {
2295        Err(crate::AvError::new(-1))
2296    }
2297
2298    #[must_use]
2299    pub fn get_out_samples(&mut self, _in_samples: c_int) -> c_int {
2300        0
2301    }
2302}
2303
2304impl Drop for ResampleContext {
2305    fn drop(&mut self) {}
2306}
2307
2308// SAFETY: stub; never executed on docs.rs.
2309unsafe impl Send for ResampleContext {}
2310
2311// Free-function stub (mirrors crate::buffersink)
2312// Under DOCS_RS the real `buffersink` module is cfg'd out; these shape-compatible
2313// stubs keep `ff_sys::BufferSinkOutcome` / `ff_sys::buffersink_get_frame`
2314// available for docs.rs.
2315
2316/// Stub mirror of `crate::buffersink::BufferSinkOutcome`.
2317#[derive(Debug, Clone, Copy, PartialEq, Eq)]
2318pub enum BufferSinkOutcome {
2319    Frame,
2320    NeedMore,
2321    Drained,
2322}
2323
2324/// # Safety
2325/// Stub; never executed on docs.rs.
2326pub unsafe fn buffersink_get_frame(
2327    _sink: *mut AVFilterContext,
2328    _dst: &mut Frame,
2329) -> Result<BufferSinkOutcome, crate::AvError> {
2330    Err(crate::AvError::new(-1))
2331}
2332
2333// Under DOCS_RS the real `bsf` module is cfg'd out; this shape-compatible stub keeps
2334// `ff_sys::BsfContext` available for docs.rs (ff-remux names it).
2335
2336/// Stub mirror of `crate::bsf::BsfContext`.
2337#[derive(Debug)]
2338pub struct BsfContext {
2339    _ptr: std::ptr::NonNull<AVBSFContext>,
2340}
2341
2342impl BsfContext {
2343    /// # Errors
2344    /// Stub; never executed on docs.rs.
2345    pub fn open(
2346        _spec: &str,
2347        _par_in: Option<CodecParameters<'_>>,
2348        _time_base_in: AVRational,
2349    ) -> Result<Self, crate::AvError> {
2350        Err(crate::AvError::new(-1))
2351    }
2352
2353    /// # Errors
2354    /// Stub; never executed on docs.rs.
2355    pub fn passthrough(
2356        _par_in: Option<CodecParameters<'_>>,
2357        _time_base_in: AVRational,
2358    ) -> Result<Self, crate::AvError> {
2359        Err(crate::AvError::new(-1))
2360    }
2361
2362    #[must_use]
2363    pub fn output_params(&self) -> CodecParameters<'_> {
2364        // SAFETY: stub; never executed on docs.rs.
2365        unsafe {
2366            CodecParameters {
2367                _ptr: std::ptr::NonNull::dangling(),
2368                _marker: std::marker::PhantomData,
2369            }
2370        }
2371    }
2372
2373    #[must_use]
2374    pub fn output_time_base(&self) -> AVRational {
2375        AVRational { num: 0, den: 1 }
2376    }
2377
2378    /// # Errors
2379    /// Stub; never executed on docs.rs.
2380    pub fn send_packet(&mut self, _pkt: &mut Packet) -> Result<(), crate::AvError> {
2381        Err(crate::AvError::new(-1))
2382    }
2383
2384    /// # Errors
2385    /// Stub; never executed on docs.rs.
2386    pub fn send_eof(&mut self) -> Result<(), crate::AvError> {
2387        Err(crate::AvError::new(-1))
2388    }
2389
2390    /// # Errors
2391    /// Stub; never executed on docs.rs.
2392    pub fn receive_packet(
2393        &mut self,
2394        _pkt: &mut Packet,
2395    ) -> Result<ReceiveOutcome, crate::AvError> {
2396        Err(crate::AvError::new(-1))
2397    }
2398}
2399
2400impl Drop for BsfContext {
2401    fn drop(&mut self) {}
2402}
2403
2404// SAFETY: stub; never executed on docs.rs.
2405unsafe impl Send for BsfContext {}