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

Commit fbb4fca5 authored by Ethan Chen's avatar Ethan Chen
Browse files

libstagefright: conditionally expose support for QCOM HW AAC decoder

Change-Id: Ifcbd89ef5cf84c18e53fc16abc53b9b807f73eb2
parent 654a4058
Loading
Loading
Loading
Loading
+12 −5
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
//#define LOG_NDEBUG 0
#define LOG_TAG "MediaCodecList"
#include <utils/Log.h>
#include <cutils/properties.h>

#include <media/stagefright/MediaCodecList.h>

@@ -66,12 +67,18 @@ MediaCodecList::MediaCodecList()
        addMediaCodec(
                false /* encoder */, "OMX.google.raw.decoder", "audio/raw");

#ifdef QCOM_HARDWARE
        char value[PROPERTY_MAX_VALUE] = {0};
        int aaccodectype = property_get("media.aaccodectype", value, NULL);
        if (aaccodectype && !strncmp("0", value, 1)) {
            Vector<AString> QcomAACQuirks;
            QcomAACQuirks.push(AString("requires-allocate-on-input-ports"));
            QcomAACQuirks.push(AString("requires-allocate-on-output-ports"));
            QCUtils::helper_addMediaCodec(mCodecInfos, mTypes, false, "OMX.qcom.audio.decoder.multiaac",
                "audio/mp4a-latm", QCUtils::helper_getCodecSpecificQuirks(mCodecQuirks, QcomAACQuirks));
        }
#endif
    }

#if 0
    for (size_t i = 0; i < mCodecInfos.size(); ++i) {
+4 −0
Original line number Diff line number Diff line
@@ -464,13 +464,17 @@ sp<MediaSource> OMXCodec::Create(

    Vector<CodecNameAndQuirks> matchingCodecs;

#ifdef QCOM_HARDWARE
    if (ExtendedCodec::useHWAACDecoder(mime)) {
        findMatchingCodecs(mime, createEncoder,
            "OMX.qcom.audio.decoder.multiaac", flags, &matchingCodecs);
    } else {
#endif
        findMatchingCodecs(
            mime, createEncoder, matchComponentName, flags, &matchingCodecs);
#ifdef QCOM_HARDWARE
    }
#endif

    if (matchingCodecs.isEmpty()) {
        ALOGV("No matching codecs! (mime: %s, createEncoder: %s, "