Commit 60acedb5 authored by Gwenole Beauchesne's avatar Gwenole Beauchesne

decoder: add GstVaapiDecoder::flush() hook.

parent e4e3a58b
......@@ -257,6 +257,16 @@ do_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *base_frame)
return status;
}
static inline GstVaapiDecoderStatus
do_flush(GstVaapiDecoder *decoder)
{
GstVaapiDecoderClass * const klass = GST_VAAPI_DECODER_GET_CLASS(decoder);
if (klass->flush)
return klass->flush(decoder);
return GST_VAAPI_DECODER_STATUS_SUCCESS;
}
static GstVaapiDecoderStatus
decode_step(GstVaapiDecoder *decoder)
{
......@@ -896,3 +906,12 @@ gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame)
return status;
return do_decode(decoder, frame);
}
GstVaapiDecoderStatus
gst_vaapi_decoder_flush(GstVaapiDecoder *decoder)
{
g_return_val_if_fail(GST_VAAPI_IS_DECODER(decoder),
GST_VAAPI_DECODER_STATUS_ERROR_INVALID_PARAMETER);
return do_flush(decoder);
}
......@@ -123,6 +123,7 @@ struct _GstVaapiDecoderClass {
GstVaapiDecoderStatus (*start_frame)(GstVaapiDecoder *decoder,
struct _GstVaapiDecoderUnit *unit);
GstVaapiDecoderStatus (*end_frame)(GstVaapiDecoder *decoder);
GstVaapiDecoderStatus (*flush)(GstVaapiDecoder *decoder);
};
GType
......@@ -156,6 +157,9 @@ gst_vaapi_decoder_parse(GstVaapiDecoder *decoder,
GstVaapiDecoderStatus
gst_vaapi_decoder_decode(GstVaapiDecoder *decoder, GstVideoCodecFrame *frame);
GstVaapiDecoderStatus
gst_vaapi_decoder_flush(GstVaapiDecoder *decoder);
G_END_DECLS
#endif /* GST_VAAPI_DECODER_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment