Bug 1379926 - Support request key frame for Lollipop. r=jolin
authorMunro Mengjue Chiang <mchiang@mozilla.com>
Mon, 17 Jul 2017 23:44:53 +0800
changeset 418142 0fc972e77eb4916165c208f15b93f2fecc78f60c
parent 418141 e89a6503c2f6ea75bee4126b0089ca13173480ad
child 418143 47cb5063c8f54227a96af137fa1a4d669b6973b3
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjolin
bugs1379926
milestone56.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 1379926 - Support request key frame for Lollipop. r=jolin MozReview-Commit-ID: H2XBFsrFJA2
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
@@ -183,16 +183,21 @@ import java.nio.ByteBuffer;
     @Override
     public ByteBuffer getOutputBuffer(final int index) {
         return mCodec.getOutputBuffer(index);
     }
 
     @Override
     public void queueInputBuffer(final int index, final int offset, final int size,
             final long presentationTimeUs, final int flags) {
+        if ((flags & MediaCodec.BUFFER_FLAG_KEY_FRAME) != 0) {
+            Bundle params = new Bundle();
+            params.putInt(MediaCodec.PARAMETER_KEY_REQUEST_SYNC_FRAME, 0);
+            mCodec.setParameters(params);
+        }
         mCodec.queueInputBuffer(index, offset, size, presentationTimeUs, flags);
     }
 
     @Override
     public void queueSecureInputBuffer(final int index, final int offset, final MediaCodec.CryptoInfo info,
             final long presentationTimeUs, final int flags) {
         mCodec.queueSecureInputBuffer(index, offset, info, presentationTimeUs, flags);
     }