Enabled deprication warnings, fixed some of the warnings

This commit is contained in:
Ziver Koc 2025-12-18 01:00:03 +01:00
parent 5f02f65ead
commit 986ec8958a
17 changed files with 235 additions and 109 deletions

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021 Ziver Koc
* Copyright (c) 2021-2025 Ziver Koc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -26,6 +26,8 @@ package zutil.osal.app.ffmpeg;
import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.*;
public class FFmpegInputTest {
@ -34,7 +36,7 @@ public class FFmpegInputTest {
public void onlyInput() {
FFmpegInput ffmpegInput = new FFmpegInput("iTest.mp4");
assertEquals("-i \"iTest.mp4\"", ffmpegInput.buildCommand());
assertEquals(Arrays.asList("-i", "iTest.mp4"), ffmpegInput.buildCommand());
}
@Test
@ -48,9 +50,10 @@ public class FFmpegInputTest {
ffmpegInput.setSubtitleEnabled(false);
assertEquals("-ss 9.1 -to 20.1 -t 10.1" +
" -an" +
" -sn" +
" -i \"iTest.mp4\"", ffmpegInput.buildCommand());
assertEquals(Arrays.asList("-ss", "9.1", "-to", "20.1", "-t", "10.1",
"-an",
"-sn",
"-i", "iTest.mp4"),
ffmpegInput.buildCommand());
}
}

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021 Ziver Koc
* Copyright (c) 2021-2025 Ziver Koc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -26,6 +26,8 @@ package zutil.osal.app.ffmpeg;
import org.junit.Test;
import java.util.Arrays;
import static org.junit.Assert.*;
public class FFmpegOutputTest {
@ -34,7 +36,7 @@ public class FFmpegOutputTest {
public void onlyOutput() {
FFmpegOutput ffmpegOutput = new FFmpegOutput("oTest.mp4");
assertEquals("\"oTest.mp4\"", ffmpegOutput.buildCommand());
assertEquals(Arrays.asList("oTest.mp4"), ffmpegOutput.buildCommand());
}
@ -63,11 +65,11 @@ public class FFmpegOutputTest {
ffmpegOutput.setSubtitleCodec(FFmpegConstants.FFmpegSubtitleCodec.subrip);
ffmpegOutput.setSubtitleEnabled(false);
assertEquals("-ss 9.1 -to 20.1 -t 10.1 -fs 1000 -pass 2" +
" -codec:v libx264 -frames 29.8 -filter:v scale=320:240 -b:v 300000 -qscale:v 22" +
" -codec:a libmp3lame -ar 48000 -ac 6 -b:a 360000 -qscale:a 23 -an" +
" -codec:s subrip -sn" +
" \"oTest.mp4\"",
assertEquals(Arrays.asList("-ss", "9.1", "-to", "20.1", "-t", "10.1", "-fs", "1000", "-pass", "2",
"-codec:v", "libx264", "-frames", "29.8", "-filter:v", "scale=320:240", "-b:v", "300000", "-qscale:v", "22",
"-codec:a", "libmp3lame", "-ar", "48000", "-ac", "6", "-b:a", "360000", "-qscale:a", "23", "-an",
"-codec:s", "subrip", "-sn",
"oTest.mp4"),
ffmpegOutput.buildCommand());
}

View file

@ -1,7 +1,7 @@
/*
* The MIT License (MIT)
*
* Copyright (c) 2021 Ziver Koc
* Copyright (c) 2021-2025 Ziver Koc
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -27,6 +27,8 @@ package zutil.osal.app.ffmpeg;
import org.junit.Test;
import zutil.osal.app.ffmpeg.FFmpegConstants.*;
import java.util.Arrays;
import static org.junit.Assert.*;
@ -38,7 +40,7 @@ public class FFmpegTest {
ffmpeg.addInput(new FFmpegInput("iTest.mp4"));
ffmpeg.addOutput(new FFmpegOutput("oTest.mp4"));
assertEquals("ffmpeg -i \"iTest.mp4\" \"oTest.mp4\"", ffmpeg.buildCommand());
assertEquals(Arrays.asList("-i", "iTest.mp4", "oTest.mp4"), ffmpeg.buildCommand());
}
@Test
@ -48,7 +50,7 @@ public class FFmpegTest {
ffmpeg.addInput(new FFmpegInput("iTest.mp4"));
ffmpeg.addOutput(new FFmpegOutput("oTest.mp4"));
assertEquals("ffmpeg -loglevel error -i \"iTest.mp4\" \"oTest.mp4\"", ffmpeg.buildCommand());
assertEquals(Arrays.asList("-loglevel", "error", "-i", "iTest.mp4", "oTest.mp4"), ffmpeg.buildCommand());
}
@Test
@ -58,6 +60,6 @@ public class FFmpegTest {
ffmpeg.addInput(new FFmpegInput("iTest.mp4"));
ffmpeg.addOutput(new FFmpegOutput("oTest.mp4"));
assertEquals("ffmpeg -y -i \"iTest.mp4\" \"oTest.mp4\"", ffmpeg.buildCommand());
assertEquals(Arrays.asList("-y", "-i", "iTest.mp4", "oTest.mp4"), ffmpeg.buildCommand());
}
}