Domanda

I have developed video chat application for android device using Flex 4 and action script 3. all working fine. now the problem is camera focus. when I using my android device for video chat , the camera focusing the face widely , means the face shows very large. it's just focus only the part of the face. how can i change the camera focus using action script 3.

 var camera : Camera=getFrontCamera();
            if (camera)
            {

                var ui      : UIComponent   = new          UIComponent();
                var localVideoDisplay   : Video     = new Video(322, 196);
                localVideoDisplay.attachCamera(camera);
                ui.addChild(localVideoDisplay);                     
                cameraGroup.addChild(ui);

this is the code I have used for camera. now I need to change to focus of my camera and it should be shown the face little small in the videoDisplay. the actual problem is both the two persons can't see the others face clearly. it shows only large part of the face.kindly suggest me some ideas to solve this problme.

È stato utile?

Soluzione

There's no direct way I'm aware of to have tight control over the camera focus, however if you call setMode on the Camera object it does re-do the auto focus, I'm not entirely clear if this is what you're looking for but it's the only thing I'm aware of with regard to controlling the camera focus via AS3:

            camera.setMode(VID_SIZE, VID_SIZE, 24);

Also be sure you have this in your -app.xml file for the AIR project

<uses-feature android:name="android.hardware.camera.autofocus"/>

should be near the bottom of the file within these nodes:

<android>
    <manifestAdditions>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top