Android getsupportedvideosizes returns null on emulator

前端 未结 4 1390
轻奢々
轻奢々 2021-01-27 14:22

I have tried to get the supported video size as below in an emulator but it always return null.Why it is so?I have tried in 4.03.Thanks in advance

 Camera cam         


        
4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-27 14:55

    Here is the one of the option by which you can get Camera Preview Size of the devices.

    Camera camera=Camera.open();
    android.hardware.Camera.Parameters params = camera.getParameters();
    Size supportedPicSizes = params.getPreviewSize();
    if (supportedPicSizes==null){
          Log.i("*****supportedVideoSize*****", "*****Null****"); 
    }
    else{
          Log.i("*****supportedVideoSize*****", "*****"+supportedPicSizes.height); 
          Log.i("*****supportedVideoSize*****", "*****"+supportedPicSizes.width); 
    }
    

    Hope it helps you.

    Thanks.

提交回复
热议问题