Lines Matching refs:buffer
39 bool Codec2Buffer::canCopyLinear(const std::shared_ptr<C2Buffer> &buffer) const { in canCopyLinear()
43 if (!buffer) { in canCopyLinear()
47 if (buffer->data().type() != C2BufferData::LINEAR) { in canCopyLinear()
50 if (buffer->data().linearBlocks().size() == 0u) { in canCopyLinear()
53 } else if (buffer->data().linearBlocks().size() > 1u) { in canCopyLinear()
57 if (buffer->data().linearBlocks()[0].size() > capacity()) { in canCopyLinear()
64 bool Codec2Buffer::copyLinear(const std::shared_ptr<C2Buffer> &buffer) { in copyLinear() argument
66 if (!buffer || buffer->data().linearBlocks().size() == 0u in copyLinear()
67 || buffer->data().linearBlocks()[0].size() == 0u) { in copyLinear()
71 C2ReadView view = buffer->data().linearBlocks()[0].map().get(); in copyLinear()
102 bool LocalLinearBuffer::canCopy(const std::shared_ptr<C2Buffer> &buffer) const { in canCopy()
103 return canCopyLinear(buffer); in canCopy()
106 bool LocalLinearBuffer::copy(const std::shared_ptr<C2Buffer> &buffer) { in copy() argument
107 return copyLinear(buffer); in copy()
115 const sp<AMessage> &format, const std::shared_ptr<C2Buffer> &buffer) in DummyContainerBuffer() argument
117 mBufferRef(buffer) { in DummyContainerBuffer()
118 setRange(0, buffer ? 1 : 0); in DummyContainerBuffer()
129 bool DummyContainerBuffer::copy(const std::shared_ptr<C2Buffer> &buffer) { in copy() argument
130 mBufferRef = buffer; in copy()
151 bool LinearBlockBuffer::canCopy(const std::shared_ptr<C2Buffer> &buffer) const { in canCopy()
152 return canCopyLinear(buffer); in canCopy()
155 bool LinearBlockBuffer::copy(const std::shared_ptr<C2Buffer> &buffer) { in copy() argument
156 return copyLinear(buffer); in copy()
172 const sp<AMessage> &format, const std::shared_ptr<C2Buffer> &buffer) { in Allocate() argument
173 if (!buffer in Allocate()
174 || buffer->data().type() != C2BufferData::LINEAR in Allocate()
175 || buffer->data().linearBlocks().size() != 1u) { in Allocate()
178 C2ReadView readView(buffer->data().linearBlocks()[0].map().get()); in Allocate()
182 return new ConstLinearBlockBuffer(format, std::move(readView), buffer); in Allocate()
188 const std::shared_ptr<C2Buffer> &buffer) in ConstLinearBlockBuffer() argument
194 mBufferRef(buffer) { in ConstLinearBlockBuffer()
518 sp<ABuffer> buffer = converter.wrap(); in Allocate() local
519 if (buffer == nullptr) { in Allocate()
520 buffer = alloc(converter.backBufferSize()); in Allocate()
521 if (!converter.setBackBuffer(buffer)) { in Allocate()
529 buffer, in Allocate()
538 const sp<ABuffer> &buffer, in GraphicBlockBuffer() argument
543 : Codec2Buffer(format, buffer), in GraphicBlockBuffer()
573 ANativeWindowBuffer *buffer = (ANativeWindowBuffer *)meta->pBuffer; in asC2Buffer() local
574 if (buffer == nullptr) { in asC2Buffer()
579 ALOGV("VideoNativeMetadata: %dx%d", buffer->width, buffer->height); in asC2Buffer()
581 buffer->handle, in asC2Buffer()
582 buffer->width, in asC2Buffer()
583 buffer->height, in asC2Buffer()
584 buffer->format, in asC2Buffer()
585 buffer->usage, in asC2Buffer()
586 buffer->stride); in asC2Buffer()
598 block->share(C2Rect(buffer->width, buffer->height), C2Fence())); in asC2Buffer()
610 const std::shared_ptr<C2Buffer> &buffer, in Allocate() argument
612 if (!buffer in Allocate()
613 || buffer->data().type() != C2BufferData::GRAPHIC in Allocate()
614 || buffer->data().graphicBlocks().size() != 1u) { in Allocate()
619 buffer->data().graphicBlocks()[0].map().get())); in Allocate()
647 buffer, in Allocate()
676 const std::shared_ptr<C2Buffer> &buffer, in ConstGraphicBlockBuffer() argument
681 mBufferRef(buffer), in ConstGraphicBlockBuffer()
693 bool ConstGraphicBlockBuffer::canCopy(const std::shared_ptr<C2Buffer> &buffer) const { in canCopy()
699 if (!buffer) { in canCopy()
703 if (buffer->data().type() != C2BufferData::GRAPHIC) { in canCopy()
707 if (buffer->data().graphicBlocks().size() == 0) { in canCopy()
709 } else if (buffer->data().graphicBlocks().size() != 1u) { in canCopy()
719 buffer->data().graphicBlocks()[0].map().get(), colorFormat); in canCopy()
732 bool ConstGraphicBlockBuffer::copy(const std::shared_ptr<C2Buffer> &buffer) { in copy() argument
733 if (!buffer || buffer->data().graphicBlocks().size() == 0) { in copy()
741 buffer->data().graphicBlocks()[0].map().get(), colorFormat); in copy()
753 mBufferRef = buffer; in copy()