Loading media/codec2/sfplugin/CCodecBuffers.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -1550,19 +1550,23 @@ void LinearOutputBuffers::flush( sp<Codec2Buffer> LinearOutputBuffers::wrap(const std::shared_ptr<C2Buffer> &buffer) { if (buffer == nullptr) { ALOGV("[%s] using a dummy buffer", mName); ALOGD("[%s] received null buffer", mName); return new LocalLinearBuffer(mFormat, new ABuffer(0)); } if (buffer->data().type() != C2BufferData::LINEAR) { ALOGV("[%s] non-linear buffer %d", mName, buffer->data().type()); ALOGW("[%s] non-linear buffer %d", mName, buffer->data().type()); // We expect linear output buffers from the component. return nullptr; } if (buffer->data().linearBlocks().size() != 1u) { ALOGV("[%s] no linear buffers", mName); ALOGW("[%s] no linear buffers", mName); // We expect one and only one linear block from the component. return nullptr; } if (buffer->data().linearBlocks().front().size() == 0) { ALOGD("[%s] received 0-sized buffer", mName); return new LocalLinearBuffer(mFormat, new ABuffer(0)); } sp<Codec2Buffer> clientBuffer = ConstLinearBlockBuffer::Allocate(mFormat, buffer); if (clientBuffer == nullptr) { ALOGD("[%s] ConstLinearBlockBuffer::Allocate failed", mName); Loading media/codec2/sfplugin/Codec2Buffer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -179,10 +179,17 @@ sp<ConstLinearBlockBuffer> ConstLinearBlockBuffer::Allocate( if (!buffer || buffer->data().type() != C2BufferData::LINEAR || buffer->data().linearBlocks().size() != 1u) { if (!buffer) { ALOGD("ConstLinearBlockBuffer::Allocate: null buffer"); } else { ALOGW("ConstLinearBlockBuffer::Allocate: type=%d # linear blocks=%zu", buffer->data().type(), buffer->data().linearBlocks().size()); } return nullptr; } C2ReadView readView(buffer->data().linearBlocks()[0].map().get()); if (readView.error() != C2_OK) { ALOGW("ConstLinearBlockBuffer::Allocate: readView.error()=%d", readView.error()); return nullptr; } return new ConstLinearBlockBuffer(format, std::move(readView), buffer); Loading media/libstagefright/MediaCodec.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -6646,9 +6646,9 @@ ssize_t MediaCodec::dequeuePortBuffer(int32_t portIndex) { CHECK_EQ(info, &mPortBuffers[portIndex][index]); availBuffers->erase(availBuffers->begin()); CHECK(!info->mOwnedByClient); { Mutex::Autolock al(mBufferLock); CHECK(!info->mOwnedByClient); info->mOwnedByClient = true; // set image-data Loading Loading
media/codec2/sfplugin/CCodecBuffers.cpp +7 −3 Original line number Diff line number Diff line Loading @@ -1550,19 +1550,23 @@ void LinearOutputBuffers::flush( sp<Codec2Buffer> LinearOutputBuffers::wrap(const std::shared_ptr<C2Buffer> &buffer) { if (buffer == nullptr) { ALOGV("[%s] using a dummy buffer", mName); ALOGD("[%s] received null buffer", mName); return new LocalLinearBuffer(mFormat, new ABuffer(0)); } if (buffer->data().type() != C2BufferData::LINEAR) { ALOGV("[%s] non-linear buffer %d", mName, buffer->data().type()); ALOGW("[%s] non-linear buffer %d", mName, buffer->data().type()); // We expect linear output buffers from the component. return nullptr; } if (buffer->data().linearBlocks().size() != 1u) { ALOGV("[%s] no linear buffers", mName); ALOGW("[%s] no linear buffers", mName); // We expect one and only one linear block from the component. return nullptr; } if (buffer->data().linearBlocks().front().size() == 0) { ALOGD("[%s] received 0-sized buffer", mName); return new LocalLinearBuffer(mFormat, new ABuffer(0)); } sp<Codec2Buffer> clientBuffer = ConstLinearBlockBuffer::Allocate(mFormat, buffer); if (clientBuffer == nullptr) { ALOGD("[%s] ConstLinearBlockBuffer::Allocate failed", mName); Loading
media/codec2/sfplugin/Codec2Buffer.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -179,10 +179,17 @@ sp<ConstLinearBlockBuffer> ConstLinearBlockBuffer::Allocate( if (!buffer || buffer->data().type() != C2BufferData::LINEAR || buffer->data().linearBlocks().size() != 1u) { if (!buffer) { ALOGD("ConstLinearBlockBuffer::Allocate: null buffer"); } else { ALOGW("ConstLinearBlockBuffer::Allocate: type=%d # linear blocks=%zu", buffer->data().type(), buffer->data().linearBlocks().size()); } return nullptr; } C2ReadView readView(buffer->data().linearBlocks()[0].map().get()); if (readView.error() != C2_OK) { ALOGW("ConstLinearBlockBuffer::Allocate: readView.error()=%d", readView.error()); return nullptr; } return new ConstLinearBlockBuffer(format, std::move(readView), buffer); Loading
media/libstagefright/MediaCodec.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -6646,9 +6646,9 @@ ssize_t MediaCodec::dequeuePortBuffer(int32_t portIndex) { CHECK_EQ(info, &mPortBuffers[portIndex][index]); availBuffers->erase(availBuffers->begin()); CHECK(!info->mOwnedByClient); { Mutex::Autolock al(mBufferLock); CHECK(!info->mOwnedByClient); info->mOwnedByClient = true; // set image-data Loading