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.

4

1 回答 1

0

我通过编辑视图的布局成功地进行了旋转。
我创建了包含要旋转的对象或对象列表的 RelativeLayout。
然后,我将 RelativeLayout 旋转 90 度。
最后,我将布局设置为纵向模式而不是横向模式。
事实上,我旋转了除 SurfaceView 之外的所有对象。

这不是最好的方法,但它确实有效。

于 2014-12-10T12:11:14.077 回答