Multi-Frame problem implementing NvDec with GstVideoDecoder

Stirling Westrup swestrup at gmail.com
Tue Mar 28 17:16:33 UTC 2017


I've written a plugin to implement Nvidia cuvid decoding based on the
GstVideoDecoder base. I've gotten a few test files to play, but have run
into a problem with the old standby of BigBuckBunny (specifically
bbb_sunflower_2160p_60fps_normal.mp4).

My code gets called in gst_nv_dec_parse by the base GstVideoDecode, and I
pass the information on to cuvidParseVideoData() to parse the input data
into frames. It finds TWO frames and so calls my cuvid_frame_parsed
callback twice in a row.

On the first call, I record the frame that I was given in gst_nv_dec_parse
(for later use as an output frame) and call gst_video_decoder_have_frame.

On the second call, I've already used the input frame, and now don't know
where I'm going to get a second output frame. There doesn't seem to be any
way to request one.

Technically, I could simply call gst_video_decoder_have_frame twice in a
row, but looking at its code, this seems likely to cause a crash as it
relies on there being a valid current_frame, and it sets the current_frame
to NULL at the end of processing.

Any suggestions on how to solve this issue?
-- 
Stirling Westrup
Programmer, Entrepreneur.
https://www.linkedin.com/e/fpf/77228
http://www.linkedin.com/in/swestrup
http://technaut.livejournal.com
http://sourceforge.net/users/stirlingwestrup
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/gstreamer-devel/attachments/20170328/1f395fe7/attachment.html>


More information about the gstreamer-devel mailing list