This should fix #162 (closed)
I'm not sure if this is the right fix.
The problem is
gst_vaapiencode_handle_frame locks waiting for available
codedbufs. So when state is being changed from
Ready and encoding task is stopped, no
codedbufs are being returned to codedbuf_queue anymore, hence gst_vaapiencode_handle_frame never unlocks.
(parent_class)->change_state (PAUSED_TO_READY) locks waiting for the srcpad's chain function to complete, and chain function is waiting for new
codedbufs, hence the deadlock.