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

Commit 302fce3a authored by Emilian Peev's avatar Emilian Peev
Browse files

Add ImageReader callback traces

Adds performance tracing around the ImageReader image
callbacks

Bug: 327502995
Test: Manual using camera application

Change-Id: I094d161cbe3617899596b1f3f5def315b96fbdf6
parent 1710ca94
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -37,6 +37,7 @@ import android.os.Build;
import android.os.Handler;
import android.os.Looper;
import android.os.ParcelFileDescriptor;
import android.os.Trace;
import android.view.Surface;

import dalvik.system.VMRuntime;
@@ -925,6 +926,7 @@ public class ImageReader implements AutoCloseable {
        if (ir == null) {
            return;
        }
        Trace.beginSection("android.media.ImageReader#postEventFromNative");

        final Executor executor;
        final OnImageAvailableListener listener;
@@ -948,6 +950,7 @@ public class ImageReader implements AutoCloseable {
                }
            });
        }
        Trace.endSection();
    }

    /**
+3 −0
Original line number Diff line number Diff line
@@ -16,11 +16,13 @@

//#define LOG_NDEBUG 0
#define LOG_TAG "ImageReader_JNI"
#define ATRACE_TAG ATRACE_TAG_CAMERA
#include "android_media_Utils.h"
#include <cutils/atomic.h>
#include <utils/Log.h>
#include <utils/misc.h>
#include <utils/List.h>
#include <utils/Trace.h>
#include <utils/String8.h>

#include <cstdio>
@@ -223,6 +225,7 @@ JNIImageReaderContext::~JNIImageReaderContext() {

void JNIImageReaderContext::onFrameAvailable(const BufferItem& /*item*/)
{
    ATRACE_CALL();
    ALOGV("%s: frame available", __FUNCTION__);
    bool needsDetach = false;
    JNIEnv* env = getJNIEnv(&needsDetach);