mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 20:21:24 +00:00
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:
parent
0847b3888d
commit
41dcd82e2f
1 changed files with 11 additions and 8 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue