Loading include/gui/BufferQueueCore.h +2 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,8 @@ private: // The slot of the last queued buffer int mLastQueuedSlot; const uint64_t mUniqueId; }; // class BufferQueueCore } // namespace android Loading include/gui/BufferQueueProducer.h +3 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,9 @@ public: virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) override; // See IGraphicBufferProducer::getUniqueId virtual status_t getUniqueId(uint64_t* outId) const override; private: // This is required by the IBinder::DeathRecipient interface virtual void binderDied(const wp<IBinder>& who); Loading include/gui/IGraphicBufferProducer.h +3 −0 Original line number Diff line number Diff line Loading @@ -568,6 +568,9 @@ public: // Returns NO_ERROR or the status of the Binder transaction virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) = 0; // Returns a unique id for this BufferQueue virtual status_t getUniqueId(uint64_t* outId) const = 0; }; // ---------------------------------------------------------------------------- Loading include/gui/Surface.h +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ public: status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]); status_t getUniqueId(uint64_t* outId) const; protected: virtual ~Surface(); Loading libs/gui/BufferQueueCore.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,12 @@ static String8 getUniqueName() { android_atomic_inc(&counter)); } static uint64_t getUniqueId() { static std::atomic<uint32_t> counter{0}; static uint64_t id = static_cast<uint64_t>(getpid()) << 32; return id | counter++; } BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : mAllocator(allocator), mMutex(), Loading Loading @@ -82,7 +88,8 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : mAutoRefresh(false), mSharedBufferSlot(INVALID_BUFFER_SLOT), mSharedBufferCache(Rect::INVALID_RECT, 0, NATIVE_WINDOW_SCALING_MODE_FREEZE, HAL_DATASPACE_UNKNOWN) HAL_DATASPACE_UNKNOWN), mUniqueId(getUniqueId()) { if (allocator == NULL) { sp<ISurfaceComposer> composer(ComposerService::getComposerService()); Loading Loading
include/gui/BufferQueueCore.h +2 −0 Original line number Diff line number Diff line Loading @@ -322,6 +322,8 @@ private: // The slot of the last queued buffer int mLastQueuedSlot; const uint64_t mUniqueId; }; // class BufferQueueCore } // namespace android Loading
include/gui/BufferQueueProducer.h +3 −0 Original line number Diff line number Diff line Loading @@ -186,6 +186,9 @@ public: virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) override; // See IGraphicBufferProducer::getUniqueId virtual status_t getUniqueId(uint64_t* outId) const override; private: // This is required by the IBinder::DeathRecipient interface virtual void binderDied(const wp<IBinder>& who); Loading
include/gui/IGraphicBufferProducer.h +3 −0 Original line number Diff line number Diff line Loading @@ -568,6 +568,9 @@ public: // Returns NO_ERROR or the status of the Binder transaction virtual status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]) = 0; // Returns a unique id for this BufferQueue virtual status_t getUniqueId(uint64_t* outId) const = 0; }; // ---------------------------------------------------------------------------- Loading
include/gui/Surface.h +2 −0 Original line number Diff line number Diff line Loading @@ -134,6 +134,8 @@ public: status_t getLastQueuedBuffer(sp<GraphicBuffer>* outBuffer, sp<Fence>* outFence, float outTransformMatrix[16]); status_t getUniqueId(uint64_t* outId) const; protected: virtual ~Surface(); Loading
libs/gui/BufferQueueCore.cpp +8 −1 Original line number Diff line number Diff line Loading @@ -44,6 +44,12 @@ static String8 getUniqueName() { android_atomic_inc(&counter)); } static uint64_t getUniqueId() { static std::atomic<uint32_t> counter{0}; static uint64_t id = static_cast<uint64_t>(getpid()) << 32; return id | counter++; } BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : mAllocator(allocator), mMutex(), Loading Loading @@ -82,7 +88,8 @@ BufferQueueCore::BufferQueueCore(const sp<IGraphicBufferAlloc>& allocator) : mAutoRefresh(false), mSharedBufferSlot(INVALID_BUFFER_SLOT), mSharedBufferCache(Rect::INVALID_RECT, 0, NATIVE_WINDOW_SCALING_MODE_FREEZE, HAL_DATASPACE_UNKNOWN) HAL_DATASPACE_UNKNOWN), mUniqueId(getUniqueId()) { if (allocator == NULL) { sp<ISurfaceComposer> composer(ComposerService::getComposerService()); Loading