Git Product home page Git Product logo

jitsi-sctp's Introduction

jitsi-sctp

The jitsi-sctp project creates a JNI wrapper around the usrsctp lib and provides a set of Java classes to further flesh out a convenient Java SCTP API.

Project organization

Because JNI has a complex build process, this project has multiple submodules to try and separate each of the phases necessary from start to finish. The maven modules are laid out as follows:

`-- jitsi-sctp
    |-- jniwrapper
    |   |-- java
    |   |-- jnilib
    |   `-- native
    |-- sctp
    `-- usrsctp
  • The usrsctp submodule handles the compilation of the usrsctp source into a library. Once the usrsctp source has been cloned to the proper place (into the src/native/usrsctp directory of this submodule), the compile lifecycle can be used to bootstrap, configure and make the source into a library. package will create a jar that will include the native library and the necessary include headers.
  • The jniwrapper submodule has 3 nested submodules:
    • The jniwrapper-java submodule includes the Java portion of the JNI API and interacts with the native code.
    • The jniwrapper-native submodule contains the C portion of the JNI API that bridges the Java and the usrsctp native lib. It depends on both the usrsctp module (because it needs the built library and include headers) and the jniwrapper-java module (to generate the header file to match the C implementation from the Java file). The compile lifecycle will create a new jni lib in target/. The package lifecycle will create a jar that includes the java code and the native libraries. NOTE: The package lifecycle does NOT use the created JNI lib from the target directory. It is intended that the JNI libs are built for each platform ahead of time, and are placed in the src/main/resources directory. This directory is where the package lifecycle will include libraries from.
    • The jnilib submodule combines the jniwrapper-java and jniwrapper-native submodules into a fat jar which includes the Java API and the native JNI libraries that will need to be loaded at runtime.
  • The sctp submodule contains the library on top of the JNI code. The jar built by this is what is intended to be used by other code.

Building the jar files

  • Clone the project
  • Run mvn package (and mvn install to install locally)

This will install all the jars built by the project. Depend on the sctp module to use jitsi-sctp in your code.

(Re)Building a new JNI lib

The JNI lib will need to be rebuilt if there is a change in the usrsctp version or a change in the JNI wrapper C file.

  • Clone the project
  • Clone the usrsctp src:
jitsi-sctp/usrsctp> git clone https://github.com/sctplab/usrsctp
(check out whatever hash/version you want)
  • Package everything and denote what should be rebuilt and redeployed. Here we rebuild the usrsctp libs, rebuild the native wrapper and deploy the newly-built jnilib to the prebuilt libs directory
jitsi-sctp> mvn package -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib
  • Compile and install
jitsi-sctp> mvn install -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib
  • Note: The above commands must be run separately right now due to a bug in the maven-native-plugin. Once a new release is done which includes this fix we'll be able to just run mvn package install -DbuildSctp -DbuildNativeWrapper -DdeployNewJnilib.

jitsi-sctp's People

Contributors

bbaldino avatar bgrozev avatar zewaren avatar

Watchers

 avatar

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.