get Camera Supported Video Sizes - Android Camera

Android examples for Camera:Camera Size

Description

get Camera Supported Video Sizes

Demo Code


//package com.java2s;
import android.annotation.TargetApi;

import android.hardware.Camera;

import android.os.Build;

import java.util.List;

public class Main {
    @TargetApi(Build.VERSION_CODES.HONEYCOMB)
    public static List<Camera.Size> getCameraSupportedVideoSizes(
            Camera camera) {//from   w  w  w .java 2  s .  com
        if ((Build.VERSION.SDK_INT >= 11) && (camera != null)) {
            //         return camera.getParameters().getSupportedVideoSizes();
            List<Camera.Size> sizes = camera.getParameters()
                    .getSupportedVideoSizes();
            if (sizes == null)
                return camera.getParameters().getSupportedPreviewSizes();
            else {
                return null;
            }
        } else {
            return null;
        }
    }
}

Related Tutorials