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

Commit 5448745f authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 7506386 from b24894a1 to sc-d1-release

Change-Id: I5960b9a924e0eae19269505ef01543eb6f312543
parents d19fa84a b24894a1
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -514,8 +514,8 @@ void C2SoftAacDec::drainRingBuffer(

                // TODO: error handling, proper usage, etc.
                C2MemoryUsage usage = { C2MemoryUsage::CPU_READ, C2MemoryUsage::CPU_WRITE };
                c2_status_t err = pool->fetchLinearBlock(
                        numSamples * sizeof(int16_t), usage, &block);
                size_t bufferSize = numSamples * sizeof(int16_t);
                c2_status_t err = pool->fetchLinearBlock(bufferSize, usage, &block);
                if (err != C2_OK) {
                    ALOGD("failed to fetch a linear block (%d)", err);
                    return std::bind(fillEmptyWork, _1, C2_NO_MEMORY);
@@ -529,7 +529,7 @@ void C2SoftAacDec::drainRingBuffer(
                    mSignalledError = true;
                    return std::bind(fillEmptyWork, _1, C2_CORRUPTED);
                }
                return [buffer = createLinearBuffer(block)](
                return [buffer = createLinearBuffer(block, 0, bufferSize)](
                        const std::unique_ptr<C2Work> &work) {
                    work->result = C2_OK;
                    C2FrameData &output = work->worklets.front()->output;
+7 −1
Original line number Diff line number Diff line
@@ -361,7 +361,13 @@ void C2SoftAmrDec::process(

    work->worklets.front()->output.flags = work->input.flags;
    work->worklets.front()->output.buffers.clear();
    work->worklets.front()->output.buffers.push_back(createLinearBuffer(block));
    // we filled the output buffer to (intptr_t)output - (intptr_t)wView.data()
    // use calOutSize as that contains the expected number of samples
    ALOGD_IF(calOutSize != ((intptr_t)output - (intptr_t)wView.data()),
            "Expected %zu output bytes, but filled %lld",
             calOutSize, (long long)((intptr_t)output - (intptr_t)wView.data()));
    work->worklets.front()->output.buffers.push_back(
            createLinearBuffer(block, 0, calOutSize));
    work->worklets.front()->output.ordinal = work->input.ordinal;
    if (eos) {
        mSignalledOutputEos = true;
+0 −10
Original line number Diff line number Diff line
@@ -591,21 +591,11 @@ bool SimpleC2Component::processQueue() {
    return hasQueuedWork;
}

std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer(
        const std::shared_ptr<C2LinearBlock> &block) {
    return createLinearBuffer(block, block->offset(), block->size());
}

std::shared_ptr<C2Buffer> SimpleC2Component::createLinearBuffer(
        const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size) {
    return C2Buffer::CreateLinearBuffer(block->share(offset, size, ::C2Fence()));
}

std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer(
        const std::shared_ptr<C2GraphicBlock> &block) {
    return createGraphicBuffer(block, C2Rect(block->width(), block->height()));
}

std::shared_ptr<C2Buffer> SimpleC2Component::createGraphicBuffer(
        const std::shared_ptr<C2GraphicBlock> &block, const C2Rect &crop) {
    return C2Buffer::CreateGraphicBuffer(block->share(crop, ::C2Fence()));
+0 −6
Original line number Diff line number Diff line
@@ -139,15 +139,9 @@ protected:
            std::function<void(const std::unique_ptr<C2Work> &)> fillWork);


    std::shared_ptr<C2Buffer> createLinearBuffer(
            const std::shared_ptr<C2LinearBlock> &block);

    std::shared_ptr<C2Buffer> createLinearBuffer(
            const std::shared_ptr<C2LinearBlock> &block, size_t offset, size_t size);

    std::shared_ptr<C2Buffer> createGraphicBuffer(
            const std::shared_ptr<C2GraphicBlock> &block);

    std::shared_ptr<C2Buffer> createGraphicBuffer(
            const std::shared_ptr<C2GraphicBlock> &block,
            const C2Rect &crop);
+1 −1
Original line number Diff line number Diff line
@@ -199,7 +199,7 @@ void C2SoftG711Dec::process(

    work->worklets.front()->output.flags = work->input.flags;
    work->worklets.front()->output.buffers.clear();
    work->worklets.front()->output.buffers.push_back(createLinearBuffer(block));
    work->worklets.front()->output.buffers.push_back(createLinearBuffer(block, 0, outSize));
    work->worklets.front()->output.ordinal = work->input.ordinal;

    if (eos) {
Loading