FileDocCategorySizeDatePackage
EncoderCapabilities.javaAPI DocAndroid 5.1 API6346Thu Mar 12 22:22:30 GMT 2015android.media

EncoderCapabilities

public class EncoderCapabilities extends Object
The EncoderCapabilities class is used to retrieve the capabilities for different video and audio encoders supported on a specific Android platform. {@hide}

Fields Summary
private static final String
TAG
Constructors Summary
private EncoderCapabilities()

Methods Summary
public static java.util.ListgetAudioEncoders()
Returns the capabilities of the supported audio encoders.

see
android.media.EncoderCapabilities.AudioEncoderCap

        int nEncoders = native_get_num_audio_encoders();
        if (nEncoders == 0) return null;

        List<AudioEncoderCap> encoderList = new ArrayList<AudioEncoderCap>();
        for (int i = 0; i < nEncoders; ++i) {
            encoderList.add(native_get_audio_encoder_cap(i));
        }
        return encoderList;
    
public static int[]getOutputFileFormats()
Returns the array of supported output file formats.

see
android.media.MediaRecorder.OutputFormat

        System.loadLibrary("media_jni");
        native_init();
    
        int nFormats = native_get_num_file_formats();
        if (nFormats == 0) return null;

        int[] formats = new int[nFormats];
        for (int i = 0; i < nFormats; ++i) {
            formats[i] = native_get_file_format(i);
        }
        return formats;
    
public static java.util.ListgetVideoEncoders()
Returns the capabilities of the supported video encoders.

see
android.media.EncoderCapabilities.VideoEncoderCap

        int nEncoders = native_get_num_video_encoders();
        if (nEncoders == 0) return null;

        List<VideoEncoderCap> encoderList = new ArrayList<VideoEncoderCap>();
        for (int i = 0; i < nEncoders; ++i) {
            encoderList.add(native_get_video_encoder_cap(i));
        }
        return encoderList;
    
private static final native android.media.EncoderCapabilities$AudioEncoderCapnative_get_audio_encoder_cap(int index)

private static final native intnative_get_file_format(int index)

private static final native intnative_get_num_audio_encoders()

private static final native intnative_get_num_file_formats()

private static final native intnative_get_num_video_encoders()

private static final native android.media.EncoderCapabilities$VideoEncoderCapnative_get_video_encoder_cap(int index)

private static final native voidnative_init()