Loading media/codec2/sfplugin/CCodecBuffers.cpp +19 −2 Original line number Diff line number Diff line Loading @@ -439,6 +439,10 @@ size_t BuffersArrayImpl::numClientBuffers() const { }); } size_t BuffersArrayImpl::arraySize() const { return mBuffers.size(); } // InputBuffersArray void InputBuffersArray::initialize( Loading Loading @@ -883,11 +887,24 @@ void OutputBuffersArray::realloc(const std::shared_ptr<C2Buffer> &c2buffer) { mAlloc = [format = mFormat, size] { return new LocalLinearBuffer(format, new ABuffer(size)); }; ALOGD("[%s] reallocating with linear buffer of size %u", mName, size); break; } // TODO: add support case C2BufferData::GRAPHIC: [[fallthrough]]; case C2BufferData::GRAPHIC: { // This is only called for RawGraphicOutputBuffers. mAlloc = [format = mFormat, lbp = LocalBufferPool::Create(kMaxLinearBufferSize * mImpl.arraySize())] { return ConstGraphicBlockBuffer::AllocateEmpty( format, [lbp](size_t capacity) { return lbp->newBuffer(capacity); }); }; ALOGD("[%s] reallocating with graphic buffer: format = %s", mName, mFormat->debugString().c_str()); break; } case C2BufferData::INVALID: [[fallthrough]]; case C2BufferData::LINEAR_CHUNKS: [[fallthrough]]; Loading media/codec2/sfplugin/CCodecBuffers.h +5 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,11 @@ public: */ size_t numClientBuffers() const; /** * Return the size of the array. */ size_t arraySize() const; private: std::string mImplName; ///< name for debugging const char *mName; ///< C-string version of name Loading Loading
media/codec2/sfplugin/CCodecBuffers.cpp +19 −2 Original line number Diff line number Diff line Loading @@ -439,6 +439,10 @@ size_t BuffersArrayImpl::numClientBuffers() const { }); } size_t BuffersArrayImpl::arraySize() const { return mBuffers.size(); } // InputBuffersArray void InputBuffersArray::initialize( Loading Loading @@ -883,11 +887,24 @@ void OutputBuffersArray::realloc(const std::shared_ptr<C2Buffer> &c2buffer) { mAlloc = [format = mFormat, size] { return new LocalLinearBuffer(format, new ABuffer(size)); }; ALOGD("[%s] reallocating with linear buffer of size %u", mName, size); break; } // TODO: add support case C2BufferData::GRAPHIC: [[fallthrough]]; case C2BufferData::GRAPHIC: { // This is only called for RawGraphicOutputBuffers. mAlloc = [format = mFormat, lbp = LocalBufferPool::Create(kMaxLinearBufferSize * mImpl.arraySize())] { return ConstGraphicBlockBuffer::AllocateEmpty( format, [lbp](size_t capacity) { return lbp->newBuffer(capacity); }); }; ALOGD("[%s] reallocating with graphic buffer: format = %s", mName, mFormat->debugString().c_str()); break; } case C2BufferData::INVALID: [[fallthrough]]; case C2BufferData::LINEAR_CHUNKS: [[fallthrough]]; Loading
media/codec2/sfplugin/CCodecBuffers.h +5 −0 Original line number Diff line number Diff line Loading @@ -478,6 +478,11 @@ public: */ size_t numClientBuffers() const; /** * Return the size of the array. */ size_t arraySize() const; private: std::string mImplName; ///< name for debugging const char *mName; ///< C-string version of name Loading