Build a Mobile Video Chat Framework With Nex Gen Media Server (NGMS) API

 

Presentation

 

Nex Gen Media Server is most popular as a multi-reason media streaming server to convey live and put away video to an assortment of gadgets. Similar media server can be inserted into a portable application to work with ongoing video correspondence. Here we will utilize the NGMS API to work with building a video talk client for Android gadgets utilizing the Android Software Developer Kit (SDK) and Google Android Native Developer Kit (NDK).

 

We will utilize NGMS to give all of the organization transport RTP administrations, video outline pressure and decompression. NGMS will run as a locally ordered shared object utilized by our Android application. We will utilize a Java Native Interface (JNI) spanning layer to conjure local strategies from Java application code.

 

Pre-requisistes

 

This article accepts that you have an essential stardew valley mod apk mod menu and basically a middle of the road level of involvement building Android applications. I won’t go over the subtleties of setting up and Android project in an iDE like Eclipse. Assuming you have recently made Android applications, or possibly went through some model instructional exercises you ought to have the option to use this instructional exercise to make a constant video web based client.

 

In the event that you haven’t previously done as such, you should download the Google Android SDK (Software Developer Kit). In this model I utilized Revision 15 on a Linux 32bit machine. The java application layer is utilized to make the real Android application. The application code will interact with a JNI layer to summon the NGMS API schedules.

 

You will likewise have to download the Google Android NDK (Native Developer Kit). In this model I utilized Revision 6b on a Linux 32bit machine. The NDK will be utilized for making the local point of interaction layer which fills in as the paste between the local code and Java application code. You ought to likewise have a fundamental comprehend of the C programming language.

 

You ought to initially start by making a skeleton Android application utilizing an IDE like Eclipse. In this model, the application will be called ngmsclient. The Java bundle name will be called com.example.ngmsclient and will target Android OS 2.3 or higher. The root project registry ought to contain an envelope called “jni” which will contain the local sources used to communicate with the Java application code. The model beneath expects that you have a skeleton Android application working and will tell you the best way to incorporate an ExampleChat class into your Android project.

 

The Native Layer

 

The NGMS center implanted library is written in C and is bundled as a common item document. Since the Android OS depends on Linux, the NGMS center library will run locally inside your Android application space. You should get the NGMS center library for Android OS from the ngmsvid.com site. The fundamental parts are the library documents libngms.so, libxcode.so, and the header record ngmslib.h. The ngms bundled.so documents will be bundled alongside your ngmsclient.apk to give video talk administrations.

 

The JNI Layer

We will construct a common library called ngmsglue.so which will act as the paste between the ngms API and our Java application code. The design of the Java Native Interface (JNI) registry inside your ngmsclient project catalog ought to seem to be this.

 

jni/Android.mk

 

jni/ngmsglue.c

 

jni/ngms/incorporate/ngmslib.h

 

jni/ngms/lib/libngms.so

 

jni/ngms/lib/libxcode.so

 

ngmsglue.c will contain the code to control NGMS result and info highlights. The code will keep two seperate NGMS API settings, one for stream yield boundaries and one for stream input boundaries. You ought to see that the naming show of each capacity ought to match the Java bundle and class name from where you are conjuring the local code.

 

ngmsStartReceiver is called to instate the NGMS catch input API to tune in on port 5004 for an organization video transfer typified over MPEG-2 TS. Each progressive video casing will be naturally demuxed and decoded into RGB565 pixel design. The total casing can then be perused by calling ngmsReceiveFrame.

 

ngmsStartSender is called to introduce the NGMS stream yield API to yield encoded video edges to a remote host over port 5004. ngmsTransmitFrame is called to encode and send a solitary crude edge in NV21 pixel design.

Leave a Reply

Your email address will not be published.