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

Commit 25dcb655 authored by Ricardo Cerqueira's avatar Ricardo Cerqueira Committed by Gerrit Code Review
Browse files

libstagefright: matroska: Make new extractor paths conditional to QCOM

This code path includes things that are implemented by
ExtendedMediaDefs and ExtendedUtils, both of which are
QC enhancements

Change-Id: I9bf30e8ce039aaad32d58d0bf379f77312037c58
parent a255913b
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@

#include <inttypes.h>

#ifdef ENABLE_AV_ENHANCEMENTS
#include <ExtendedUtils.h>
#ifdef ENABLE_AV_ENHANCEMENTS
#include <QCMediaDefs.h>
@@ -154,11 +155,13 @@ private:
    enum Type {
        AVC,
        AAC,
#ifdef ENABLE_AV_ENHANCEMENTS
        MP3,
        AC3,
        EAC3,
        DTS,
        MPEG4,
#endif
        OTHER
    };

@@ -259,6 +262,7 @@ MatroskaSource::MatroskaSource(
        ALOGV("mNALSizeLen = %zu", mNALSizeLen);
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) {
        mType = AAC;
#ifdef ENABLE_AV_ENHANCEMENTS
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AC3)) {
        mType = AC3;
    } else if (!strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_EAC3)) {
@@ -908,7 +912,9 @@ static void addESDSFromCodecPrivate(

    meta->setData(kKeyESDS, 0, esds, esdsSize);

#ifdef ENABLE_AV_ENHANCEMENTS
    ExtendedUtils::updateVideoTrackInfoFromESDS_MPEG4Video(meta);
#endif

    delete[] esds;
    esds = NULL;
@@ -1030,6 +1036,7 @@ void MatroskaExtractor::addTracks() {
                    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_VP8);
                } else if (!strcmp("V_VP9", codecID)) {
                    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_VP9);
#ifdef ENABLE_AV_ENHANCEMENTS
                } else if (!strcmp("V_MS/VFW/FOURCC", codecID)) {
                    if (codecPrivateSize >= sizeof(BITMAPINFOHEADER)) {
                        char *fourcc = (char *) &((BITMAPINFOHEADER *) codecPrivate)->biCompression;
@@ -1073,6 +1080,7 @@ void MatroskaExtractor::addTracks() {
                        ALOGW("fourcc size: %d is not supported\n", codecPrivateSize);
                        continue;
                    }
#endif
                } else {
                    ALOGW("%s is not supported.", codecID);
                    continue;
@@ -1107,6 +1115,7 @@ void MatroskaExtractor::addTracks() {
                    mSeekPreRollNs = track->GetSeekPreRoll();
                } else if (!strcmp("A_MPEG/L3", codecID)) {
                    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_MPEG);
#ifdef ENABLE_AV_ENHANCEMENTS
                } else if (!strcmp("A_AC3", codecID)) {
                    meta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_AUDIO_AC3);
                } else if (!strcmp("A_EAC3", codecID)) {