WalkerKnapp / devolay

A Java binding for the Newtek NDI(tm) SDK.
Apache License 2.0
56 stars 17 forks source link

Devolay

A Java library for sending and receiving video over the network using the Newtek NDI® SDK. For more information about NDI®, see:

http://NDI.NewTek.com/

Download / Installation

Separated Builds

Separated builds do not contain NDI SDK binaries, so end users will need to install the Newtek NDI SDK.

Gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation 'me.walkerknapp:devolay:2.1.1'
}

Maven

<dependency>
  <groupId>me.walkerknapp</groupId>
  <artifactId>devolay</artifactId>
  <version>2.1.1</version>
</dependency>

Integrated Builds

Integrated builds contain NDI SDK binaries bundled into the Jar file, so end users do not need to install the NDI SDK. However, there are some licensing restrictions that must be followed if you use integrated builds in your product. Please see the Licensing Considerations Section.

Gradle

repositories {
    mavenCentral()
}

dependencies {
    implementation 'me.walkerknapp:devolay:2.1.1:integrated'
}

Maven

<dependency>
  <groupId>me.walkerknapp</groupId>
  <artifactId>devolay</artifactId>
  <version>2.1.1</version>
  <classifier>integrated</classifier>  
</dependency>

Android Builds

Android builds contain NDI SDK binaries bundled into the Aar file. Therefore, there are some licensing restrictions that must be followed if you use android builds in your product. Please see the Licensing Considerations Section.

Gradle

dependencies {
    implementation('me.walkerknapp:devolay:2.1.1') {
        artifact {
            name = "devolay"
            type = "aar"
        }
    }
}

⚠️Licensing Considerations⚠️

Separated Builds do not contain any assets restricted under the NDI SDK License Agreement. However, Integrated and Android Builds contain binary files from each platform's NDI SDK. Therefore, any products distributed to end users that use Integrated or Android Builds must follow the guidelines in section 5.2 of the NDI SDK Documentation.

For full details, please install the NDI SDK and read the NDI SDK Documentation and NDI SDK License Agreement. To summarize to the best of my knowledge (not legal advice, please get legal consultation any serious application), applications must:

Usage

Devolay aims to be close to the original NDI SDK while still following Java standards and conventions. The vast majority of applications can be simply translated from NDI SDK calls to Devolay calls.

Examples can be found in examples/src/main/java/me/walkerknapp/devolayexamples.

Android Users

On Android, NDI needs access to the Network Service Discovery Manager, so an instance of NsdManager needs to be exist whenever a sender, finder, or receiver is instantiated. This can be done by adding this to the beginning of long-running activities:

private NsdManager nsdManager;

At some point before creating a sender, finder, or receiver, instantiate the NsdManager:

nsdManager = (NsdManager)getSystemService(Context.NSD_SERVICE);

This requires the INTERNET permission, which can be granted by adding this to your manifest:

<uses-permission android:name="android.permission.INTERNET" />

Additionally, emulators in Android Studio with an ABI of x86_64 do not work with Devolay. Physical devices appear to function normally, but NDI seems to encounter an emulation bug here. To mitigate this, try to use x86 emulators, ARM emulators, or physical devices for testing.

Compiling

Linux or WSL (Recommended)

Requirements

Targeting any platform
Targeting Linux
Targeting Windows
Targeting MacOS
Targeting Android
Targeting IOS/tvOS

Targeting tvOS or iOS is theoretically possible, but not configured, as I don't have access to either platform to test. If you need support for these platforms and would be willing to help, please open an issue.

In theory, these dependencies would be needed:

Building

Clone the repository, or download the zip archive and extract it:

> git clone --recurse-submodules -j8 https://github.com/WalkerKnapp/devolay.git 
> cd devolay

Run the automatic assembly:

> ./gradlew assemble
> ./gradlew install

The library output will now be in devolay-java/build/libs and installed in the local maven repository. The jar can either be used directly, or with gradle:

repositories {
    mavenLocal()
}

dependencies {
    implementation 'com.walker:devolay:VERSION'
}