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