oussdag / imsdroid

Automatically exported from code.google.com/p/imsdroid
0 stars 0 forks source link

Video sent is mirror image when using FFC #228

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

Original issue reported on code.google.com by gmapsv...@gmail.com on 20 May 2011 at 6:29

GoogleCodeExporter commented 9 years ago
I forgot to mention that I am using IMSDroid v2.0 revision 406.

Original comment by gmapsv...@gmail.com on 20 May 2011 at 6:30

GoogleCodeExporter commented 9 years ago
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.

Original comment by rich.ho...@gmail.com on 20 May 2011 at 9:28

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

Original comment by boss...@yahoo.fr on 23 May 2011 at 8:26

GoogleCodeExporter commented 9 years ago
'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.

Original comment by rich.ho...@gmail.com on 23 May 2011 at 11:42

GoogleCodeExporter commented 9 years ago

Original comment by boss...@yahoo.fr on 5 Jun 2011 at 5:31

GoogleCodeExporter commented 9 years ago
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;
    }

Original comment by wmas...@gmail.com on 12 Jun 2011 at 7:03

GoogleCodeExporter commented 9 years ago
@wmas...@gmail.com

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

Original comment by boss...@yahoo.fr on 15 Jun 2011 at 11:24

GoogleCodeExporter commented 9 years ago
Fixed by version 2.0.509

Original comment by boss...@yahoo.fr on 22 Aug 2012 at 5:21