Build a Cell Movie Chat Framework With Nex Gen Media Server (NGMS) API
Nex Gen Media Server is greatest called a multi-objective media streaming server to provide Dwell and stored video to various devices. The exact same media server is usually embedded right into a mobile application to aid actual time online video communication. Listed here We are going to make use of the NGMS API to aid creating a video chat consumer for Android equipment using the Android Software package Developer Kit (SDK) and Google Android Native Developer Package (NDK).
We will use NGMS to supply all the network transportation RTP products and services, online video body compression and decompression. NGMS will operate as a natively compiled shared item utilized by our Android app. We’ll use a Java Indigenous Interface (JNI) bridging layer to invoke native methods from Java software code.
This post assumes you have a simple being familiar with and no less than an intermediate volume of expertise creating Android apps. I will never go more than the small print of putting together and Android undertaking in an iDE including Eclipse. In case you have futemax Earlier created Android apps, or no less than went by means of some example tutorials you ought to be ready to employ this tutorial to produce a true-time video streaming consumer.
In the event you have not already finished so, you need to obtain the Google Android SDK (Program Developer Kit). In this instance I utilized Revision 15 over a Linux 32bit equipment. The java software layer is made use of to generate the particular Android app. The application code will interface that has a JNI layer to invoke the NGMS API routines.
Additionally, you will really need to down load the Google Android NDK (Native Developer Package). In this example I applied Revision 6b on the Linux 32bit device. The NDK will likely be useful for making the indigenous interface layer which serves given that the glue in between the native code and Java application code. It’s also advisable to Have got a fundamental recognize on the C programming language.
You should very first get started by developing a skeleton Android software employing an IDE which include Eclipse. In this example, the applying will likely be referred to as ngmsclient. The Java offer title will likely be identified as com.instance.ngmsclient and will target Android OS 2.three or bigger. The basis job Listing should really have a folder called “jni” which can comprise the indigenous resources used to interface With all the Java software code. The instance underneath assumes that you have a skeleton Android application Functioning and may demonstrate tips on how to combine an ExampleChat course into your Android job.
The Indigenous Layer
The NGMS core embedded library is created in C which is packaged as being a shared object file. Considering that the Android OS relies on Linux, the NGMS Main library will run natively within your Android application space. You have got to attain the NGMS Main library for Android OS within the ngmsvid.com Internet site. The essential factors are the library documents libngms.so, libxcode.so, and also the header file ngmslib.h. The ngms bundled.so files might be packaged as well as your ngmsclient.apk to supply video clip chat products and services.
The JNI Layer
We’re going to build a shared library named ngmsglue.so which will function the glue between the ngms API and our Java application code. The framework in the Java Indigenous Interface (JNI) directory inside of your ngmsclient job directory really should look like this.
ngmsglue.c will consist of the code to regulate NGMS output and input attributes. The code will maintain two seperate NGMS API contexts, just one for stream output parameters and one for stream enter parameters. You’ll want to notice which the naming Conference of every purpose should really match the Java offer and course title from where you are invoking the indigenous code.