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

Commit aa6c746a authored by Naresh Tanniru's avatar Naresh Tanniru
Browse files

Revert "libstagefright: Add support for HW AAC decoder"

- This reverts commit 146757db.

- On PDT tetsing crashes observed due to improper selection
  of multi aac decoder without setting system property

- As multi aac decoder using only for ISDBT case, reverting
  this gerrit to unblock PDT testing till root cause for crash
  is identified.

Change-Id: I1c195bb9150199ae71c686081d75bbb7653fa8fe
parent d9b04af0
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -152,6 +152,8 @@ struct ExtendedCodec {
            const sp<IOMX> &omx, IOMX::node_id nodeID, bool* isEnabled,
            const char* componentName);

    static bool useHWAACDecoder(const char *mime);

    static bool isSourcePauseRequired(const char *componentName);

private:
+3 −13
Original line number Diff line number Diff line
@@ -4654,7 +4654,7 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) {
    // MediaCodecSource does not pass the output format details when calling
    // kInit leading to msg passed not having enough details
    if (!strcasecmp(mime.c_str(), MEDIA_MIMETYPE_AUDIO_AAC)
        && ExtendedUtils::UseQCHWAACEncoder() && encoder) {
        && ExtendedUtils::UseQCHWAACEncoder()) {
        //use hw aac encoder
        ALOGD("use QCOM HW AAC encoder");
        OMXCodec::findMatchingCodecs(
@@ -4663,24 +4663,14 @@ bool ACodec::UninitializedState::onAllocateComponent(const sp<AMessage> &msg) {
                "OMX.qcom.audio.encoder.aac",  // OMX.qcom.audio.encoder.aac
                0,     // flags
                &matchingCodecs);
    } else if (!strcasecmp(mime.c_str(), MEDIA_MIMETYPE_AUDIO_AAC)
        && ExtendedUtils::UseQCHWAACDecoder(mime.c_str()) && !encoder) {
        //use hw aac decoder
        ALOGD("use QCOM HW AAC decoder");
        OMXCodec::findMatchingCodecs(
                mime.c_str(),
                encoder, // createEncoder
                "OMX.qcom.audio.decoder.multiaac",  // OMX.qcom.audio.decoder.multiaac
                0,     // flags
                &matchingCodecs);
    } else {
    }
    else
        OMXCodec::findMatchingCodecs(
                mime.c_str(),
                encoder, // createEncoder
                NULL,  // matchComponentName
                0,     // flags
                &matchingCodecs);
    }
#else
    OMXCodec::findMatchingCodecs(
                mime.c_str(),
+17 −0
Original line number Diff line number Diff line
@@ -1157,6 +1157,18 @@ status_t ExtendedCodec::setAMRWBPLUSFormat(
    return err;
}

bool ExtendedCodec::useHWAACDecoder(const char *mime) {
    char value[PROPERTY_VALUE_MAX] = {0};
    int aaccodectype = 0;
    aaccodectype = property_get("media.aaccodectype", value, NULL);
    if (aaccodectype && !strncmp("0", value, 1) &&
        !strcasecmp(mime, MEDIA_MIMETYPE_AUDIO_AAC)) {
        ALOGI("Using Hardware AAC Decoder");
        return true;
    }
    return false;
}

bool ExtendedCodec::isSourcePauseRequired(const char *componentName) {
    /* pause is required for hardware component to release adsp resources */
    if (!strncmp(componentName, "OMX.qcom.", 9)) {
@@ -1440,6 +1452,11 @@ namespace android {
        ARG_TOUCH(componentName);
    }

    bool ExtendedCodec::useHWAACDecoder(const char *mime) {
        ARG_TOUCH(mime);
        return false;
    }

    void ExtendedCodec::enableSmoothStreaming(
            const sp<IOMX> &omx, IOMX::node_id nodeID, bool* isEnabled,
            const char* componentName) {
+0 −15
Original line number Diff line number Diff line
@@ -940,16 +940,6 @@ bool ExtendedUtils::UseQCHWAACEncoder(audio_encoder Encoder,int32_t Channel,int3
    return mIsQCHWAACEncoder;
}

bool ExtendedUtils::UseQCHWAACDecoder(const char *mime) {
    if (!strncmp(mime, MEDIA_MIMETYPE_AUDIO_AAC, strlen(MEDIA_MIMETYPE_AUDIO_AAC))) {
        char value[PROPERTY_VALUE_MAX] = {0};
        if (property_get("media.aaccodectype", value, 0) && (atoi(value) == 1)) {
            return true;
        }
    }
    return false;
}


//- returns NULL if we dont really need a new extractor (or cannot),
//  valid extractor is returned otherwise
@@ -1726,11 +1716,6 @@ bool ExtendedUtils::UseQCHWAACEncoder(audio_encoder Encoder,int32_t Channel,
    return false;
}

bool ExtendedUtils::UseQCHWAACDecoder(const char *mime) {
    ARG_TOUCH(mime);
    return false;
}

sp<MediaExtractor> ExtendedUtils::MediaExtractor_CreateIfNeeded(
        sp<MediaExtractor> defaultExt,
        const sp<DataSource> &source,
+2 −31
Original line number Diff line number Diff line
@@ -249,7 +249,7 @@ void OMXCodec::findMatchingCodecs(
    size_t index = 0;

#ifdef ENABLE_AV_ENHANCEMENTS
    //Check if application specially reuqested for aac hardware encoder/decoder
    //Check if application specially reuqested for  aac hardware encoder
    //This is not a part of  mediacodec list
    if (matchComponentName &&
            !strncmp("OMX.qcom.audio.encoder.aac", matchComponentName, 26)) {
@@ -260,17 +260,6 @@ void OMXCodec::findMatchingCodecs(
        entry->mQuirks = 0;
        return;
    }

    if (matchComponentName &&
            !strncmp("OMX.qcom.audio.decoder.multiaac", matchComponentName, 31)) {
        matchingCodecs->add();

        CodecNameAndQuirks *entry = &matchingCodecs->editItemAt(index);
        entry->mName = String8("OMX.qcom.audio.decoder.multiaac");
        entry->mQuirks |= kRequiresAllocateBufferOnInputPorts;
        entry->mQuirks |= kRequiresAllocateBufferOnOutputPorts;
        return;
    }
#endif

    for (;;) {
@@ -365,17 +354,6 @@ bool OMXCodec::findCodecQuirks(const char *componentName, uint32_t *quirks) {
        return false;
    }

#ifdef ENABLE_AV_ENHANCEMENTS
    //Check for aac hardware decoder
    //This is not a part of  mediacodec list
    if (componentName &&
            !strncmp("OMX.qcom.audio.decoder.multiaac", componentName, 31)) {
        *quirks |= kRequiresAllocateBufferOnInputPorts;
        *quirks |= kRequiresAllocateBufferOnOutputPorts;
        return true;
    }
#endif

    const sp<MediaCodecInfo> info = list->getCodecInfo(index);
    CHECK(info != NULL);
    *quirks = getComponentQuirks(info);
@@ -405,15 +383,8 @@ sp<MediaSource> OMXCodec::Create(
    CHECK(success);

    Vector<CodecNameAndQuirks> matchingCodecs;

    if (!strncmp(mime, MEDIA_MIMETYPE_AUDIO_AAC, 15) &&
            ExtendedUtils::UseQCHWAACDecoder(mime)) {
        findMatchingCodecs(mime, createEncoder,
            "OMX.qcom.audio.decoder.multiaac", flags, &matchingCodecs);
    } else {
    findMatchingCodecs(
            mime, createEncoder, matchComponentName, flags, &matchingCodecs);
    }

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