get Default Video Profile - Android Media

Android examples for Media:Video

Description

get Default Video Profile

Demo Code


//package com.java2s;

import android.media.CamcorderProfile;

public class Main {
    public static CamcorderProfile getDefaultVideoProfile(int cameraId) {
        final int[] qualities = { CamcorderProfile.QUALITY_HIGH,
                CamcorderProfile.QUALITY_1080P,
                CamcorderProfile.QUALITY_720P,
                CamcorderProfile.QUALITY_480P,
                CamcorderProfile.QUALITY_CIF, CamcorderProfile.QUALITY_LOW };
        for (int quality : qualities) {
            if (CamcorderProfile.hasProfile(cameraId, quality)) {
                return CamcorderProfile.get(cameraId, quality);
            }/* www  .j  a  va 2  s. c  om*/
        }
        return null;
    }
}

Related Tutorials