aom: Implement flush for av1dec

https://bugzilla.gnome.org/show_bug.cgi?id=791674
This commit is contained in:
Sean DuBois 2018-01-31 07:34:32 +00:00 committed by Sebastian Dröge
parent 4d0b06f42c
commit 3a8d50a355

View file

@ -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)
{