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

Commit 543b15e9 authored by Shalaj Jain's avatar Shalaj Jain Committed by Linux Build Service Account
Browse files

stagefright: Print clip name in thumbnail/normal mode.

Add a routine to print clip name in ExtendedUtils called from
AwesomePlayer and StagefrightMetadataRetriever.

CRs-Fixed: 711094

Conflicts:
	media/libstagefright/StagefrightMetadataRetriever.cpp

Change-Id: I690a03671dc2563557da88b7eadad9d4e8c3855f
parent e5bf3c1e
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -396,6 +396,10 @@ status_t AwesomePlayer::setDataSource(
       printFileName(fd);
    }

    if (fd) {
        ExtendedUtils::printFileName(fd);
    }

    sp<DataSource> dataSource = new FileSource(fd, offset, length);

    status_t err = dataSource->initCheck();
+18 −0
Original line number Diff line number Diff line
@@ -1254,6 +1254,7 @@ bool ExtendedUtils::HEVCMuxer::getHEVCCodecConfigData(const sp<MetaData> &meta,
    *size = 0;
    return false;
}

}
#endif //ENABLE_AV_ENHANCEMENTS

@@ -1276,4 +1277,21 @@ bool ExtendedUtils::isVideoMuxFormatSupported(const char *mime) {
    return false;
}

void ExtendedUtils::printFileName(int fd) {
    if (fd) {
        char prop[PROPERTY_VALUE_MAX];
        if (property_get("media.stagefright.log-uri", prop, "false") &&
                (!strcmp(prop, "1") || !strcmp(prop, "true"))) {

            char symName[40] = {0};
            char fileName[256] = {0};
            snprintf(symName, sizeof(symName), "/proc/%d/fd/%d", getpid(), fd);

            if (readlink( symName, fileName, (sizeof(fileName) - 1)) != -1 ) {
                ALOGI("printFileName fd(%d) -> %s", fd, fileName);
            }
        }
    }
}

}
+6 −1
Original line number Diff line number Diff line
@@ -32,6 +32,8 @@
#include <media/stagefright/MetaData.h>
#include <media/stagefright/OMXCodec.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/Utils.h>
#include "include/ExtendedUtils.h"
#include <CharacterEncodingDetector.h>

namespace android {
@@ -58,7 +60,7 @@ status_t StagefrightMetadataRetriever::setDataSource(
        const sp<IMediaHTTPService> &httpService,
        const char *uri,
        const KeyedVector<String8, String8> *headers) {
    ALOGV("setDataSource(%s)", uri);
    ALOGI("setDataSource(%s)", uriDebugString(uri, false).c_str());

    mParsedMetaData = false;
    mMetaData.clear();
@@ -91,6 +93,9 @@ status_t StagefrightMetadataRetriever::setDataSource(
    fd = dup(fd);

    ALOGV("setDataSource(%d, %" PRId64 ", %" PRId64 ")", fd, offset, length);
    if (fd) {
        ExtendedUtils::printFileName(fd);
    }

    mParsedMetaData = false;
    mMetaData.clear();
+2 −0
Original line number Diff line number Diff line
@@ -194,6 +194,8 @@ struct ExtendedUtils {
    static bool checkIsThumbNailMode(const uint32_t flags, char* componentName);

    static bool isVideoMuxFormatSupported(const char *mime);

    static void printFileName(int fd);
};

}