-
Notifications
You must be signed in to change notification settings - Fork 779
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xamarin samples for Android and iOS #3584
Conversation
How about the video? Is it smooth or is there any noticeable lag? For the audio, since it happens on both iOS and Android, it's unlikely to be caused by a particular audio backend. So perhaps the audio troubleshooting can help? Such as:
|
|
I tested locally and the SWIG build fails if executed from the default directory (i.e. |
The audio stutters issue was caused by an issue with network setup during test, causing packet loss. Using a normal setup, the audio stutters doesn't happen.
So what happens with extra audio device setup? Does it work fine now without it? What was the issue then? |
I retested and use the normal sound device, and the audio works fine (no stutters). My guess is there's a network issue on the first test. There are few access points (one with weak signal) here on the environment. If one of the devices connected the weak access point, media issue is observable. On the latest test, I make sure both endpoints are using the normal/good access point. |
This PR will add samples for Xamarin app on Android and iOS.
The Xamarin app will use PJSUA2 API with SWIG binding.
Requirements
Building PJSIP
Trying our sample application and creating your own
Building our Xamarin Android sample app
Make sure SWIG is in the build environment PATH.
Run make from directory pjsip-apps/src/swig (note that the Android NDK root should be in the PATH), e.g:
This step should produce:
Make sure any library dependencies are copied to pjsip-apps/src/swig/csharp/pjsua2xamarin/pjsua2xamarin.Android/lib/arm64-v8a (or the appropriate target ABI directory), e.g: libopenh264.so for video support.
Open pjsua2xamarin app solution in Visual Studio, it is located in pjsip-apps/src/swig/csharp/pjsua2xamarin.
For video support, the make command will copy additional supporting .java files (PJCamera*.java). From the Visual Studio, right click the files and set the Build Action as Java Native Source.
Build the pjsua2xamarin.Android project
Run it.
Building our Xamarin iOS sample app
Make sure SWIG is in the build environment PATH.
Run make from directory pjsip-apps/src/swig e.g:
This step should produce:
Make sure any library dependencies are copied to pjsip-apps/src/swig/csharp/pjsua2xamarin/pjsua2xamarin.iOS/lib/arm64 (or the appropriate target ABI directory), e.g: libopenh264.so for video support.
Open pjsua2xamarin app solution in Visual Studio, it is located in pjsip-apps/src/swig/csharp/pjsua2xamarin.
Build the pjsua2xamarin.iOS project
Run it.
Creating your own application
For developing Xamarin application, you should use pjsua2 API whose C# interface available via SWIG C# binding.
First, build pjproject libraries as described above.
Also build pjsua2xamarin SWIG binding, this step is required to generate the pjsua2 c# interface and the native library.
Create Xamarin application outside the PJSIP sources for your project.
Get pjsua2 C# interface and native library from pjsua2 sample application:
Copy pjsua2 C# interface files from pjsip-apps/src/swig/csharp/pjsua2xamarin/pjsua2xamarin/pjsua2 to your project’s folder, e.g:
Copy native library libpjsua2.so and libc++_shared.so from pjsip-apps/src/swig/csharp/pjsua2xamarin/pjsua2xamarin.[platform]/lib/ to your project’s libs folder:
Notes:
Start writing your application, please check pjsua2 docs for reference.