Haihao's VAAPI patches