0

I google my question but can't find something to help me to solve my problem. So excuse me if this question is a duplicate.

In my app, I use the sdk ooVoo that use it's own VideoRenderer.
My problem is that the camera preview is not in the right orientation. I forced my activity to have the orientation Landscape (because my app is meant to be played only on glasses).
For the moment, the SurfaceView of my camera preview have an offset of 90 degrees. So I tried to call the setRotation(-90) method of the surfaceView but it translate the preview.
I also tried to setPivot in onStart to be sure that I could use getX() from surfaceView.

Here is a preview of the activity with a call of setRotation(-10) (because setRotation(-90) give me a black square) : ScreenShot


Do you know what I do wrong ?

PS : Here is the code

public class ConferenceActivity extends Activity
{
    private static final String LOGTAG = "ConferenceActivity";
    SurfaceView myCameraView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.w(LOGTAG, "onCreate");
        setContentView(R.layout.activity_conference);

        myCameraView = (SurfaceView)findViewById(R.id.myVideoSurface);
        myCameraView.setRotation(-10);
    }

    ...

}


[EDIT]
As mentioned by a developer of the ooVoo team, I changed the SurfaceView by a GLSurfaceView.
But I still have the same problem of the 90 degree offset of the the view.

CeDerache
  • 43
  • 8

1 Answers1

0

I succes doing the rotation by editing the layout of my view.
I create RelativeLayout that contains the object or the list of objects that I wanted to rotate.
Then, I rotate the RelativeLayout by 90 degree.
Finally, I set the layout to appear in portrait mode instead of landscape.
In fact, I rotated all the objects except the SurfaceView.

It's not the best way to do that, but it works.

CeDerache
  • 43
  • 8