It's not clear why the pad object lock is taken here. But gst_pad_{has,get}_current_caps() will try to take the lock as well and deadlock, since it's not recursive.