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

Commit 4050d401 authored by Lajos Molnar's avatar Lajos Molnar Committed by Gerrit Code Review
Browse files

Merge "MediaCodec: Implement onMetricsFlushed callback" into main

parents 2e26a3ed a28a8373
Loading
Loading
Loading
Loading
+15 −0
Original line number Diff line number Diff line
@@ -1461,6 +1461,21 @@ void JMediaCodec::handleCallback(const sp<AMessage> &msg) {
            break;
        }

        case MediaCodec::CB_METRICS_FLUSHED:
        {
            sp<WrapperObject<std::unique_ptr<mediametrics::Item>>> metrics;
            CHECK(msg->findObject("metrics", (sp<RefBase>*)&metrics));

            // metrics should never be null. Not sure if checking it here adds any value.
            if (metrics == nullptr) {
                return;
            }

            mediametrics::Item *item = metrics->value.get();
            obj = MediaMetricsJNI::writeMetricsToBundle(env, item, NULL);
            break;
        }

        default:
            TRESPASS();
    }