diff options
author | Hyunjun Ko <zzoon@igalia.com> | 2016-09-07 17:51:23 +0900 |
---|---|---|
committer | Víctor Manuel Jáquez Leal <victorx.jaquez@intel.com> | 2016-09-08 16:38:52 +0200 |
commit | c67edea4aba35f16d9e97c78a0b49ad1b590b112 (patch) | |
tree | 4631cdfd20f29f37b26d42964c876a89a602ec5a | |
parent | 5ed967088f5f3256f4a0121c3b042ed05b967b55 (diff) |
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
-rw-r--r-- | gst/vaapi/gstvaapivideomemory.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gst/vaapi/gstvaapivideomemory.c b/gst/vaapi/gstvaapivideomemory.c index 3b2b4d82..813b4150 100644 --- a/gst/vaapi/gstvaapivideomemory.c +++ b/gst/vaapi/gstvaapivideomemory.c @@ -208,8 +208,10 @@ gst_video_meta_map_vaapi_memory (GstVideoMeta * meta, guint plane, if (!ensure_image (mem)) goto error_ensure_image; - // Load VA image from surface - if ((flags & GST_MAP_READ) && !ensure_image_is_current (mem)) + /* Load VA image from surface only on read OR write, not both. + * Refer to bugs #704078 and #704083 */ + if (((flags & GST_MAP_READWRITE) != GST_MAP_READWRITE) + && !ensure_image_is_current (mem)) goto error_no_current_image; if (!gst_vaapi_image_map (mem->image)) |