Skip to content

Commit

Permalink
Merge pull request #6 from umjammer/0.8.9
Browse files Browse the repository at this point in the history
0.8.9
  • Loading branch information
umjammer authored May 22, 2023
2 parents 6a858f1 + b7b6bc7 commit 9116064
Show file tree
Hide file tree
Showing 305 changed files with 42,393 additions and 39,824 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,13 @@ on:
pull_request:
# The branches below must be a subset of the branches above
branches: [ vavi ]
schedule:
- cron: '27 6 * * 2'
# schedule:
# - cron: '27 6 * * 2'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
Expand All @@ -38,11 +34,11 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v3

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
Expand All @@ -53,7 +49,7 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
Expand All @@ -67,4 +63,4 @@ jobs:
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2
25 changes: 16 additions & 9 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,19 @@ jobs:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: '8'
distribution: 'adopt'
cache: maven
- name: Build with Maven
run: mvn -B package --file pom.xml
- name: Checkout repository
uses: actions/checkout@v3

- name: Check w/o SNAPSHOT when "bump version"
if: ${{ contains(github.event.head_commit.message, 'bump version') }}
run: grep "<version>" pom.xml | head -1 | grep -v SNAPSHOT

- name: Set up JDK 8
uses: actions/setup-java@v3
with:
java-version: '8'
distribution: 'temurin'
cache: maven

- name: Build with Maven
run: mvn -B package --file pom.xml
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@
*.iml
*.ipr
*.iws

/tmp/
local.properties
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
[![Release](https://jitpack.io/v/umjammer/JAADec.svg)](https://jitpack.io/#umjammer/JAADec)
[![Actions Status](https://github.com/umjammer/JAADec/workflows/Java%20CI/badge.svg)](https://github.com/umjammer/JAADec/actions)
[![Java CI with Maven](https://github.com/umjammer/JAADec/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/JAADec/actions/workflows/maven.yml)
[![CodeQL](https://github.com/umjammer/JAADec/actions/workflows/codeql.yml/badge.svg)](https://github.com/umjammer/JAADec/actions/workflows/codeql.yml)
![Java](https://img.shields.io/badge/Java-8-b07219)
[![Parent](https://img.shields.io/badge/Parent-vavi--sound--sandbox-pink)](https://github.com/umjammer/vavi-sound-sandbox)

# JAADec

Expand All @@ -16,4 +19,9 @@ and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+).

## Install

* https://jitpack.io/v/umjammer/JAADec
* https://jitpack.io/#/umjammer/JAADec

## Applied Patches

* https://github.com/Tianscar/jaac/commit/cf9b24f55fcd8f77ae76c42cac87602fdb0382a8
* https://github.com/Tianscar/jaac/commit/bbaaec277d6620e0233561d02185f2e901970480
1 change: 1 addition & 0 deletions local.properties.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mp4=/foo/bar.m4a
30 changes: 21 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<groupId>net.sourceforge.jaadec</groupId>
<artifactId>jaad</artifactId>
<version>0.8.8</version>
<version>0.8.9</version>

<description>JAAD is an AAC decoder and MP4 demultiplexer library written completely in Java. It uses no native libraries, is platform-independent and portable. It can read MP4 container from almost every input-stream (files, network sockets etc.) and decode AAC-LC (Low Complexity) and HE-AAC (High Efficiency/AAC+).</description>
<url>https://github.com/DV8FromTheWorld/JAADec</url>
<url>https://github.com/umjammer/JAADec</url>
<licenses>
<license>
<name>Public Domain</name>
Expand All @@ -33,28 +33,30 @@
</developer>
</developers>
<scm>
<connection>scm:git:[email protected]:DV8FromTheWorld/JAADec.git</connection>
<developerConnection>scm:git:[email protected]:DV8FromTheWorld/JAADec.git</developerConnection>
<url>scm:git:[email protected]:DV8FromTheWorld/JAADec.git</url>
<connection>scm:git:[email protected]:umjammer/JAADec.git</connection>
<developerConnection>scm:git:[email protected]:umjammer/JAADec.git</developerConnection>
<url>scm:git:[email protected]:umjammer/JAADec.git</url>
</scm>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.10.1</version>
<configuration>
<source>8</source>
<target>8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M5</version>
<version>3.0.0-M7</version>
<configuration>
<argLine>
-Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties
-Dvavi.test=true
</argLine>
<trimStackTrace>false</trimStackTrace>
<forkMode>always</forkMode>
Expand All @@ -75,7 +77,7 @@
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.8.1</version>
<version>5.9.2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -86,8 +88,18 @@
<dependency>
<groupId>com.github.umjammer</groupId>
<artifactId>vavi-sound</artifactId>
<version>1.0.12</version>
<version>1.0.15</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down
143 changes: 72 additions & 71 deletions src/main/java/net/sourceforge/jaad/MP4Info.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,94 +3,95 @@
import java.io.RandomAccessFile;
import java.util.List;
import java.util.Map;

import net.sourceforge.jaad.mp4.MP4Container;
import net.sourceforge.jaad.mp4.MP4Input;
import net.sourceforge.jaad.mp4.api.MetaData;
import net.sourceforge.jaad.mp4.api.Movie;
import net.sourceforge.jaad.mp4.api.Protection;
import net.sourceforge.jaad.mp4.api.Track;
import net.sourceforge.jaad.mp4.boxes.Box;


public class MP4Info {

private static final String USAGE = "usage:\nnet.sourceforge.jaad.MP4Info [options] <infile>\n\n\t-b\talso print all boxes";
private static final String USAGE = "usage:\nnet.sourceforge.jaad.MP4Info [options] <infile>\n\n\t-b\talso print all boxes";

public static void main(String[] args) {
try {
if(args.length<1) printUsage();
else {
boolean boxes = false;
final String file;
if(args.length>1) {
if(args[0].equals("-b")) boxes = true;
else printUsage();
file = args[1];
}
else file = args[0];
public static void main(String[] args) {
try {
if (args.length < 1) printUsage();
else {
boolean boxes = false;
String file;
if (args.length > 1) {
if (args[0].equals("-b")) boxes = true;
else printUsage();
file = args[1];
} else file = args[0];

final MP4Container cont = new MP4Container(new RandomAccessFile(file, "r"));
final Movie movie = cont.getMovie();
System.out.println("Movie:");
MP4Input is = MP4Input.open(new RandomAccessFile(file, "r"));
MP4Container cont = new MP4Container(is);
Movie movie = cont.getMovie();
System.out.println("Movie:");

final List<Track> tracks = movie.getTracks();
Track t;
for(int i = 0; i<tracks.size(); i++) {
t = tracks.get(i);
System.out.println("\tTrack "+i+": "+t.getCodec()+" (language: "+t.getLanguage()+", created: "+t.getCreationTime()+")");
List<Track> tracks = movie.getTracks();
Track t;
for (int i = 0; i < tracks.size(); i++) {
t = tracks.get(i);
System.out.println("\tTrack " + i + ": " + t.getCodec() + " (language: " + t.getLanguage() + ", created: " + t.getCreationTime() + ")");

final Protection p = t.getProtection();
if(p!=null) System.out.println("\t\tprotection: "+p.getScheme());
}
Protection p = t.getProtection();
if (p != null) System.out.println("\t\tprotection: " + p.getScheme());
}

if(movie.containsMetaData()) {
System.out.println("\tMetadata:");
final Map<MetaData.Field<?>, Object> data = movie.getMetaData().getAll();
for(MetaData.Field<?> key : data.keySet()) {
if(key.equals(MetaData.Field.COVER_ARTWORKS)) {
final List<?> l = (List<?>) data.get(MetaData.Field.COVER_ARTWORKS);
System.out.println("\t\t"+l.size()+" Cover Artworks present");
}
else System.out.println("\t\t"+key.getName()+" = "+data.get(key));
}
}
if (movie.containsMetaData()) {
System.out.println("\tMetadata:");
Map<MetaData.Field<?>, Object> data = movie.getMetaData().getAll();
for (MetaData.Field<?> key : data.keySet()) {
if (key.equals(MetaData.Field.COVER_ARTWORKS)) {
List<?> l = (List<?>) data.get(MetaData.Field.COVER_ARTWORKS);
System.out.println("\t\t" + l.size() + " Cover Artworks present");
} else System.out.println("\t\t" + key.getName() + " = " + data.get(key));
}
}

final List<Protection> protections = movie.getProtections();
if(protections.size()>0) {
System.out.println("\tprotections:");
for(Protection p : protections) {
System.out.println("\t\t"+p.getScheme());
}
}
List<Protection> protections = movie.getProtections();
if (protections.size() > 0) {
System.out.println("\tprotections:");
for (Protection p : protections) {
System.out.println("\t\t" + p.getScheme());
}
}

//print all boxes
if(boxes) {
System.out.println("================================");
for(Box box : cont.getBoxes()) {
printBox(box, 0);
}
}
}
}
catch(Exception e) {
e.printStackTrace();
System.err.println("error while reading file: "+e.toString());
}
}
//print all boxes
if (boxes) {
System.out.println("================================");
for (Box box : cont.getBoxes()) {
printBox(box, 0);
}
}
}
} catch (Exception e) {
e.printStackTrace();
System.err.println("error while reading file: " + e);
}
}

private static void printUsage() {
System.out.println(USAGE);
System.exit(1);
}
private static void printUsage() {
System.out.println(USAGE);
System.exit(1);
}

private static void printBox(Box box, int level) {
final StringBuilder sb = new StringBuilder();
for(int i = 0; i<level; i++) {
sb.append(" ");
}
sb.append(box.toString());
System.out.println(sb.toString());
private static void printBox(Box box, int level) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < level; i++) {
sb.append(" ");
}
sb.append(box.toString());
System.out.println(sb);

for(Box child : box.getChildren()) {
printBox(child, level+1);
}
}
for (Box child : box.getChildren()) {
printBox(child, level + 1);
}
}
}
Loading

0 comments on commit 9116064

Please sign in to comment.