mirror of
https://github.com/encounter/rust-ffmpeg-zmwangx.git
synced 2026-07-10 21:18:40 -07:00
crate: improve link attributes and allow static linking
This commit is contained in:
@@ -15,6 +15,7 @@ libc = "*"
|
||||
[features]
|
||||
default = ["avcodec", "avdevice", "avfilter", "avformat", "avresample", "postproc", "swresample", "swscale"]
|
||||
|
||||
static = []
|
||||
avcodec = []
|
||||
avdevice = ["avformat"]
|
||||
avfilter = []
|
||||
|
||||
@@ -1315,7 +1315,6 @@ pub enum AVLockOp {
|
||||
AV_LOCK_DESTROY,
|
||||
}
|
||||
|
||||
#[link(name = "avcodec")]
|
||||
extern {
|
||||
pub fn av_codec_get_pkt_timebase(avctx: *const AVCodecContext) -> AVRational;
|
||||
pub fn av_codec_set_pkt_timebase(avctx: *mut AVCodecContext, val: AVRational);
|
||||
|
||||
@@ -25,7 +25,6 @@ pub struct AVDVProfile {
|
||||
pub audio_shuffle: [*const uint8_t; 9],
|
||||
}
|
||||
|
||||
#[link(name = "avcodec")]
|
||||
extern {
|
||||
pub fn av_dv_frame_profile(sys: *const AVDVProfile, frame: *const uint8_t, buf_size: c_uint) -> *const AVDVProfile;
|
||||
pub fn av_dv_codec_profile(width: c_int, height: c_int, pix_fmt: AVPixelFormat) -> *const AVDVProfile;
|
||||
|
||||
@@ -33,7 +33,6 @@ pub enum DCTTransformType {
|
||||
|
||||
pub type DCTContext = c_void;
|
||||
|
||||
#[link(name = "avcodec")]
|
||||
extern {
|
||||
pub fn av_fft_init(nbits: c_int, inverse: c_int) -> *mut FFTContext;
|
||||
pub fn av_fft_permute(s: *mut FFTContext, z: *mut FFTComplex);
|
||||
|
||||
@@ -35,3 +35,7 @@ pub use self::vobis_parser::*;
|
||||
|
||||
mod xvmc;
|
||||
pub use self::xvmc::*;
|
||||
|
||||
#[cfg_attr(feature = "static", link(name = "avcodec", kind = "static"))]
|
||||
#[cfg_attr(not(feature = "static"), link(name = "avcodec"))]
|
||||
extern { }
|
||||
|
||||
@@ -9,7 +9,6 @@ pub struct AVQSVContext {
|
||||
pub nb_ext_buffers: c_int,
|
||||
}
|
||||
|
||||
#[link(name = "avcodec")]
|
||||
extern {
|
||||
pub fn av_qsv_alloc_context() -> *mut AVQSVContext;
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ pub struct AVVDAContext {
|
||||
pub output_callback: extern fn(*mut c_void, *mut c_void, i32, uint32_t, *mut c_void),
|
||||
}
|
||||
|
||||
#[link(name = "avcodec")]
|
||||
extern {
|
||||
pub fn ff_vda_create_decoder(vda_ctx: *mut vda_context, extradata: *mut uint8_t, extradata_size: c_int) -> c_int;
|
||||
pub fn ff_vda_destroy_decoder(vda_ctx: *mut vda_context) -> c_int;
|
||||
|
||||
@@ -6,7 +6,6 @@ pub const VORBIS_FLAG_HEADER: c_int = 0x00000001;
|
||||
pub const VORBIS_FLAG_COMMENT: c_int = 0x00000002;
|
||||
pub const VORBIS_FLAG_SETUP: c_int = 0x00000004;
|
||||
|
||||
#[link(name = "avcodec")]
|
||||
extern {
|
||||
pub fn av_vorbis_parse_init(extradata: *const uint8_t, extradata_size: c_int) -> *mut AVVorbisParseContext;
|
||||
pub fn av_vorbis_parse_free(s: *mut *mut AVVorbisParseContext);
|
||||
|
||||
@@ -78,7 +78,6 @@ pub struct AVDeviceInfoList {
|
||||
pub default_device: c_int,
|
||||
}
|
||||
|
||||
#[link(name = "avdevice")]
|
||||
extern {
|
||||
pub static av_device_capabilities: *const AVOption;
|
||||
|
||||
|
||||
@@ -1,2 +1,6 @@
|
||||
mod device;
|
||||
pub use self::device::*;
|
||||
|
||||
#[cfg_attr(feature = "static", link(name = "avdevice", kind = "static"))]
|
||||
#[cfg_attr(not(feature = "static"), link(name = "avdevice"))]
|
||||
extern { }
|
||||
|
||||
@@ -19,7 +19,6 @@ pub struct AVABufferSinkParams {
|
||||
pub sample_rates: *mut c_int,
|
||||
}
|
||||
|
||||
#[link(name = "avfilter")]
|
||||
extern {
|
||||
pub fn av_buffersink_get_frame_flags(ctx: *mut AVFilterContext, frame: *mut AVFrame, flags: c_int) -> c_int;
|
||||
|
||||
|
||||
@@ -7,7 +7,6 @@ pub const AV_BUFFERSRC_FLAG_NO_COPY: c_int = 2;
|
||||
pub const AV_BUFFERSRC_FLAG_PUSH: c_int = 4;
|
||||
pub const AV_BUFFERSRC_FLAG_KEEP_REF: c_int = 8;
|
||||
|
||||
#[link(name = "avfilter")]
|
||||
extern {
|
||||
pub fn av_buffersrc_add_ref(buffer_src: *mut AVFilterContext, picref: *mut AVFilterBufferRef, flags: c_int) -> c_int;
|
||||
pub fn av_buffersrc_get_nb_failed_requests(buffer_src: *mut AVFilterContext) -> c_uint;
|
||||
|
||||
@@ -219,7 +219,6 @@ pub struct AVFilterInOut {
|
||||
pub next: *mut AVFilterInOut,
|
||||
}
|
||||
|
||||
#[link(name = "avfilter")]
|
||||
extern {
|
||||
pub fn avfilter_version() -> c_uint;
|
||||
pub fn avfilter_configuration() -> *const c_char;
|
||||
|
||||
@@ -6,3 +6,7 @@ pub use self::buffersink::*;
|
||||
|
||||
mod buffersrc;
|
||||
pub use self::buffersrc::*;
|
||||
|
||||
#[cfg_attr(feature = "static", link(name = "avfilter", kind = "static"))]
|
||||
#[cfg_attr(not(feature = "static"), link(name = "avfilter"))]
|
||||
extern { }
|
||||
|
||||
@@ -433,7 +433,6 @@ pub const AVSEEK_FLAG_BYTE: c_int = 2;
|
||||
pub const AVSEEK_FLAG_ANY: c_int = 4;
|
||||
pub const AVSEEK_FLAG_FRAME: c_int = 8;
|
||||
|
||||
#[link(name = "avformat")]
|
||||
extern {
|
||||
pub fn av_get_packet(s: *mut AVIOContext, pkt: *mut AVPacket, size: c_int) -> c_int;
|
||||
pub fn av_append_packet(s: *mut AVIOContext, pkt: *mut AVPacket, size: c_int) -> c_int;
|
||||
|
||||
@@ -93,7 +93,6 @@ pub unsafe fn avio_tell(s: *mut AVIOContext) -> int64_t {
|
||||
avio_seek(s, 0, SEEK_CUR)
|
||||
}
|
||||
|
||||
#[link(name = "avformat")]
|
||||
extern {
|
||||
pub fn avio_find_protocol_name(url: *const c_char) -> *const c_char;
|
||||
pub fn avio_check(url: *const c_char, flags: c_int) -> c_int;
|
||||
|
||||
@@ -3,3 +3,7 @@ pub use self::format::*;
|
||||
|
||||
mod io;
|
||||
pub use self::io::*;
|
||||
|
||||
#[cfg_attr(feature = "static", link(name = "avformat", kind = "static"))]
|
||||
#[cfg_attr(not(feature = "static"), link(name = "avformat"))]
|
||||
extern { }
|
||||
|
||||
@@ -3,3 +3,7 @@ pub use self::resample::*;
|
||||
pub use self::resample::AVMixCoeffType::*;
|
||||
pub use self::resample::AVResampleFilterType::*;
|
||||
pub use self::resample::AVResampleDitherMethod::*;
|
||||
|
||||
#[cfg_attr(feature = "static", link(name = "avresample", kind = "static"))]
|
||||
#[cfg_attr(not(feature = "static"), link(name = "avresample"))]
|
||||
extern { }
|
||||
|
||||
@@ -33,7 +33,6 @@ pub enum AVResampleDitherMethod {
|
||||
AV_RESAMPLE_DITHER_NB,
|
||||
}
|
||||
|
||||
#[link(name = "avresample")]
|
||||
extern {
|
||||
pub fn avresample_version() -> c_uint;
|
||||
pub fn avresample_configuration() -> *const c_char;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
use libc::{c_int, c_ulong, uint8_t};
|
||||
|
||||
#[link(name = "avutil")]
|
||||
extern {
|
||||
pub fn av_adler32_update(adler: c_ulong, buf: *const uint8_t, len: c_int) -> c_ulong;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user