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

Commit b4a1d1bc authored by Gopalakrishnan Nallasamy's avatar Gopalakrishnan Nallasamy Committed by Automerger Merge Worker
Browse files

Merge "MediaAppender:File fmt mime to determine extractor" into sc-qpr1-dev am: 8d015fc6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/av/+/15751076

Change-Id: I43d034e333eeed05363d5f5530d6dac4e4a6c5cf
parents f9039650 8d015fc6
Loading
Loading
Loading
Loading
+13 −2
Original line number Diff line number Diff line
@@ -75,10 +75,21 @@ status_t MediaAppender::init() {
        return status;
    }

    if (strcmp("MPEG4Extractor", mExtractor->getName()) == 0) {
    sp<AMessage> fileFormat;
    status = mExtractor->getFileFormat(&fileFormat);
    if (status != OK) {
        ALOGE("extractor_getFileFormat failed, status :%d", status);
        return status;
    }

    AString fileMime;
    fileFormat->findString("mime", &fileMime);
    // only compare the end of the file MIME type to allow for vendor customized mime type
    if (fileMime.endsWith("mp4")){
        mFormat = MediaMuxer::OUTPUT_FORMAT_MPEG_4;
    } else {
        ALOGE("Unsupported format, extractor name:%s", mExtractor->getName());
        ALOGE("Unsupported file format, extractor name:%s, fileformat %s",
              mExtractor->getName(), fileMime.c_str());
        return ERROR_UNSUPPORTED;
    }