From 0374a8c0a5921eaa68a6759e4b76e5fb54822c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Manuel=20J=C3=A1quez=20Leal?= Date: Mon, 21 May 2018 13:22:45 +0200 Subject: [PATCH] libs: decoder: mpeg2: implement reset() callback remove create() and destroy() callbacks https://bugzilla.gnome.org/show_bug.cgi?id=796308 --- gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c index 618270e6dd..17ebcd4abc 100644 --- a/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c +++ b/gst-libs/gst/vaapi/gstvaapidecoder_mpeg2.c @@ -361,6 +361,14 @@ gst_vaapi_decoder_mpeg2_create (GstVaapiDecoder * base_decoder) return TRUE; } +static GstVaapiDecoderStatus +gst_vaapi_decoder_mpeg2_reset (GstVaapiDecoder * base_decoder) +{ + gst_vaapi_decoder_mpeg2_destroy (base_decoder); + gst_vaapi_decoder_mpeg2_create (base_decoder); + return GST_VAAPI_DECODER_STATUS_SUCCESS; +} + static inline void copy_quant_matrix (guint8 dst[64], const guint8 src[64]) { @@ -1584,8 +1592,7 @@ gst_vaapi_decoder_mpeg2_class_init (GstVaapiDecoderMpeg2Class * klass) object_class->finalize = gst_vaapi_decoder_mpeg2_finalize; - decoder_class->create = gst_vaapi_decoder_mpeg2_create; - decoder_class->destroy = gst_vaapi_decoder_mpeg2_destroy; + decoder_class->reset = gst_vaapi_decoder_mpeg2_reset; decoder_class->parse = gst_vaapi_decoder_mpeg2_parse; decoder_class->decode = gst_vaapi_decoder_mpeg2_decode; decoder_class->start_frame = gst_vaapi_decoder_mpeg2_start_frame;