File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -95,6 +95,7 @@ build-lib-x264 = ["build"]
9595build-lib-x265 = [" build" ]
9696build-lib-avs = [" build" ]
9797build-lib-xvid = [" build" ]
98+ build-lib-decklink = [" build" ]
9899
99100# hardware accelleration
100101build-videotoolbox = [" build" ]
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ extern crate num_cpus;
44extern crate pkg_config;
55
66use std:: env;
7+ use std:: ffi:: OsString ;
78use std:: fmt:: Write as FmtWrite ;
89use std:: fs:: { self , File } ;
910use 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
You can’t perform that action at this time.
0 commit comments