Add sys crate and rename things
This commit is contained in:
parent
92a8c6a9d8
commit
cbe6033984
144
Cargo.toml
144
Cargo.toml
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "ffmpeg-next"
|
name = "ffmpeg-the-third"
|
||||||
version = "5.1.1"
|
version = "5.1.1"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
@ -7,102 +7,110 @@ authors = ["meh. <meh@schizofreni.co>", "Zhiming Wang <i@zhimingwang.org>"]
|
|||||||
license = "WTFPL"
|
license = "WTFPL"
|
||||||
|
|
||||||
description = "Safe FFmpeg wrapper (FFmpeg 4 compatible fork of the ffmpeg crate)"
|
description = "Safe FFmpeg wrapper (FFmpeg 4 compatible fork of the ffmpeg crate)"
|
||||||
documentation = "https://docs.rs/ffmpeg-next"
|
documentation = "https://docs.rs/ffmpeg-the-third"
|
||||||
homepage = "https://github.com/zmwangx/rust-ffmpeg#readme"
|
homepage = "https://github.com/shssoichiro/ffmpeg-the-third"
|
||||||
repository = "https://github.com/zmwangx/rust-ffmpeg"
|
repository = "https://github.com/shssoichiro/ffmpeg-the-third"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
keywords = ["ffmpeg", "multimedia", "video", "audio"]
|
keywords = ["ffmpeg", "multimedia", "video", "audio"]
|
||||||
categories = ["multimedia"]
|
categories = ["multimedia"]
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["codec", "device", "filter", "format", "software-resampling", "software-scaling", "non-exhaustive-enums"]
|
default = [
|
||||||
|
"codec",
|
||||||
|
"device",
|
||||||
|
"filter",
|
||||||
|
"format",
|
||||||
|
"software-resampling",
|
||||||
|
"software-scaling",
|
||||||
|
"non-exhaustive-enums",
|
||||||
|
]
|
||||||
|
|
||||||
# ffmpeg<xy> are obsolete features kept for backward compatibility purposes and
|
# ffmpeg<xy> are obsolete features kept for backward compatibility purposes and
|
||||||
# don't do anything anymore (equivalents are automatically specified through
|
# don't do anything anymore (equivalents are automatically specified through
|
||||||
# compile-time detection in ffmpeg-sys-next). Deprecation plan: all these
|
# compile-time detection in ffmpeg-sys-the-third). Deprecation plan: all these
|
||||||
# features will be removed come 5.0.
|
# features will be removed come 5.0.
|
||||||
ffmpeg43 = []
|
ffmpeg43 = []
|
||||||
ffmpeg42 = []
|
ffmpeg42 = []
|
||||||
ffmpeg41 = []
|
ffmpeg41 = []
|
||||||
ffmpeg4 = []
|
ffmpeg4 = []
|
||||||
|
|
||||||
static = ["ffmpeg-sys-next/static"]
|
static = ["ffmpeg-sys-the-third/static"]
|
||||||
build = ["static", "ffmpeg-sys-next/build"]
|
build = ["static", "ffmpeg-sys-the-third/build"]
|
||||||
|
|
||||||
# mark enums in generated bindings as #[non_exhaustive]
|
# mark enums in generated bindings as #[non_exhaustive]
|
||||||
non-exhaustive-enums = ["ffmpeg-sys-next/non-exhaustive-enums"]
|
non-exhaustive-enums = ["ffmpeg-sys-the-third/non-exhaustive-enums"]
|
||||||
|
|
||||||
# licensing
|
# licensing
|
||||||
build-license-gpl = ["ffmpeg-sys-next/build-license-gpl"]
|
build-license-gpl = ["ffmpeg-sys-the-third/build-license-gpl"]
|
||||||
build-license-nonfree = ["ffmpeg-sys-next/build-license-nonfree"]
|
build-license-nonfree = ["ffmpeg-sys-the-third/build-license-nonfree"]
|
||||||
build-license-version3 = ["ffmpeg-sys-next/build-license-version3"]
|
build-license-version3 = ["ffmpeg-sys-the-third/build-license-version3"]
|
||||||
|
|
||||||
# misc
|
# misc
|
||||||
build-pic = ["ffmpeg-sys-next/build-pic"]
|
build-pic = ["ffmpeg-sys-the-third/build-pic"]
|
||||||
build-zlib = ["ffmpeg-sys-next/build-zlib"]
|
build-zlib = ["ffmpeg-sys-the-third/build-zlib"]
|
||||||
|
|
||||||
# ssl
|
# ssl
|
||||||
build-lib-gnutls = ["ffmpeg-sys-next/build-lib-gnutls"]
|
build-lib-gnutls = ["ffmpeg-sys-the-third/build-lib-gnutls"]
|
||||||
build-lib-openssl = ["ffmpeg-sys-next/build-lib-openssl"]
|
build-lib-openssl = ["ffmpeg-sys-the-third/build-lib-openssl"]
|
||||||
|
|
||||||
# filters
|
# filters
|
||||||
build-lib-fontconfig = ["ffmpeg-sys-next/build-lib-fontconfig"]
|
build-lib-fontconfig = ["ffmpeg-sys-the-third/build-lib-fontconfig"]
|
||||||
build-lib-frei0r = ["ffmpeg-sys-next/build-lib-frei0r"]
|
build-lib-frei0r = ["ffmpeg-sys-the-third/build-lib-frei0r"]
|
||||||
build-lib-ladspa = ["ffmpeg-sys-next/build-lib-ladspa"]
|
build-lib-ladspa = ["ffmpeg-sys-the-third/build-lib-ladspa"]
|
||||||
build-lib-ass = ["ffmpeg-sys-next/build-lib-ass"]
|
build-lib-ass = ["ffmpeg-sys-the-third/build-lib-ass"]
|
||||||
build-lib-freetype = ["ffmpeg-sys-next/build-lib-freetype"]
|
build-lib-freetype = ["ffmpeg-sys-the-third/build-lib-freetype"]
|
||||||
build-lib-freebidi = ["ffmpeg-sys-next/build-lib-freebidi"]
|
build-lib-freebidi = ["ffmpeg-sys-the-third/build-lib-freebidi"]
|
||||||
build-lib-opencv = ["ffmpeg-sys-next/build-lib-opencv"]
|
build-lib-opencv = ["ffmpeg-sys-the-third/build-lib-opencv"]
|
||||||
build-lib-vmaf = ["ffmpeg-sys-next/build-lib-vmaf"]
|
build-lib-vmaf = ["ffmpeg-sys-the-third/build-lib-vmaf"]
|
||||||
|
|
||||||
# encoders/decoders
|
# encoders/decoders
|
||||||
build-lib-aacplus = ["ffmpeg-sys-next/build-lib-aacplus"]
|
build-lib-aacplus = ["ffmpeg-sys-the-third/build-lib-aacplus"]
|
||||||
build-lib-celt = ["ffmpeg-sys-next/build-lib-celt"]
|
build-lib-celt = ["ffmpeg-sys-the-third/build-lib-celt"]
|
||||||
build-lib-dav1d = ["ffmpeg-sys-next/build-lib-dav1d"]
|
build-lib-dav1d = ["ffmpeg-sys-the-third/build-lib-dav1d"]
|
||||||
build-lib-dcadec = ["ffmpeg-sys-next/build-lib-dcadec"]
|
build-lib-dcadec = ["ffmpeg-sys-the-third/build-lib-dcadec"]
|
||||||
build-lib-faac = ["ffmpeg-sys-next/build-lib-faac"]
|
build-lib-faac = ["ffmpeg-sys-the-third/build-lib-faac"]
|
||||||
build-lib-fdk-aac = ["ffmpeg-sys-next/build-lib-fdk-aac"]
|
build-lib-fdk-aac = ["ffmpeg-sys-the-third/build-lib-fdk-aac"]
|
||||||
build-lib-gsm = ["ffmpeg-sys-next/build-lib-gsm"]
|
build-lib-gsm = ["ffmpeg-sys-the-third/build-lib-gsm"]
|
||||||
build-lib-ilbc = ["ffmpeg-sys-next/build-lib-ilbc"]
|
build-lib-ilbc = ["ffmpeg-sys-the-third/build-lib-ilbc"]
|
||||||
build-lib-kvazaar = ["ffmpeg-sys-next/build-lib-kvazaar"]
|
build-lib-kvazaar = ["ffmpeg-sys-the-third/build-lib-kvazaar"]
|
||||||
build-lib-mp3lame = ["ffmpeg-sys-next/build-lib-mp3lame"]
|
build-lib-mp3lame = ["ffmpeg-sys-the-third/build-lib-mp3lame"]
|
||||||
build-lib-opencore-amrnb = ["ffmpeg-sys-next/build-lib-opencore-amrnb"]
|
build-lib-opencore-amrnb = ["ffmpeg-sys-the-third/build-lib-opencore-amrnb"]
|
||||||
build-lib-opencore-amrwb = ["ffmpeg-sys-next/build-lib-opencore-amrwb"]
|
build-lib-opencore-amrwb = ["ffmpeg-sys-the-third/build-lib-opencore-amrwb"]
|
||||||
build-lib-openh264 = ["ffmpeg-sys-next/build-lib-openh264"]
|
build-lib-openh264 = ["ffmpeg-sys-the-third/build-lib-openh264"]
|
||||||
build-lib-openjpeg = ["ffmpeg-sys-next/build-lib-openjpeg"]
|
build-lib-openjpeg = ["ffmpeg-sys-the-third/build-lib-openjpeg"]
|
||||||
build-lib-opus = ["ffmpeg-sys-next/build-lib-opus"]
|
build-lib-opus = ["ffmpeg-sys-the-third/build-lib-opus"]
|
||||||
build-lib-schroedinger = ["ffmpeg-sys-next/build-lib-schroedinger"]
|
build-lib-schroedinger = ["ffmpeg-sys-the-third/build-lib-schroedinger"]
|
||||||
build-lib-shine = ["ffmpeg-sys-next/build-lib-shine"]
|
build-lib-shine = ["ffmpeg-sys-the-third/build-lib-shine"]
|
||||||
build-lib-snappy = ["ffmpeg-sys-next/build-lib-snappy"]
|
build-lib-snappy = ["ffmpeg-sys-the-third/build-lib-snappy"]
|
||||||
build-lib-speex = ["ffmpeg-sys-next/build-lib-speex"]
|
build-lib-speex = ["ffmpeg-sys-the-third/build-lib-speex"]
|
||||||
build-lib-stagefright-h264 = ["ffmpeg-sys-next/build-lib-stagefright-h264"]
|
build-lib-stagefright-h264 = ["ffmpeg-sys-the-third/build-lib-stagefright-h264"]
|
||||||
build-lib-theora = ["ffmpeg-sys-next/build-lib-theora"]
|
build-lib-theora = ["ffmpeg-sys-the-third/build-lib-theora"]
|
||||||
build-lib-twolame = ["ffmpeg-sys-next/build-lib-twolame"]
|
build-lib-twolame = ["ffmpeg-sys-the-third/build-lib-twolame"]
|
||||||
build-lib-utvideo = ["ffmpeg-sys-next/build-lib-utvideo"]
|
build-lib-utvideo = ["ffmpeg-sys-the-third/build-lib-utvideo"]
|
||||||
build-lib-vo-aacenc = ["ffmpeg-sys-next/build-lib-vo-aacenc"]
|
build-lib-vo-aacenc = ["ffmpeg-sys-the-third/build-lib-vo-aacenc"]
|
||||||
build-lib-vo-amrwbenc = ["ffmpeg-sys-next/build-lib-vo-amrwbenc"]
|
build-lib-vo-amrwbenc = ["ffmpeg-sys-the-third/build-lib-vo-amrwbenc"]
|
||||||
build-lib-vorbis = ["ffmpeg-sys-next/build-lib-vorbis"]
|
build-lib-vorbis = ["ffmpeg-sys-the-third/build-lib-vorbis"]
|
||||||
build-lib-vpx = ["ffmpeg-sys-next/build-lib-vpx"]
|
build-lib-vpx = ["ffmpeg-sys-the-third/build-lib-vpx"]
|
||||||
build-lib-wavpack = ["ffmpeg-sys-next/build-lib-wavpack"]
|
build-lib-wavpack = ["ffmpeg-sys-the-third/build-lib-wavpack"]
|
||||||
build-lib-webp = ["ffmpeg-sys-next/build-lib-webp"]
|
build-lib-webp = ["ffmpeg-sys-the-third/build-lib-webp"]
|
||||||
build-lib-x264 = ["ffmpeg-sys-next/build-lib-x264"]
|
build-lib-x264 = ["ffmpeg-sys-the-third/build-lib-x264"]
|
||||||
build-lib-x265 = ["ffmpeg-sys-next/build-lib-x265"]
|
build-lib-x265 = ["ffmpeg-sys-the-third/build-lib-x265"]
|
||||||
build-lib-avs = ["ffmpeg-sys-next/build-lib-avs"]
|
build-lib-avs = ["ffmpeg-sys-the-third/build-lib-avs"]
|
||||||
build-lib-xvid = ["ffmpeg-sys-next/build-lib-xvid"]
|
build-lib-xvid = ["ffmpeg-sys-the-third/build-lib-xvid"]
|
||||||
|
|
||||||
# protocols
|
# protocols
|
||||||
build-lib-smbclient = ["ffmpeg-sys-next/build-lib-smbclient"]
|
build-lib-smbclient = ["ffmpeg-sys-the-third/build-lib-smbclient"]
|
||||||
build-lib-ssh = ["ffmpeg-sys-next/build-lib-ssh"]
|
build-lib-ssh = ["ffmpeg-sys-the-third/build-lib-ssh"]
|
||||||
|
|
||||||
# components
|
# components
|
||||||
codec = ["ffmpeg-sys-next/avcodec"]
|
codec = ["ffmpeg-sys-the-third/avcodec"]
|
||||||
device = ["ffmpeg-sys-next/avdevice", "format"]
|
device = ["ffmpeg-sys-the-third/avdevice", "format"]
|
||||||
filter = ["ffmpeg-sys-next/avfilter"]
|
filter = ["ffmpeg-sys-the-third/avfilter"]
|
||||||
format = ["ffmpeg-sys-next/avformat", "codec"]
|
format = ["ffmpeg-sys-the-third/avformat", "codec"]
|
||||||
resampling = ["ffmpeg-sys-next/avresample"]
|
resampling = ["ffmpeg-sys-the-third/avresample"]
|
||||||
postprocessing = ["ffmpeg-sys-next/postproc"]
|
postprocessing = ["ffmpeg-sys-the-third/postproc"]
|
||||||
software-resampling = ["ffmpeg-sys-next/swresample"]
|
software-resampling = ["ffmpeg-sys-the-third/swresample"]
|
||||||
software-scaling = ["ffmpeg-sys-next/swscale", "codec"]
|
software-scaling = ["ffmpeg-sys-the-third/swscale", "codec"]
|
||||||
|
|
||||||
# platforms
|
# platforms
|
||||||
rpi = []
|
rpi = []
|
||||||
@ -115,6 +123,6 @@ bitflags = "1.2"
|
|||||||
version = "0.23"
|
version = "0.23"
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
[dependencies.ffmpeg-sys-next]
|
[dependencies.ffmpeg-sys-the-third]
|
||||||
version = "5.1.1"
|
version = "5.1.1"
|
||||||
default-features = false
|
default-features = false
|
||||||
|
20
README.md
20
README.md
@ -1,25 +1,23 @@
|
|||||||
[![crates.io](https://img.shields.io/crates/v/ffmpeg-next.svg)](https://crates.io/crates/ffmpeg-next)
|
[![crates.io](https://img.shields.io/crates/v/ffmpeg-the-third.svg)](https://crates.io/crates/ffmpeg-the-third)
|
||||||
[![docs.rs](https://docs.rs/ffmpeg-next/badge.svg)](https://docs.rs/ffmpeg-next/)
|
[![docs.rs](https://docs.rs/ffmpeg-the-third/badge.svg)](https://docs.rs/ffmpeg-the-third/)
|
||||||
[![build](https://github.com/zmwangx/rust-ffmpeg/workflows/build/badge.svg)](https://github.com/zmwangx/rust-ffmpeg/actions)
|
[![build](https://github.com/shssoichiro/ffmpeg-the-third/workflows/build/badge.svg)](https://github.com/shssoichiro/ffmpeg-the-third/actions)
|
||||||
|
|
||||||
This is a fork of the abandoned [ffmpeg](https://crates.io/crates/ffmpeg) crate by [meh.](https://github.com/meh/rust-ffmpeg).
|
This is a fork of the abandoned [ffmpeg-next](https://crates.io/crates/ffmpeg-next) crate which is a fork of the abandoned [ffmpeg](https://crates.io/crates/ffmpeg) crate.
|
||||||
|
|
||||||
Currently supported FFmpeg versions: 3.4.x through 4.4.x.
|
Currently supported FFmpeg versions: 4.x, 5.x.
|
||||||
|
|
||||||
Build instructions can be found on the [wiki](https://github.com/zmwangx/rust-ffmpeg/wiki/Notes-on-building).
|
Build instructions can be found on the [wiki](https://github.com/zmwangx/rust-ffmpeg/wiki/Notes-on-building).
|
||||||
|
|
||||||
Documentation:
|
Documentation:
|
||||||
|
|
||||||
- [docs.rs](https://docs.rs/ffmpeg-next/);
|
- [docs.rs](https://docs.rs/ffmpeg-the-third/);
|
||||||
- [FFmpeg user manual](https://ffmpeg.org/ffmpeg-all.html);
|
- [FFmpeg user manual](https://ffmpeg.org/ffmpeg-all.html);
|
||||||
- [FFmpeg Doxygen](https://ffmpeg.org/doxygen/trunk/).
|
- [FFmpeg Doxygen](https://ffmpeg.org/doxygen/trunk/).
|
||||||
|
|
||||||
*Note on upgrading to v4.3.4 or later: v4.3.4 introduced automatic FFmpeg version detection, obsoleting feature flags `ffmpeg4`, `ffmpeg41`, `ffmpeg42` and `ffmpeg43`. If you manually specify any of these features, now is the time to remove them; if you use `ffmpeg43` through the `default` feature, it's still on for backward-compatibility but it has turned into a no-op, and you don't need to do anything. Deprecation plan: `ffmpeg43` will be dropped from default features come 4.4, and all these features will be removed come 5.0.*
|
_Note on upgrading to v4.3.4 or later: v4.3.4 introduced automatic FFmpeg version detection, obsoleting feature flags `ffmpeg4`, `ffmpeg41`, `ffmpeg42` and `ffmpeg43`. If you manually specify any of these features, now is the time to remove them; if you use `ffmpeg43` through the `default` feature, it's still on for backward-compatibility but it has turned into a no-op, and you don't need to do anything. Deprecation plan: `ffmpeg43` will be dropped from default features come 4.4, and all these features will be removed come 5.0._
|
||||||
|
|
||||||
*See [CHANGELOG.md](CHANGELOG.md) for other information on version upgrades.*
|
_See [CHANGELOG.md](CHANGELOG.md) for other information on version upgrades._
|
||||||
|
|
||||||
A word on versioning: major and minor versions of this crate track major and minor versions of FFmpeg, e.g. 4.2.x of this crate has been updated to support the 4.2.x series of FFmpeg. Patch level is reserved for changes to this crate and does not track FFmpeg patch versions. Since we can only freely bump the patch level, versioning of this crate differs from semver: minor versions may behave like semver major versions and introduce backward-incompatible changes; patch versions may behave like semver minor versions and introduce new APIs. Please peg the version you use accordingly.
|
A word on versioning: major and minor versions of this crate track major and minor versions of FFmpeg, e.g. 4.2.x of this crate has been updated to support the 4.2.x series of FFmpeg. Patch level is reserved for changes to this crate and does not track FFmpeg patch versions. Since we can only freely bump the patch level, versioning of this crate differs from semver: minor versions may behave like semver major versions and introduce backward-incompatible changes; patch versions may behave like semver minor versions and introduce new APIs. Please peg the version you use accordingly.
|
||||||
|
|
||||||
**Please realize that this crate is in maintenance-only mode for the most part.** Which means I'll try my best to ensure the crate compiles against all release branches of FFmpeg 3.4 and later (only the latest patch release of each release branch is officially supported) and fix reported bugs, but if a new FFmpeg version brings new APIs that require significant effort to port to Rust, you might have to send me a PR (and just to be clear, I can't really guarantee I'll have the time to review). Any PR to improve existing API is unlikely to be merged, unfortunately.
|
**If you have significant, demonstrable experience in Rust and multimedia-related programming, please let me know, I'll be more than happy to invite you as a collaborator.**
|
||||||
|
|
||||||
🤝 **If you have significant, demonstrable experience in Rust and multimedia-related programming, please let me know, I'll be more than happy to invite you as a collaborator.** 🤝
|
|
||||||
|
41
ffmpeg-sys-the-third/.github/workflows/build.yml
vendored
Normal file
41
ffmpeg-sys-the-third/.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
name: build
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
pull_request:
|
||||||
|
schedule:
|
||||||
|
- cron: "0 0 * * *"
|
||||||
|
jobs:
|
||||||
|
build-test-lint:
|
||||||
|
name: FFmpeg ${{ matrix.ffmpeg_version }} - build, test and lint
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
container: jrottenberg/ffmpeg:${{ matrix.ffmpeg_version }}-ubuntu
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
ffmpeg_version: ['3.3', '3.4', '4.0', '4.1', '4.2', '4.3', '4.4', '5.0', '5.1']
|
||||||
|
fail-fast: false
|
||||||
|
env:
|
||||||
|
FEATURES: avcodec,avdevice,avfilter,avformat,postproc,swresample,swscale
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
- name: Install dependencies
|
||||||
|
run: |
|
||||||
|
apt update
|
||||||
|
apt install -y --no-install-recommends clang curl pkg-config
|
||||||
|
- name: Set up Rust
|
||||||
|
uses: actions-rs/toolchain@v1
|
||||||
|
with:
|
||||||
|
toolchain: stable
|
||||||
|
override: true
|
||||||
|
components: rustfmt, clippy
|
||||||
|
- name: Build
|
||||||
|
run: |
|
||||||
|
cargo build --features $FEATURES
|
||||||
|
- name: Test
|
||||||
|
run: |
|
||||||
|
cargo test --features $FEATURES
|
||||||
|
- name: Lint
|
||||||
|
run: |
|
||||||
|
cargo clippy --features $FEATURES -- -D warnings
|
||||||
|
- name: Check format
|
||||||
|
run: |
|
||||||
|
cargo fmt -- --check
|
3
ffmpeg-sys-the-third/.gitignore
vendored
Normal file
3
ffmpeg-sys-the-third/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
target
|
||||||
|
Cargo.lock
|
||||||
|
/tmp
|
119
ffmpeg-sys-the-third/Cargo.toml
Normal file
119
ffmpeg-sys-the-third/Cargo.toml
Normal file
@ -0,0 +1,119 @@
|
|||||||
|
[package]
|
||||||
|
name = "ffmpeg-sys-the-third"
|
||||||
|
version = "5.1.1"
|
||||||
|
build = "build.rs"
|
||||||
|
links = "ffmpeg"
|
||||||
|
|
||||||
|
authors = ["meh. <meh@schizofreni.co>", "Zhiming Wang <i@zhimingwang.org>"]
|
||||||
|
license = "WTFPL"
|
||||||
|
|
||||||
|
description = "FFI bindings to FFmpeg"
|
||||||
|
repository = "https://github.com/zmwangx/rust-ffmpeg-sys"
|
||||||
|
keywords = ["audio", "video"]
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
# Disable doctests as a workaround for https://github.com/rust-lang/rust-bindgen/issues/1313
|
||||||
|
doctest = false
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
libc = "0.2"
|
||||||
|
|
||||||
|
[build-dependencies]
|
||||||
|
num_cpus = "1.11"
|
||||||
|
cc = "1.0"
|
||||||
|
pkg-config = "0.3"
|
||||||
|
bindgen = { version = "0.59", default-features = false, features = ["runtime"] }
|
||||||
|
|
||||||
|
[target.'cfg(target_env = "msvc")'.build-dependencies]
|
||||||
|
vcpkg = "0.2"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = [
|
||||||
|
"avcodec",
|
||||||
|
"avdevice",
|
||||||
|
"avfilter",
|
||||||
|
"avformat",
|
||||||
|
"swresample",
|
||||||
|
"swscale",
|
||||||
|
"non-exhaustive-enums",
|
||||||
|
]
|
||||||
|
|
||||||
|
static = []
|
||||||
|
build = ["static"]
|
||||||
|
|
||||||
|
# mark enums in generated bindings as #[non_exhaustive]
|
||||||
|
non-exhaustive-enums = []
|
||||||
|
|
||||||
|
# licensing
|
||||||
|
build-license-gpl = ["build"]
|
||||||
|
build-license-nonfree = ["build"]
|
||||||
|
build-license-version3 = ["build"]
|
||||||
|
|
||||||
|
# misc
|
||||||
|
build-drm = ["build"]
|
||||||
|
build-nvenc = ["build"]
|
||||||
|
build-pic = ["build"]
|
||||||
|
build-zlib = ["build"]
|
||||||
|
|
||||||
|
# ssl
|
||||||
|
build-lib-gnutls = ["build"]
|
||||||
|
build-lib-openssl = ["build"]
|
||||||
|
|
||||||
|
# filters
|
||||||
|
build-lib-fontconfig = ["build"]
|
||||||
|
build-lib-frei0r = ["build"]
|
||||||
|
build-lib-ladspa = ["build"]
|
||||||
|
build-lib-ass = ["build"]
|
||||||
|
build-lib-freetype = ["build"]
|
||||||
|
build-lib-freebidi = ["build"]
|
||||||
|
build-lib-opencv = ["build"]
|
||||||
|
build-lib-vmaf = ["build"]
|
||||||
|
|
||||||
|
# encoders/decoders
|
||||||
|
build-lib-aacplus = ["build"]
|
||||||
|
build-lib-celt = ["build"]
|
||||||
|
build-lib-dav1d = ["build"]
|
||||||
|
build-lib-dcadec = ["build"]
|
||||||
|
build-lib-faac = ["build"]
|
||||||
|
build-lib-fdk-aac = ["build"]
|
||||||
|
build-lib-gsm = ["build"]
|
||||||
|
build-lib-ilbc = ["build"]
|
||||||
|
build-lib-kvazaar = ["build"]
|
||||||
|
build-lib-mp3lame = ["build"]
|
||||||
|
build-lib-opencore-amrnb = ["build"]
|
||||||
|
build-lib-opencore-amrwb = ["build"]
|
||||||
|
build-lib-openh264 = ["build"]
|
||||||
|
build-lib-openjpeg = ["build"]
|
||||||
|
build-lib-opus = ["build"]
|
||||||
|
build-lib-schroedinger = ["build"]
|
||||||
|
build-lib-shine = ["build"]
|
||||||
|
build-lib-snappy = ["build"]
|
||||||
|
build-lib-speex = ["build"]
|
||||||
|
build-lib-stagefright-h264 = ["build"]
|
||||||
|
build-lib-theora = ["build"]
|
||||||
|
build-lib-twolame = ["build"]
|
||||||
|
build-lib-utvideo = ["build"]
|
||||||
|
build-lib-vo-aacenc = ["build"]
|
||||||
|
build-lib-vo-amrwbenc = ["build"]
|
||||||
|
build-lib-vorbis = ["build"]
|
||||||
|
build-lib-vpx = ["build"]
|
||||||
|
build-lib-wavpack = ["build"]
|
||||||
|
build-lib-webp = ["build"]
|
||||||
|
build-lib-x264 = ["build"]
|
||||||
|
build-lib-x265 = ["build"]
|
||||||
|
build-lib-avs = ["build"]
|
||||||
|
build-lib-xvid = ["build"]
|
||||||
|
|
||||||
|
# protocols
|
||||||
|
build-lib-smbclient = ["build"]
|
||||||
|
build-lib-ssh = ["build"]
|
||||||
|
|
||||||
|
# components
|
||||||
|
avcodec = []
|
||||||
|
avdevice = ["avformat"]
|
||||||
|
avfilter = []
|
||||||
|
avformat = ["avcodec"]
|
||||||
|
avresample = []
|
||||||
|
postproc = []
|
||||||
|
swresample = []
|
||||||
|
swscale = []
|
31
ffmpeg-sys-the-third/README.md
Normal file
31
ffmpeg-sys-the-third/README.md
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
[![ffmpeg-sys-the-third on crates.io](https://img.shields.io/crates/v/ffmpeg-sys-the-third?cacheSeconds=3600)](https://crates.io/crates/ffmpeg-sys-the-third)
|
||||||
|
[![build](https://github.com/zmwangx/rust-ffmpeg-sys/workflows/build/badge.svg)](https://github.com/zmwangx/rust-ffmpeg-sys/actions)
|
||||||
|
|
||||||
|
This is a fork of the abandoned [ffmpeg-sys](https://github.com/meh/rust-ffmpeg-sys) crate. You can find this crate as [ffmpeg-sys-the-third](https://crates.io/crates/ffmpeg-sys-the-third) on crates.io.
|
||||||
|
|
||||||
|
This crate contains low level bindings to FFmpeg. You're probably interested in the high level bindings instead: [ffmpeg-next](https://github.com/zmwangx/rust-ffmpeg).
|
||||||
|
|
||||||
|
A word on versioning: major and minor versions track major and minor versions of FFmpeg, e.g. 4.2.x of this crate has been updated to support the 4.2.x series of FFmpeg. Patch level is reserved for bug fixes of this crate and does not track FFmpeg patch versions.
|
||||||
|
|
||||||
|
## Feature flags
|
||||||
|
|
||||||
|
In addition to feature flags declared in `Cargo.toml`, this crate performs various compile-time version and feature detections and exposes the results in additional flags. These flags are briefly documented below; run `cargo build -vv` to view more details.
|
||||||
|
|
||||||
|
- `ffmpeg_<x>_<y>` flags (new in v4.3.2), e.g. `ffmpeg_4_4`, indicating the FFmpeg installation being compiled against is at least version `<x>.<y>`. Currently available:
|
||||||
|
|
||||||
|
- `ffmpeg_3_0`
|
||||||
|
- `ffmpeg_3_1`
|
||||||
|
- `ffmpeg_3_2`
|
||||||
|
- `ffmpeg_3_3`
|
||||||
|
- `ffmpeg_3_1`
|
||||||
|
- `ffmpeg_4_0`
|
||||||
|
- `ffmpeg_4_1`
|
||||||
|
- `ffmpeg_4_2`
|
||||||
|
- `ffmpeg_4_3`
|
||||||
|
- `ffmpeg_4_4`
|
||||||
|
|
||||||
|
- `avcodec_version_greater_than_<x>_<y>` (new in v4.3.2), e.g., `avcodec_version_greater_than_58_90`. The name should be self-explanatory.
|
||||||
|
|
||||||
|
- `ff_api_<feature>`, e.g. `ff_api_vaapi`, corresponding to whether their respective uppercase deprecation guards evaluate to true.
|
||||||
|
|
||||||
|
- `ff_api_<feature>_is_defined`, e.g. `ff_api_vappi_is_defined`, similar to above except these are enabled as long as the corresponding deprecation guards are defined.
|
1301
ffmpeg-sys-the-third/build.rs
Normal file
1301
ffmpeg-sys-the-third/build.rs
Normal file
File diff suppressed because it is too large
Load Diff
188
ffmpeg-sys-the-third/channel_layout_fixed.h
Normal file
188
ffmpeg-sys-the-third/channel_layout_fixed.h
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
// Here until https://github.com/rust-lang/rust-bindgen/issues/2192 /
|
||||||
|
// https://github.com/rust-lang/rust-bindgen/issues/258 is fixed.
|
||||||
|
#include <libavutil/channel_layout.h>
|
||||||
|
|
||||||
|
#if LIBAVUTIL_VERSION_MAJOR >= 57 && LIBAVUTIL_VERSION_MINOR >= 28
|
||||||
|
|
||||||
|
#undef AV_CH_FRONT_LEFT
|
||||||
|
#undef AV_CH_FRONT_RIGHT
|
||||||
|
#undef AV_CH_FRONT_CENTER
|
||||||
|
#undef AV_CH_LOW_FREQUENCY
|
||||||
|
#undef AV_CH_BACK_LEFT
|
||||||
|
#undef AV_CH_BACK_RIGHT
|
||||||
|
#undef AV_CH_FRONT_LEFT_OF_CENTER
|
||||||
|
#undef AV_CH_FRONT_RIGHT_OF_CENTER
|
||||||
|
#undef AV_CH_BACK_CENTER
|
||||||
|
#undef AV_CH_SIDE_LEFT
|
||||||
|
#undef AV_CH_SIDE_RIGHT
|
||||||
|
#undef AV_CH_TOP_CENTER
|
||||||
|
#undef AV_CH_TOP_FRONT_LEFT
|
||||||
|
#undef AV_CH_TOP_FRONT_CENTER
|
||||||
|
#undef AV_CH_TOP_FRONT_RIGHT
|
||||||
|
#undef AV_CH_TOP_BACK_LEFT
|
||||||
|
#undef AV_CH_TOP_BACK_CENTER
|
||||||
|
#undef AV_CH_TOP_BACK_RIGHT
|
||||||
|
#undef AV_CH_STEREO_LEFT
|
||||||
|
#undef AV_CH_STEREO_RIGHT
|
||||||
|
#undef AV_CH_WIDE_LEFT
|
||||||
|
#undef AV_CH_WIDE_RIGHT
|
||||||
|
#undef AV_CH_SURROUND_DIRECT_LEFT
|
||||||
|
#undef AV_CH_SURROUND_DIRECT_RIGHT
|
||||||
|
#undef AV_CH_LOW_FREQUENCY_2
|
||||||
|
#undef AV_CH_TOP_SIDE_LEFT
|
||||||
|
#undef AV_CH_TOP_SIDE_RIGHT
|
||||||
|
#undef AV_CH_BOTTOM_FRONT_CENTER
|
||||||
|
#undef AV_CH_BOTTOM_FRONT_LEFT
|
||||||
|
#undef AV_CH_BOTTOM_FRONT_RIGHT
|
||||||
|
|
||||||
|
const unsigned long long AV_CH_FRONT_LEFT = (1ULL << AV_CHAN_FRONT_LEFT);
|
||||||
|
const unsigned long long AV_CH_FRONT_RIGHT = (1ULL << AV_CHAN_FRONT_RIGHT);
|
||||||
|
const unsigned long long AV_CH_FRONT_CENTER =
|
||||||
|
(1ULL << AV_CHAN_FRONT_CENTER);
|
||||||
|
const unsigned long long AV_CH_LOW_FREQUENCY =
|
||||||
|
(1ULL << AV_CHAN_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_BACK_LEFT = (1ULL << AV_CHAN_BACK_LEFT);
|
||||||
|
const unsigned long long AV_CH_BACK_RIGHT = (1ULL << AV_CHAN_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_FRONT_LEFT_OF_CENTER =
|
||||||
|
(1ULL << AV_CHAN_FRONT_LEFT_OF_CENTER);
|
||||||
|
const unsigned long long AV_CH_FRONT_RIGHT_OF_CENTER =
|
||||||
|
(1ULL << AV_CHAN_FRONT_RIGHT_OF_CENTER);
|
||||||
|
const unsigned long long AV_CH_BACK_CENTER = (1ULL << AV_CHAN_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_SIDE_LEFT = (1ULL << AV_CHAN_SIDE_LEFT);
|
||||||
|
const unsigned long long AV_CH_SIDE_RIGHT = (1ULL << AV_CHAN_SIDE_RIGHT);
|
||||||
|
const unsigned long long AV_CH_TOP_CENTER = (1ULL << AV_CHAN_TOP_CENTER);
|
||||||
|
const unsigned long long AV_CH_TOP_FRONT_LEFT =
|
||||||
|
(1ULL << AV_CHAN_TOP_FRONT_LEFT);
|
||||||
|
const unsigned long long AV_CH_TOP_FRONT_CENTER =
|
||||||
|
(1ULL << AV_CHAN_TOP_FRONT_CENTER);
|
||||||
|
const unsigned long long AV_CH_TOP_FRONT_RIGHT =
|
||||||
|
(1ULL << AV_CHAN_TOP_FRONT_RIGHT);
|
||||||
|
const unsigned long long AV_CH_TOP_BACK_LEFT =
|
||||||
|
(1ULL << AV_CHAN_TOP_BACK_LEFT);
|
||||||
|
const unsigned long long AV_CH_TOP_BACK_CENTER =
|
||||||
|
(1ULL << AV_CHAN_TOP_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_TOP_BACK_RIGHT =
|
||||||
|
(1ULL << AV_CHAN_TOP_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_STEREO_LEFT = (1ULL << AV_CHAN_STEREO_LEFT);
|
||||||
|
const unsigned long long AV_CH_STEREO_RIGHT =
|
||||||
|
(1ULL << AV_CHAN_STEREO_RIGHT);
|
||||||
|
const unsigned long long AV_CH_WIDE_LEFT = (1ULL << AV_CHAN_WIDE_LEFT);
|
||||||
|
const unsigned long long AV_CH_WIDE_RIGHT = (1ULL << AV_CHAN_WIDE_RIGHT);
|
||||||
|
const unsigned long long AV_CH_SURROUND_DIRECT_LEFT =
|
||||||
|
(1ULL << AV_CHAN_SURROUND_DIRECT_LEFT);
|
||||||
|
const unsigned long long AV_CH_SURROUND_DIRECT_RIGHT =
|
||||||
|
(1ULL << AV_CHAN_SURROUND_DIRECT_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LOW_FREQUENCY_2 =
|
||||||
|
(1ULL << AV_CHAN_LOW_FREQUENCY_2);
|
||||||
|
const unsigned long long AV_CH_TOP_SIDE_LEFT =
|
||||||
|
(1ULL << AV_CHAN_TOP_SIDE_LEFT);
|
||||||
|
const unsigned long long AV_CH_TOP_SIDE_RIGHT =
|
||||||
|
(1ULL << AV_CHAN_TOP_SIDE_RIGHT);
|
||||||
|
const unsigned long long AV_CH_BOTTOM_FRONT_CENTER =
|
||||||
|
(1ULL << AV_CHAN_BOTTOM_FRONT_CENTER);
|
||||||
|
const unsigned long long AV_CH_BOTTOM_FRONT_LEFT =
|
||||||
|
(1ULL << AV_CHAN_BOTTOM_FRONT_LEFT);
|
||||||
|
const unsigned long long AV_CH_BOTTOM_FRONT_RIGHT =
|
||||||
|
(1ULL << AV_CHAN_BOTTOM_FRONT_RIGHT);
|
||||||
|
|
||||||
|
#undef AV_CH_LAYOUT_MONO
|
||||||
|
#undef AV_CH_LAYOUT_STEREO
|
||||||
|
#undef AV_CH_LAYOUT_2POINT1
|
||||||
|
#undef AV_CH_LAYOUT_2_1
|
||||||
|
#undef AV_CH_LAYOUT_SURROUND
|
||||||
|
#undef AV_CH_LAYOUT_3POINT1
|
||||||
|
#undef AV_CH_LAYOUT_4POINT0
|
||||||
|
#undef AV_CH_LAYOUT_4POINT1
|
||||||
|
#undef AV_CH_LAYOUT_2_2
|
||||||
|
#undef AV_CH_LAYOUT_QUAD
|
||||||
|
#undef AV_CH_LAYOUT_5POINT0
|
||||||
|
#undef AV_CH_LAYOUT_5POINT1
|
||||||
|
#undef AV_CH_LAYOUT_5POINT0_BACK
|
||||||
|
#undef AV_CH_LAYOUT_5POINT1_BACK
|
||||||
|
#undef AV_CH_LAYOUT_6POINT0
|
||||||
|
#undef AV_CH_LAYOUT_6POINT0_FRONT
|
||||||
|
#undef AV_CH_LAYOUT_HEXAGONAL
|
||||||
|
#undef AV_CH_LAYOUT_6POINT1
|
||||||
|
#undef AV_CH_LAYOUT_6POINT1_BACK
|
||||||
|
#undef AV_CH_LAYOUT_6POINT1_FRONT
|
||||||
|
#undef AV_CH_LAYOUT_7POINT0
|
||||||
|
#undef AV_CH_LAYOUT_7POINT0_FRONT
|
||||||
|
#undef AV_CH_LAYOUT_7POINT1
|
||||||
|
#undef AV_CH_LAYOUT_7POINT1_WIDE
|
||||||
|
#undef AV_CH_LAYOUT_7POINT1_WIDE_BACK
|
||||||
|
#undef AV_CH_LAYOUT_OCTAGONAL
|
||||||
|
#undef AV_CH_LAYOUT_HEXADECAGONAL
|
||||||
|
#undef AV_CH_LAYOUT_STEREO_DOWNMIX
|
||||||
|
#undef AV_CH_LAYOUT_22POINT2
|
||||||
|
|
||||||
|
const unsigned long long AV_CH_LAYOUT_MONO = (AV_CH_FRONT_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_STEREO =
|
||||||
|
(AV_CH_FRONT_LEFT | AV_CH_FRONT_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_2POINT1 =
|
||||||
|
(AV_CH_LAYOUT_STEREO | AV_CH_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_2_1 =
|
||||||
|
(AV_CH_LAYOUT_STEREO | AV_CH_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_SURROUND =
|
||||||
|
(AV_CH_LAYOUT_STEREO | AV_CH_FRONT_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_3POINT1 =
|
||||||
|
(AV_CH_LAYOUT_SURROUND | AV_CH_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_4POINT0 =
|
||||||
|
(AV_CH_LAYOUT_SURROUND | AV_CH_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_4POINT1 =
|
||||||
|
(AV_CH_LAYOUT_4POINT0 | AV_CH_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_2_2 =
|
||||||
|
(AV_CH_LAYOUT_STEREO | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_QUAD =
|
||||||
|
(AV_CH_LAYOUT_STEREO | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_5POINT0 =
|
||||||
|
(AV_CH_LAYOUT_SURROUND | AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_5POINT1 =
|
||||||
|
(AV_CH_LAYOUT_5POINT0 | AV_CH_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_5POINT0_BACK =
|
||||||
|
(AV_CH_LAYOUT_SURROUND | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_5POINT1_BACK =
|
||||||
|
(AV_CH_LAYOUT_5POINT0_BACK | AV_CH_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_6POINT0 =
|
||||||
|
(AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_6POINT0_FRONT =
|
||||||
|
(AV_CH_LAYOUT_2_2 | AV_CH_FRONT_LEFT_OF_CENTER |
|
||||||
|
AV_CH_FRONT_RIGHT_OF_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_HEXAGONAL =
|
||||||
|
(AV_CH_LAYOUT_5POINT0_BACK | AV_CH_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_6POINT1 =
|
||||||
|
(AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_6POINT1_BACK =
|
||||||
|
(AV_CH_LAYOUT_5POINT1_BACK | AV_CH_BACK_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_6POINT1_FRONT =
|
||||||
|
(AV_CH_LAYOUT_6POINT0_FRONT | AV_CH_LOW_FREQUENCY);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_7POINT0 =
|
||||||
|
(AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_7POINT0_FRONT =
|
||||||
|
(AV_CH_LAYOUT_5POINT0 | AV_CH_FRONT_LEFT_OF_CENTER |
|
||||||
|
AV_CH_FRONT_RIGHT_OF_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_7POINT1 =
|
||||||
|
(AV_CH_LAYOUT_5POINT1 | AV_CH_BACK_LEFT | AV_CH_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_7POINT1_WIDE =
|
||||||
|
(AV_CH_LAYOUT_5POINT1 | AV_CH_FRONT_LEFT_OF_CENTER |
|
||||||
|
AV_CH_FRONT_RIGHT_OF_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_7POINT1_WIDE_BACK =
|
||||||
|
(AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER |
|
||||||
|
AV_CH_FRONT_RIGHT_OF_CENTER);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_OCTAGONAL =
|
||||||
|
(AV_CH_LAYOUT_5POINT0 | AV_CH_BACK_LEFT | AV_CH_BACK_CENTER |
|
||||||
|
AV_CH_BACK_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_HEXADECAGONAL =
|
||||||
|
(AV_CH_LAYOUT_OCTAGONAL | AV_CH_WIDE_LEFT | AV_CH_WIDE_RIGHT |
|
||||||
|
AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_BACK_CENTER |
|
||||||
|
AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_FRONT_LEFT | AV_CH_TOP_FRONT_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_STEREO_DOWNMIX =
|
||||||
|
(AV_CH_STEREO_LEFT | AV_CH_STEREO_RIGHT);
|
||||||
|
const unsigned long long AV_CH_LAYOUT_22POINT2 =
|
||||||
|
(AV_CH_LAYOUT_5POINT1_BACK | AV_CH_FRONT_LEFT_OF_CENTER |
|
||||||
|
AV_CH_FRONT_RIGHT_OF_CENTER | AV_CH_BACK_CENTER | AV_CH_LOW_FREQUENCY_2 |
|
||||||
|
AV_CH_SIDE_LEFT | AV_CH_SIDE_RIGHT | AV_CH_TOP_FRONT_LEFT |
|
||||||
|
AV_CH_TOP_FRONT_RIGHT | AV_CH_TOP_FRONT_CENTER | AV_CH_TOP_CENTER |
|
||||||
|
AV_CH_TOP_BACK_LEFT | AV_CH_TOP_BACK_RIGHT | AV_CH_TOP_SIDE_LEFT |
|
||||||
|
AV_CH_TOP_SIDE_RIGHT | AV_CH_TOP_BACK_CENTER | AV_CH_BOTTOM_FRONT_CENTER |
|
||||||
|
AV_CH_BOTTOM_FRONT_LEFT | AV_CH_BOTTOM_FRONT_RIGHT);
|
||||||
|
#endif
|
68
ffmpeg-sys-the-third/src/avutil/error.rs
Normal file
68
ffmpeg-sys-the-third/src/avutil/error.rs
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
use libc::{c_char, c_int, size_t};
|
||||||
|
|
||||||
|
// Note: FFmpeg's AVERROR and AVUNERROR are conditionally defined based on
|
||||||
|
// whether EDOM is positive, claiming that "Some platforms have E* and errno
|
||||||
|
// already negated". This can be traced to a commit in 2007 where "some
|
||||||
|
// platforms" were specifically identified as BeOS (so maybe also Haiku?):
|
||||||
|
// https://github.com/FFmpeg/FFmpeg/commit/8fa36ae09dddb1b639b4df5d505c0dbcf4e916e4
|
||||||
|
// constness is more valuable than BeOS support, so if someone really needs it,
|
||||||
|
// send a patch with cfg_attr.
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub const fn AVERROR(e: c_int) -> c_int {
|
||||||
|
-e
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub const fn AVUNERROR(e: c_int) -> c_int {
|
||||||
|
-e
|
||||||
|
}
|
||||||
|
|
||||||
|
macro_rules! FFERRTAG {
|
||||||
|
($a:expr, $b:expr, $c:expr, $d:expr) => {
|
||||||
|
-MKTAG!($a, $b, $c, $d) as c_int
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
pub const AVERROR_BSF_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'B', b'S', b'F');
|
||||||
|
pub const AVERROR_BUG: c_int = FFERRTAG!(b'B', b'U', b'G', b'!');
|
||||||
|
pub const AVERROR_BUFFER_TOO_SMALL: c_int = FFERRTAG!(b'B', b'U', b'F', b'S');
|
||||||
|
pub const AVERROR_DECODER_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'D', b'E', b'C');
|
||||||
|
pub const AVERROR_DEMUXER_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'D', b'E', b'M');
|
||||||
|
pub const AVERROR_ENCODER_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'E', b'N', b'C');
|
||||||
|
pub const AVERROR_EOF: c_int = FFERRTAG!(b'E', b'O', b'F', b' ');
|
||||||
|
pub const AVERROR_EXIT: c_int = FFERRTAG!(b'E', b'X', b'I', b'T');
|
||||||
|
pub const AVERROR_EXTERNAL: c_int = FFERRTAG!(b'E', b'X', b'T', b' ');
|
||||||
|
pub const AVERROR_FILTER_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'F', b'I', b'L');
|
||||||
|
pub const AVERROR_INVALIDDATA: c_int = FFERRTAG!(b'I', b'N', b'D', b'A');
|
||||||
|
pub const AVERROR_MUXER_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'M', b'U', b'X');
|
||||||
|
pub const AVERROR_OPTION_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'O', b'P', b'T');
|
||||||
|
pub const AVERROR_PATCHWELCOME: c_int = FFERRTAG!(b'P', b'A', b'W', b'E');
|
||||||
|
pub const AVERROR_PROTOCOL_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'P', b'R', b'O');
|
||||||
|
|
||||||
|
pub const AVERROR_STREAM_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'S', b'T', b'R');
|
||||||
|
|
||||||
|
pub const AVERROR_BUG2: c_int = FFERRTAG!(b'B', b'U', b'G', b' ');
|
||||||
|
pub const AVERROR_UNKNOWN: c_int = FFERRTAG!(b'U', b'N', b'K', b'N');
|
||||||
|
|
||||||
|
pub const AVERROR_HTTP_BAD_REQUEST: c_int = FFERRTAG!(0xF8, b'4', b'0', b'0');
|
||||||
|
pub const AVERROR_HTTP_UNAUTHORIZED: c_int = FFERRTAG!(0xF8, b'4', b'0', b'1');
|
||||||
|
pub const AVERROR_HTTP_FORBIDDEN: c_int = FFERRTAG!(0xF8, b'4', b'0', b'3');
|
||||||
|
pub const AVERROR_HTTP_NOT_FOUND: c_int = FFERRTAG!(0xF8, b'4', b'0', b'4');
|
||||||
|
pub const AVERROR_HTTP_OTHER_4XX: c_int = FFERRTAG!(0xF8, b'4', b'X', b'X');
|
||||||
|
pub const AVERROR_HTTP_SERVER_ERROR: c_int = FFERRTAG!(0xF8, b'5', b'X', b'X');
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn av_make_error_string(
|
||||||
|
errbuf: *mut c_char,
|
||||||
|
errbuf_size: size_t,
|
||||||
|
errnum: c_int,
|
||||||
|
) -> *mut c_char {
|
||||||
|
av_strerror(errnum, errbuf, errbuf_size);
|
||||||
|
|
||||||
|
errbuf
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
pub fn av_strerror(errnum: c_int, errbuf: *mut c_char, errbuf_size: size_t) -> c_int;
|
||||||
|
}
|
13
ffmpeg-sys-the-third/src/avutil/macros.rs
Normal file
13
ffmpeg-sys-the-third/src/avutil/macros.rs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#[macro_export]
|
||||||
|
macro_rules! MKBETAG {
|
||||||
|
($a:expr, $b:expr, $c:expr, $d:expr) => {
|
||||||
|
($d as isize) | (($c as isize) << 8) | (($b as isize) << 16) | (($a as isize) << 24)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
#[macro_export]
|
||||||
|
macro_rules! MKTAG {
|
||||||
|
($a:expr, $b:expr, $c:expr, $d:expr) => {
|
||||||
|
($a as isize) | (($b as isize) << 8) | (($c as isize) << 16) | (($d as isize) << 24)
|
||||||
|
};
|
||||||
|
}
|
14
ffmpeg-sys-the-third/src/avutil/mod.rs
Normal file
14
ffmpeg-sys-the-third/src/avutil/mod.rs
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#[macro_use]
|
||||||
|
mod macros;
|
||||||
|
|
||||||
|
mod error;
|
||||||
|
pub use self::error::*;
|
||||||
|
|
||||||
|
mod util;
|
||||||
|
pub use self::util::*;
|
||||||
|
|
||||||
|
mod rational;
|
||||||
|
pub use self::rational::*;
|
||||||
|
|
||||||
|
mod pixfmt;
|
||||||
|
pub use self::pixfmt::*;
|
236
ffmpeg-sys-the-third/src/avutil/pixfmt.rs
Normal file
236
ffmpeg-sys-the-third/src/avutil/pixfmt.rs
Normal file
@ -0,0 +1,236 @@
|
|||||||
|
use AVPixelFormat;
|
||||||
|
use AVPixelFormat::*;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_RGB32: AVPixelFormat = AV_PIX_FMT_BGRA;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_RGB32_1: AVPixelFormat = AV_PIX_FMT_ABGR;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BGR32: AVPixelFormat = AV_PIX_FMT_RGBA;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BGR32_1: AVPixelFormat = AV_PIX_FMT_ARGB;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_0RGB32: AVPixelFormat = AV_PIX_FMT_BGR0;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_0BGR32: AVPixelFormat = AV_PIX_FMT_RGB0;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GRAY16: AVPixelFormat = AV_PIX_FMT_GRAY16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YA16: AVPixelFormat = AV_PIX_FMT_YA16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_RGB48: AVPixelFormat = AV_PIX_FMT_RGB48LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_RGB565: AVPixelFormat = AV_PIX_FMT_RGB565LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_RGB555: AVPixelFormat = AV_PIX_FMT_RGB555LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_RGB444: AVPixelFormat = AV_PIX_FMT_RGB444LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BGR48: AVPixelFormat = AV_PIX_FMT_BGR48LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BGR565: AVPixelFormat = AV_PIX_FMT_BGR565LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BGR555: AVPixelFormat = AV_PIX_FMT_BGR555LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BGR444: AVPixelFormat = AV_PIX_FMT_BGR444LE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P9: AVPixelFormat = AV_PIX_FMT_YUV420P9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P9: AVPixelFormat = AV_PIX_FMT_YUV422P9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P9: AVPixelFormat = AV_PIX_FMT_YUV444P9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P10: AVPixelFormat = AV_PIX_FMT_YUV420P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P10: AVPixelFormat = AV_PIX_FMT_YUV422P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV440P10: AVPixelFormat = AV_PIX_FMT_YUV440P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P10: AVPixelFormat = AV_PIX_FMT_YUV444P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P12: AVPixelFormat = AV_PIX_FMT_YUV420P12LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P12: AVPixelFormat = AV_PIX_FMT_YUV422P12LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV440P12: AVPixelFormat = AV_PIX_FMT_YUV440P12LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P12: AVPixelFormat = AV_PIX_FMT_YUV444P12LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P14: AVPixelFormat = AV_PIX_FMT_YUV420P14LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P14: AVPixelFormat = AV_PIX_FMT_YUV422P14LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P14: AVPixelFormat = AV_PIX_FMT_YUV444P14LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P16: AVPixelFormat = AV_PIX_FMT_YUV420P16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P16: AVPixelFormat = AV_PIX_FMT_YUV422P16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P16: AVPixelFormat = AV_PIX_FMT_YUV444P16LE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GBRP9: AVPixelFormat = AV_PIX_FMT_GBRP9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GBRP10: AVPixelFormat = AV_PIX_FMT_GBRP10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GBRP12: AVPixelFormat = AV_PIX_FMT_GBRP12LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GBRP14: AVPixelFormat = AV_PIX_FMT_GBRP14LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GBRP16: AVPixelFormat = AV_PIX_FMT_GBRP16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_GBRAP16: AVPixelFormat = AV_PIX_FMT_GBRAP16LE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_BGGR16: AVPixelFormat = AV_PIX_FMT_BAYER_BGGR16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_RGGB16: AVPixelFormat = AV_PIX_FMT_BAYER_RGGB16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_GBRG16: AVPixelFormat = AV_PIX_FMT_BAYER_GBRG16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_GRBG16: AVPixelFormat = AV_PIX_FMT_BAYER_GRBG16LE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA420P9: AVPixelFormat = AV_PIX_FMT_YUVA420P9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA422P9: AVPixelFormat = AV_PIX_FMT_YUVA422P9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA444P9: AVPixelFormat = AV_PIX_FMT_YUVA444P9LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA420P10: AVPixelFormat = AV_PIX_FMT_YUVA420P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA422P10: AVPixelFormat = AV_PIX_FMT_YUVA422P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA444P10: AVPixelFormat = AV_PIX_FMT_YUVA444P10LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA420P16: AVPixelFormat = AV_PIX_FMT_YUVA420P16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA422P16: AVPixelFormat = AV_PIX_FMT_YUVA422P16LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_YUVA444P16: AVPixelFormat = AV_PIX_FMT_YUVA444P16LE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_XYZ12: AVPixelFormat = AV_PIX_FMT_XYZ12LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_NV20: AVPixelFormat = AV_PIX_FMT_NV20LE;
|
||||||
|
#[cfg(target_endian = "little")]
|
||||||
|
pub const AV_PIX_FMT_AYUV64: AVPixelFormat = AV_PIX_FMT_AYUV64LE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_RGB32: AVPixelFormat = AV_PIX_FMT_ARGB;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_RGB32_1: AVPixelFormat = AV_PIX_FMT_RGBA;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BGR32: AVPixelFormat = AV_PIX_FMT_ABGR;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BGR32_1: AVPixelFormat = AV_PIX_FMT_BGRA;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_0RGB32: AVPixelFormat = AV_PIX_FMT_0RGB;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_0BGR32: AVPixelFormat = AV_PIX_FMT_0BGR;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GRAY16: AVPixelFormat = AV_PIX_FMT_GRAY16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YA16: AVPixelFormat = AV_PIX_FMT_YA16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_RGB48: AVPixelFormat = AV_PIX_FMT_RGB48BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_RGB565: AVPixelFormat = AV_PIX_FMT_RGB565BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_RGB555: AVPixelFormat = AV_PIX_FMT_RGB555BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_RGB444: AVPixelFormat = AV_PIX_FMT_RGB444BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BGR48: AVPixelFormat = AV_PIX_FMT_BGR48BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BGR565: AVPixelFormat = AV_PIX_FMT_BGR565BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BGR555: AVPixelFormat = AV_PIX_FMT_BGR555BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BGR444: AVPixelFormat = AV_PIX_FMT_BGR444BE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P9: AVPixelFormat = AV_PIX_FMT_YUV420P9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P9: AVPixelFormat = AV_PIX_FMT_YUV422P9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P9: AVPixelFormat = AV_PIX_FMT_YUV444P9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P10: AVPixelFormat = AV_PIX_FMT_YUV420P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P10: AVPixelFormat = AV_PIX_FMT_YUV422P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV440P10: AVPixelFormat = AV_PIX_FMT_YUV440P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P10: AVPixelFormat = AV_PIX_FMT_YUV444P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P12: AVPixelFormat = AV_PIX_FMT_YUV420P12BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P12: AVPixelFormat = AV_PIX_FMT_YUV422P12BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV440P12: AVPixelFormat = AV_PIX_FMT_YUV440P12BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P12: AVPixelFormat = AV_PIX_FMT_YUV444P12BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P14: AVPixelFormat = AV_PIX_FMT_YUV420P14BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P14: AVPixelFormat = AV_PIX_FMT_YUV422P14BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P14: AVPixelFormat = AV_PIX_FMT_YUV444P14BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV420P16: AVPixelFormat = AV_PIX_FMT_YUV420P16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV422P16: AVPixelFormat = AV_PIX_FMT_YUV422P16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUV444P16: AVPixelFormat = AV_PIX_FMT_YUV444P16BE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GBRP9: AVPixelFormat = AV_PIX_FMT_GBRP9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GBRP10: AVPixelFormat = AV_PIX_FMT_GBRP10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GBRP12: AVPixelFormat = AV_PIX_FMT_GBRP12BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GBRP14: AVPixelFormat = AV_PIX_FMT_GBRP14BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GBRP16: AVPixelFormat = AV_PIX_FMT_GBRP16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_GBRAP16: AVPixelFormat = AV_PIX_FMT_GBRAP16BE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_BGGR16: AVPixelFormat = AV_PIX_FMT_BAYER_BGGR16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_RGGB16: AVPixelFormat = AV_PIX_FMT_BAYER_RGGB16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_GBRG16: AVPixelFormat = AV_PIX_FMT_BAYER_GBRG16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_BAYER_GRBG16: AVPixelFormat = AV_PIX_FMT_BAYER_GRBG16BE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA420P9: AVPixelFormat = AV_PIX_FMT_YUVA420P9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA422P9: AVPixelFormat = AV_PIX_FMT_YUVA422P9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA444P9: AVPixelFormat = AV_PIX_FMT_YUVA444P9BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA420P10: AVPixelFormat = AV_PIX_FMT_YUVA420P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA422P10: AVPixelFormat = AV_PIX_FMT_YUVA422P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA444P10: AVPixelFormat = AV_PIX_FMT_YUVA444P10BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA420P16: AVPixelFormat = AV_PIX_FMT_YUVA420P16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA422P16: AVPixelFormat = AV_PIX_FMT_YUVA422P16BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_YUVA444P16: AVPixelFormat = AV_PIX_FMT_YUVA444P16BE;
|
||||||
|
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_XYZ12: AVPixelFormat = AV_PIX_FMT_XYZ12BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_NV20: AVPixelFormat = AV_PIX_FMT_NV20BE;
|
||||||
|
#[cfg(target_endian = "big")]
|
||||||
|
pub const AV_PIX_FMT_AYUV64: AVPixelFormat = AV_PIX_FMT_AYUV64BE;
|
35
ffmpeg-sys-the-third/src/avutil/rational.rs
Normal file
35
ffmpeg-sys-the-third/src/avutil/rational.rs
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
use libc::{c_double, c_int};
|
||||||
|
use AVRational;
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn av_make_q(num: c_int, den: c_int) -> AVRational {
|
||||||
|
AVRational { num, den }
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn av_cmp_q(a: AVRational, b: AVRational) -> c_int {
|
||||||
|
let tmp = i64::from(a.num) * i64::from(b.den) - i64::from(b.num) * i64::from(a.den);
|
||||||
|
|
||||||
|
if tmp != 0 {
|
||||||
|
(((tmp ^ i64::from(a.den) ^ i64::from(b.den)) >> 63) | 1) as c_int
|
||||||
|
} else if b.den != 0 && a.den != 0 {
|
||||||
|
0
|
||||||
|
} else if a.num != 0 && b.num != 0 {
|
||||||
|
((i64::from(a.num) >> 31) - (i64::from(b.num) >> 31)) as c_int
|
||||||
|
} else {
|
||||||
|
c_int::min_value()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn av_q2d(a: AVRational) -> c_double {
|
||||||
|
f64::from(a.num) / f64::from(a.den)
|
||||||
|
}
|
||||||
|
|
||||||
|
#[inline(always)]
|
||||||
|
pub unsafe fn av_inv_q(q: AVRational) -> AVRational {
|
||||||
|
AVRational {
|
||||||
|
num: q.den,
|
||||||
|
den: q.num,
|
||||||
|
}
|
||||||
|
}
|
8
ffmpeg-sys-the-third/src/avutil/util.rs
Normal file
8
ffmpeg-sys-the-third/src/avutil/util.rs
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
use libc::c_int;
|
||||||
|
use {AVRational, AV_TIME_BASE};
|
||||||
|
|
||||||
|
pub const AV_NOPTS_VALUE: i64 = 0x8000000000000000u64 as i64;
|
||||||
|
pub const AV_TIME_BASE_Q: AVRational = AVRational {
|
||||||
|
num: 1,
|
||||||
|
den: AV_TIME_BASE as c_int,
|
||||||
|
};
|
16
ffmpeg-sys-the-third/src/lib.rs
Normal file
16
ffmpeg-sys-the-third/src/lib.rs
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#![allow(non_upper_case_globals)]
|
||||||
|
#![allow(non_camel_case_types)]
|
||||||
|
#![allow(non_snake_case)]
|
||||||
|
#![allow(clippy::approx_constant)]
|
||||||
|
#![allow(clippy::missing_safety_doc)]
|
||||||
|
#![allow(clippy::redundant_static_lifetimes)]
|
||||||
|
#![allow(clippy::too_many_arguments)]
|
||||||
|
#![allow(clippy::type_complexity)]
|
||||||
|
|
||||||
|
extern crate libc;
|
||||||
|
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
|
||||||
|
|
||||||
|
#[macro_use]
|
||||||
|
mod avutil;
|
||||||
|
pub use avutil::*;
|
Loading…
x
Reference in New Issue
Block a user