TextureView with camera preview

后端 未结 2 1413
我寻月下人不归
我寻月下人不归 2021-01-20 03:08

I would like to use TextureView to show camera preview in it. Finally i want to set opacity for camera preview, using TextureView. But i have problem:

相关标签:
2条回答
  • 2021-01-20 03:41

    You should set this in you manifest.xml.

    android:hardwareAccelerated="true"
    

    Where you declare this it's up to where you want to use your TextureView,you used it in your service.so you should declare this in your service declaration.

    <service android:hardwareAccelerated="true"
     /> 
    
    0 讨论(0)
  • 2021-01-20 03:53

    try using this...

    <uses-feature
            android:name="android.hardware.camera"
            android:required="false"/>
        <uses-feature
            android:name="android.hardware.camera.autofocus"
            android:required="false"/>
    
    <application
            android:name=".app.ExampleApp"
            android:allowBackup="true"
            android:icon="@mipmap/ic_launcher"
            android:label="@string/app_name"
            android:largeHeap="true"
            android:theme="@style/AppTheme"
            android:hardwareAccelerated="true" >
    

    This worked for me

    0 讨论(0)
提交回复
热议问题