Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2524fe52 authored by Marco Nelissen's avatar Marco Nelissen
Browse files

Convert capture frame rate metadata

Bug: 119779455
Bug: 111407253
Test: CTS
Change-Id: I27442b189c0d31b77a9a8b3799e96efdad16fb9d
parent 6b6a0f05
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -588,6 +588,12 @@ static std::vector<std::pair<const char *, uint32_t>> stringMappings {
    }
};

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 @@ void convertMessageToMetaDataFromMappings(const sp<AMessage> &msg, sp<MetaData>
        }
    }

    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 @@ void convertMetaDataToMessageFromMappings(const MetaDataBase *meta, sp<AMessage>
        }
    }

    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)) {