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

Commit 7ee7abbd authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 11766482 from 3db4ea63 to 24Q3-release

Change-Id: Ic6bffc6682fe0d132fad2872ba0ec3132954c3d8
parents 5cfb4791 3db4ea63
Loading
Loading
Loading
Loading
+17 −4
Original line number Diff line number Diff line
@@ -58,7 +58,9 @@ using ::aidl::android::hardware::audio::effect::CommandId;
using ::aidl::android::hardware::audio::effect::Descriptor;
using ::aidl::android::hardware::audio::effect::IEffect;
using ::aidl::android::hardware::audio::effect::IFactory;
using ::aidl::android::hardware::audio::effect::kEventFlagDataMqNotEmpty;
using ::aidl::android::hardware::audio::effect::kEventFlagDataMqUpdate;
using ::aidl::android::hardware::audio::effect::kEventFlagNotEmpty;
using ::aidl::android::hardware::audio::effect::kReopenSupportedVersion;
using ::aidl::android::hardware::audio::effect::State;

@@ -200,6 +202,7 @@ status_t EffectHalAidl::process() {
                              efState & kEventFlagDataMqUpdate) {
        ALOGV("%s %s V%d receive dataMQUpdate eventFlag from HAL", __func__, effectName.c_str(),
              halVersion);

        mConversion->reopen();
    }
    auto statusQ = mConversion->getStatusMQ();
@@ -225,12 +228,22 @@ status_t EffectHalAidl::process() {
              floatsToWrite, mInBuffer->audioBuffer(), inputQ->availableToWrite());
        return INVALID_OPERATION;
    }
    efGroup->wake(aidl::android::hardware::audio::effect::kEventFlagNotEmpty);

    // for V2 audio effect HAL, expect different EventFlag to avoid bit conflict with FMQ_NOT_EMPTY
    efGroup->wake(halVersion >= kReopenSupportedVersion ? kEventFlagDataMqNotEmpty
                                                        : kEventFlagNotEmpty);

    IEffect::Status retStatus{};
    if (!statusQ->readBlocking(&retStatus, 1) || retStatus.status != OK ||
        (size_t)retStatus.fmqConsumed != floatsToWrite || retStatus.fmqProduced == 0) {
        ALOGE("%s read status failed: %s", __func__, retStatus.toString().c_str());
    if (!statusQ->readBlocking(&retStatus, 1)) {
        ALOGE("%s %s V%d read status from status FMQ failed", __func__, effectName.c_str(),
              halVersion);
        return INVALID_OPERATION;
    }
    if (retStatus.status != OK || (size_t)retStatus.fmqConsumed != floatsToWrite ||
        retStatus.fmqProduced == 0) {
        ALOGE("%s read status failed: %s, consumed %d (of %zu) produced %d", __func__,
              retStatus.toString().c_str(), retStatus.fmqConsumed, floatsToWrite,
              retStatus.fmqProduced);
        return INVALID_OPERATION;
    }

+4 −1
Original line number Diff line number Diff line
@@ -177,7 +177,10 @@ void DownmixImpl::process() {
     * in the life cycle of workerThread (threadLoop).
     */
    uint32_t efState = 0;
    if (!mEventFlag || ::android::OK != mEventFlag->wait(kEventFlagNotEmpty, &efState)) {
    if (!mEventFlag ||
        ::android::OK != mEventFlag->wait(mDataMqNotEmptyEf, &efState, 0 /* no timeout */,
                                          true /* retry */) ||
        !(efState & mDataMqNotEmptyEf)) {
        LOG(ERROR) << getEffectName() << __func__ << ": StatusEventFlag invalid";
    }

+6 −4
Original line number Diff line number Diff line
@@ -213,11 +213,12 @@ ndk::ScopedAStatus DynamicsProcessingImpl::open(const Parameter::Common& common,
    RETURN_OK_IF(mState != State::INIT);
    mImplContext = createContext(common);
    RETURN_IF(!mContext || !mImplContext, EX_NULL_POINTER, "createContextFailed");
    int version = 0;
    RETURN_IF(!getInterfaceVersion(&version).isOk(), EX_UNSUPPORTED_OPERATION,
    RETURN_IF(!getInterfaceVersion(&mVersion).isOk(), EX_UNSUPPORTED_OPERATION,
              "FailedToGetInterfaceVersion");
    mImplContext->setVersion(version);
    mEventFlag = mImplContext->getStatusEventFlag();
    mDataMqNotEmptyEf =
            mVersion >= kReopenSupportedVersion ? kEventFlagDataMqNotEmpty : kEventFlagNotEmpty;

    if (specific.has_value()) {
        RETURN_IF_ASTATUS_NOT_OK(setParameterSpecific(specific.value()), "setSpecParamErr");
@@ -231,8 +232,9 @@ ndk::ScopedAStatus DynamicsProcessingImpl::open(const Parameter::Common& common,

    mState = State::IDLE;
    mContext->dupeFmq(ret);
    RETURN_IF(createThread(getEffectName()) != RetCode::SUCCESS, EX_UNSUPPORTED_OPERATION,
              "FailedToCreateWorker");
    RETURN_IF(createThread(getEffectNameWithVersion()) != RetCode::SUCCESS,
              EX_UNSUPPORTED_OPERATION, "FailedToCreateWorker");
    LOG(INFO) << getEffectNameWithVersion() << __func__;
    return ndk::ScopedAStatus::ok();
}

+6 −0
Original line number Diff line number Diff line
@@ -159,10 +159,13 @@ cc_fuzz {
        "libmediaplayerserviceFuzzer_defaults",
    ],
    static_libs: [
        "libgmock",
        "libgtest_ndk_c++",
        "libplayerservice_datasource",
        "libstagefright_nuplayer",
        "libstagefright_rtsp",
        "libstagefright_timedtext",
        "libbinder_random_parcel",
    ],
    shared_libs: [
        "android.hardware.media.c2@1.0",
@@ -191,7 +194,10 @@ cc_fuzz {
        "libpowermanager",
        "libstagefright_httplive",
        "libaudiohal@7.0",
        "libmediaextractorservice",
    ],
    corpus: ["corpus/*"],
    include_dirs: ["frameworks/av/services/mediaextractor"],
}

cc_fuzz {
Loading