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

Unverified Commit 7981e160 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 594eb17f
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -192,6 +192,7 @@ CCodecBufferChannel::CCodecBufferChannel(
      mMetaMode(MODE_NONE),
      mInputMetEos(false),
      mLastInputBufferAvailableTs(0u),
      mIsHWDecoder(false),
      mSendEncryptedInfoBuffer(false) {
    {
        Mutexed<Input>::Locked input(mInput);
@@ -229,6 +230,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(
@@ -1075,8 +1078,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();
@@ -1116,6 +1118,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
@@ -403,6 +403,7 @@ private:

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

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