From 03da000bdf3f6cef6b7a40a6a7eb639b4c38c4f9 Mon Sep 17 00:00:00 2001 From: Bhumi Sabarwal Date: Thu, 26 Oct 2023 13:55:50 -0700 Subject: [PATCH] Introduce GifDemuxDecodeWrapper Reviewed By: ricky8554 Differential Revision: D50593355 fbshipit-source-id: e74773641c6967ec6805b6ec6230a9283c1b3ca8 --- .../fresco/animation/drawable/AnimatedDrawable2.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java b/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java index 1e2fd303d2..db625ee91d 100644 --- a/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java +++ b/animated-drawable/src/main/java/com/facebook/fresco/animation/drawable/AnimatedDrawable2.java @@ -390,6 +390,16 @@ public int getFrameCount() { return mAnimationBackend == null ? 0 : mAnimationBackend.getFrameCount(); } + /** + * Get the duration of a specific frame. If not animation backend is set, 0 will be returned. + * + * @param frameNumber the requested frame + * @return the duration of the frame + */ + public int getFrameDurationMs(int frameNumber) { + return mAnimationBackend == null ? 0 : mAnimationBackend.getFrameDurationMs(frameNumber); + } + /** * Get the loop count of the animation. The returned value is either * [AnimationInformation#LOOP_COUNT_INFINITE] if the animation is repeated infinitely or a