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

Commit 6ead2c34 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add timestamps to mediaextractor dumpsys"

parents 594564c4 b5894373
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
#include <utils/Log.h>

#include <stdint.h>
#include <time.h>
#include <sys/types.h>

#include <binder/IPCThreadState.h>
@@ -219,10 +220,16 @@ typedef struct {
    Vector<wp<IMediaSource>> tracks;
    Vector<String8> trackDescriptions;
    String8 toString() const;
    time_t when;
} ExtractorInstance;

String8 ExtractorInstance::toString() const {
    String8 str = name;
    String8 str;
    char timeString[32];
    strftime(timeString, sizeof(timeString), "%m-%d %T", localtime(&when));
    str.append(timeString);
    str.append(": ");
    str.append(name);
    str.append(" for mime ");
    str.append(mime);
    str.append(", source ");
@@ -287,6 +294,7 @@ void registerMediaExtractor(
    ex.sourceDescription = source->toString();
    ex.owner = IPCThreadState::self()->getCallingPid();
    ex.extractor = extractor;
    ex.when = time(NULL);

    {
        Mutex::Autolock lock(sExtractorsLock);