srtdroid

Additional

Language
Kotlin
Version
1.7.0 (Oct 17, 2023)
Created
Sep 22, 2019
Updated
Oct 17, 2023
Owner
Thibault Beyou (ThibaultBee)
Contributors
Yo (yoobi)
Thibault Beyou (ThibaultBee)
2
Activity
Badge
Generate
Download
Source code

srtdroid: Secure Reliable Transport (SRT) Protocol for Android

Low level API for SRT library on Android. SRT is an open source transport technology that optimizes streaming performance across unpredictable networks. More information on SRT.

srtdroid is a binder/wrapper for Android built on SRT. It is a not a new implementation of SRT protocol.

For a live streaming SDK based on SRT, go to StreamPack.

Install

Get srtdroid latest artifacts on MavenCentral.

dependencies {
    implementation 'io.github.thibaultbee:srtdroid:1.7.0'
}

Sample

srtdroid comes with an examples application. Examples are the srtdroid counterpart of SRT examples folder.

On the server side, configure local IP to 0.0.0.0. On the client side, configure remote IP to server device IP. The port must be the same value for both.

API

As srtdroid is a simple wrapper, it provides a minimalist API documentation. For an extensive SRT API documentation refers to the official SRT API documentation.

Send/recv

Srt send, sendMsg and sendMsg are called send() in srtdroid. Alternatively, you can use the OutputStream API. Srt recv, recvdMsg are called recv() in srtdroid. Alternatively, you can use the InputStream API.

Permissions

You need to add the INTERNET permission in your AndroidManifest.xml:

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

To use, sendFile and recvFile, you might also need to add READ_EXTERNAL_STORAGE and WRITE_EXTERNAL_STORAGE:

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

Then, you have to request permissions at runtime.

Build

srtdroid downloads and builds SRT and OpenSSL (ssl and crypto) libraries. The first compilation will take a while.

Linux

You have to install make:

sudo apt-get install build-essential

Windows

srtdroid does not build on Windows because OpenSSL is really tricky to compile on Windows.

macOS

Not tested.

Licence

Copyright 2021 Thibault B.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.