C2BufferQueueBlockPoolData: remove C2BufferQueueBlockPool::Impl field
Originally, C2BufferQueueBlockPoolData has
C2BufferQueueBlockPool::Impl field for calling IGBP::cancelBuffer() at
destructor if the buffer is still held. However,
C2BufferQueueBlockPoolData already has a IGBP field. This CL removes
the unnecessary C2BufferQueueBlockPool::Impl field.
Bug: 174188958
Test: android.media.cts.MediaCodecPlayerTest#testPlaybackSwitchViews
Change-Id: I6baf5c4a1b9d1c27f95d18817628cd6ffcd35478
diff --git a/media/codec2/vndk/include/C2BqBufferPriv.h b/media/codec2/vndk/include/C2BqBufferPriv.h
index 5ff4128..57f4011 100644
--- a/media/codec2/vndk/include/C2BqBufferPriv.h
+++ b/media/codec2/vndk/include/C2BqBufferPriv.h
@@ -97,7 +97,7 @@
// Create a local BlockPoolData.
C2BufferQueueBlockPoolData(
uint32_t generation, uint64_t bqId, int32_t bqSlot,
- const std::shared_ptr<C2BufferQueueBlockPool::Impl>& pool);
+ const android::sp<HGraphicBufferProducer>& producer);
virtual ~C2BufferQueueBlockPoolData() override;
@@ -124,15 +124,23 @@
const bool mLocal;
bool mHeld;
+
+ // Data of the corresponding buffer.
uint32_t mGeneration;
uint64_t mBqId;
int32_t mBqSlot;
+
+ // Data of the current IGBP, updated at migrate(). If the values are
+ // mismatched, then the corresponding buffer will not be cancelled back to
+ // IGBP at the destructor.
+ uint32_t mCurrentGeneration;
+ uint64_t mCurrentBqId;
+
bool mTransfer; // local transfer to remote
bool mAttach; // attach on remote
bool mDisplay; // display on remote;
std::weak_ptr<int> mOwner;
android::sp<HGraphicBufferProducer> mIgbp;
- std::shared_ptr<C2BufferQueueBlockPool::Impl> mLocalPool;
mutable std::mutex mLock;
};