Android TextureView Display

How to use it

Since linphone-android's commit id 6a2a652957fdc0b347ddc2db7d37a6d3acb5c654 a new display filter for video calls is available.

It relies upon Android's TextureView instead of SurfaceView, and is much easier to use.

Here's how to use it:

TextureView mVideoView = view.findViewById(R.id.videoSurface);
org.linphone.mediastream.video.capture.CaptureTextureView mCaptureView = view.findViewById(R.id.videoCaptureSurface);

LinphoneManager.getLc().setNativeVideoWindowId(mVideoView);
LinphoneManager.getLc().setNativePreviewWindowId(mCaptureView);

There is no longer any need for the developper to use a listener and set/remove the view depending on the surface's state, everything is handled by the liblinphone SDK.

The remote video will fill the TextureView (using black areas if needed to keep the ratio).

The CaptureTextureView inside the SDK is inherited from TextureView and takes care of rotating the captured image from the camera and scale it to keep it's ratio.

Here's the implementation in case you want to do your own based on ours: https://gitlab.linphone.org/BC/public/mediastreamer2/blob/master/java/src/org/linphone/mediastream/video/capture/CaptureTextureView.java

How to keep using the previous one

This filter is now used by default (since linphone's commit 3792f8c5cffc991425d4664d12873c8b60b3d934 and mediastreamer2's commit b44b9fcacb6db7948092ef107055b092f53b0def), but you can still continue to use the previous one using the GL2JNIView and the SurfaceView.

To do so, simply add the following inside the linphonerc_factory of your application:

[video]
displaytype=MSAndroidOpenGLDisplay
Tags: