Android Camera Check sizeSupported(Camera.Parameters cp, CamcorderProfile profile)

Here you can find the source of sizeSupported(Camera.Parameters cp, CamcorderProfile profile)

Description

size Supported

Declaration

public static boolean sizeSupported(Camera.Parameters cp,
            CamcorderProfile profile) 

Method Source Code

//package com.java2s;
import android.hardware.Camera;
import android.media.CamcorderProfile;
import java.util.List;

public class Main {
    public static boolean sizeSupported(Camera.Parameters cp,
            CamcorderProfile profile) {/*from   www. j a  v a 2s .  c  o  m*/
        List<Camera.Size> sl = cp.getSupportedVideoSizes();

        if (sl == null)
            sl = cp.getSupportedPictureSizes();

        for (Camera.Size s : sl) {
            if (profile.videoFrameWidth == s.width
                    && profile.videoFrameHeight == s.height)
                return true;
        }

        return false;
    }
}

Related

  1. checkCameraHardware(Context context)
  2. checkCameraHardware(Context context)
  3. checkCameraHardware(Context context)
  4. checkFrontCamera(Context context)
  5. deviceHasCamera(Context context)
  6. hasFlash(Camera mCamera)
  7. findBestPreviewSizeValue( Camera.Parameters parameters, Point screenResolution)