Fill in frame duration from sample meta

If sample duration is not available, use the average
frame duration of the sequence; if that's not available
default to 30fps.

bug: 120414514
bug: 139815242
test: test some 25fps heif sequence files, the reported
      duration should be 40ms instead of the default 33ms.

Change-Id: I5ddf0a6cbfb44021dee2955badf3f2772586bb1e
diff --git a/media/libheif/HeifDecoderImpl.cpp b/media/libheif/HeifDecoderImpl.cpp
index a7c0f84..bad4210 100644
--- a/media/libheif/HeifDecoderImpl.cpp
+++ b/media/libheif/HeifDecoderImpl.cpp
@@ -44,8 +44,7 @@
     info->mHeight = videoFrame->mHeight;
     info->mRotationAngle = videoFrame->mRotationAngle;
     info->mBytesPerPixel = videoFrame->mBytesPerPixel;
-    // TODO: retrieve per-frame duration from extractor/metadataretriever.
-    info->mDurationUs = 33333;
+    info->mDurationUs = videoFrame->mDurationUs;
     if (videoFrame->mIccSize > 0) {
         info->mIccData.assign(
                 videoFrame->getFlattenedIccData(),