Fixes code style of utility classes

This commit is contained in:
2020-05-08 19:12:09 +02:00
parent 857c8f29a4
commit 4f07fd09fd
6 changed files with 84 additions and 41 deletions

View File

@ -18,15 +18,16 @@ import java.util.List;
*/
public final class FFMpegHelper {
private static final String PROBE_SPLIT_CHARACTER = "øæåÆØå";
private FFMpegHelper() {
}
private static final String PROBE_SPLIT_CHARACTER = "øæåÆØå";
/**
* Gets streams from a file
*
* @param ffprobePath <p>The path/command to ffprobe.</p>
* @param file <p>The file to probe.</p>
* @param file <p>The file to probe.</p>
* @return <p>A list of StreamObjects.</p>
* @throws IOException <p>If the process can't be readProcess.</p>
*/
@ -36,8 +37,9 @@ public final class FFMpegHelper {
/**
* Gets a list of all streams in a file
*
* @param ffprobePath <p>The path/command to ffprobe.</p>
* @param file <p>The file to probe.</p>
* @param file <p>The file to probe.</p>
* @return <p>A list of streams.</p>
* @throws IOException <p>If something goes wrong while probing.</p>
*/
@ -69,8 +71,9 @@ public final class FFMpegHelper {
/**
* Takes a list of all streams and parses each stream into one of three objects
*
* @param streams <p>A list of all streams for the current file.</p>
* @param file <p>The file currently being converted.</p>
* @param file <p>The file currently being converted.</p>
* @return <p>A list of StreamObjects.</p>
*/
private static List<StreamObject> parseStreams(String ffprobePath, String[] streams, File file) throws IOException {
@ -95,8 +98,9 @@ public final class FFMpegHelper {
/**
* Checks whether there exists an external image subtitle with the same filename as the file
* @param ffprobePath <p>The path/command to ffprobe.</p>
* @param directory <p>The directory containing the file.</p>
*
* @param ffprobePath <p>The path/command to ffprobe.</p>
* @param directory <p>The directory containing the file.</p>
* @param convertingFile <p>The file to be converted.</p>
* @return <p>The extension of the subtitle or empty if no subtitle was found.</p>
*/
@ -127,8 +131,9 @@ public final class FFMpegHelper {
/**
* Starts and prints output of a process
*
* @param process <p>The process to run.</p>
* @param folder <p>The folder the process should run in.</p>
* @param folder <p>The folder the process should run in.</p>
* @throws IOException <p>If the process can't be readProcess.</p>
*/
public static void convertProcess(ProcessBuilder process, File folder) throws IOException {
@ -149,6 +154,7 @@ public final class FFMpegHelper {
/**
* Reads from a process reader
*
* @param reader <p>The reader of a process.</p>
* @return <p>The output from the readProcess.</p>
* @throws IOException <p>On reader failure.</p>
@ -164,8 +170,9 @@ public final class FFMpegHelper {
/**
* Creates a list containing all required arguments for converting a video to a web playable video
*
* @param executable <p>The executable to use (ffmpeg/ffprobe).</p>
* @param fileName <p>The name of the file to execute on.</p>
* @param fileName <p>The name of the file to execute on.</p>
* @return <p>A base list of ffmpeg commands for converting a video for web</p>
*/
public static List<String> getFFMpegWebVideoCommand(String executable, String fileName) {
@ -183,8 +190,9 @@ public final class FFMpegHelper {
/**
* Creates a list containing command line arguments for a general file
*
* @param executable <p>The executable to use (ffmpeg/ffprobe).</p>
* @param fileName <p>The name of the file to execute on.</p>
* @param fileName <p>The name of the file to execute on.</p>
* @return <p>A base list of ffmpeg commands for converting a file.</p>
*/
public static List<String> getFFMpegGeneralFileCommand(String executable, String fileName) {
@ -198,9 +206,10 @@ public final class FFMpegHelper {
/**
* Adds debugging parameters for only converting parts of a file
*
* @param command <p>The list containing the command to run.</p>
* @param start <p>The offset before converting.</p>
* @param length <p>The offset for stopping the conversion.</p>
* @param start <p>The offset before converting.</p>
* @param length <p>The offset for stopping the conversion.</p>
*/
public static void addDebugArguments(List<String> command, int start, int length) {
command.add("-ss");
@ -211,7 +220,8 @@ public final class FFMpegHelper {
/**
* Parses a list of video stream parameters to a video stream object
* @param streamParts <p>A list of parameters belonging to an video stream.</p>
*
* @param streamParts <p>A list of parameters belonging to an video stream.</p>
* @param relativeIndex <p>The relative index of the video stream.</p>
* @return <p>A SubtitleStream object.</p>
* @throws NumberFormatException <p>If codec index contains a non-numeric value.</p>
@ -237,7 +247,8 @@ public final class FFMpegHelper {
/**
* Parses a list of audio stream parameters to an audio stream object
* @param streamParts <p>A list of parameters belonging to an audio stream.</p>
*
* @param streamParts <p>A list of parameters belonging to an audio stream.</p>
* @param relativeIndex <p>The relative index of the audio stream.</p>
* @return <p>A SubtitleStream object.</p>
* @throws NumberFormatException <p>If codec index contains a non-numeric value.</p>
@ -266,9 +277,10 @@ public final class FFMpegHelper {
/**
* Parses a list of subtitle stream parameters to a subtitle stream object
* @param streamParts <p>A list of parameters belonging to a subtitle stream.</p>
*
* @param streamParts <p>A list of parameters belonging to a subtitle stream.</p>
* @param relativeIndex <p>The relative index of the subtitle.</p>
* @param file <p>The file currently being converted.</p>
* @param file <p>The file currently being converted.</p>
* @return <p>A SubtitleStream object.</p>
* @throws NumberFormatException <p>If codec index contains a non-numeric value.</p>
*/