d3d11bufferpool: Fix heavy CPU usage in case of fixed-size pool
authorSeungha Yang <seungha@centricular.com>
Mon, 26 Jun 2023 20:09:49 +0000 (05:09 +0900)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Tue, 11 Jul 2023 23:23:12 +0000 (23:23 +0000)
commit62aa802d1788ab18e7e5de717ce4290e4af2716e
tree84a804680f4938fb0529b065293ed3f92f1d0684
parentb8e70128822e68a51cf2297ab33d06320794b8f6
d3d11bufferpool: Fix heavy CPU usage in case of fixed-size pool

There's no reason to release GstMemory manually at all.
If we do release GstMemory, corresponding GstBuffer will be
discarded by GstBufferPool baseclass because the size is changed
to zero.

Actual cause of heavy CPU usage in case of fixed-size pool
(i.e., decoder output buffer pool) and if we remove GstMemory from
GstBuffer is that GstBufferPool baseclass is doing busy wait in acquire_buffer()
for some reason. That needs to be investigated though, discarding
and re-alloc every GstBuffer is not ideal already.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/4943>
subprojects/gst-plugins-bad/gst-libs/gst/d3d11/gstd3d11bufferpool.cpp
subprojects/gst-plugins-bad/tests/check/libs/d3d11memory.c [new file with mode: 0644]
subprojects/gst-plugins-bad/tests/check/meson.build