gleglimage: cache EGL images per DmabufUpload instead of per GstMemory
As noted in gst-plugins-base!980 (comment 732243), storing cached EGL images per-GstMemory in QData
is not thread/tee safe. Instead, use a per-DmabufUpload GHashTable
to store cache entries with a weak reference to the GstMemory.
This allows two glupload elements on separate tee branches to have their own EGL image cache. For this pipeline:
gst-launch-1.0 v4l2src ! tee name=t \
t. ! queue ! glupload ! fakesink
t. ! queue ! glupload ! fakesink
this gets rid of the occasional critical error message:
GStreamer-CRITICAL **: 08:26:33.194: gst_mini_object_unref: assertion 'GST_MINI_OBJECT_REFCOUNT_VALUE (mini_object) > 0' failed