v4l2object: gst_structure_remove_field met critical log
When run below pileline with RGB as encoder's input format, v4l2 decoder will meet critical log "GStreamer-CRITICAL **: 01:08:47.324: gst_structure_remove_field: assertion 'IS_MUTABLE (structure)' failed" when set format for input caps.
gst-launch-1.0 videotestsrc num-buffers=10 ! video/x-raw,format=BGRA ! v4l2h264enc ! v4l2h264dec ! fakesink
The root cause is refcount of decoder's input caps is 4, and cause assertion IS_MUTABLE (structure) in gst_structure_remove_field failed.
#define IS_MUTABLE(structure) \ (!GST_STRUCTURE_REFCOUNT(structure) || \ g_atomic_int_get (GST_STRUCTURE_REFCOUNT(structure)) == 1)