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

Commit 0253bf76 authored by Wonsik Kim's avatar Wonsik Kim Committed by Gerrit Code Review
Browse files

Merge "C2 mpeg4enc: Support dynamic bitrate change"

parents 65ac21dc 49aa91b8
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -448,6 +448,20 @@ void C2SoftMpeg4Enc::process(
        work->worklets.front()->output.configUpdate.push_back(std::move(csd));
    }

    // handle dynamic bitrate change
    {
        IntfImpl::Lock lock = mIntf->lock();
        std::shared_ptr<C2StreamBitrateInfo::output> bitrate = mIntf->getBitrate_l();
        lock.unlock();

        if (bitrate != mBitrate) {
            mBitrate = bitrate;
            int layerBitrate[2] = {static_cast<int>(mBitrate->value), 0};
            ALOGV("Calling PVUpdateBitRate %d", layerBitrate[0]);
            PVUpdateBitRate(mHandle, layerBitrate);
        }
    }

    std::shared_ptr<const C2GraphicView> rView;
    std::shared_ptr<C2Buffer> inputBuffer;
    bool eos = ((work->input.flags & C2FrameData::FLAG_END_OF_STREAM) != 0);
+0 −5
Original line number Diff line number Diff line
@@ -524,11 +524,9 @@ OSCL_EXPORT_REF Bool PVInitVideoEncoder(VideoEncControls *encoderControl, Vid
    }

    /* check bit rate */
    /* set max bit rate */
    for (i = 0; i < encParams->nLayers; i++)
    {
        encParams->LayerBitRate[i] = encOption->bitRate[i];
        encParams->LayerMaxBitRate[i] = encOption->bitRate[i];
    }
    if (encParams->nLayers > 1)
    {
@@ -3302,6 +3300,3 @@ Bool SetProfile_BufferSize(VideoEncData *video, float delay, Int bInitialized)
}

#endif /* #ifndef ORIGINAL_VERSION */