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

Commit f1e3f724 authored by Sungtak Lee's avatar Sungtak Lee Committed by Automerger Merge Worker
Browse files

Merge changes from topic "bq-attach-media" into main am: 636d8a60

parents a91d4f03 636d8a60
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -2556,6 +2556,19 @@ void Codec2Client::Component::onBufferReleasedFromOutputSurface(
    mOutputBufferQueue->onBufferReleased(generation);
    mOutputBufferQueue->onBufferReleased(generation);
}
}


void Codec2Client::Component::onBufferAttachedToOutputSurface(
        uint32_t generation) {
    if (mAidlBase) {
        std::shared_ptr<AidlGraphicBufferAllocator> gba =
                mGraphicBufferAllocators->current();
        if (gba) {
            gba->onBufferAttached(generation);
        }
        return;
    }
    mOutputBufferQueue->onBufferAttached(generation);
}

void Codec2Client::Component::holdIgbaBlocks(
void Codec2Client::Component::holdIgbaBlocks(
        const std::list<std::unique_ptr<C2Work>>& workList) {
        const std::list<std::unique_ptr<C2Work>>& workList) {
    if (!mAidlBase) {
    if (!mAidlBase) {
+4 −0
Original line number Original line Diff line number Diff line
@@ -481,6 +481,10 @@ struct Codec2Client::Component : public Codec2Client::Configurable {
    void onBufferReleasedFromOutputSurface(
    void onBufferReleasedFromOutputSurface(
            uint32_t generation);
            uint32_t generation);


    // Notify a buffer is attached to output surface.
    void onBufferAttachedToOutputSurface(
            uint32_t generation);

    // When the client received \p workList and the blocks inside
    // When the client received \p workList and the blocks inside
    // \p workList are IGBA based graphic blocks, specify the owner
    // \p workList are IGBA based graphic blocks, specify the owner
    // as the current IGBA for the future operations.
    // as the current IGBA for the future operations.
+3 −0
Original line number Original line Diff line number Diff line
@@ -69,6 +69,9 @@ struct OutputBufferQueue {
    // update the number of dequeueable/allocatable buffers.
    // update the number of dequeueable/allocatable buffers.
    void onBufferReleased(uint32_t generation);
    void onBufferReleased(uint32_t generation);


    // Nofify a buffer is attached to the output surface.
    void onBufferAttached(uint32_t generation);

    // Retrieve frame event history from the output surface.
    // Retrieve frame event history from the output surface.
    void pollForRenderedFrames(FrameEventHistoryDelta* delta);
    void pollForRenderedFrames(FrameEventHistoryDelta* delta);


+5 −0
Original line number Original line Diff line number Diff line
@@ -542,6 +542,11 @@ void OutputBufferQueue::onBufferReleased(uint32_t generation) {
    }
    }
}
}


void OutputBufferQueue::onBufferAttached(uint32_t generation) {
    // TODO
    (void) generation;
}

void OutputBufferQueue::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
void OutputBufferQueue::pollForRenderedFrames(FrameEventHistoryDelta* delta) {
    if (mIgbp) {
    if (mIgbp) {
        mIgbp->getFrameTimestamps(delta);
        mIgbp->getFrameTimestamps(delta);
+11 −0
Original line number Original line Diff line number Diff line
@@ -1469,6 +1469,17 @@ void CCodecBufferChannel::onBufferReleasedFromOutputSurface(uint32_t generation)
    }
    }
}
}


void CCodecBufferChannel::onBufferAttachedToOutputSurface(uint32_t generation) {
    // Note: Since this is called asynchronously from IProducerListener not
    // knowing the internal state of CCodec/CCodecBufferChannel,
    // prevent mComponent from being destroyed by holding the shared reference
    // during this interface being executed.
    std::shared_ptr<Codec2Client::Component> comp = mComponent;
    if (comp) {
        comp->onBufferAttachedToOutputSurface(generation);
    }
}

status_t CCodecBufferChannel::discardBuffer(const sp<MediaCodecBuffer> &buffer) {
status_t CCodecBufferChannel::discardBuffer(const sp<MediaCodecBuffer> &buffer) {
    ALOGV("[%s] discardBuffer: %p", mName, buffer.get());
    ALOGV("[%s] discardBuffer: %p", mName, buffer.get());
    bool released = false;
    bool released = false;
Loading