Merge "media: avoid NPE in CodecCapabilities.createFromProfileLevel" into nyc-dev am: 9061b26f1e am: 12273862c3

am: d1991f03de

* commit 'd1991f03de6e2fa25f7e3f6d8cc5a6b25ce6ff7e':
  media: avoid NPE in CodecCapabilities.createFromProfileLevel

Change-Id: Icbd327f57fbadacadf70c47f8c60dcfb6bdeeaef
This commit is contained in:
Lajos Molnar
2016-06-02 01:01:13 +00:00
committed by android-build-merger
2 changed files with 8 additions and 1 deletions

View File

@@ -750,6 +750,9 @@ public final class MediaCodecInfo {
* Retrieve the codec capabilities for a certain {@code mime type}, {@code
* profile} and {@code level}. If the type, or profile-level combination
* is not understood by the framework, it returns null.
* <p class=note> In {@link android.os.Build.VERSION_CODES#M}, calling this
* method without calling any method of the {@link MediaCodecList} class beforehand
* results in a {@link NullPointerException}.</p>
*/
public static CodecCapabilities createFromProfileLevel(
String mime, int profile, int level) {

View File

@@ -63,6 +63,11 @@ final public class MediaCodecList {
}
/* package private */ static final Map<String, Object> getGlobalSettings() {
synchronized (sInitLock) {
if (sGlobalSettings == null) {
sGlobalSettings = native_getGlobalSettings();
}
}
return sGlobalSettings;
}
@@ -74,7 +79,6 @@ final public class MediaCodecList {
private static final void initCodecList() {
synchronized (sInitLock) {
if (sRegularCodecInfos == null) {
sGlobalSettings = native_getGlobalSettings();
int count = native_getCodecCount();
ArrayList<MediaCodecInfo> regulars = new ArrayList<MediaCodecInfo>();
ArrayList<MediaCodecInfo> all = new ArrayList<MediaCodecInfo>();