Add AImageDecoder_isAnimated
Bug: 160984428
Test: Ie98a7e80c2d0d6101bdf0ac3549a1fa6581aeba6
Change-Id: I32c3994f87bf9f342a5b9dec462f7be23a346351
diff --git a/include/android/imagedecoder.h b/include/android/imagedecoder.h
index 996895e..e8a63a7 100644
--- a/include/android/imagedecoder.h
+++ b/include/android/imagedecoder.h
@@ -504,6 +504,10 @@
*
* Available since API level 30.
*
+ * Starting in API level 31, it can be used to decode all of the frames of an
+ * animated image (i.e. GIF, WebP, HEIF) using new APIs (TODO (scroggo): list
+ * and describe here).
+ *
* @param decoder Opaque object representing the decoder.
* @param pixels On success, will be filled with the result
* of the decode. Must be large enough to hold |size| bytes.
@@ -537,6 +541,24 @@
#endif // __ANDROID_API__ >= 30
+#if __ANDROID_API__ >= 31
+
+/**
+ * Return true iff the image is animated - i.e. has multiple frames.
+ *
+ * Introduced in API 31.
+ *
+ * This may require seeking past the first frame to verify whether
+ * there is a following frame (e.g. for GIF).
+ *
+ * Errors:
+ * - returns false if |decoder| is null.
+ */
+bool AImageDecoder_isAnimated(AImageDecoder* _Nonnull decoder)
+ __INTRODUCED_IN(31);
+
+#endif // __ANDROID_API__ >= 31
+
#ifdef __cplusplus
}
#endif