This is a POC for building Java bindings for the OpenTimelineIO C++ API.
The main goal of this was to experiment with embedding the compliled libraries in built jar files and building JNI bindings. There are many other issues to address such as how memory management should work.
This was built on macOS Mojave with the Xcode developer tools (clang compiler). Your mileage will likely vary a lot in other circumstances.
- Clone the OpenTimelineIO repo and fetch submodules according to instructions
- Build opentimelineio by doing the following from the repo root:
mkdir build && cd build
- on the next step, make sure you update the prefix with the path to your where you cloned this repo. For instance, if you cloned java-opentimelineio to
~/Projects
, your prefix path would be~/Projects/java-opentimelineio/opentimelineio
cmake -DCMAKE_INSTALL_PREFIX:PATH=/path/to/java-opentimelineio/opentimelineio ..
make install
- You should now have an
opentimelineio
directory in yourjava-opentimelineio
root
- cd into the root of the java-opentimelineio repo
make runtest
- You should see lots of building happen followed by the smoketest (
TestRT.java
) output. OpenTimelineIO.jar
should now exist in thebuild
dir.
- Come up with memory management strategy.
- Come up with strategy for marshalling otio objects with less boilerplate/copying.
- Validate the compiled libray linking works when moving jar between systems.
- Look into if there is a way we can better consume the output of the OpenTimelineIO cmake build rather than building to our repo,
- Determine how to distribute pre-built jars for multiple platforms.
- Clarify any licensing issues surrounding
handle.h
(if we stick with that approach)
This is provided as example code. License implications of other example code that has been referenced/copied has not been explored yet. The goal would be to clear this for the Apache 2.0 License in line with the main OTIO repo.