Skip to content

Commit

Permalink
Merge pull request #135 from kokorin/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kokorin authored Mar 30, 2021
2 parents 1bb4874 + c188136 commit 2ac1d47
Show file tree
Hide file tree
Showing 64 changed files with 2,375 additions and 4,070 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/maven-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
types:
- released

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3

jobs:
release:

Expand All @@ -26,8 +29,10 @@ jobs:
path: |
~/.m2/repository
~/.m2/wrapper
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2
key: release-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: |
release-m2
${{ runner.os }}-m2
- name: Set up Maven settings.xml to access Sonatype Nexus
run: |
Expand Down
16 changes: 15 additions & 1 deletion .github/workflows/maven-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ on:
- master
- develop
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- master
- develop

env:
MAVEN_OPTS: -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3

jobs:
tests:

Expand All @@ -29,7 +36,7 @@ jobs:
with:
java-version: ${{ matrix.java-version }}

- name: Cache Maven packages
- name: Cache Maven Packages
uses: actions/cache@v2
with:
# be careful not to include ~/.m2/settings.xml which contains credentials
Expand All @@ -39,6 +46,13 @@ jobs:
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
restore-keys: ${{ runner.os }}-m2

- name: Cache Test Artifacts
uses: actions/cache@v2
with:
path: |
.artifacts
key: ${{ runner.os }}-artifacts-${{ hashFiles('**/Artifacts.java') }}

- name: Install ffmpeg on Ubuntu
run: sudo apt-get update && sudo apt-get install -y ffmpeg && ffmpeg -version
if: startsWith(matrix.os, 'ubuntu')
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.iml
target
.artifacts
dependency-reduced-pom.xml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Inspired by [ffmpeg-cli-wrapper](https://github.com/bramp/ffmpeg-cli-wrapper)
<dependency>
<groupId>com.github.kokorin.jaffree</groupId>
<artifactId>jaffree</artifactId>
<version>0.10.1</version>
<version>0.11.0</version>
</dependency>

<!--
Expand Down
71 changes: 69 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.github.kokorin.jaffree</groupId>
<artifactId>jaffree</artifactId>
<version>0.10.1</version>
<version>0.11.0</version>
<packaging>jar</packaging>

<name>Jaffree</name>
Expand Down Expand Up @@ -46,6 +46,8 @@
<properties>
<sl4j.version>1.7.25</sl4j.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<createSourcesJar>false</createSourcesJar>
<shadeSourcesContent>false</shadeSourcesContent>
</properties>

<dependencies>
Expand All @@ -62,14 +64,20 @@
<scope>provided</scope>
</dependency>

<dependency>
<groupId>com.grack</groupId>
<artifactId>nanojson</artifactId>
<!--TODO upgrade to 1.7 when switched to Java8-->
<version>1.6</version>
</dependency>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
<version>2.12.1</version>
<scope>test</scope>
</dependency>


<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
Expand All @@ -88,6 +96,10 @@
<profiles>
<profile>
<id>release</id>
<properties>
<createSourcesJar>true</createSourcesJar>
<shadeSourcesContent>true</shadeSourcesContent>
</properties>
<build>
<plugins>
<plugin>
Expand All @@ -97,6 +109,7 @@
<executions>
<execution>
<id>attach-sources</id>
<phase>prepare-package</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
Expand Down Expand Up @@ -185,6 +198,60 @@
<compilerArgs>-Xlint:unchecked</compilerArgs>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.2.4</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<artifactSet>
<includes>
<include>com.grack:nanojson</include>
</includes>
</artifactSet>
<createDependencyReducedPom>true</createDependencyReducedPom>
<createSourcesJar>${createSourcesJar}</createSourcesJar>
<shadeSourcesContent>${shadeSourcesContent}</shadeSourcesContent>
<relocations>
<relocation>
<pattern>com.grack.nanojson</pattern>
<shadedPattern>com.github.kokorin.jaffree.shaded.com.grack.nanojson</shadedPattern>
</relocation>
</relocations>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<target>
<copy file="dependency-reduced-pom.xml"
tofile="${project.build.directory}/META-INF/maven/${project.groupId}/${project.artifactId}/pom.xml"/>
<zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.jar"
basedir="${project.build.directory}"
includes="META-INF/**/*"
update="true"/>
</target>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
2 changes: 1 addition & 1 deletion publiccode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ url: 'https://github.com/kokorin/Jaffree'
# TODO update
releaseDate: '2021-02-22'
developmentStatus: stable
softwareVersion: 0.10.1
softwareVersion: 0.11.0
platforms:
- web
- windows
Expand Down
18 changes: 17 additions & 1 deletion src/main/java/com/github/kokorin/jaffree/JaffreeException.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
package com.github.kokorin.jaffree;
/*
* Copyright 2021 Dan-Mikkel
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*
*/

package com.github.kokorin.jaffree;

public class JaffreeException extends RuntimeException {

Expand Down
37 changes: 37 additions & 0 deletions src/main/java/com/github/kokorin/jaffree/LogCategory.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package com.github.kokorin.jaffree;

public enum LogCategory {
NA(0),
INPUT(1),
OUTPUT(2),
MUXER(3),
DEMUXER(4),
ENCODER(5),
DECODER(6),
FILTER(7),
BITSTREAM_FILTER(8),
SWSCALER(9),
SWRESAMPLER(10),
DEVICE_VIDEO_OUTPUT(40),
DEVICE_VIDEO_INPUT(41),
DEVICE_AUDIO_OUTPUT(42),
DEVICE_AUDIO_INPUT(43),
DEVICE_OUTPUT(44),
DEVICE_INPUT(45),
NB(46);

private final int code;

LogCategory(int code) {
this.code = code;
}

public static LogCategory fromCode(int code) {
for (LogCategory category : values()) {
if (category.code == code) {
return category;
}
}
return null;
}
}
9 changes: 9 additions & 0 deletions src/main/java/com/github/kokorin/jaffree/LogLevel.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,13 @@ public enum LogLevel {
public int code() {
return code;
}

public static LogLevel fromCode(int code) {
for (LogLevel level : values()) {
if (level.code == code) {
return level;
}
}
return null;
}
}
Loading

0 comments on commit 2ac1d47

Please sign in to comment.