Skip to content

Commit b8ad15f

Browse files
authored
Initial updates for Photon v5 (#395)
- 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
1 parent 2ee9afa commit b8ad15f

File tree

156 files changed

+11776
-7623
lines changed

Some content is hidden

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

156 files changed

+11776
-7623
lines changed

.github/workflows/nebula-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
runs-on: ubuntu-latest
1313
strategy:
1414
matrix:
15-
# test against JDK 8
16-
java: [ 8 ]
15+
# test against JDK 11, 17 and 21
16+
java: [ 11, 17, 21 ]
1717
name: CI with Java ${{ matrix.java }}
1818
steps:
1919
- uses: actions/checkout@v1

.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 & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
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'
75
}
86

@@ -42,25 +40,6 @@ if (JavaVersion.current().isJava8Compatible()) {
4240

4341
repositories {
4442
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
6443
}
6544

6645
pmd {
@@ -87,30 +66,22 @@ javadoc {
8766
}
8867

8968
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}"*/
69+
implementation 'com.github.spotbugs:spotbugs-annotations:latest.release'
70+
implementation "com.sandflow:regxmllib:1.1.6-rc.1"
10571
testImplementation "org.mockito:mockito-core:3.3+"
10672
testImplementation "org.testng:testng:7.5+"
107-
implementation "org.slf4j:slf4j-simple:1.7.2"
108-
implementation "org.slf4j:slf4j-api:1.7.2"
73+
implementation "org.slf4j:slf4j-simple:latest.release"
74+
implementation "org.slf4j:slf4j-api:latest.release"
10975

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

11178
// 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"
79+
implementation "org.glassfish.jaxb:jaxb-runtime:4.0.5"
80+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:4.0.2"
81+
implementation 'jakarta.annotation:jakarta.annotation-api:3.0.0'
82+
83+
// Add JAXB XJC tool for code generation
84+
jaxb 'org.glassfish.jaxb:jaxb-xjc:4.0.5'
11485
}
11586

11687
test {
@@ -130,8 +101,8 @@ task getDependencies(type: Copy) {
130101

131102
jacocoTestReport {
132103
reports {
133-
xml.enabled true
134-
html.enabled false
104+
xml.required = true
105+
html.required = false
135106
}
136107
}
137108

@@ -140,6 +111,6 @@ jacocoTestReport {
140111
//assemble.dependsOn getDependencies
141112
java {
142113
toolchain {
143-
languageVersion = JavaLanguageVersion.of(8)
114+
languageVersion = JavaLanguageVersion.of(11)
144115
}
145116
}
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

src/main/java/com/netflix/imflibrary/Colorimetry.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
import com.netflix.imflibrary.st0377.header.GenericPictureEssenceDescriptor.*;
44
import com.netflix.imflibrary.st0377.header.UL;
55

6-
import javax.annotation.Nonnull;
7-
import javax.annotation.Nullable;
6+
import jakarta.annotation.Nonnull;
7+
import jakarta.annotation.Nullable;
88
import java.util.HashSet;
99
import java.util.List;
1010
import java.util.Set;

0 commit comments

Comments
 (0)