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

Commit 5b59b446 authored by Wonsik Kim's avatar Wonsik Kim
Browse files

codec2: fix C2Buffer

Test: setprop debug.stagefright.ccodec yes
Test: screenrecord --codec-name c2.google.avc.encoder /sdcard/record.mp4
Change-Id: I5045c1a65822818e5df5227034da626c40e23c35
parent 031b695b
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -271,6 +271,7 @@ C2Acquirable<C2ReadView> C2ConstLinearBlock::map() const {
                new ReadViewBuddy::Impl(*mImpl, (uint8_t *)base, offset(), len),
                [base, len](ReadViewBuddy::Impl *i) {
                    (void)i->getAllocation()->unmap(base, len, nullptr);
                    delete i;
        });
        return AcquirableReadViewBuddy(error, C2Fence(), ReadViewBuddy(rvi, 0, len));
    } else {
@@ -300,6 +301,7 @@ C2Acquirable<C2WriteView> C2LinearBlock::map() {
                new WriteViewBuddy::Impl(*mImpl, (uint8_t *)base, 0, len),
                [base, len](WriteViewBuddy::Impl *i) {
                    (void)i->getAllocation()->unmap(base, len, nullptr);
                    delete i;
        });
        return AcquirableWriteViewBuddy(error, C2Fence(), WriteViewBuddy(rvi));
    } else {
@@ -791,4 +793,14 @@ std::shared_ptr<C2Info> C2Buffer::removeInfo(C2Param::Type index) {
    return mImpl->removeInfo(index);
}

// static
std::shared_ptr<C2Buffer> C2Buffer::CreateLinearBuffer(const C2ConstLinearBlock &block) {
    return std::shared_ptr<C2Buffer>(new C2Buffer({ block }));
}

// static
std::shared_ptr<C2Buffer> C2Buffer::CreateGraphicBuffer(const C2ConstGraphicBlock &block) {
    return std::shared_ptr<C2Buffer>(new C2Buffer({ block }));
}

} // namespace android