codecs: {vp8,vp9}decoder: Cleanup drain code
Make them consistent with h26x decoder baseclass Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
This commit is contained in:
parent
9f4ea145e0
commit
aab3ea2736
@ -76,7 +76,8 @@ static void gst_vp8_decoder_clear_output_frame (GstVp8DecoderOutputFrame *
|
|||||||
output_frame);
|
output_frame);
|
||||||
static void gst_vp8_decoder_drain_output_queue (GstVp8Decoder * self,
|
static void gst_vp8_decoder_drain_output_queue (GstVp8Decoder * self,
|
||||||
guint num, GstFlowReturn * ret);
|
guint num, GstFlowReturn * ret);
|
||||||
|
static GstFlowReturn gst_vp8_decoder_drain_internal (GstVp8Decoder * self,
|
||||||
|
gboolean wait_keyframe);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_vp8_decoder_class_init (GstVp8DecoderClass * klass)
|
gst_vp8_decoder_class_init (GstVp8DecoderClass * klass)
|
||||||
@ -273,18 +274,29 @@ done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vp8_decoder_finish (GstVideoDecoder * decoder)
|
gst_vp8_decoder_drain_internal (GstVp8Decoder * self, gboolean wait_keyframe)
|
||||||
{
|
{
|
||||||
GstVp8Decoder *self = GST_VP8_DECODER (decoder);
|
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
GstVp8DecoderPrivate *priv = self->priv;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "finish");
|
gst_vp8_decoder_drain_output_queue (self, 0, &ret);
|
||||||
|
gst_vp8_picture_clear (&self->last_picture);
|
||||||
|
gst_vp8_picture_clear (&self->golden_ref_picture);
|
||||||
|
gst_vp8_picture_clear (&self->alt_ref_picture);
|
||||||
|
|
||||||
gst_vp8_decoder_drain_output_queue (GST_VP8_DECODER (decoder), 0, &ret);
|
priv->wait_keyframe = wait_keyframe;
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_vp8_decoder_finish (GstVideoDecoder * decoder)
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (decoder, "finish");
|
||||||
|
|
||||||
|
return gst_vp8_decoder_drain_internal (GST_VP8_DECODER (decoder), TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_vp8_decoder_flush (GstVideoDecoder * decoder)
|
gst_vp8_decoder_flush (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
@ -300,15 +312,9 @@ gst_vp8_decoder_flush (GstVideoDecoder * decoder)
|
|||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vp8_decoder_drain (GstVideoDecoder * decoder)
|
gst_vp8_decoder_drain (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstVp8Decoder *self = GST_VP8_DECODER (decoder);
|
GST_DEBUG_OBJECT (decoder, "drain");
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (self, "drain");
|
return gst_vp8_decoder_drain_internal (GST_VP8_DECODER (decoder), TRUE);
|
||||||
|
|
||||||
gst_vp8_decoder_drain_output_queue (GST_VP8_DECODER (decoder), 0, &ret);
|
|
||||||
gst_vp8_decoder_reset (self);
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -110,6 +110,8 @@ static void
|
|||||||
gst_vp9_decoder_clear_output_frame (GstVp9DecoderOutputFrame * output_frame);
|
gst_vp9_decoder_clear_output_frame (GstVp9DecoderOutputFrame * output_frame);
|
||||||
static void gst_vp9_decoder_drain_output_queue (GstVp9Decoder * self,
|
static void gst_vp9_decoder_drain_output_queue (GstVp9Decoder * self,
|
||||||
guint num, GstFlowReturn * ret);
|
guint num, GstFlowReturn * ret);
|
||||||
|
static GstFlowReturn gst_vp9_decoder_drain_internal (GstVp9Decoder * self,
|
||||||
|
gboolean wait_keyframe);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
gst_vp9_decoder_class_init (GstVp9DecoderClass * klass)
|
gst_vp9_decoder_class_init (GstVp9DecoderClass * klass)
|
||||||
@ -249,18 +251,28 @@ gst_vp9_decoder_reset (GstVp9Decoder * self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vp9_decoder_finish (GstVideoDecoder * decoder)
|
gst_vp9_decoder_drain_internal (GstVp9Decoder * self, gboolean wait_keyframe)
|
||||||
{
|
{
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
GstFlowReturn ret = GST_FLOW_OK;
|
||||||
|
GstVp9DecoderPrivate *priv = self->priv;
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (decoder, "finish");
|
gst_vp9_decoder_drain_output_queue (self, 0, &ret);
|
||||||
|
if (priv->dpb)
|
||||||
|
gst_vp9_dpb_clear (priv->dpb);
|
||||||
|
|
||||||
gst_vp9_decoder_drain_output_queue (GST_VP9_DECODER (decoder), 0, &ret);
|
priv->wait_keyframe = wait_keyframe;
|
||||||
gst_vp9_decoder_reset (GST_VP9_DECODER (decoder));
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static GstFlowReturn
|
||||||
|
gst_vp9_decoder_finish (GstVideoDecoder * decoder)
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (decoder, "finish");
|
||||||
|
|
||||||
|
return gst_vp9_decoder_drain_internal (GST_VP9_DECODER (decoder), TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
gst_vp9_decoder_flush (GstVideoDecoder * decoder)
|
gst_vp9_decoder_flush (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
@ -274,14 +286,9 @@ gst_vp9_decoder_flush (GstVideoDecoder * decoder)
|
|||||||
static GstFlowReturn
|
static GstFlowReturn
|
||||||
gst_vp9_decoder_drain (GstVideoDecoder * decoder)
|
gst_vp9_decoder_drain (GstVideoDecoder * decoder)
|
||||||
{
|
{
|
||||||
GstFlowReturn ret = GST_FLOW_OK;
|
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (decoder, "drain");
|
GST_DEBUG_OBJECT (decoder, "drain");
|
||||||
|
|
||||||
gst_vp9_decoder_drain_output_queue (GST_VP9_DECODER (decoder), 0, &ret);
|
return gst_vp9_decoder_drain_internal (GST_VP9_DECODER (decoder), TRUE);
|
||||||
gst_vp9_decoder_reset (GST_VP9_DECODER (decoder));
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user