Skip to content

Commit

Permalink
Bump av-metrics-decoders in other av-metrics crates (#298)
Browse files Browse the repository at this point in the history
* Bump decoder crate in av-metrics-tool

* Bump decoder crate in av-metrics-tests

* Ignore unused imports in tests

* Hide import behind feature flag
  • Loading branch information
FreezyLemon authored Sep 17, 2024
1 parent 8155e07 commit 52b9fdd
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 27 deletions.
24 changes: 3 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion av_metrics_tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ publish = false

[dependencies]
av-metrics = { version = "0.9", features = ["serde"] }
av-metrics-decoders = "0.2.1"
av-metrics-decoders = "0.3.1"

[features]
default = ["y4m"]
Expand Down
8 changes: 6 additions & 2 deletions av_metrics_tests/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#[cfg(test)]
mod tests {
#![allow(unused_imports)]

use av_metrics::video::ciede::{calculate_video_ciede, calculate_video_ciede_nosimd};
use av_metrics::video::psnr::{calculate_video_apsnr, calculate_video_psnr};
use av_metrics::video::psnr_hvs::calculate_video_psnr_hvs;
Expand All @@ -8,11 +10,13 @@ mod tests {
use av_metrics_decoders::FfmpegDecoder;
#[cfg(not(feature = "ffmpeg"))]
use av_metrics_decoders::Y4MDecoder;
use std::fs::File;
use std::io::BufReader;
use std::path::Path;

#[cfg(not(feature = "ffmpeg"))]
fn get_decoder<P: AsRef<Path>>(input: P) -> Result<Y4MDecoder, String> {
Y4MDecoder::new(input)
fn get_decoder<P: AsRef<Path>>(input: P) -> Result<Y4MDecoder<BufReader<File>>, String> {
av_metrics_decoders::y4m::new_decoder_from_file(input)
}

#[cfg(feature = "ffmpeg")]
Expand Down
2 changes: 1 addition & 1 deletion av_metrics_tool/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include = ["src/**/*", "LICENSE"]

[dependencies]
av-metrics = { version = "0.9", features = ["serde"] }
av-metrics-decoders = "0.2.1"
av-metrics-decoders = "0.3.1"
clap = "4"
console = "0.15.0"
indicatif = "0.17.1"
Expand Down
6 changes: 4 additions & 2 deletions av_metrics_tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ use indicatif::{ProgressBar, ProgressStyle};
use serde::Serialize;
use std::error::Error;
use std::fs::File;
#[cfg(not(feature = "ffmpeg"))]
use std::io::BufReader;
use std::io::{BufWriter, Stdout, Write};
use std::path::Path;

Expand Down Expand Up @@ -166,8 +168,8 @@ impl InputType {
}

#[cfg(not(feature = "ffmpeg"))]
pub fn get_decoder<P: AsRef<Path>>(input: P) -> Result<Y4MDecoder, String> {
Y4MDecoder::new(input)
pub fn get_decoder<P: AsRef<Path>>(input: P) -> Result<Y4MDecoder<BufReader<File>>, String> {
av_metrics_decoders::y4m::new_decoder_from_file(input)
}

#[cfg(feature = "ffmpeg")]
Expand Down

0 comments on commit 52b9fdd

Please sign in to comment.