android相机分辨率设置在哪里,在某些Android手机中找不到相机分辨率CamcorderProfile(Camera resolution CamcorderProfile not found…

  • Post author:
  • Post category:其他


在某些Android手机中找不到相机分辨率CamcorderProfile(Camera resolution CamcorderProfile not found in some Android phones)

我有一个代码示例:

mediaRecorder = new MediaRecorder();

mediaRecorder.setPreviewDisplay(surfaceHolder.getSurface());

mediaRecorder.setCamera(camera);

mediaRecorder.setAudioSource(MediaRecorder.AudioSource.CAMCORDER);

mediaRecorder.setVideoSource(MediaRecorder.VideoSource.CAMERA);

mediaRecorder.setProfile(CamcorderProfile.get(CamcorderProfile.QUALITY_480P));

这似乎工作得很好,以及CamcorderProfile.QUALITY_LOW

但当我试图获得360p视频,并使用CamcorderProfile.QUALITY_CIF(int = 3)时,我在索尼Xperia Z3(android 6.0.1)中出现错误

MediaProfiles: The given camcorder profile camera 0 quality 3 is not found

System.err: java.lang.RuntimeException: Error retrieving camcorder profile params

System.err: at android.media.CamcorderProfile.native_get_camcorder_profile(Native Method)

System.err: at android.media.CamcorderProfile.get(CamcorderProfile.java:471)

System.err: at android.media.CamcorderProfile.get(CamcorderProfile.java:402)

AOSP测试套件是否仍然没有测试SDK相机质量常数? 我可以在生产中使用哪些常量,并期望所有手机(至少从5.0)支持它?

I have a code example:

mediaRecorder = new MediaRecorder();