Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions checkstyle-suppressions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,24 @@
<suppress checks="ParameterName"
files="(probe|builder|options|progress)[\\/]"/>

<!-- Keep established public method names exempt from Google's naming rule. -->
<suppress checks="GoogleMethodName" files="FFmpegStream\.java"
message="Method name 'getHasBFrames'.*"/>
<suppress checks="GoogleMethodName" files="FFmpegStream\.java"
message="Method name 'getRFrameRate'.*"/>
<suppress checks="GoogleMethodName" files="FFmpegBuilder\.java"
message="Method name 'setVBR'.*"/>
<suppress checks="GoogleMethodName" files="AbstractFFmpegOutputBuilder\.java"
message="Method name 'setBFrames'.*"/>
<suppress files="FFmpeg\.java" checks="GoogleMethodName"
message="Method name 'isFFmpeg'.*"/>
<suppress files="FFprobe\.java" checks="GoogleMethodName"
message="Method name 'isFFprobe'.*"/>
<suppress files="NutDataInputStream\.java" checks="GoogleMethodName"
message="Method name 'resetCRC'.*"/>
<suppress files="NutDataInputStream\.java" checks="GoogleMethodName"
message="Method name 'getCRC'.*"/>

<!-- NUT format parser uses spec-matching names for readability -->
<suppress checks="MemberName|ParameterName|LocalVariableName|AbbreviationAsWordInName|GoogleNonConstantFieldName"
files="nut[\\/]"/>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>13.4.2</version>
<version>14.3.0</version>
</dependency>
</dependencies>
<configuration>
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/net/bramp/ffmpeg/FFmpeg.java
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ public boolean isFFmpeg() throws IOException {
* @throws IllegalArgumentException if this is not the official ffmpeg binary.
* @throws IOException If a I/O error occurs while executing ffmpeg.
*/
private void checkIfFFmpeg() throws IllegalArgumentException, IOException {
private void checkIfFfmpeg() throws IllegalArgumentException, IOException {
if (!isFFmpeg()) {
throw new IllegalArgumentException(
"This binary '" + path + "' is not a supported version of ffmpeg");
Expand All @@ -143,7 +143,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException {

/** Returns the list of supported codecs. */
public synchronized @Nonnull List<Codec> codecs() throws IOException {
checkIfFFmpeg();
checkIfFfmpeg();

if (this.codecs == null) {
codecs = new ArrayList<>();
Expand Down Expand Up @@ -173,7 +173,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException {

/** Returns the list of supported filters. */
public synchronized @Nonnull List<Filter> filters() throws IOException {
checkIfFFmpeg();
checkIfFfmpeg();

if (this.filters == null) {
filters = new ArrayList<>();
Expand Down Expand Up @@ -213,7 +213,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException {

/** Returns the list of supported formats. */
public synchronized @Nonnull List<Format> formats() throws IOException {
checkIfFFmpeg();
checkIfFfmpeg();

if (this.formats == null) {
formats = new ArrayList<>();
Expand Down Expand Up @@ -242,7 +242,7 @@ private void checkIfFFmpeg() throws IllegalArgumentException, IOException {

/** Returns the list of supported pixel formats. */
public synchronized List<PixelFormat> pixelFormats() throws IOException {
checkIfFFmpeg();
checkIfFfmpeg();

if (this.pixelFormats == null) {
pixelFormats = new ArrayList<>();
Expand Down Expand Up @@ -275,7 +275,7 @@ public synchronized List<PixelFormat> pixelFormats() throws IOException {

/** Returns the list of supported channel layouts. */
public synchronized List<ChannelLayout> channelLayouts() throws IOException {
checkIfFFmpeg();
checkIfFfmpeg();

if (this.channelLayouts == null) {
Process p = runFunc.run(ImmutableList.of(path, "-layouts"));
Expand Down Expand Up @@ -305,7 +305,7 @@ protected ProgressParser createProgressParser(ProgressListener listener) throws

@Override
public void run(List<String> args) throws IOException {
checkIfFFmpeg();
checkIfFfmpeg();
super.run(args);
}

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/net/bramp/ffmpeg/FFprobe.java
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public FFmpegProbeResult probe(
// TODO: Add Probe Inputstream
/** Probes media using the supplied arguments and returns the result. */
public FFmpegProbeResult probe(List<String> args) throws IOException {
checkIfFFprobe();
checkIfFfprobe();

Process p = runFunc.run(path(args));
try {
Expand Down Expand Up @@ -118,7 +118,7 @@ public boolean isFFprobe() throws IOException {
* @throws IllegalArgumentException if this is not the official ffprobe binary.
* @throws IOException If a I/O error occurs while executing ffprobe.
*/
private void checkIfFFprobe() throws IllegalArgumentException, IOException {
private void checkIfFfprobe() throws IllegalArgumentException, IOException {
if (!isFFprobe()) {
throw new IllegalArgumentException(
"This binary '" + path + "' is not a supported version of ffprobe");
Expand All @@ -127,7 +127,7 @@ private void checkIfFFprobe() throws IllegalArgumentException, IOException {

@Override
public void run(List<String> args) throws IOException {
checkIfFFprobe();
checkIfFfprobe();
super.run(args);
}

Expand Down
2 changes: 2 additions & 0 deletions src/test/java/net/bramp/ffmpeg/FFmpegTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import static org.hamcrest.Matchers.hasItem;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import static org.mockito.Mockito.*;
import static org.mockito.hamcrest.MockitoHamcrest.argThat;
Expand Down Expand Up @@ -60,6 +61,7 @@ public static <T> List<T> argThatHasItem(T s) {
public void testVersion() throws Exception {
assertEquals("ffmpeg version 0.10.9-7:0.10.9-1~raring1", ffmpeg.version());
assertEquals("ffmpeg version 0.10.9-7:0.10.9-1~raring1", ffmpeg.version());
assertTrue(ffmpeg.isFFmpeg());

verify(runFunc, times(1)).run(argThatHasItem("-version"));
}
Expand Down
1 change: 1 addition & 0 deletions src/test/java/net/bramp/ffmpeg/FFprobeTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ public void testVersion() throws Exception {
"ffprobe version 3.0.2 Copyright (c) 2007-2016 the FFmpeg developers", ffprobe.version());
assertEquals(
"ffprobe version 3.0.2 Copyright (c) 2007-2016 the FFmpeg developers", ffprobe.version());
assertTrue(ffprobe.isFFprobe());

verify(runFunc, times(1)).run(argThatHasItem("-version"));
}
Expand Down
Loading