Skip to content Skip to sidebar Skip to footer

Pjsip Android Video Call: Inverted Video Preview

I am using Pjsip library for SIP Video call. I am facing issue displying my own view in a SurfaceView. Here is the image: Expected View: Fetching Preview ID in onCallMediaSta

Solution 1:

What I did is replaced SurfaceView with TextureView and then check:

if (isFrontCamera) {
    valmatrix= Matrix()
    matrix.setScale(-1.0f, 1.0f)
    matrix.postTranslate(width.toFloat(), 0.0f)
    surfacePreviewCapture.setTransform(matrix)
}

And it worked. Hope it help others. :)

====== UPDATE ======

When I checked my back camera, the view was also flipped over there so I need to do this to make it proper:

surfacePreviewCapture.setTransform(null)

Solution 2:

Instead of using SurfaceView, you can use TextureView for your preview which you can flipped afterwards. Have a look at How to keep android from inverting the image from the front facing camera? as a reference

Post a Comment for "Pjsip Android Video Call: Inverted Video Preview"