vaapivideomemory: load VA Image when mapping to write

When calling gst_video_frame_map() with GST_MAP_WRITE flag, it doesn't call
ensure_image_is_current(), which means it doesn't guarentee VAImage is valid
in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=766978
This commit is contained in:
Hyunjun Ko 2016-09-07 17:51:23 +09:00 committed by Víctor Manuel Jáquez Leal
parent 5ed967088f
commit c67edea4ab

View file

@ -208,8 +208,10 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane,
if (!ensure_image (mem)) if (!ensure_image (mem))
goto error_ensure_image; goto error_ensure_image;
// Load VA image from surface /* Load VA image from surface only on read OR write, not both.
if ((flags & GST_MAP_READ) && !ensure_image_is_current (mem)) * Refer to bugs #704078 and #704083 */
if (((flags & GST_MAP_READWRITE) != GST_MAP_READWRITE)
&& !ensure_image_is_current (mem))
goto error_no_current_image; goto error_no_current_image;
if (!gst_vaapi_image_map (mem->image)) if (!gst_vaapi_image_map (mem->image))