Skip to content

Commit d667aa6

Browse files
committed
initial test
1 parent 1fe4958 commit d667aa6

6 files changed

Lines changed: 2263 additions & 6 deletions

File tree

crates/file-cache/src/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
88
use data_encoding::BASE64URL_NOPAD;
99
use linked_hash_map::LinkedHashMap;
1010
use rand::RngCore;
11-
use std::cmp::Ordering;
1211
use std::collections::{HashMap, HashSet};
1312
use std::fs::{self, Metadata};
1413
use std::io::{self, Read, Write};

crates/media_info/build.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const FFMPEG_VERSION_4: &str = "ffmpeg-4.4.6";
22
const FFMPEG_VERSION_5: &str = "ffmpeg-5.1.7";
33
const FFMPEG_VERSION_6: &str = "ffmpeg-6.1.1";
4+
const FFMPEG_VERSION_7: &str = "ffmpeg-7.1.1";
45

56
macro_rules! warn {
67
($fmt:literal $(, $arg:expr)* ) => {
@@ -15,15 +16,23 @@ fn parse_main_version(version: &str) -> Option<u32> {
1516

1617
fn main() {
1718
println!("cargo:rerun-if-changed=build.rs");
19+
#[cfg(windows)]
20+
{
21+
println!("cargo:rustc-link-search=C:/ffmpeg/lib");
22+
std::env::set_var("PKG_CONFIG_PATH", "C:\\ffmpeg\\lib\\pkgconfig");
23+
}
24+
1825
let ffmpeg_version = if cfg!(feature = "static") || cfg!(feature = "partially-static") {
1926
FFMPEG_VERSION_6
2027
} else {
2128
match pkg_config::probe_library("libavformat") {
2229
Ok(lib) => {
2330
if let Some(version) = parse_main_version(&lib.version) {
24-
if version > 60 {
25-
warn!("libavformat is too new - will try latest ffi, but may not work");
26-
FFMPEG_VERSION_6
31+
if version > 62 {
32+
warn!("libavformat {} is too new - will try latest ffi, but may not work", version);
33+
FFMPEG_VERSION_7
34+
} else if version == 62 {
35+
FFMPEG_VERSION_7
2736
} else if version == 60 {
2837
FFMPEG_VERSION_6
2938
} else if version == 59 {

crates/media_info/generate_ffi.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,5 @@ bindgen \
2525
--allowlist-var AV_DICT_IGNORE_SUFFIX \
2626
--allowlist-var AV_TIME_BASE \
2727
wrapper.h -- -I $FFMPEG_VERSION \
28+
-I"C:\ffmpeg\include" \
2829
> src/ffi_$FFMPEG_VERSION.rs

0 commit comments

Comments
 (0)