Loading media/codec2/sfplugin/CCodecBufferChannel.cpp +24 −8 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ public: */ virtual void getArray(Vector<sp<MediaCodecBuffer>> *) const {} /** * Return number of buffers the client owns. */ virtual size_t numClientBuffers() const = 0; protected: std::string mComponentName; ///< name of component for debugging std::string mChannelName; ///< name of channel for debugging Loading Loading @@ -152,11 +157,6 @@ public: */ virtual std::unique_ptr<InputBuffers> toArrayMode(size_t size) = 0; /** * Return number of buffers the client owns. */ virtual size_t numClientBuffers() const = 0; protected: // Pool to obtain blocks for input buffers. std::shared_ptr<C2BlockPool> mPool; Loading Loading @@ -1226,6 +1226,10 @@ public: mImpl.realloc(alloc); } size_t numClientBuffers() const final { return mImpl.numClientBuffers(); } private: BuffersArrayImpl mImpl; }; Loading Loading @@ -1287,6 +1291,10 @@ public: return std::move(array); } size_t numClientBuffers() const final { return mImpl.numClientBuffers(); } /** * Return an appropriate Codec2Buffer object for the type of buffers. * Loading Loading @@ -1816,9 +1824,17 @@ void CCodecBufferChannel::feedInputBufferIfAvailable() { } void CCodecBufferChannel::feedInputBufferIfAvailableInternal() { while (!mInputMetEos && !mReorderStash.lock()->hasPending() && !mPipelineWatcher.lock()->pipelineFull()) { if (mInputMetEos || mReorderStash.lock()->hasPending() || mPipelineWatcher.lock()->pipelineFull()) { return; } else { Mutexed<std::unique_ptr<OutputBuffers>>::Locked buffers(mOutputBuffers); if ((*buffers)->numClientBuffers() >= mNumOutputSlots) { return; } } for (size_t i = 0; i < mNumInputSlots; ++i) { sp<MediaCodecBuffer> inBuffer; size_t index; { Loading Loading
media/codec2/sfplugin/CCodecBufferChannel.cpp +24 −8 Original line number Diff line number Diff line Loading @@ -94,6 +94,11 @@ public: */ virtual void getArray(Vector<sp<MediaCodecBuffer>> *) const {} /** * Return number of buffers the client owns. */ virtual size_t numClientBuffers() const = 0; protected: std::string mComponentName; ///< name of component for debugging std::string mChannelName; ///< name of channel for debugging Loading Loading @@ -152,11 +157,6 @@ public: */ virtual std::unique_ptr<InputBuffers> toArrayMode(size_t size) = 0; /** * Return number of buffers the client owns. */ virtual size_t numClientBuffers() const = 0; protected: // Pool to obtain blocks for input buffers. std::shared_ptr<C2BlockPool> mPool; Loading Loading @@ -1226,6 +1226,10 @@ public: mImpl.realloc(alloc); } size_t numClientBuffers() const final { return mImpl.numClientBuffers(); } private: BuffersArrayImpl mImpl; }; Loading Loading @@ -1287,6 +1291,10 @@ public: return std::move(array); } size_t numClientBuffers() const final { return mImpl.numClientBuffers(); } /** * Return an appropriate Codec2Buffer object for the type of buffers. * Loading Loading @@ -1816,9 +1824,17 @@ void CCodecBufferChannel::feedInputBufferIfAvailable() { } void CCodecBufferChannel::feedInputBufferIfAvailableInternal() { while (!mInputMetEos && !mReorderStash.lock()->hasPending() && !mPipelineWatcher.lock()->pipelineFull()) { if (mInputMetEos || mReorderStash.lock()->hasPending() || mPipelineWatcher.lock()->pipelineFull()) { return; } else { Mutexed<std::unique_ptr<OutputBuffers>>::Locked buffers(mOutputBuffers); if ((*buffers)->numClientBuffers() >= mNumOutputSlots) { return; } } for (size_t i = 0; i < mNumInputSlots; ++i) { sp<MediaCodecBuffer> inBuffer; size_t index; { Loading