vaapidecode: handle decode-only frames.

Decode-only frames may not have a valid surface proxy. So, simply discard
them gracefully, i.e. don't create meta data information. GstVideoDecoder
base class will properly handle this case and won't try to push any buffer
to downstream elements.
This commit is contained in:
Gwenole Beauchesne 2013-01-30 16:26:07 +01:00
parent 0847b3888d
commit 41dcd82e2f

View file

@ -252,21 +252,24 @@ gst_vaapidecode_push_decoded_frames(GstVideoDecoder *vdec)
if (status != GST_VAAPI_DECODER_STATUS_SUCCESS)
return GST_FLOW_OK;
proxy = gst_video_codec_frame_get_user_data(out_frame);
if (!GST_VIDEO_CODEC_FRAME_IS_DECODE_ONLY(out_frame)) {
proxy = gst_video_codec_frame_get_user_data(out_frame);
gst_vaapi_surface_proxy_set_user_data(proxy,
decode, (GDestroyNotify)gst_vaapidecode_release);
gst_vaapi_surface_proxy_set_user_data(proxy,
decode, (GDestroyNotify)gst_vaapidecode_release);
out_frame->output_buffer =
gst_vaapi_video_buffer_new_with_surface_proxy(proxy);
if (!out_frame->output_buffer)
goto error_create_buffer;
out_frame->output_buffer =
gst_vaapi_video_buffer_new_with_surface_proxy(proxy);
if (!out_frame->output_buffer)
goto error_create_buffer;
}
ret = gst_video_decoder_finish_frame(vdec, out_frame);
if (ret != GST_FLOW_OK)
goto error_commit_buffer;
decode->last_buffer_time = out_frame->pts;
if (GST_CLOCK_TIME_IS_VALID(out_frame->pts))
decode->last_buffer_time = out_frame->pts;
gst_video_codec_frame_unref(out_frame);
};
return GST_FLOW_OK;