Methods Summary |
---|
private static int | checkPowerOfTwo(int value, java.lang.String message)
if ((value & (value - 1)) != 0) {
throw new IllegalArgumentException(message);
}
return value;
|
public final android.media.MediaCodecInfo$CodecCapabilities | getCapabilitiesForType(java.lang.String type)Enumerates the capabilities of the codec component. Since a single
component can support data of a variety of types, the type has to be
specified to yield a meaningful result.
CodecCapabilities caps = mCaps.get(type);
if (caps == null) {
throw new IllegalArgumentException("codec does not support type");
}
// clone writable object
return caps.dup();
|
public final java.lang.String | getName()Retrieve the codec name.
return mName;
|
public final java.lang.String[] | getSupportedTypes()Query the media types supported by the codec.
Set<String> typeSet = mCaps.keySet();
String[] types = typeSet.toArray(new String[typeSet.size()]);
Arrays.sort(types);
return types;
|
public final boolean | isEncoder()Query if the codec is an encoder.
return mIsEncoder;
|
public android.media.MediaCodecInfo | makeRegular()
ArrayList<CodecCapabilities> caps = new ArrayList<CodecCapabilities>();
for (CodecCapabilities c: mCaps.values()) {
if (c.isRegular()) {
caps.add(c);
}
}
if (caps.size() == 0) {
return null;
} else if (caps.size() == mCaps.size()) {
return this;
}
return new MediaCodecInfo(
mName, mIsEncoder,
caps.toArray(new CodecCapabilities[caps.size()]));
|