summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorSean DuBois <sean@siobud.com>2018-01-31 07:34:32 +0000
committerSebastian Dröge <sebastian@centricular.com>2018-02-05 10:09:48 +0200
commit3a8d50a355311f8f5dc286b7cc8da770e12986aa (patch)
treed20be49e6584f28ffd0b67bd94d0f35ae57f5df0 /ext
parent4d0b06f42c784c974d9534454c2d588ebf9a36bd (diff)
downloadgstreamer-plugins-bad-3a8d50a355311f8f5dc286b7cc8da770e12986aa.tar.gz
aom: Implement flush for av1dec
https://bugzilla.gnome.org/show_bug.cgi?id=791674
Diffstat (limited to 'ext')
-rw-r--r--ext/aom/gstav1dec.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/ext/aom/gstav1dec.c b/ext/aom/gstav1dec.c
index b2a9b51ad..d33118e64 100644
--- a/ext/aom/gstav1dec.c
+++ b/ext/aom/gstav1dec.c
@@ -70,6 +70,7 @@ static gboolean gst_av1_dec_start (GstVideoDecoder * dec);
static gboolean gst_av1_dec_stop (GstVideoDecoder * dec);
static gboolean gst_av1_dec_set_format (GstVideoDecoder * dec,
GstVideoCodecState * state);
+static gboolean gst_av1_dec_flush (GstVideoDecoder * dec);
static GstFlowReturn
gst_av1_dec_handle_frame (GstVideoDecoder * decoder,
GstVideoCodecFrame * frame);
@@ -109,6 +110,8 @@ gst_av1_dec_class_init (GstAV1DecClass * klass)
vdec_class->start = GST_DEBUG_FUNCPTR (gst_av1_dec_start);
vdec_class->stop = GST_DEBUG_FUNCPTR (gst_av1_dec_stop);
+ vdec_class->flush = GST_DEBUG_FUNCPTR (gst_av1_dec_flush);
+
vdec_class->set_format = GST_DEBUG_FUNCPTR (gst_av1_dec_set_format);
vdec_class->handle_frame = GST_DEBUG_FUNCPTR (gst_av1_dec_handle_frame);
@@ -209,6 +212,24 @@ gst_av1_dec_set_format (GstVideoDecoder * dec, GstVideoCodecState * state)
return TRUE;
}
+static gboolean
+gst_av1_dec_flush (GstVideoDecoder * dec)
+{
+ GstAV1Dec *av1dec = GST_AV1_DEC_CAST (dec);
+
+ if (av1dec->output_state) {
+ gst_video_codec_state_unref (av1dec->output_state);
+ av1dec->output_state = NULL;
+ }
+
+ if (av1dec->decoder_inited) {
+ aom_codec_destroy (&av1dec->decoder);
+ }
+ av1dec->decoder_inited = FALSE;
+
+ return TRUE;
+}
+
static GstFlowReturn
gst_av1_dec_open_codec (GstAV1Dec * av1dec, GstVideoCodecFrame * frame)
{