Skip to content

Commit fa5e496

Browse files
committed
Added decklink configure flag
1 parent 8c643bb commit fa5e496

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ build-lib-x264 = ["build"]
9595
build-lib-x265 = ["build"]
9696
build-lib-avs = ["build"]
9797
build-lib-xvid = ["build"]
98+
build-lib-decklink = ["build"]
9899

99100
# hardware accelleration
100101
build-videotoolbox = ["build"]

build.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ extern crate num_cpus;
44
extern crate pkg_config;
55

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

534+
enable!(configure, "BUILD_LIB_DECKLINK", "decklink");
535+
if env::var("CARGO_FEATURE_BUILD_LIB_DECKLINK").is_ok() {
536+
match env::var_os("FFMPEG_DECKLINK_SDK_INCLUDE") {
537+
Some(path) => {
538+
let mut flags = OsString::from("--extra-cflags=-I");
539+
flags.push(path);
540+
configure.arg(flags);
541+
}
542+
None => {
543+
eprintln!("Warning: missing environment variable FFMPEG_DECKLINK_SDK_INCLUDE, compilation may fail");
544+
eprintln!("FFMPEG_DECKLINK_SDK_INCLUDE should be a path to decklink SDK (v12.9) include folder");
545+
eprintln!("Please do not include space in path");
546+
}
547+
}
548+
}
549+
533550
// make sure to only enable related hw acceleration features for a correct
534551
// target os. This allows to leave allows cargo features enable and control
535552
// ffmpeg compilation using target only

0 commit comments

Comments
 (0)