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

Commit ff378867 authored by android-build-team Robot's avatar android-build-team Robot
Browse files

Snap for 7230642 from 8518ebbc to sc-release

Change-Id: I1b5ace70f1525e6f6936ef99f32b93cbfac77198
parents 51c4b1d3 8518ebbc
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -110,6 +110,7 @@ apex_defaults {
    native_shared_libs: [
        "libcodec2_hidl@1.0",
        "libcodec2_hidl@1.1",
        "libcodec2_hidl@1.2",
        "libstagefright_foundation",
    ],
    prebuilts: [
+29 −1
Original line number Diff line number Diff line
@@ -55,6 +55,8 @@
namespace android {

constexpr char COMPONENT_NAME[] = "c2.android.aac.decoder";
constexpr size_t kDefaultOutputPortDelay = 2;
constexpr size_t kMaxOutputPortDelay = 16;

class C2SoftAacDec::IntfImpl : public SimpleInterface<void>::BaseParams {
public:
@@ -73,7 +75,9 @@ public:

        addParameter(
                DefineParam(mActualOutputDelay, C2_PARAMKEY_OUTPUT_DELAY)
                .withConstValue(new C2PortActualDelayTuning::output(2u))
                .withDefault(new C2PortActualDelayTuning::output(kDefaultOutputPortDelay))
                .withFields({C2F(mActualOutputDelay, value).inRange(0, kMaxOutputPortDelay)})
                .withSetter(Setter<decltype(*mActualOutputDelay)>::StrictValueWithNoDeps)
                .build());

        addParameter(
@@ -263,6 +267,7 @@ C2SoftAacDec::C2SoftAacDec(
      mAACDecoder(nullptr),
      mStreamInfo(nullptr),
      mSignalledError(false),
      mOutputPortDelay(kDefaultOutputPortDelay),
      mOutputDelayRingBuffer(nullptr) {
}

@@ -915,6 +920,29 @@ void C2SoftAacDec::process(

    int32_t outputDelay = mStreamInfo->outputDelay * mStreamInfo->numChannels;

    size_t numSamplesInOutput = mStreamInfo->frameSize * mStreamInfo->numChannels;
    if (numSamplesInOutput > 0) {
        size_t actualOutputPortDelay = (outputDelay + numSamplesInOutput - 1) / numSamplesInOutput;
        if (actualOutputPortDelay > mOutputPortDelay) {
            mOutputPortDelay = actualOutputPortDelay;
            ALOGV("New Output port delay %zu ", mOutputPortDelay);

            C2PortActualDelayTuning::output outputPortDelay(mOutputPortDelay);
            std::vector<std::unique_ptr<C2SettingResult>> failures;
            c2_status_t err =
                mIntf->config({&outputPortDelay}, C2_MAY_BLOCK, &failures);
            if (err == OK) {
                work->worklets.front()->output.configUpdate.push_back(
                    C2Param::Copy(outputPortDelay));
            } else {
                ALOGE("Cannot set output delay");
                mSignalledError = true;
                work->workletsProcessed = 1u;
                work->result = C2_CORRUPTED;
                return;
            }
        }
    }
    mBuffersInfo.push_back(std::move(inInfo));
    work->workletsProcessed = 0u;
    if (!eos && mOutputDelayCompensated < outputDelay) {
+1 −0
Original line number Diff line number Diff line
@@ -57,6 +57,7 @@ private:
    size_t mInputBufferCount;
    size_t mOutputBufferCount;
    bool mSignalledError;
    size_t mOutputPortDelay;
    struct Info {
        uint64_t frameIndex;
        size_t bufferSize;
+0 −11
Original line number Diff line number Diff line
@@ -176,14 +176,3 @@ cc_defaults {
    ],
}
// Alias to the latest "defaults" for Codec 2.0 HAL service implementations
cc_defaults {
    name: "libcodec2-hidl-defaults",
    defaults: ["libcodec2-hidl-defaults@1.1"],
}

// Alias to the latest "defaults" for Codec 2.0 HAL client
cc_defaults {
    name: "libcodec2-hidl-client-defaults",
    defaults: ["libcodec2-hidl-client-defaults@1.1"],
}
+3 −0
Original line number Diff line number Diff line
@@ -366,6 +366,9 @@ Return<void> ComponentStore::createComponent_1_1(
            mStore->createComponent(name, &c2component));

    if (status == Status::OK) {
#ifndef __ANDROID_APEX__
        c2component = GetFilterWrapper()->maybeWrapComponent(c2component);
#endif
        onInterfaceLoaded(c2component->intf());
        component = new Component(c2component, listener, this, pool);
        if (!component) {
Loading