Convert capture frame rate metadata

Bug: 119779455
Bug: 111407253
Test: CTS
Change-Id: I27442b189c0d31b77a9a8b3799e96efdad16fb9d
diff --git a/media/libstagefright/Utils.cpp b/media/libstagefright/Utils.cpp
index 53c32b2..ec043f2 100644
--- a/media/libstagefright/Utils.cpp
+++ b/media/libstagefright/Utils.cpp
@@ -588,6 +588,12 @@
     }
 };
 
+static std::vector<std::pair<const char *, uint32_t>> floatMappings {
+    {
+        { "capture-rate", kKeyCaptureFramerate },
+    }
+};
+
 static std::vector<std::pair<const char *, uint32_t>> int64Mappings {
     {
         { "exif-offset", kKeyExifOffset },
@@ -632,6 +638,13 @@
         }
     }
 
+    for (auto elem : floatMappings) {
+        float value;
+        if (msg->findFloat(elem.first, &value)) {
+            meta->setFloat(elem.second, value);
+        }
+    }
+
     for (auto elem : int64Mappings) {
         int64_t value;
         if (msg->findInt64(elem.first, &value)) {
@@ -663,6 +676,13 @@
         }
     }
 
+    for (auto elem : floatMappings) {
+        float value;
+        if (meta->findFloat(elem.second, &value)) {
+            format->setFloat(elem.first, value);
+        }
+    }
+
     for (auto elem : int64Mappings) {
         int64_t value;
         if (meta->findInt64(elem.second, &value)) {