Skip to content

Commit 40be08c

Browse files
committed
Fix formatting issues.
1 parent ecadc53 commit 40be08c

7 files changed

Lines changed: 28 additions & 756 deletions

File tree

ISSUE_RESPONSES.md

Lines changed: 0 additions & 730 deletions
This file was deleted.

src/main/java/net/bramp/ffmpeg/FFmpegUtils.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package net.bramp.ffmpeg;
22

3-
import static com.google.common.base.Preconditions.checkArgument;
43
import static java.util.concurrent.TimeUnit.*;
54
import static net.bramp.ffmpeg.Preconditions.checkNotEmpty;
65

@@ -75,7 +74,8 @@ public static String toTimecode(long duration, TimeUnit units) {
7574
if (ns == 0) {
7675
result = String.format("%02d:%02d:%02d", hours, minutes, seconds);
7776
} else {
78-
result = ZERO.trimTrailingFrom(String.format("%02d:%02d:%02d.%09d", hours, minutes, seconds, ns));
77+
result =
78+
ZERO.trimTrailingFrom(String.format("%02d:%02d:%02d.%09d", hours, minutes, seconds, ns));
7979
}
8080

8181
return prefix + result;
@@ -123,7 +123,8 @@ public static long fromTimecode(String time) {
123123
long mins = Long.parseLong(m.group(3));
124124
double secs = Double.parseDouble(m.group(4));
125125

126-
return sign * (HOURS.toNanos(hours) + MINUTES.toNanos(mins) + (long) (SECONDS.toNanos(1) * secs));
126+
return sign
127+
* (HOURS.toNanos(hours) + MINUTES.toNanos(mins) + (long) (SECONDS.toNanos(1) * secs));
127128
}
128129

129130
/**

src/test/java/net/bramp/ffmpeg/FFmpegExecutorTest.java

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
import com.google.common.io.ByteStreams;
1313
import com.google.common.io.CountingOutputStream;
1414
import com.google.common.net.HostAndPort;
15-
1615
import java.io.File;
1716
import java.io.IOException;
1817
import java.util.List;
@@ -270,7 +269,6 @@ public void testIssue112() {
270269
ffExecutor.createJob(builder).run();
271270
}
272271

273-
274272
@Test
275273
public void testIssue287() throws InterruptedException, ExecutionException, IOException {
276274
FFmpegProbeResult in = ffprobe.probe(Samples.big_buck_bunny_720p_1mb);
@@ -279,18 +277,19 @@ public void testIssue287() throws InterruptedException, ExecutionException, IOEx
279277
String tempDir = System.getProperty("java.io.tmpdir");
280278

281279
FFmpegBuilder builder =
282-
new FFmpegBuilder()
283-
.setInput(in)
284-
.done()
285-
.overrideOutputFiles(true)
286-
.addOutput(Samples.output_mp4)
287-
.setFormat("mp4")
288-
.disableAudio()
289-
.setVideoCodec("mpeg4")
290-
.setVideoFrameRate(FFmpeg.FPS_30)
291-
.setVideoResolution(320, 240)
292-
.setTargetSize(1024 * 1024)
293-
.done().setPassDirectory(tempDir);
280+
new FFmpegBuilder()
281+
.setInput(in)
282+
.done()
283+
.overrideOutputFiles(true)
284+
.addOutput(Samples.output_mp4)
285+
.setFormat("mp4")
286+
.disableAudio()
287+
.setVideoCodec("mpeg4")
288+
.setVideoFrameRate(FFmpeg.FPS_30)
289+
.setVideoResolution(320, 240)
290+
.setTargetSize(1024 * 1024)
291+
.done()
292+
.setPassDirectory(tempDir);
294293

295294
FFmpegJob job = ffExecutor.createTwoPassJob(builder);
296295
runAndWait(job);
@@ -300,9 +299,8 @@ public void testIssue287() throws InterruptedException, ExecutionException, IOEx
300299
File passDir = new File(builder.getPassDirectory());
301300
String passPrefix = builder.getPassPrefix();
302301

303-
File[] remainingFiles = passDir.listFiles((dir, name) ->
304-
name.startsWith(passPrefix) && name.contains(".log")
305-
);
302+
File[] remainingFiles =
303+
passDir.listFiles((dir, name) -> name.startsWith(passPrefix) && name.contains(".log"));
306304

307305
assertEquals(true, remainingFiles == null || remainingFiles.length == 0);
308306
}

src/test/java/net/bramp/ffmpeg/FFprobeTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -815,7 +815,8 @@ public void testFullFrameDeserialization() throws IOException {
815815

816816
@Test
817817
public void testReservedColorSpaceVideo() throws IOException {
818-
FFprobeBuilder probeBuilder = ffprobe.builder().setShowStreams(true).setInput(Samples.video_with_reserved_color_space);
818+
FFprobeBuilder probeBuilder =
819+
ffprobe.builder().setShowStreams(true).setInput(Samples.video_with_reserved_color_space);
819820
List<FFmpegStream> streams = ffprobe.probe(probeBuilder).getStreams();
820821
assertEquals(1, streams.size());
821822
FFmpegStream stream = streams.get(0);

src/test/java/net/bramp/ffmpeg/ReadmeTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import static org.junit.Assert.assertEquals;
44

5-
import com.google.common.base.Joiner;
65
import java.io.IOException;
76
import java.nio.file.Files;
87
import java.nio.file.Path;
@@ -13,7 +12,9 @@
1312
import net.bramp.ffmpeg.builder.Strict;
1413
import net.bramp.ffmpeg.fixtures.Samples;
1514
import net.bramp.ffmpeg.job.FFmpegJob;
15+
import net.bramp.ffmpeg.probe.FFmpegFormat;
1616
import net.bramp.ffmpeg.probe.FFmpegProbeResult;
17+
import net.bramp.ffmpeg.probe.FFmpegStream;
1718
import net.bramp.ffmpeg.progress.Progress;
1819
import net.bramp.ffmpeg.progress.ProgressListener;
1920
import org.junit.Test;

src/test/java/net/bramp/ffmpeg/builder/FFmpegHlsOutputBuilderTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,8 +225,7 @@ public void testHlsInitTime() {
225225
.setHlsInitTime(10, TimeUnit.MILLISECONDS)
226226
.build(0);
227227

228-
assertThat(
229-
command, is(ImmutableList.of("-f", "hls", "-hls_init_time", "0.01", "output.m3u8")));
228+
assertThat(command, is(ImmutableList.of("-f", "hls", "-hls_init_time", "0.01", "output.m3u8")));
230229
}
231230

232231
@Test

src/test/java/net/bramp/ffmpeg/fixtures/Samples.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@ private Samples() {
1111
public static final String base_big_buck_bunny_720p_1mb = "big_buck_bunny_720p_1mb.mp4";
1212
public static final String base_testscreen_jpg = "testscreen.jpg";
1313
public static final String base_test_mp3 = "test.mp3";
14-
public static final String base_video_with_reserved_color_space = "video_with_reserved_color_space.mp4";
14+
public static final String base_video_with_reserved_color_space =
15+
"video_with_reserved_color_space.mp4";
1516

1617
public static final String big_buck_bunny_720p_1mb = TEST_PREFIX + base_big_buck_bunny_720p_1mb;
1718
public static final String testscreen_jpg = TEST_PREFIX + base_testscreen_jpg;
1819
public static final String test_mp3 = TEST_PREFIX + base_test_mp3;
19-
public static final String video_with_reserved_color_space = TEST_PREFIX + base_video_with_reserved_color_space;
20+
public static final String video_with_reserved_color_space =
21+
TEST_PREFIX + base_video_with_reserved_color_space;
2022

2123
private static final String book_m4b = "book_with_chapters.m4b";
2224
public static final String book_with_chapters = TEST_PREFIX + book_m4b;

0 commit comments

Comments
 (0)