diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c index 461ac0fe44..6b1ef630ca 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c @@ -74,9 +74,6 @@ static GstFlowReturn gst_av1_decoder_drain (GstVideoDecoder * decoder); static GstFlowReturn gst_av1_decoder_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame); -static GstAV1Picture *gst_av1_decoder_duplicate_picture_default (GstAV1Decoder * - decoder, GstAV1Picture * picture); - static void gst_av1_decoder_class_init (GstAV1DecoderClass * klass) { @@ -90,9 +87,6 @@ gst_av1_decoder_class_init (GstAV1DecoderClass * klass) decoder_class->drain = GST_DEBUG_FUNCPTR (gst_av1_decoder_drain); decoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_av1_decoder_handle_frame); - - klass->duplicate_picture = - GST_DEBUG_FUNCPTR (gst_av1_decoder_duplicate_picture_default); } static void @@ -199,17 +193,6 @@ gst_av1_decoder_drain (GstVideoDecoder * decoder) return GST_FLOW_OK; } -static GstAV1Picture * -gst_av1_decoder_duplicate_picture_default (GstAV1Decoder * decoder, - GstAV1Picture * picture) -{ - GstAV1Picture *new_picture; - - new_picture = gst_av1_picture_new (); - - return new_picture; -} - static const gchar * get_obu_name (GstAV1OBUType type) { @@ -363,10 +346,10 @@ gst_av1_decoder_decode_frame_header (GstAV1Decoder * self, return GST_FLOW_ERROR; } - /* FIXME: duplicate picture might be optional feature like that of VP9 - * decoder baseclass */ + /* The duplicated picture, if a key frame, will be placed in the DPB and + * for this reason is not optional. */ g_assert (klass->duplicate_picture); - picture = klass->duplicate_picture (self, ref_picture); + picture = klass->duplicate_picture (self, priv->current_frame, ref_picture); if (!picture) { GST_ERROR_OBJECT (self, "subclass didn't provide duplicated picture"); return GST_FLOW_ERROR; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.h index 612af920d2..dc0e953019 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.h @@ -96,13 +96,16 @@ struct _GstAV1DecoderClass * GstAV1DecoderClass::duplicate_picture: * @decoder: a #GstAV1Decoder * @picture: (transfer none): a #GstAV1Picture + * @frame: (transfer none): the current #GstVideoCodecFrame * - * Optional. Called when need to duplicate an existing - * #GstAV1Picture. + * Called when need to duplicate an existing #GstAV1Picture. As + * duplicated key-frame will populate the DPB, this virtual + * function is not optional. * - * Since: 1.20 + * Since: 1.22 */ GstAV1Picture * (*duplicate_picture) (GstAV1Decoder * decoder, + GstVideoCodecFrame * frame, GstAV1Picture * picture); /** * GstAV1DecoderClass::start_picture: diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c index ff9e1a20c0..6d7eb535c6 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c @@ -459,6 +459,7 @@ gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder, GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (frame); gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame); + return GST_FLOW_OK; } pic_to_dup = priv->dpb->pic_list[frame_hdr.frame_to_show_map_idx]; diff --git a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp index 1c55e66042..591a7299a0 100644 --- a/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp +++ b/subprojects/gst-plugins-bad/sys/d3d11/gstd3d11av1dec.cpp @@ -427,7 +427,7 @@ static GstFlowReturn gst_d3d11_av1_dec_new_sequence (GstAV1Decoder * decoder, static GstFlowReturn gst_d3d11_av1_dec_new_picture (GstAV1Decoder * decoder, GstVideoCodecFrame * frame, GstAV1Picture * picture); static GstAV1Picture *gst_d3d11_av1_dec_duplicate_picture (GstAV1Decoder * - decoder, GstAV1Picture * picture); + decoder, GstVideoCodecFrame * frame, GstAV1Picture * picture); static GstFlowReturn gst_d3d11_av1_dec_start_picture (GstAV1Decoder * decoder, GstAV1Picture * picture, GstAV1Dpb * dpb); static GstFlowReturn gst_d3d11_av1_dec_decode_tile (GstAV1Decoder * decoder, @@ -728,7 +728,7 @@ gst_d3d11_av1_dec_new_picture (GstAV1Decoder * decoder, static GstAV1Picture * gst_d3d11_av1_dec_duplicate_picture (GstAV1Decoder * decoder, - GstAV1Picture * picture) + GstVideoCodecFrame * frame, GstAV1Picture * picture) { GstD3D11AV1Dec *self = GST_D3D11_AV1_DEC (decoder); GstBuffer *view_buffer; diff --git a/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c b/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c index a3dc527eff..429a8d3da4 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvaav1dec.c @@ -357,7 +357,7 @@ gst_va_av1_dec_new_picture (GstAV1Decoder * decoder, static GstAV1Picture * gst_va_av1_dec_duplicate_picture (GstAV1Decoder * decoder, - GstAV1Picture * picture) + GstVideoCodecFrame * frame, GstAV1Picture * picture) { GstVaAV1Dec *self = GST_VA_AV1_DEC (decoder); GstVaBaseDec *base = GST_VA_BASE_DEC (decoder);