From b9a142746cfe8b356fe877e58867429caf19a1c6 Mon Sep 17 00:00:00 2001 From: Naohide Sano Date: Wed, 28 Feb 2024 19:32:16 +0900 Subject: [PATCH 1/3] follow ide advices --- .../java/net/sourceforge/jaad/MP4Info.java | 6 ++-- src/main/java/net/sourceforge/jaad/Radio.java | 4 +-- .../net/sourceforge/jaad/aac/error/RVLC.java | 6 ++-- .../jaad/aac/gain/GainControl.java | 4 +-- .../net/sourceforge/jaad/aac/gain/IMDCT.java | 2 +- .../jaad/aac/sbr/HFAdjustment.java | 4 +-- .../jaad/aac/sbr/SynthesisFilterbank32.java | 4 +-- .../sourceforge/jaad/aac/syntax/Element.java | 2 +- .../sourceforge/jaad/aac/syntax/ICSInfo.java | 24 ++++--------- .../net/sourceforge/jaad/aac/syntax/PCE.java | 36 ++----------------- .../jaad/aac/syntax/SyntacticElements.java | 3 +- .../jaad/aac/tools/ICPrediction.java | 6 ++-- .../sourceforge/jaad/aac/tools/MSMask.java | 24 ++++--------- .../net/sourceforge/jaad/aac/tools/Utils.java | 2 +- .../net/sourceforge/jaad/mp4/api/Artwork.java | 24 ++++--------- .../net/sourceforge/jaad/mp4/api/Movie.java | 16 +++------ .../sourceforge/jaad/mp4/boxes/BoxImpl.java | 2 +- .../mp4/boxes/impl/ItemInformationEntry.java | 12 +++---- .../sourceforge/jaad/mp4/od/Descriptor.java | 34 ++++++------------ .../spi/javasound/AACAudioFileReader.java | 2 +- 20 files changed, 66 insertions(+), 151 deletions(-) diff --git a/src/main/java/net/sourceforge/jaad/MP4Info.java b/src/main/java/net/sourceforge/jaad/MP4Info.java index 70a894c..5d36a1f 100644 --- a/src/main/java/net/sourceforge/jaad/MP4Info.java +++ b/src/main/java/net/sourceforge/jaad/MP4Info.java @@ -56,7 +56,7 @@ public static void main(String[] args) { } List protections = movie.getProtections(); - if (protections.size() > 0) { + if (!protections.isEmpty()) { System.out.println("\tprotections:"); for (Protection p : protections) { System.out.println("\t\t" + p.getScheme()); @@ -84,9 +84,7 @@ private static void printUsage() { private static void printBox(Box box, int level) { StringBuilder sb = new StringBuilder(); - for (int i = 0; i < level; i++) { - sb.append(" "); - } + sb.append(" ".repeat(Math.max(0, level))); sb.append(box.toString()); System.out.println(sb); diff --git a/src/main/java/net/sourceforge/jaad/Radio.java b/src/main/java/net/sourceforge/jaad/Radio.java index 250f6cf..73e3348 100644 --- a/src/main/java/net/sourceforge/jaad/Radio.java +++ b/src/main/java/net/sourceforge/jaad/Radio.java @@ -51,7 +51,7 @@ private static void decode(String arg) throws Exception { // send HTTP request PrintStream out = new PrintStream(sock.getOutputStream()); String path = uri.getPath(); - if (path == null || path.equals("")) + if (path == null || path.isEmpty()) path = "/"; if (uri.getQuery() != null) path += "?" + uri.getQuery(); @@ -64,7 +64,7 @@ private static void decode(String arg) throws Exception { String x; do { x = in.readLine(); - } while (x != null && !x.trim().equals("")); + } while (x != null && !x.trim().isEmpty()); ADTSDemultiplexer adts = new ADTSDemultiplexer(in); AudioFormat aufmt = new AudioFormat(adts.getSampleFrequency(), 16, adts.getChannelCount(), true, true); diff --git a/src/main/java/net/sourceforge/jaad/aac/error/RVLC.java b/src/main/java/net/sourceforge/jaad/aac/error/RVLC.java index 5078069..16d4981 100644 --- a/src/main/java/net/sourceforge/jaad/aac/error/RVLC.java +++ b/src/main/java/net/sourceforge/jaad/aac/error/RVLC.java @@ -66,7 +66,7 @@ public void decode(BitStream in, ICStream ics, int[][] scaleFactors) { if (in.readBool()) decodeEscapes(in, ics, scaleFactors); } - private void decodeEscapes(BitStream in, ICStream ics, int[][] scaleFactors) { + private static void decodeEscapes(BitStream in, ICStream ics, int[][] scaleFactors) { ICSInfo info = ics.getInfo(); int windowGroupCount = info.getWindowGroupCount(); int maxSFB = info.getMaxSFB(); @@ -89,7 +89,7 @@ else if (Math.abs(sfbCB[g][sfb]) == ESCAPE_FLAG) { } } - private int decodeHuffman(BitStream in) { + private static int decodeHuffman(BitStream in) { int off = 0; int i = RVLC_BOOK[off][1]; int cw = in.readBits(i); @@ -106,7 +106,7 @@ private int decodeHuffman(BitStream in) { return RVLC_BOOK[off][0]; } - private int decodeHuffmanEscape(BitStream in) { + private static int decodeHuffmanEscape(BitStream in) { int off = 0; int i = ESCAPE_BOOK[off][1]; int cw = in.readBits(i); diff --git a/src/main/java/net/sourceforge/jaad/aac/gain/GainControl.java b/src/main/java/net/sourceforge/jaad/aac/gain/GainControl.java index d9c9e6c..ca62daa 100644 --- a/src/main/java/net/sourceforge/jaad/aac/gain/GainControl.java +++ b/src/main/java/net/sourceforge/jaad/aac/gain/GainControl.java @@ -269,7 +269,7 @@ private float calculateFMD(int bd, int wd, boolean prev, int maxLocGain, int sam * transforms the exponent value of the gain to the id of the gain change * point */ - private int getGainChangePointID(int lngain) { + private static int getGainChangePointID(int lngain) { for (int i = 0; i < ID_GAIN; i++) { if (lngain == LN_GAIN[i]) return i; } @@ -282,7 +282,7 @@ private int getGainChangePointID(int lngain) { * positions is calculated by the formula: * f(a,b,j) = 2^(((8-j)log2(a)+j*log2(b))/8) */ - private float interpolateGain(float alev0, float alev1, int iloc) { + private static float interpolateGain(float alev0, float alev1, int iloc) { float a0 = (float) (Math.log(alev0) / Math.log(2)); float a1 = (float) (Math.log(alev1) / Math.log(2)); return (float) Math.pow(2.0f, (((8 - iloc) * a0 + iloc * a1) / 8)); diff --git a/src/main/java/net/sourceforge/jaad/aac/gain/IMDCT.java b/src/main/java/net/sourceforge/jaad/aac/gain/IMDCT.java index fec4979..3e3e72b 100644 --- a/src/main/java/net/sourceforge/jaad/aac/gain/IMDCT.java +++ b/src/main/java/net/sourceforge/jaad/aac/gain/IMDCT.java @@ -126,7 +126,7 @@ private void process2(float[] in, float[] out, WindowSequence winSeq, int winSha } } - private void imdct(float[] in, float[] out, float[] window, int n) throws AACException { + private static void imdct(float[] in, float[] out, float[] window, int n) throws AACException { int n2 = n / 2; float[][] table, table2; if (n == 256) { diff --git a/src/main/java/net/sourceforge/jaad/aac/sbr/HFAdjustment.java b/src/main/java/net/sourceforge/jaad/aac/sbr/HFAdjustment.java index 9d4e07a..031c3dd 100644 --- a/src/main/java/net/sourceforge/jaad/aac/sbr/HFAdjustment.java +++ b/src/main/java/net/sourceforge/jaad/aac/sbr/HFAdjustment.java @@ -33,7 +33,7 @@ public static void hf_adjustment(SBR sbr, float[][][] Xsbr, Channel ch) { ch.l_A = ch.L_E + 1 - ch.bs_pointer; } - adj.estimate_current_envelope(sbr, Xsbr, ch); + HFAdjustment.estimate_current_envelope(sbr, Xsbr, ch); adj.calculate_gain(sbr, ch); @@ -75,7 +75,7 @@ private static int get_S_mapped(SBR sbr, Channel ch, int l, int current_band) { return 0; } - private void estimate_current_envelope(SBR sbr, float[][][] Xsbr, Channel ch) { + private static void estimate_current_envelope(SBR sbr, float[][][] Xsbr, Channel ch) { float nrg, div; if (sbr.hdr.bs_interpol_freq) { diff --git a/src/main/java/net/sourceforge/jaad/aac/sbr/SynthesisFilterbank32.java b/src/main/java/net/sourceforge/jaad/aac/sbr/SynthesisFilterbank32.java index d2187ba..e8d7d14 100644 --- a/src/main/java/net/sourceforge/jaad/aac/sbr/SynthesisFilterbank32.java +++ b/src/main/java/net/sourceforge/jaad/aac/sbr/SynthesisFilterbank32.java @@ -93,7 +93,7 @@ void synthesis(int numTimeSlotsRate, float[][][] X, float[] output) { } } - private void DCT4_32(float[] y, float[] x) { + private static void DCT4_32(float[] y, float[] x) { float f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10; float f11, f12, f13, f14, f15, f16, f17, f18, f19, f20; float f21, f22, f23, f24, f25, f26, f27, f28, f29, f30; @@ -534,7 +534,7 @@ private void DCT4_32(float[] y, float[] x) { y[1] = f397 - f396; } - private void DST4_32(float[] y, float[] x) { + private static void DST4_32(float[] y, float[] x) { float f0, f1, f2, f3, f4, f5, f6, f7, f8, f9; float f10, f11, f12, f13, f14, f15, f16, f17, f18, f19; float f20, f21, f22, f23, f24, f25, f26, f27, f28, f29; diff --git a/src/main/java/net/sourceforge/jaad/aac/syntax/Element.java b/src/main/java/net/sourceforge/jaad/aac/syntax/Element.java index 046f5d7..6d361ee 100644 --- a/src/main/java/net/sourceforge/jaad/aac/syntax/Element.java +++ b/src/main/java/net/sourceforge/jaad/aac/syntax/Element.java @@ -69,7 +69,7 @@ public String toString() { static List createTagList(int count, IntFunction newTag) { - List tags = new AbstractList() { + List tags = new AbstractList<>() { @Override public int size() { diff --git a/src/main/java/net/sourceforge/jaad/aac/syntax/ICSInfo.java b/src/main/java/net/sourceforge/jaad/aac/syntax/ICSInfo.java index dc7289c..8512c9f 100644 --- a/src/main/java/net/sourceforge/jaad/aac/syntax/ICSInfo.java +++ b/src/main/java/net/sourceforge/jaad/aac/syntax/ICSInfo.java @@ -32,23 +32,13 @@ public enum WindowSequence { LONG_STOP_SEQUENCE; public static WindowSequence forInt(int i) throws AACException { - WindowSequence w; - switch (i) { - case 0: - w = ONLY_LONG_SEQUENCE; - break; - case 1: - w = LONG_START_SEQUENCE; - break; - case 2: - w = EIGHT_SHORT_SEQUENCE; - break; - case 3: - w = LONG_STOP_SEQUENCE; - break; - default: - throw new AACException("unknown window sequence type"); - } + WindowSequence w = switch (i) { + case 0 -> ONLY_LONG_SEQUENCE; + case 1 -> LONG_START_SEQUENCE; + case 2 -> EIGHT_SHORT_SEQUENCE; + case 3 -> LONG_STOP_SEQUENCE; + default -> throw new AACException("unknown window sequence type"); + }; return w; } } diff --git a/src/main/java/net/sourceforge/jaad/aac/syntax/PCE.java b/src/main/java/net/sourceforge/jaad/aac/syntax/PCE.java index 49e2288..f56e94f 100644 --- a/src/main/java/net/sourceforge/jaad/aac/syntax/PCE.java +++ b/src/main/java/net/sourceforge/jaad/aac/syntax/PCE.java @@ -63,42 +63,12 @@ public Tag getElementInstanceTag() { private static final int MAX_ASSOC_DATA_ELEMENTS = 8; private static final int MAX_VALID_CC_ELEMENTS = 16; - public static class TaggedElement { + public record TaggedElement(boolean isCPE, int tag) { - private final boolean isCPE; - private final int tag; - - public TaggedElement(boolean isCPE, int tag) { - this.isCPE = isCPE; - this.tag = tag; - } - - public boolean isIsCPE() { - return isCPE; - } - - public int getTag() { - return tag; - } } - public static class CCE { + public record CCE(boolean isIndSW, int tag) { - private final boolean isIndSW; - private final int tag; - - public CCE(boolean isIndSW, int tag) { - this.isIndSW = isIndSW; - this.tag = tag; - } - - public boolean isIsIndSW() { - return isIndSW; - } - - public int getTag() { - return tag; - } } private Profile profile; @@ -182,7 +152,7 @@ public void decode(BitStream in) throws AACException { } } - private void readTaggedElementArray(TaggedElement[] te, BitStream in, int len) throws AACException { + private static void readTaggedElementArray(TaggedElement[] te, BitStream in, int len) throws AACException { for (int i = 0; i < len; ++i) { te[i] = new TaggedElement(in.readBool(), in.readBits(4)); } diff --git a/src/main/java/net/sourceforge/jaad/aac/syntax/SyntacticElements.java b/src/main/java/net/sourceforge/jaad/aac/syntax/SyntacticElements.java index 2a1e6ef..09e767a 100644 --- a/src/main/java/net/sourceforge/jaad/aac/syntax/SyntacticElements.java +++ b/src/main/java/net/sourceforge/jaad/aac/syntax/SyntacticElements.java @@ -147,8 +147,7 @@ private Element decode(List tags, BitStream in) { cces.add((CCE) element); } - if (element instanceof PCE) { - PCE pce = (PCE) element; + if (element instanceof PCE pce) { config.setAudioDecoderInfo(pce); } diff --git a/src/main/java/net/sourceforge/jaad/aac/tools/ICPrediction.java b/src/main/java/net/sourceforge/jaad/aac/tools/ICPrediction.java index b2c63ae..9277921 100644 --- a/src/main/java/net/sourceforge/jaad/aac/tools/ICPrediction.java +++ b/src/main/java/net/sourceforge/jaad/aac/tools/ICPrediction.java @@ -121,17 +121,17 @@ private void predict(float[] data, int off, boolean output) { state.r0 = trunc(A * e0); } - private float round(float pf) { + private static float round(float pf) { return Float.intBitsToFloat((Float.floatToIntBits(pf) + 0x00008000) & 0xFFFF0000); } - private float even(float pf) { + private static float even(float pf) { int i = Float.floatToIntBits(pf); i = (i + 0x00007FFF + (i & 0x00010000 >> 16)) & 0xFFFF0000; return Float.intBitsToFloat(i); } - private float trunc(float pf) { + private static float trunc(float pf) { return Float.intBitsToFloat(Float.floatToIntBits(pf) & 0xFFFF0000); } } diff --git a/src/main/java/net/sourceforge/jaad/aac/tools/MSMask.java b/src/main/java/net/sourceforge/jaad/aac/tools/MSMask.java index 6d8093e..a7ffd7d 100644 --- a/src/main/java/net/sourceforge/jaad/aac/tools/MSMask.java +++ b/src/main/java/net/sourceforge/jaad/aac/tools/MSMask.java @@ -16,23 +16,13 @@ public enum MSMask { TYPE_RESERVED(3); public static MSMask forInt(int i) { - MSMask m; - switch (i) { - case 0: - m = TYPE_ALL_0; - break; - case 1: - m = TYPE_USED; - break; - case 2: - m = TYPE_ALL_1; - break; - case 3: - m = TYPE_RESERVED; - break; - default: - throw new AACException("unknown MS mask type"); - } + MSMask m = switch (i) { + case 0 -> TYPE_ALL_0; + case 1 -> TYPE_USED; + case 2 -> TYPE_ALL_1; + case 3 -> TYPE_RESERVED; + default -> throw new AACException("unknown MS mask type"); + }; return m; } diff --git a/src/main/java/net/sourceforge/jaad/aac/tools/Utils.java b/src/main/java/net/sourceforge/jaad/aac/tools/Utils.java index 6371c5a..c912717 100644 --- a/src/main/java/net/sourceforge/jaad/aac/tools/Utils.java +++ b/src/main/java/net/sourceforge/jaad/aac/tools/Utils.java @@ -42,7 +42,7 @@ static int clip(int idx, int min, int max) { @SafeVarargs static List listOf(E... elements) { if (elements.length == 0) return Collections.emptyList(); - else return Collections.unmodifiableList(Arrays.asList(elements)); + else return List.of(elements); } @SuppressWarnings("unchecked") diff --git a/src/main/java/net/sourceforge/jaad/mp4/api/Artwork.java b/src/main/java/net/sourceforge/jaad/mp4/api/Artwork.java index 39041e9..b785936 100644 --- a/src/main/java/net/sourceforge/jaad/mp4/api/Artwork.java +++ b/src/main/java/net/sourceforge/jaad/mp4/api/Artwork.java @@ -20,23 +20,13 @@ public enum Type { GIF, JPEG, PNG, BMP; static Type forDataType(DataType dataType) { - Type type; - switch (dataType) { - case GIF: - type = GIF; - break; - case JPEG: - type = JPEG; - break; - case PNG: - type = PNG; - break; - case BMP: - type = BMP; - break; - default: - type = null; - } + Type type = switch (dataType) { + case GIF -> GIF; + case JPEG -> JPEG; + case PNG -> PNG; + case BMP -> BMP; + default -> null; + }; return type; } } diff --git a/src/main/java/net/sourceforge/jaad/mp4/api/Movie.java b/src/main/java/net/sourceforge/jaad/mp4/api/Movie.java index 330f45e..159e59a 100644 --- a/src/main/java/net/sourceforge/jaad/mp4/api/Movie.java +++ b/src/main/java/net/sourceforge/jaad/mp4/api/Movie.java @@ -55,17 +55,11 @@ else if (moov.hasChild(BoxTypes.USER_DATA_BOX)) { // TODO: support hint and meta private Track createTrack(Box trak) { HandlerBox hdlr = (HandlerBox) trak.getChild(BoxTypes.MEDIA_BOX).getChild(BoxTypes.HANDLER_BOX); - Track track; - switch ((int) hdlr.getHandlerType()) { - case HandlerBox.TYPE_VIDEO: - track = new VideoTrack(trak, in); - break; - case HandlerBox.TYPE_SOUND: - track = new AudioTrack(trak, in); - break; - default: - track = null; - } + Track track = switch ((int) hdlr.getHandlerType()) { + case HandlerBox.TYPE_VIDEO -> new VideoTrack(trak, in); + case HandlerBox.TYPE_SOUND -> new AudioTrack(trak, in); + default -> null; + }; return track; } diff --git a/src/main/java/net/sourceforge/jaad/mp4/boxes/BoxImpl.java b/src/main/java/net/sourceforge/jaad/mp4/boxes/BoxImpl.java index 375f7c8..5a7a90c 100644 --- a/src/main/java/net/sourceforge/jaad/mp4/boxes/BoxImpl.java +++ b/src/main/java/net/sourceforge/jaad/mp4/boxes/BoxImpl.java @@ -75,7 +75,7 @@ public String toString() { // container methods @Override public boolean hasChildren() { - return children.size() > 0; + return !children.isEmpty(); } @Override diff --git a/src/main/java/net/sourceforge/jaad/mp4/boxes/impl/ItemInformationEntry.java b/src/main/java/net/sourceforge/jaad/mp4/boxes/impl/ItemInformationEntry.java index 21e09d8..c721712 100644 --- a/src/main/java/net/sourceforge/jaad/mp4/boxes/impl/ItemInformationEntry.java +++ b/src/main/java/net/sourceforge/jaad/mp4/boxes/impl/ItemInformationEntry.java @@ -119,14 +119,10 @@ public abstract static class Extension { private static final int TYPE_FDEL = 1717855596; // fdel static Extension forType(int type) { - Extension ext; - switch (type) { - case Extension.TYPE_FDEL: - ext = new FDExtension(); - break; - default: - ext = null; - } + Extension ext = switch (type) { + case Extension.TYPE_FDEL -> new FDExtension(); + default -> null; + }; return ext; } diff --git a/src/main/java/net/sourceforge/jaad/mp4/od/Descriptor.java b/src/main/java/net/sourceforge/jaad/mp4/od/Descriptor.java index 4d0d89b..eabeddc 100644 --- a/src/main/java/net/sourceforge/jaad/mp4/od/Descriptor.java +++ b/src/main/java/net/sourceforge/jaad/mp4/od/Descriptor.java @@ -63,31 +63,19 @@ public static Descriptor createDescriptor(MP4Input in) throws IOException { } private static Descriptor forTag(int tag) { - Descriptor desc; - switch (tag) { - case TYPE_OBJECT_DESCRIPTOR: - desc = new ObjectDescriptor(); - break; - case TYPE_INITIAL_OBJECT_DESCRIPTOR: - case TYPE_MP4_INITIAL_OBJECT_DESCRIPTOR: - desc = new InitialObjectDescriptor(); - break; - case TYPE_ES_DESCRIPTOR: - desc = new ESDescriptor(); - break; - case TYPE_DECODER_CONFIG_DESCRIPTOR: - desc = new DecoderConfigDescriptor(); - break; - case TYPE_DECODER_SPECIFIC_INFO: - desc = new DecoderSpecificInfo(); - break; - case TYPE_SL_CONFIG_DESCRIPTOR: + Descriptor desc = switch (tag) { + case TYPE_OBJECT_DESCRIPTOR -> new ObjectDescriptor(); + case TYPE_INITIAL_OBJECT_DESCRIPTOR, TYPE_MP4_INITIAL_OBJECT_DESCRIPTOR -> new InitialObjectDescriptor(); + case TYPE_ES_DESCRIPTOR -> new ESDescriptor(); + case TYPE_DECODER_CONFIG_DESCRIPTOR -> new DecoderConfigDescriptor(); + case TYPE_DECODER_SPECIFIC_INFO -> new DecoderSpecificInfo(); // desc = new SLConfigDescriptor(); // break; - default: - Logger.getLogger("MP4 Boxes").log(Level.FINE, "Unknown descriptor type: {0}", tag); - desc = new UnknownDescriptor(); - } + default -> { + Logger.getLogger("MP4 Boxes").log(Level.FINE, "Unknown descriptor type: {0}", tag); + yield new UnknownDescriptor(); + } + }; return desc; } diff --git a/src/main/java/net/sourceforge/jaad/spi/javasound/AACAudioFileReader.java b/src/main/java/net/sourceforge/jaad/spi/javasound/AACAudioFileReader.java index d0d2642..d9a8e04 100644 --- a/src/main/java/net/sourceforge/jaad/spi/javasound/AACAudioFileReader.java +++ b/src/main/java/net/sourceforge/jaad/spi/javasound/AACAudioFileReader.java @@ -149,7 +149,7 @@ private AudioFileFormat getAudioFileFormat(InputStream in, int mediaLength) thro if (canHandle) { AudioFileFormat.Type afft = type; - AudioFormat format = new AudioFormat(AAC_ENCODING, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, true, new HashMap() {{ + AudioFormat format = new AudioFormat(AAC_ENCODING, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, AudioSystem.NOT_SPECIFIED, true, new HashMap<>() {{ put("type", afft); }}); logger.fine("DEFINED: " + type); From daccc05b588c3e1994d6ad526021009447275fac Mon Sep 17 00:00:00 2001 From: Naohide Sano Date: Wed, 28 Feb 2024 19:32:36 +0900 Subject: [PATCH 2/3] update settings --- .github/workflows/codeql.yml | 19 +++++++++++++++---- .github/workflows/maven.yml | 10 +++++----- README.md | 14 +++++++++----- jitpack.yml | 2 ++ pom.xml | 29 +++++++++++------------------ 5 files changed, 42 insertions(+), 32 deletions(-) create mode 100644 jitpack.yml diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 48d974c..3450993 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -24,6 +24,10 @@ jobs: analyze: name: Analyze runs-on: ubuntu-latest + permissions: + actions: read + contents: read + security-events: write strategy: fail-fast: false @@ -34,11 +38,11 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@v2 + uses: github/codeql-action/init@v3 with: languages: ${{ matrix.language }} # If you wish to specify custom queries, you can do so here or in a config file. @@ -48,8 +52,15 @@ 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: Set up JDK 17 + uses: actions/setup-java@v4 + with: + java-version: '17' + distribution: 'temurin' + cache: maven + - name: Autobuild - uses: github/codeql-action/autobuild@v2 + uses: github/codeql-action/autobuild@v3 # ℹ️ Command-line programs to run using the OS shell. # 📚 https://git.io/JvXDl @@ -63,4 +74,4 @@ jobs: # make release - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 + uses: github/codeql-action/analyze@v3 diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 6590a16..cf097a2 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -1,7 +1,7 @@ # This workflow will build a Java project with Maven, and cache/restore any dependencies to improve the workflow execution time # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven -name: Java CI with Maven +name: Java CI on: push: @@ -16,16 +16,16 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Check w/o SNAPSHOT when "bump version" if: ${{ contains(github.event.head_commit.message, 'bump version') }} run: grep "" pom.xml | head -1 | grep -v SNAPSHOT - - name: Set up JDK 8 - uses: actions/setup-java@v3 + - name: Set up JDK 17 + uses: actions/setup-java@v4 with: - java-version: '8' + java-version: '17' distribution: 'temurin' cache: maven diff --git a/README.md b/README.md index af07461..8ca59e9 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,14 @@ [![Release](https://jitpack.io/v/umjammer/vavi-sound-aac.svg)](https://jitpack.io/#umjammer/vavi-sound-aac) -[![Java CI with Maven](https://github.com/umjammer/vavi-sound-aac/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-sound-aac/actions/workflows/maven.yml) +[![Java CI](https://github.com/umjammer/vavi-sound-aac/actions/workflows/maven.yml/badge.svg)](https://github.com/umjammer/vavi-sound-aac/actions/workflows/maven.yml) [![CodeQL](https://github.com/umjammer/vavi-sound-aac/actions/workflows/codeql.yml/badge.svg)](https://github.com/umjammer/vavi-sound-aac/actions/workflows/codeql.yml) -![Java](https://img.shields.io/badge/Java-8-b07219) +![Java](https://img.shields.io/badge/Java-17-b07219) [![Parent](https://img.shields.io/badge/Parent-vavi--sound--sandbox-pink)](https://github.com/umjammer/vavi-sound-sandbox) # vavi-sound-aac -Pure Java AAC decoder (Java Sound SPI) +AAC logo© Dolby Laboratories, Inc. -AAC logo© Dolby Laboratories, Inc. +Pure Java AAC decoder (Java Sound SPI) powered by [JAADec](https://github.com/DV8FromTheWorld/JAADec). ## Install @@ -23,6 +23,10 @@ Pure Java AAC decoder (Java Sound SPI) clip.loop(Clip.LOOP_CONTINUOUSLY); ``` +## References + + * [jpcsp](https://github.com/jpcsp/jpcsp/tree/master/src/jpcsp/media/codec/aac) + ## TODO * ~~rename project into vavi-sound-aac~~ @@ -36,7 +40,7 @@ Pure Java AAC decoder (Java Sound SPI) # JAADec -**This is a fork of https://sourceforge.net/projects/vavi-sound-aac/ +**This is a fork of https://sourceforge.net/projects/jaadec/ containing fixes to make it play nice with other Java Sound Providers.** The original project was licensed under Public Domain diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 0000000..efde7bf --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,2 @@ +jdk: + - openjdk17 diff --git a/pom.xml b/pom.xml index 0f941a4..8748abe 100644 --- a/pom.xml +++ b/pom.xml @@ -43,23 +43,21 @@ org.apache.maven.plugins maven-compiler-plugin - 3.10.1 + 3.11.0 - 8 - 8 - UTF-8 + 17 org.apache.maven.plugins maven-surefire-plugin - 3.0.0-M7 + 3.2.2 -Djava.util.logging.config.file=${project.build.testOutputDirectory}/logging.properties false - always + false @@ -77,7 +75,7 @@ org.junit junit-bom - 5.9.3 + 5.10.1 pom import @@ -87,18 +85,13 @@ com.github.umjammer + vavi-commons + 1.1.10 + + + com.github.umjammer vavi-sound - 1.0.15 - - - commons-beanutils - commons-beanutils - - - org.apache.ant - ant - - + 1.0.16 From c7b529e611d31dc628b6c061ebbdb9734e1fb9fb Mon Sep 17 00:00:00 2001 From: Naohide Sano Date: Wed, 28 Feb 2024 19:33:45 +0900 Subject: [PATCH 3/3] bump version --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 8748abe..483c8e0 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ vavi vavi-sound-aac - 0.8.10 + 0.8.11 vavi-sound-aac 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+). https://github.com/umjammer/vavi-sound-aac