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

Unverified Commit 8ad48f16 authored by Shrikara B's avatar Shrikara B Committed by Michael Bestas
Browse files

CCodec: Use pipelineRoom only for HW decoder

Use pipelineRoom parameter to control the inputs notified to client
only in case of HW decoder.

CRs-Fixed: 3066971
Change-Id: Idb0aade345eaef746fc08894571f4db1cd0f796e
parent 2b88ef12
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -168,6 +168,7 @@ CCodecBufferChannel::CCodecBufferChannel(
      mMetaMode(MODE_NONE),
      mInputMetEos(false),
      mLastInputBufferAvailableTs(0u),
      mIsHWDecoder(false),
      mSendEncryptedInfoBuffer(false) {
    {
        Mutexed<Input>::Locked input(mInput);
@@ -205,6 +206,8 @@ void CCodecBufferChannel::setComponent(
    mComponent = component;
    mComponentName = component->getName() + StringPrintf("#%d", int(uintptr_t(component.get()) % 997));
    mName = mComponentName.c_str();
    std::regex pattern{"c2\\.qti\\..*\\.decoder.*"};
    mIsHWDecoder = std::regex_match(mComponentName, pattern);
}

status_t CCodecBufferChannel::setInputSurface(
@@ -751,8 +754,7 @@ void CCodecBufferChannel::feedInputBufferIfAvailable() {
    // limit this WA to qc hw decoder only
    // if feedInputBufferIfAvailableInternal() successfully (has available input buffer),
    // mLastInputBufferAvailableTs would be updated. otherwise, not input buffer available
    std::regex pattern{"c2\\.qti\\..*\\.decoder.*"};
    if (std::regex_match(mComponentName, pattern)) {
    if (mIsHWDecoder) {
        std::lock_guard<std::mutex> tsLock(mTsLock);
        uint64_t now = std::chrono::duration_cast<std::chrono::milliseconds>(
                PipelineWatcher::Clock::now().time_since_epoch()).count();
@@ -788,6 +790,11 @@ void CCodecBufferChannel::feedInputBufferIfAvailableInternal() {
            if (numActiveSlots >= input->numSlots) {
                break;
            }

            // Control the inputs based on pipelineRoom only for HW decoder
            if (!mIsHWDecoder) {
                pipelineRoom = SIZE_MAX;
            }
            if (pipelineRoom <= input->buffers->numClientBuffers()) {
                ALOGI("pipelineRoom(%zu) is <= numClientBuffers(%zu). "
                    "Not signalling any more buffers to client",
+1 −0
Original line number Diff line number Diff line
@@ -383,6 +383,7 @@ private:

    uint64_t mLastInputBufferAvailableTs;
    std::mutex mTsLock;
    bool mIsHWDecoder;

    sp<ICrypto> mCrypto;
    sp<IDescrambler> mDescrambler;