Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ build-lib-x264 = ["build"]
build-lib-x265 = ["build"]
build-lib-avs = ["build"]
build-lib-xvid = ["build"]
build-lib-decklink = ["build"]

# hardware accelleration
build-videotoolbox = ["build"]
Expand Down
17 changes: 17 additions & 0 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern crate num_cpus;
extern crate pkg_config;

use std::env;
use std::ffi::OsString;
use std::fmt::Write as FmtWrite;
use std::fs::{self, File};
use std::io::{self, BufRead, BufReader, Write};
Expand Down Expand Up @@ -530,6 +531,22 @@ fn build(sysroot: Option<&str>) -> io::Result<()> {
enable!(configure, "BUILD_LIB_AVS", "libavs");
enable!(configure, "BUILD_LIB_XVID", "libxvid");

enable!(configure, "BUILD_LIB_DECKLINK", "decklink");
if env::var("CARGO_FEATURE_BUILD_LIB_DECKLINK").is_ok() {
match env::var_os("FFMPEG_DECKLINK_SDK_INCLUDE") {
Some(path) => {
let mut flags = OsString::from("--extra-cflags=-I");
flags.push(path);
configure.arg(flags);
}
None => {
eprintln!("Warning: missing environment variable FFMPEG_DECKLINK_SDK_INCLUDE, compilation may fail");
eprintln!("FFMPEG_DECKLINK_SDK_INCLUDE should be a path to decklink SDK (v12.9) include folder");
eprintln!("Please do not include space in path");
}
}
}

// make sure to only enable related hw acceleration features for a correct
// target os. This allows to leave allows cargo features enable and control
// ffmpeg compilation using target only
Expand Down