GNOME Bugzilla – Bug 796505
[gstreamer-vaapi][jpegdec] decode image display nothing
Last modified: 2018-06-08 10:54:52 UTC
Created attachment 372564 [details] [review] Destory slice buffers after vaEndPicture instead of before vaEndPicture System Environment ======= OS Ubuntu 17.04 Kernel 4.10 Hardware Skylake Intel(R) Core(TM) i5-6600K CPU @ 3.50GHz libva tag 2.1.0 intel-media-driver 48f33e511e08a9335d57aad4c09acbbb4aeb0a7f gst-vaapi tag 1.13.90 Reproduce Steps ============== LIBVA_TRACE=./jpeg gst-launch-1.0 filesrc location=/encoderbitstreams_quality/decodebitstreams//JPEG_RefCompare/capture22.jpg ! jpegparse ! vaapijpegdec ! videoconvert ! video/x-raw,format=I420,width=1024,height=768 ! filesink location=capture22.jpg.I420 Check output I420 file with YUV player, nothing display.
Hi Tianhao, Thanks for the patch. Though it is not correctly formatted. Could you please follow the recommendations here https://gstreamer.freedesktop.org/documentation/contribute/index.html#how-to-submit-patches ?? Another recommendation is to use the latest stable branch 1.14 Or, the development branch, master. Questions: 1\ did you tried with intel-vaapi-driver? 2\ since this is a patch that affects all the elements, did you test it thoroughly with all the encoders and decoders?
(In reply to Víctor Manuel Jáquez Leal from comment #1) > Hi Tianhao, > > Thanks for the patch. Though it is not correctly formatted. Could you please > follow the recommendations here > https://gstreamer.freedesktop.org/documentation/contribute/index.html#how-to- > submit-patches ?? > > Another recommendation is to use the latest stable branch 1.14 > Or, the development branch, master. > > Questions: > > 1\ did you tried with intel-vaapi-driver? > > 2\ since this is a patch that affects all the elements, did you test it > thoroughly with all the encoders and decoders? @Victor, I picked up 1~2 case for each elements, and it looks good. And the patch also can work with vaapi-driver.
Created attachment 372585 [details] [review] Fix jpeg decode image display nothing.
As your recommendation, run this cases on the latest stable branch 1.14 and the development branch, master, the issue still can be reproduced. The vabuffer of slice data is released before vaEndPicture, driver may or may not store the data to its internal buffer when call vaRenderPicture.If not store the data, how dose driver decode bit stream? Assuming driver will store slice data to its internal buffer seems not be reasonable.
Review of attachment 372585 [details] [review]: The commit message is wrong: the patch is unrelated with vaapijpegdec, but with "libs: decoder: ..." later, there is not a reason to do this change does the spec say that? does it make sense in general? is it safer? ::: gst-libs/gst/vaapi/gstvaapidecoder_objects.c @@ +311,3 @@ + for (i = 0; i < picture->slices->len; i++) { + GstVaapiSlice *const slice = g_ptr_array_index (picture->slices, i); + if (slice->param_id != VA_INVALID_ID) { there is no need to check if the param_id is not invalid, since vaapi_destroy_buffer() already do it. @@ +313,3 @@ + if (slice->param_id != VA_INVALID_ID) { + vaapi_destroy_buffer (va_display, &slice->param_id); + slice->param_id = VA_INVALID_ID; there is no need to set param_id to invalid since vaapi_destroy_buffer() do it too @@ +317,3 @@ + if (slice->data_id != VA_INVALID_ID) { + vaapi_destroy_buffer (va_display, &slice->data_id); + slice->data_id = VA_INVALID_ID; here the same too
Created attachment 372598 [details] [review] Fix jpeg decode image display nothing. It is safer and more reasonable to release buffer after vaEndPicture instead of before. Because some buffers will be passed into GPU when call vaEndPicture, are not necessary to copy into driver internal buffer.
Review of attachment 372598 [details] [review]: ::: gst-libs/gst/vaapi/gstvaapidecoder_objects.c @@ +312,2 @@ status = vaEndPicture (va_display, va_context); + you forgot to add in the patch the removal of the vaapi_destroy_buffer (va_display, ...); in the vaRenderPicture() block
Created attachment 372599 [details] [review] Fix jpeg decode image display nothing.
I have changed the log message. Attachment 372599 [details] pushed as bb8894aa - libs: decoder: release VA buffers after vaEndPicture