GithubHelp home page GithubHelp logo

opentimelineio / opentimelineio-java-bindings Goto Github PK

View Code? Open in Web Editor NEW
7.0 7.0 3.0 242 KB

Java bindings for the OpenTimelineIO Library (http://opentimeline.io)

Home Page: http://opentimeline.io

License: Apache License 2.0

CMake 0.57% HTML 0.08% C++ 33.64% Java 65.55% C 0.16%
java opentimelineio

opentimelineio-java-bindings's People

Contributors

dependabot[bot] avatar jradha11 avatar karthikriyer avatar reinecke avatar ssteinbach avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opentimelineio-java-bindings's Issues

Methods should throw exceptions rather than using the ErrorStatus enums

Currently, since the bindings are "down to the metal", many of the APIs accept an ErrorStatus that must be checked. To better fall in line with Java conventions, like the Python bindings, these ErrorStatus objects should not be exposed to users. Instead they should be checked internally and rewrapped as exceptions.

Here is an example of current usage:

ErrorStatus err = new ErrorStatus();
final String firstImageUrl = outImages.getTargetURLForImageNumber(0, err);
if (err.getOutcome() != ErrorStatus.Outcome.OK) {
    ... do some error handling
}

Ideally, this would look something more like:

try {
    final String firstImageUrl = outImages.getTargetURLForImageNumber(0);
catch (IndexOutOfBoundsException error) {
    ... do some error handling
}

The Python ErrorStatus to Exception mappers are good reference.

  • OpenTimelineIO ErrorStatus mapper is here
  • OpenTime ErrorStatus Mapper is here.

Also, of note, the Java ErrorStatus bindings only expose outcome, they fail to include the other helpful fields.

Wrap each_child/children_if & each_clip/clip_if instead of reimplementing

Right now, the bindings reimplement eachChild/eachClip.

This PR introduces these functions in the C++ core (each_child renamed to children_if & each_clip renamed to clip_if). Also, these functions return std::vector instead of iterators.

We should wrap these functions to maintain consistency.

The OTIO dependency with this change was landed in #20

Migrate to BDD tests

This discussion begain in #57

We should adopt BDD Testing, atleast for complicated test cases, requiring some documentation.

The BDD specification would be like:

given: "An item is created"
when: "Item is disabled"
then: "Item does not contribute to the composition"

And the code would be like:

given: "An item is created"
def item = new Item()
verify {
    item.enabled() == true
}

when: "Item is disabled"
item.setEnabled(false)

then: "Item does not contribute to the composition"
verifyAll {
        item.isEnabled() == false
}

BDD tests can be written using the spock framework.
Spock also has an extension spock-reports that generates nice HTML test reports.
image
image

Publish OpenTimelineIO to maven via sonatype

This is a post-documentation of some of the work to get OpenTimelineIO publishing to maven central.

Here was the sonatype issue we used: https://issues.sonatype.org/browse/OSSRH-64444?page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel&focusedCommentId=1016349

From @KarthikRIyer, here were the steps we started with for GPG key generation:

  1. sudo apt install gnupg2
  2. gpg2 --gen-key
  3. gpg2 --keyserver hkp://keys.openpgp.org --send-keys {KEY}
  4. Make sure the key can be found on keys.openpgp.org

The key is then exported to be stored as a github secret using: gpg2 --export-secret-keys 'Key ID' | base64 > private.key

Here is the template settings.xml that is added as a secret to our build (replacing username, password and gpg passphrase):

<?xml version="1.0" encoding="UTF-8"?>
<settings
    xmlns="http://maven.apache.org/SETTINGS/1.0.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
    <pluginGroups></pluginGroups>
    <proxies></proxies>
    <servers>
        <server>
            <id>ossrh</id>
            <username>username</username>
            <password>password</password>
        </server>
    </servers>
    <mirrors></mirrors>
    <profiles>
        <profile>
            <id>ossrh</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <properties>
                <gpg.executable>gpg2</gpg.executable>
                <gpg.passphrase></gpg.passphrase>
            </properties>
        </profile>
    </profiles>
</settings>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.