From 43d2ca9d5bd2da569c2818631a813c4d823f7d32 Mon Sep 17 00:00:00 2001 From: Munro Mengjue Chiang Date: Mon, 17 Jul 2017 23:44:53 +0800 Subject: [PATCH] Bug 1379926 - Support request key frame for Lollipop. r=jolin MozReview-Commit-ID: H2XBFsrFJA2 --HG-- extra : rebase_source : 856ad0ee3e4d77fe6f388c4eca736d97d622043b --- .../java/org/mozilla/gecko/media/LollipopAsyncCodec.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git 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 index 874748ef8956..b7f852334719 100644 --- 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 @@ -188,6 +188,11 @@ import java.nio.ByteBuffer; @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); }