(In reply to Martin Stránský [:stransky] (ni? me) from comment #14) > How VFW handles that? Or does it allocate new frames and doesn't recycle them? > I was expecting it works for shared shm surfaces...how we can reuse particular shm texture if we don't know whether is used or not? The shmem buffer is holding by `TextureClient`, so its lifecycle is determined by the texture client. When the compositor finishes rendering the specific texture client, it would release the refcount (details [here](https://bugzilla.mozilla.org/show_bug.cgi?id=1713276#c49)) When its refcount drops to zero, then that texture client would be put back into the recycle pool for reuse. Therefore, if we can get a texture client from the recycle pool, it's guarantee that it's safe to be used. > av_buffer_get_ref_count(mFrame->buf[0]) call can be used to get buffer refcount. I'm working on the patch. Thank you for working on that! > Alastor, is there an expected user-facing impact from this bug? No, this feature is only enabled on Nightly. Other versions won't be affected.
Bug 1752388 Comment 18 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
(In reply to Martin Stránský [:stransky] (ni? me) from comment #14) > How VFW handles that? Or does it allocate new frames and doesn't recycle them? > I was expecting it works for shared shm surfaces...how we can reuse particular shm texture if we don't know whether is used or not? The shmem buffer is holding by `TextureClient`, so its lifecycle is determined by the texture client. When the compositor finishes rendering the specific texture client, it would release the refcount (details [here](https://bugzilla.mozilla.org/show_bug.cgi?id=1713276#c49)) When its refcount drops to zero, then that texture client would be put back into the recycle pool for reuse. Therefore, if we can get a texture client from the recycle pool, it's guarantee that it's safe to be used. > av_buffer_get_ref_count(mFrame->buf[0]) call can be used to get buffer refcount. I'm working on the patch. Thank you for working on that! > Alastor, is there an expected user-facing impact from this bug? No, this feature is only enabled on Nightly. Other versions won't be affected.