Android Getsupportedvideosizes Returns Null On Emulator
Solution 1:
This is a known Android bug.
This still hasn't been fixed yet but the fact that it is on the bug tracking system probably means that Google has plans to see it through.
Solution 2:
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.
Solution 3:
It's clearly stated here that a null return from this method means the device doesn't support different outputs for preview and video. In case of emulator, this situation must be prominent because an emulator doesn't have a physical camera and is generally not used for testing camera-related modules.
I would like to add that even though documentations have pointed this to be a normal case scenario, I'm still unable to find a proper alternative for devices suffering from this sickness. For instance, a Verizon variant of S3 return null for both "getSupportedVideoSizes()" and "getPreferredPreviewSizeForVideo()". Has anyone gone through a way around this issue?? A help would be highly appreciated.
Solution 4:
Sample code:
public List<Size> getSupportedVideoSizes(Camera camera) {
if (camera.getParameters().getSupportedVideoSizes() != null) {
return camera.getParameters().getSupportedVideoSizes();
} else {
// Video sizes may be null, which indicates that all the supported// preview sizes are supported for video recording.return camera.getParameters().getSupportedPreviewSizes();
}
}
Post a Comment for "Android Getsupportedvideosizes Returns Null On Emulator"