Skip to main content

ff_sys/
constants.rs

1//! Global FFmpeg constants.
2
3/// Invalid PTS value (no presentation timestamp).
4///
5/// This constant indicates that a frame or packet does not have a valid
6/// presentation timestamp.
7pub const AV_NOPTS_VALUE: i64 = i64::MIN;
8
9/// `AVFMT_TS_DISCONT` — `AVInputFormat` flag indicating discontinuous timestamps.
10///
11/// Set for live/streaming formats such as HLS (live playlists), RTMP, RTSP,
12/// MPEG-TS (UDP/SRT), and similar sources. Used to detect live streams after
13/// `avformat_find_stream_info` has been called.
14pub const AVFMT_TS_DISCONT: i32 = 0x0200;
15
16/// `AV_BUFFERSRC_FLAG_KEEP_REF` normalized to `i32` for cross-platform use.
17///
18/// bindgen generates `AV_BUFFERSRC_FLAG_KEEP_REF` as `u32` on Linux/macOS
19/// (pkg-config / Homebrew) but as `i32` on Windows (VCPKG). Use this constant
20/// instead of the raw bindgen symbol when calling `av_buffersrc_add_frame_flags`.
21///
22/// The cfg flag `ffmpeg_buffersrc_flag_u32` is emitted by the build script on
23/// platforms where the bindgen type is `u32` (Linux, macOS).
24#[cfg(ffmpeg_buffersrc_flag_u32)]
25pub const BUFFERSRC_FLAG_KEEP_REF: i32 = crate::AV_BUFFERSRC_FLAG_KEEP_REF as i32;
26#[cfg(not(ffmpeg_buffersrc_flag_u32))]
27pub const BUFFERSRC_FLAG_KEEP_REF: i32 = crate::AV_BUFFERSRC_FLAG_KEEP_REF;