Bug 1363210 - use MediaCodec async API for Lollipop MR1 (API 22) and later. r=jya
authorJohn Lin <jolin@mozilla.com>
Fri, 19 May 2017 15:49:52 +0800
changeset 360053 8fdfd63fe0f7feaf359886e119be67e9ae5960ce
parent 360052 bc722bc488b50ed85df9e013a535687a2bc1efe0
child 360054 146fefaee64c96e6c6380dd38d34d59be5a18ec8
push id43193
push userjolin@mozilla.com
push dateTue, 23 May 2017 02:31:39 +0000
treeherderautoland@8fdfd63fe0f7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjya
bugs1363210
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1363210 - use MediaCodec async API for Lollipop MR1 (API 22) and later. r=jya Workaround for stagefright bug in Android 5.0/Lollipop. MozReview-Commit-ID: AYiEff0nGoj
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/AsyncCodecFactory.java
@@ -5,13 +5,15 @@
 package org.mozilla.gecko.media;
 
 import android.os.Build;
 
 import java.io.IOException;
 
 public final class AsyncCodecFactory {
     public static AsyncCodec create(String name) throws IOException {
-        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP
+        // A bug that getInputBuffer() could fail after flush() then start() wasn't fixed until MR1.
+        // See: https://android.googlesource.com/platform/frameworks/av/+/d9e0603a1be07dbb347c55050c7d4629ea7492e8
+        return Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP_MR1
                ? new LollipopAsyncCodec(name)
                : new JellyBeanAsyncCodec(name);
     }
 }