Export to GitHub

imsdroid - issue #228

Video sent is mirror image when using FFC


Posted on May 20, 2011 by Happy Bird

The video sent is a mirror image of what it should be when using the front facing camera. I would expect that the remote video is not a mirror image.

  1. Create a video call between an IMSDroid Android device and another client (IMSDroid, Boghe, etc). Be sure to use the front facing camera.

  2. The camera PIP as displayed on the Android device is a mirror image as expected.

  3. The video displayed on the remote device is a mirror image of what the camera sees. This is not the expected behavior.

Note that if you use the rear facing camera that this does not occur.

Devices tested: Android 2.2; Samsung Galaxy 9000, Samsung Fascinate, Motorola Atrix

Comment #1

Posted on May 20, 2011 by Happy Bird

I forgot to mention that I am using IMSDroid v2.0 revision 406.

Comment #2

Posted on May 20, 2011 by Grumpy Hippo

I have noticed the same issue on IMSDroid. Most noticeable when the FFC is capturing video of text.

Boghe transmits video correctly (non-mirror) image. I suspect because laptops/PC's usually only have one camera to choose from.

Comment #3

Posted on May 23, 2011 by Swift Cat

Strange because I don't have the issue on my Galaxy S. Do you have "video flip" (Options -> General)?

Comment #4

Posted on May 23, 2011 by Grumpy Hippo

'Video Flip' should really be titled 'Video Rotate'... For me 'Video Flip' normally has to be enabled or the image transmitted to the B party either from the FFC or the back camera are rotated 90 degrees on the HTC, Samsung and Motorola. What this bug is reporting is the image transmitted to the B-party from IMSDroid is a mirror image. To reproduce put some text in front of the A-party camera of IMSDroid and try to read it at the B-party, we are seeing mirror image video stream on all the available Droid devices. Video Flip just rotates the problem.

Comment #5

Posted on Jun 5, 2011 by Swift Cat

(No comment was entered for this change.)

Comment #6

Posted on Jun 12, 2011 by Happy Hippo

hi all

i have galaxy is and i note that the back camera work instead the front face camera i debug the code and i see that it should be different for gingerbread ,what i did i changed the code in openFrontFacingCamera method totally :

this is the new code

private static Camera openFrontFacingCamera() { Camera camera = null;

    // Look for front-facing camera, using the Gingerbread API.
    // Java reflection is used for backwards compatibility with pre-Gingerbread APIs.
    try {
        Class<?> cameraClass = Class.forName("android.hardware.Camera");
        Object cameraInfo = null;
        Field field = null;
        int cameraCount = 0;
        Method getNumberOfCamerasMethod = cameraClass.getMethod( "getNumberOfCameras" );
        if ( getNumberOfCamerasMethod != null ) {
            cameraCount = (Integer) getNumberOfCamerasMethod.invoke( null, (Object[]) null );
        }
        Class<?> cameraInfoClass = Class.forName("android.hardware.Camera$CameraInfo");
        if ( cameraInfoClass != null ) {
            cameraInfo = cameraInfoClass.newInstance();
        }
        if ( cameraInfo != null ) {
            field = cameraInfo.getClass().getField( "facing" );
        }
        Method getCameraInfoMethod = cameraClass.getMethod( "getCameraInfo", Integer.TYPE, cameraInfoClass );
        if ( getCameraInfoMethod != null && cameraInfoClass != null && field != null ) {
            for ( int camIdx = 0; camIdx < cameraCount; camIdx++ ) {
                getCameraInfoMethod.invoke( null, camIdx, cameraInfo );
                int facing = field.getInt( cameraInfo );
                if ( facing == 1 ) { // Camera.CameraInfo.CAMERA_FACING_FRONT
                    try {
                        Method cameraOpenMethod = cameraClass.getMethod( "open", Integer.TYPE );
                        if ( cameraOpenMethod != null ) {
                            camera = (Camera) cameraOpenMethod.invoke( null, camIdx );
                        }
                    } catch (RuntimeException e) {
                        Log.e(TAG, "Camera failed to open: " + e.getLocalizedMessage());
                    }
                }
            }
        }
    }
    // Ignore the bevy of checked exceptions the Java Reflection API throws - if it fails, who cares.
    catch ( ClassNotFoundException e        ) {Log.e(TAG, "ClassNotFoundException" + e.getLocalizedMessage());}
    catch ( NoSuchMethodException e         ) {Log.e(TAG, "NoSuchMethodException" + e.getLocalizedMessage());}
    catch ( NoSuchFieldException e          ) {Log.e(TAG, "NoSuchFieldException" + e.getLocalizedMessage());}
    catch ( IllegalAccessException e        ) {Log.e(TAG, "IllegalAccessException" + e.getLocalizedMessage());}
    catch ( InvocationTargetException e     ) {Log.e(TAG, "InvocationTargetException" + e.getLocalizedMessage());}
    catch ( InstantiationException e        ) {Log.e(TAG, "InstantiationException" + e.getLocalizedMessage());}
    catch ( SecurityException e             ) {Log.e(TAG, "SecurityException" + e.getLocalizedMessage());}

    if ( camera == null ) {
        // Try using the pre-Gingerbread APIs to open the camera.
        try {
            camera = Camera.open();
        } catch (RuntimeException e) {
            Log.e(TAG, "Camera failed to open: " + e.getLocalizedMessage());
        }
    }

    return camera;
}

Comment #7

Posted on Jun 15, 2011 by Swift Cat

@wmas...@gmail.com

Thanks for the source code. I'll take a look and try to integrate it for the next release.

Comment #8

Posted on Aug 22, 2012 by Swift Cat

Fixed by version 2.0.509

Status: Fixed

Labels:
Type-Defect Priority-Medium