Bug 1363994 - Use the same implementation of isAdaptivePlaybackSupported in LollipopAsyncCodec and JellyBeanAsyncCodec draft
authorJames Cheng <jacheng@mozilla.com>
Thu, 11 May 2017 16:12:55 +0800
changeset 576037 c23a1d8847511f9cbb082bccc3aee405979ee3cf
parent 575938 d8762cb967423618ff0a488f14745f60964e5c49
child 628094 c6afc85c31e09148488e4d4fc6795a50d418235a
push id58248
push userbmo:jacheng@mozilla.com
push dateThu, 11 May 2017 08:13:09 +0000
bugs1363994
milestone55.0a1
Bug 1363994 - Use the same implementation of isAdaptivePlaybackSupported in LollipopAsyncCodec and JellyBeanAsyncCodec MozReview-Commit-ID: EWV1t0gdq8V
mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java
--- a/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java
+++ b/mobile/android/geckoview/src/main/java/org/mozilla/gecko/media/LollipopAsyncCodec.java
@@ -1,15 +1,15 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 package org.mozilla.gecko.media;
 
-import static android.media.MediaCodecInfo.CodecCapabilities.FEATURE_AdaptivePlayback;
+import org.mozilla.gecko.util.HardwareCodecCapabilityUtils;
 
 import android.media.MediaCodec;
 import android.media.MediaCrypto;
 import android.media.MediaFormat;
 import android.os.Bundle;
 import android.os.Handler;
 import android.os.Looper;
 import android.os.Message;
@@ -135,17 +135,17 @@ import java.nio.ByteBuffer;
 
     @Override
     public void configure(final MediaFormat format, final Surface surface, final MediaCrypto crypto, final int flags) {
         mCodec.configure(format, surface, crypto, flags);
     }
 
     @Override
     public boolean isAdaptivePlaybackSupported(final String mimeType) {
-        return mCodec.getCodecInfo().getCapabilitiesForType(mimeType).isFeatureSupported(FEATURE_AdaptivePlayback);
+        return HardwareCodecCapabilityUtils.checkSupportsAdaptivePlayback(mCodec, mimeType);
     }
 
     @Override
     public void start() {
         mCodec.start();
     }
 
     @Override