vaapiencode: Fixes deadlock in gst_vaapiencode_change_state function
vaapiencode: Fixes deadlock in gst_vaapiencode_change_state function

This fixes a deadlock in gst_vaapiencode_change_state, which was due to
srcpad's chain function was locked waiting for available buffers. Since the
coded buffers in codedbuf_queue become available after sinkpad consume the
encoded frames, Paused -> Ready state change leads to deadlock. Coded buffers
are never consumed and marked free, hence gst_vaapiencode_handle_frame waits for
available buffers and holds the stream_lock of the srcpad.

ceyusa/gstreamer-vaapi,GStreamer/gstreamer-vaapi,ceyusa/gstreamer-vaapi,GStreamer/gstreamer-vaapi