vaapidecode: submit all decoded frames before decoding a new one.

Make sure to purge all pending frames that were already decoded prior
to decoding a new one. This helps release VA surfaces as early as
possible.
This commit is contained in:
Gwenole Beauchesne 2013-04-03 11:10:41 +02:00
parent ead7ec2f43
commit 1ed3df201e

View file

@ -351,9 +351,17 @@ gst_vaapidecode_handle_frame(GstVideoDecoder *vdec, GstVideoCodecFrame *frame)
{
GstFlowReturn ret;
/* Purge all pending frames we might have already. This helps
release VA surfaces as early as possible for _decode_frame() */
ret = gst_vaapidecode_push_decoded_frames(vdec);
if (ret != GST_FLOW_OK)
return ret;
ret = gst_vaapidecode_decode_frame(vdec, frame);
if (ret != GST_FLOW_OK)
return ret;
/* Purge any pending frame thay may have been decoded already */
return gst_vaapidecode_push_decoded_frames(vdec);
}