Skip to content

Commit 6879cf4

Browse files
fschleichcfadamp
andauthored
Photon v5 updates (#396)
- updated to Gradle v8.5 - migrated from JDK8 to JDK11 - migrated from java.io to java.nio - migrated from javax to jakarta (where applicable) - added S3 support via aws-java-nio-spi-for-s3 - consolidated ApplicationComposition, AbstractApplicationComposition and IMFCompositionPlaylistype into IMFCompositionPlaylist - moved validation code into new package com.netflix.imflibrary.validation - separated validations for (revisions of) applications, core constraints, cpl and plug-ins - introduced interface ConstraintsValidator and factory ConstraintsValidatorFactory - replaced use of SequenceTypeEnum with Strings for SequenceType/Namespace for easier extensibility - renamed IMPAnalyzer.analyzePackage to IMPAnalyzer.analyzeDelivery to reflect actual scope - consolidated MXF utility methods in new class MXFUtils - moved some virtual track validation methods to ConstraintsValidatorUtils, some to core constraints validation classes, and deleted others - updated CI config with cross platform and multi-JDK builds --------- Co-authored-by: Adam Pongracz <adamp@colorfront.com>
1 parent 2ee9afa commit 6879cf4

File tree

158 files changed

+11831
-7665
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

158 files changed

+11831
-7665
lines changed

.github/workflows/nebula-ci.yml

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,36 @@ on:
99

1010
jobs:
1111
build:
12-
runs-on: ubuntu-latest
1312
strategy:
1413
matrix:
15-
# test against JDK 8
16-
java: [ 8 ]
17-
name: CI with Java ${{ matrix.java }}
14+
os: [ ubuntu-latest, macos-latest, windows-latest ]
15+
# test against JDK 11, 17 and 21
16+
java: [ 11, 17, 21 ]
17+
runs-on: ${{ matrix.os }}
18+
name: CI on ${{ matrix.os }} with Java ${{ matrix.java }}
1819
steps:
19-
- uses: actions/checkout@v1
20+
- uses: actions/checkout@v4
2021
- name: Setup jdk
21-
uses: actions/setup-java@v1
22+
uses: actions/setup-java@v4
2223
with:
24+
distribution: 'zulu'
2325
java-version: ${{ matrix.java }}
24-
- uses: actions/cache@v1
26+
- uses: actions/cache@v4
2527
id: gradle-cache
2628
with:
27-
path: ~/.gradle/caches
28-
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}
29+
path: |
30+
~/.gradle/caches
31+
~/.gradle/wrapper
32+
C:\Users\runneradmin\.gradle\caches
33+
C:\Users\runneradmin\.gradle\wrapper
34+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', '**/gradle/dependency-locks/*.lockfile') }}
2935
restore-keys: |
3036
- ${{ runner.os }}-gradle-
31-
- uses: actions/cache@v1
32-
id: gradle-wrapper-cache
33-
with:
34-
path: ~/.gradle/wrapper
35-
key: ${{ runner.os }}-gradlewrapper-${{ hashFiles('gradle/wrapper/*') }}
36-
restore-keys: |
37-
- ${{ runner.os }}-gradlewrapper-
37+
38+
- name: Grant execute permission for gradlew
39+
if: runner.os != 'Windows'
40+
run: chmod +x gradlew
41+
3842
- name: Build with Gradle
3943
run: ./gradlew --info --stacktrace build
4044
env:

.github/workflows/nebula-publish.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,20 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v1
16-
- name: Setup jdk 8
17-
uses: actions/setup-java@v1
15+
- uses: actions/checkout@v4
16+
- name: Setup jdk 11
17+
uses: actions/setup-java@v2
1818
with:
19-
java-version: 1.8
20-
- uses: actions/cache@v1
19+
distribution: 'zulu'
20+
java-version: 11
21+
- uses: actions/cache@v4
2122
id: gradle-cache
2223
with:
2324
path: ~/.gradle/caches
2425
key: ${{ runner.os }}-gradle-${{ hashFiles('**/gradle/dependency-locks/*.lockfile') }}
2526
restore-keys: |
2627
- ${{ runner.os }}-gradle-
27-
- uses: actions/cache@v1
28+
- uses: actions/cache@v4
2829
id: gradle-wrapper-cache
2930
with:
3031
path: ~/.gradle/wrapper

.github/workflows/nebula-snapshot.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,21 @@ jobs:
99
build:
1010
runs-on: ubuntu-latest
1111
steps:
12-
- uses: actions/checkout@v2
12+
- uses: actions/checkout@v4
1313
with:
1414
fetch-depth: 0
15-
- name: Set up JDK
16-
uses: actions/setup-java@v1
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v2
1717
with:
18-
java-version: 8
19-
- uses: actions/cache@v2
18+
distribution: 'zulu'
19+
java-version: 11
20+
- uses: actions/cache@v4
2021
id: gradle-cache
2122
with:
2223
path: |
2324
~/.gradle/caches
2425
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
25-
- uses: actions/cache@v2
26+
- uses: actions/cache@v4
2627
id: gradle-wrapper-cache
2728
with:
2829
path: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,4 @@ secrets/signing-key
7676

7777
# generated java classes
7878
/generated
79+
/.tmp.driveupload

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Changes from Photon v4.x to v5
2+
3+
- updated to Gradle v8.5
4+
- migrated from JDK8 to JDK11
5+
- migrated from java.io to java.nio
6+
- migrated from javax to jakarta (where applicable)
7+
- added S3 support via aws-java-nio-spi-for-s3
8+
- consolidated ApplicationComposition, AbstractApplicationComposition and IMFCompositionPlaylistype into IMFCompositionPlaylist
9+
- moved validation code into new package com.netflix.imflibrary.validation
10+
- separated validations for (revisions of) applications, core constraints, cpl and plug-ins
11+
- introduced interface ConstraintsValidator and factory ConstraintsValidatorFactory
12+
- replaced use of SequenceTypeEnum with Strings for SequenceType/Namespace for easier extensibility
13+
- renamed IMPAnalyzer.analyzePackage to IMPAnalyzer.analyzeDelivery to reflect actual scope
14+
- consolidated MXF utility methods in new class MXFUtils
15+
- moved some virtual track validation methods to ConstraintsValidatorUtils, some to core constraints validation classes, and deleted others

README.md

Lines changed: 44 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,41 @@ Photon is a Java implementation of the [Interoperable Master Format (IMF)](https
66
- AssetMap (ST 429-9)
77
- PackingList (ST 429-8)
88
- Composition Playlist (ST 2067-3)
9-
- IMF track files (ST 2067-5)
9+
- IMF Track Files (ST 2067-5)
1010

11-
Photon parses and reads IMF track files and serializes the metadata into the IMF Composition Playlist structure. Currently, Photon provides support for IMF Application #2E (ST 2067-21) and Application #5 ACES (ST 2067-50), and the Immersive Audio Bitstream (IAB) Plug-in (ST 2067-201).
11+
Photon parses and reads IMF track files and serializes the metadata into the IMF Composition Playlist structure. Currently, Photon provides support for
12+
- IMF Application #2E (ST 2067-21)
13+
- Application #5 ACES (ST 2067-50)
14+
- Immersive Audio Bitstream (IAB) Level 0 Plug-in (ST 2067-201).
15+
- Audio with Frame-based S-ADM Metadata Plug-in (ST 2067-203).
1216

1317
The goal of the Photon is to provide a simple standardized interface to completely validate an IMP.
1418

1519
## Build
1620

1721
### JDK requirements
1822

19-
Photon can be built using JDK-8. Support for earlier jdk versions has not been tested and/or verified.
23+
Photon can be built using JDK-11.
2024

2125
### Gradle
2226
Photon can be built very easily by using the included Gradle wrapper. Having downloaded the sources, simply invoke the following commands inside the folder containing the sources:
2327

28+
Linux/macOS:
2429
```
2530
$ ./gradlew clean
2631
$ ./gradlew build
32+
$ ./gradlew getDependencies
2733
```
2834

29-
For Windows
35+
Windows:
3036
```
3137
$ gradlew.bat clean
3238
$ gradlew.bat build
39+
$ gradlew.bat getDependencies
3340
```
3441

35-
## Full Documentation
36-
37-
- [Wiki](https://github.com/Netflix/photon/wiki)
38-
- [Javadoc](http://netflix.github.io/photon/)
42+
> [!NOTE]
43+
> `getDependencies` downloads all dependencies into the `./build/libs` directory.
3944
4045
## Binaries
4146
Binaries and dependency information for Maven, Ivy, Gradle and others can be found at [http://search.maven.org](http://search.maven.org/#search%7Cga%7C1%7Cg%3A%22com.netflix.photon%22).
@@ -48,63 +53,57 @@ Example for Maven:
4853
<dependency>
4954
<groupId>com.netflix.photon</groupId>
5055
<artifactId>Photon</artifactId>
51-
<version>0.1.1</version>
56+
<version>4.10.8</version>
5257
</dependency>
5358
```
5459
and for Ivy:
5560

5661
```xml
57-
<dependency org="com.netflix.photon" name="Photon" rev="0.1.1" />
62+
<dependency org="com.netflix.photon" name="Photon" rev="4.10.8" />
5863
```
5964

60-
If you need to download all dependencies, you just have to run:
61-
62-
```
63-
$ ./gradlew getDependencies
64-
```
65+
## Documentation
6566

66-
It will download all dependencies into ./build/libs directory, where Photon.*.jar is built. Multiple sample applications have been provided with this project (e.g., com.netflix.imflibrary.app.IMFTrackFileReader). Having obtained the dependencies, you can run an application as follows:
67+
### Sample Applications
68+
Multiple sample applications have been provided with this project (e.g., com.netflix.imflibrary.app.IMFTrackFileReader). Having obtained the dependencies, you can run an application as follows:
6769

70+
#### Linux/macOS:
6871
```
69-
java -cp ./build/libs/*: <fully qualified class name> <zero or more arguments>
72+
java -cp "./build/libs/*:" <fully qualified class name> <arguments>
7073
```
71-
E.g.,
74+
Example:
7275
```
73-
java -cp ./build/libs/*: com.netflix.imflibrary.st0429_9.AssetMap asset_map_file_path
76+
// Analyze an IMF Delivery locally
77+
java -cp "./build/libs/*:" com.netflix.imflibrary.app.IMPAnalyzer local_folder_path
78+
79+
// Analyze an IMF Delivery in a S3 bucket
80+
java -cp "./build/libs/*:" com.netflix.imflibrary.app.IMPAnalyzer s3://path/to/IMFDelivery/
81+
82+
// Analyze an individual IMF asset (e.g. AssetMap, PKL, CPL, MXF Track File)
83+
java -cp "./build/libs/*:" com.netflix.imflibrary.app.IMPAnalyzer local_file_path
7484
```
85+
86+
#### Windows:
7587
```
76-
java -cp ./build/libs/*: com.netflix.imflibrary.st0429_8.PackingList packing_list_file_path
88+
java -cp build\libs\*; <fully qualified class name> <arguments>
7789
```
90+
Example:
7891
```
79-
java -cp ./build/libs/*: com.netflix.imflibrary.st2067_2.Composition composition_playlist_file_path
92+
// Analyze an IMF Delivery locally
93+
java -cp build\libs\*; com.netflix.imflibrary.app.IMPAnalyzer IMP_folder_path
8094
```
95+
### S3 Access
96+
Photon supports S3 URIs through [aws-java-nio-spi-for-s3](https://github.com/awslabs/aws-java-nio-spi-for-s3). No Photon-specific setup is needed, instead the S3 CLI config and credentials are used directly (see [here](https://docs.aws.amazon.com/cli/v1/userguide/cli-configure-files.html) for instructions).
97+
98+
Example (Linux/macOS):
8199
```
82-
java -cp ./build/libs/*: com.netflix.imflibrary.app.IMPAnalyzer IMP_folder_path
100+
// Analyze an IMF Delivery in a S3 bucket
101+
java -cp "./build/libs/*:" com.netflix.imflibrary.app.IMPAnalyzer s3://imf-plugfest-imf-plugfest/plugfest_2024_11/source_test_vectors/From_Colorfront/HTJ2K/plugest_FTR_C_EN-XX_US-NR_51_UHD_20241105_OV/
83102
```
84103

85-
For Windows please refer to the following examples
86104

87-
To download all dependencies, you just have to run:
105+
### API and Developer Documentation
88106

89-
```
90-
$ gradlew.bat getDependencies
91-
```
92-
93-
It will download all dependencies into build\libs directory, where Photon.*.jar is built. Multiple sample applications have been provided with this project (e.g., com.netflix.imflibrary.app.IMFTrackFileReader). Having obtained the dependencies, you can run an application as follows:
107+
API documentation is available via [Javadoc](http://netflix.github.io/photon/).
94108

95-
```
96-
java -cp build\libs\*; <fully qualified class name> <zero or more arguments>
97-
```
98-
E.g.,
99-
```
100-
java -cp build\libs\*; com.netflix.imflibrary.st0429_9.AssetMap asset_map_file_path
101-
```
102-
```
103-
java -cp build\libs\*; com.netflix.imflibrary.st0429_8.PackingList packing_list_file_path
104-
```
105-
```
106-
java -cp build\libs\*; com.netflix.imflibrary.st2067_2.Composition composition_playlist_file_path
107-
```
108-
```
109-
java -cp build\libs\*; com.netflix.imflibrary.app.IMPAnalyzer IMP_folder_path
110-
```
109+
More information is available in the [Wiki](https://github.com/Netflix/photon/wiki).

bootstrap.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ cat <<EOT > ${photon_validator_script_to_generate}
9292
9393
set -x
9494
95-
java -cp ${photon_install_dir}/libs/*:* com.netflix.imflibrary.app.IMPAnalyzer \${1}
95+
java -cp ${photon_install_dir}/libs/*:* com.netflix.imflibrary.app.IMPAnalyzer \$@}
9696
9797
EOT
9898

build.gradle

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
plugins {
2-
id 'nebula.netflixoss' version '11.1.1'
32
id 'java'
43
id 'pmd'
5-
id 'com.github.spotbugs' version "4.4.4"
64
id 'jacoco'
5+
id 'nebula.release' version '20.1.0'
76
}
87

98
group = 'com.netflix.photon'
@@ -42,25 +41,6 @@ if (JavaVersion.current().isJava8Compatible()) {
4241

4342
repositories {
4443
mavenCentral()
45-
/**
46-
* Following represents the location of SNAPSHOTS of RegXMLLib. It should be enabled only when
47-
* necessary to verify changes to the library that are not yet committed to Maven Central.
48-
*/
49-
/*maven {
50-
url "https://oss.sonatype.org/content/repositories/snapshots/"
51-
}*/
52-
}
53-
54-
spotbugsMain {
55-
enabled = true
56-
excludeFilter = file("codequality/findbugs-excludeFilter-GeneratedCode.xml")
57-
reports {
58-
xml.enabled = false
59-
html.enabled = true
60-
}
61-
}
62-
spotbugsTest {
63-
enabled = false
6444
}
6545

6646
pmd {
@@ -87,30 +67,22 @@ javadoc {
8767
}
8868

8969
dependencies {
90-
jaxb "org.glassfish.jaxb:jaxb-xjc:2.2.11"
91-
92-
compileOnly "com.github.spotbugs:spotbugs-annotations:${spotbugs.toolVersion.get()}"
93-
compileOnly "org.slf4j:slf4j-api:latest.release"
94-
95-
/**
96-
* Following includes the RegXMLLib dependency from Maven Central.
97-
*/
98-
implementation "com.sandflow:regxmllib:1.1.5"
99-
/**
100-
* Following should be enabled and the above should be disabled
101-
* when necessary to verify changes to the RegXMLLib library that are
102-
* not yet committed to Maven Central.
103-
*/
104-
/*compile "com.sandflow:regxmllib:${revRegXMLSNAPSHOT}"*/
70+
implementation 'com.github.spotbugs:spotbugs-annotations:latest.release'
71+
implementation "com.sandflow:regxmllib:1.2.+"
10572
testImplementation "org.mockito:mockito-core:3.3+"
10673
testImplementation "org.testng:testng:7.5+"
107-
implementation "org.slf4j:slf4j-simple:1.7.2"
108-
implementation "org.slf4j:slf4j-api:1.7.2"
74+
implementation "org.slf4j:slf4j-simple:latest.release"
75+
implementation "org.slf4j:slf4j-api:latest.release"
10976

77+
runtimeOnly 'software.amazon.nio.s3:aws-java-nio-spi-for-s3:latest.release'
11078

11179
// JAX-B dependencies for JDK 9+
112-
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
113-
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
80+
implementation "org.glassfish.jaxb:jaxb-runtime:4.0.5"
81+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"
82+
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
83+
84+
// Add JAXB XJC tool for code generation
85+
jaxb 'org.glassfish.jaxb:jaxb-xjc:4.0.5'
11486
}
11587

11688
test {
@@ -130,16 +102,7 @@ task getDependencies(type: Copy) {
130102

131103
jacocoTestReport {
132104
reports {
133-
xml.enabled true
134-
html.enabled false
105+
xml.required = true
106+
html.required = false
135107
}
136108
}
137-
138-
//Following line will enable including compile time dependencies as a part of the
139-
//compile and build process.
140-
//assemble.dependsOn getDependencies
141-
java {
142-
toolchain {
143-
languageVersion = JavaLanguageVersion.of(8)
144-
}
145-
}
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionSha256Sum=7ba68c54029790ab444b39d7e293d3236b2632631fb5f2e012bb28b4ff669e4b
4-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
54
networkTimeout=10000
65
zipStoreBase=GRADLE_USER_HOME
76
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)