Error: gst-resource-error-quark: Failed to allocate a buffer

which sample are you testing or referring to? what is the whole media pipeline? please refer to this FAQ for How to connect a USB camera in DeepStream.