Skip to content

Draft: hold device lock on each access to the d3d11 objects

This prevents from crashes in the video driver when launching and stopping the pipelines during a long time.

Sorry for a messy PR. Still trying to share it, maybe it makes sence to start a discussion at least.

Current problem of this PR is that the working solution was written on top of the 1.22, and I'm also not able to test it in a good way, because to run that application with 1.24 I would have to port some other changes too, it will take sufficient amount of time.

There're also a good possibility of deadlocks introduced: in particular I found that locking device lock in the gst_d3d11_allocator_free() is absolutely required, d3d11debug layer can catch and warn about it when it crosses with d3d11decoder. But at the same time this can lead to cross-locking, because new implementation of the d3d11pool_allocator holds it's own lock around when it frees the memory. I had to refactor the d3d11pool_allocator (not present in this PR, can try to port) instead of backporting it from 1.24 to 1.22, because of that cross-locking.

Edited by Alexander Slobodeniuk

Merge request reports