Glass camera preview display is garbled

前端 未结 1 1170
庸人自扰
庸人自扰 2020-12-09 13:22

I am trying to get a live camera preview to display in Google Glass.

I\'m using all of the camera defaults (and have also tried using a few different image formats;

相关标签:
1条回答
  • 2020-12-09 13:41

    This has been answered here: https://stackoverflow.com/a/19257078/950427

    Longterm:

    Camera.Parameters params = camera.getParameters();
    params.setPreviewFpsRange(30000, 30000);
    camera.setParameters(params);
    

    Shorterm(testing):

    For quick testing and usage, simply add to your outermost view:

    android:layout_margin="1dp"
    

    For example:

    <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        xmlns:tools="http://schemas.android.com/tools"
        android:layout_width="match_parent"
        android:layout_margin="1dp"
        android:layout_height="match_parent" >
    
        <org.opencv.android.JavaCameraView
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:id="@+id/tutorial2_activity_surface_view" />
    
    </LinearLayout>
    
    0 讨论(0)
提交回复
热议问题