Skip to content

Commit

Permalink
merge with upstream
Browse files Browse the repository at this point in the history
  • Loading branch information
IMFTool committed Oct 24, 2024
2 parents 2a1ee5e + d3cc2ee commit c833cd6
Show file tree
Hide file tree
Showing 205 changed files with 17,320 additions and 118 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@

# Photon

Photon is a Java implementation of the [Interoperable Master Format (IMF)](https://www.imfug.com/explainer/imf-explainer-en/#what-is-imf) standard. IMF core constraints are defined by [SMPTE](https://www.smpte.org/who-we-are) specification [st2067-2:2013](https://ieeexplore.ieee.org/document/7291584) (paywall). Photon offers tools for parsing, interpreting and validating constituent files that make an Interoperable Master Package (IMP). These include AssetMap (st429-9:2014), PackingList (st429-8:2007), Composition Playlist (st2067-3:2013), and the essence containing IMF track file (st2067-5:2013) which follows the Material eXchange Format (MXF) format (st377-1:2011). Specifically, Photon parses and completely reads an MXF file containing a single audio or video essence as defined by the IMF Essence Component specification (st2067-5:2013) and serializes the metadata into the IMF Composition Playlist structure.
Photon is a Java implementation of the [Interoperable Master Format (IMF)](https://www.smpte.org/standards/st2067) standard. Photon offers tools for parsing, interpreting and validating constituent files that make an Interoperable Master Package (IMP). These include:

- AssetMap (ST 429-9)
- PackingList (ST 429-8)
- Composition Playlist (ST 2067-3)
- IMF track files (ST 2067-5)

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).

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

Expand All @@ -14,12 +21,16 @@ Photon can be built using JDK-8. Support for earlier jdk versions has not been t
### Gradle
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:

```
$ ./gradlew clean
$ ./gradlew build
```

For Windows
```
$ gradlew.bat clean
$ gradlew.bat build
```

## Full Documentation

Expand Down
10 changes: 8 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ dependencies {
/**
* Following includes the RegXMLLib dependency from Maven Central.
*/
implementation "com.sandflow:regxmllib:1.1.3"
implementation "com.sandflow:regxmllib:1.1.5"
/**
* Following should be enabled and the above should be disabled
* when necessary to verify changes to the RegXMLLib library that are
Expand All @@ -104,7 +104,13 @@ dependencies {
/*compile "com.sandflow:regxmllib:${revRegXMLSNAPSHOT}"*/
testImplementation "org.mockito:mockito-core:3.3+"
testImplementation "org.testng:testng:7.5+"
testImplementation "org.slf4j:slf4j-simple:latest.release"
implementation "org.slf4j:slf4j-simple:1.7.2"
implementation "org.slf4j:slf4j-api:1.7.2"


// JAX-B dependencies for JDK 9+
implementation "jakarta.xml.bind:jakarta.xml.bind-api:2.3.2"
implementation "org.glassfish.jaxb:jaxb-runtime:2.3.2"
}

test {
Expand Down
5 changes: 5 additions & 0 deletions codequality/findbugs-excludeFilter-GeneratedCode.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,9 @@
<Bug pattern="RCN_REDUNDANT_NULLCHECK_OF_NULL_VALUE" />
</Match>

<!-- It should be possible to define a class that is tested but not fully used at this time -->
<Match>
<Bug pattern="URF_UNREAD_FIELD" />
</Match>

</FindBugsFilter>
34 changes: 34 additions & 0 deletions src/main/java/com/netflix/imflibrary/IMFConstraints.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.netflix.imflibrary.st0377.PartitionPack;
import com.netflix.imflibrary.st0377.header.*;
import com.netflix.imflibrary.st2067_201.IABEssenceDescriptor;
import com.netflix.imflibrary.st2067_203.MGASoundEssenceDescriptor;
import com.netflix.imflibrary.utils.ErrorLogger;
import com.netflix.imflibrary.utils.Utilities;

Expand Down Expand Up @@ -453,6 +454,10 @@ else if(essenceType.equals(HeaderPartition.EssenceTypeEnum.IABEssence))
{
targetMXFDataDefinition = MXFDataDefinition.SOUND;
}
else if(essenceType.equals(HeaderPartition.EssenceTypeEnum.MGASADMEssence))
{
targetMXFDataDefinition = MXFDataDefinition.SOUND;
}
else{
targetMXFDataDefinition = MXFDataDefinition.DATA;
}
Expand Down Expand Up @@ -564,6 +569,35 @@ private boolean hasWaveAudioEssenceDescriptor()
return iabEssenceDescriptor;
}

/**
* Gets the first MGASoundEssenceDescriptor structural metadata set from
* an OP1A-conformant MXF Header partition. Returns null if none is found
* @return returns the first MGASoundEssenceDescriptor
*/
public @Nullable MGASoundEssenceDescriptor getMGASoundEssenceDescriptor()
{
MGASoundEssenceDescriptor mgaSoundEssenceDescriptor = null;
GenericPackage genericPackage = this.headerPartitionOP1A.getHeaderPartition().getPreface().getContentStorage().
getEssenceContainerDataList().get(0).getLinkedPackage();
SourcePackage filePackage = (SourcePackage)genericPackage;
for (TimelineTrack timelineTrack : filePackage.getTimelineTracks())
{
Sequence sequence = timelineTrack.getSequence();
MXFDataDefinition filePackageMxfDataDefinition = sequence.getMxfDataDefinition();
if (filePackageMxfDataDefinition.equals(MXFDataDefinition.SOUND))
{
GenericDescriptor genericDescriptor = filePackage.getGenericDescriptor();
if (genericDescriptor instanceof MGASoundEssenceDescriptor)
{
mgaSoundEssenceDescriptor = (MGASoundEssenceDescriptor)genericDescriptor;
break;
}
}
}

return mgaSoundEssenceDescriptor;
}

/**
* A method that returns the IMF Essence Component type.
* @return essenceTypeEnum an enumeration constant corresponding to the IMFEssenceComponent type
Expand Down
Loading

0 comments on commit c833cd6

Please sign in to comment.