diff options
author | Seungha Yang <seungha@centricular.com> | 2021-04-09 12:45:46 +0900 |
---|---|---|
committer | GStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org> | 2021-04-09 12:13:24 +0000 |
commit | f7a341a1f0f7ebe603af573f33b02d5c6445ae02 (patch) | |
tree | f90cc0e61f54006825ae2f607a7cb725555cfe65 /gst-libs | |
parent | 933ebba43535d75a3274f519cbcaf70863a9464c (diff) | |
download | gstreamer-plugins-bad-f7a341a1f0f7ebe603af573f33b02d5c6445ae02.tar.gz |
codecs: vp9decoder: Make duplicate_picture() vfunc optional
The default implementation was required when superframe parsing
was handled by vp9decoder. For instance, if a superframe consists
of multiple frames with show_existing_frame header, it was vague
that which GstVp9Picture should consume GstVideoCodecFrame.
After 1.18 release, we introduced vp9parse element and
superframe should be handled by upstream vp9parse elemenet now.
So, we don't need to care about the superframe at vp9decoder class
level anymore. Simply, a frame corresponding to show_existing_frame
can be dropped if subclass doesn't implement duplicate_picture().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2151>
Diffstat (limited to 'gst-libs')
-rw-r--r-- | gst-libs/gst/codecs/gstvp9decoder.c | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/gst-libs/gst/codecs/gstvp9decoder.c b/gst-libs/gst/codecs/gstvp9decoder.c index 94f4aeaac..a9df8d6b5 100644 --- a/gst-libs/gst/codecs/gstvp9decoder.c +++ b/gst-libs/gst/codecs/gstvp9decoder.c @@ -94,8 +94,6 @@ static GstFlowReturn gst_vp9_decoder_drain (GstVideoDecoder * decoder); static GstFlowReturn gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame); -static GstVp9Picture *gst_vp9_decoder_duplicate_picture_default (GstVp9Decoder * - decoder, GstVideoCodecFrame * frame, GstVp9Picture * picture); static void gst_vp9_decoder_class_init (GstVp9DecoderClass * klass) @@ -110,9 +108,6 @@ gst_vp9_decoder_class_init (GstVp9DecoderClass * klass) decoder_class->drain = GST_DEBUG_FUNCPTR (gst_vp9_decoder_drain); decoder_class->handle_frame = GST_DEBUG_FUNCPTR (gst_vp9_decoder_handle_frame); - - klass->duplicate_picture = - GST_DEBUG_FUNCPTR (gst_vp9_decoder_duplicate_picture_default); } static void @@ -245,18 +240,6 @@ gst_vp9_decoder_drain (GstVideoDecoder * decoder) return GST_FLOW_OK; } -static GstVp9Picture * -gst_vp9_decoder_duplicate_picture_default (GstVp9Decoder * decoder, - GstVideoCodecFrame * frame, GstVp9Picture * picture) -{ - GstVp9Picture *new_picture; - - new_picture = gst_vp9_picture_new (); - new_picture->frame_hdr = picture->frame_hdr; - - return new_picture; -} - static GstFlowReturn gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder, GstVideoCodecFrame * frame) @@ -338,7 +321,16 @@ gst_vp9_decoder_handle_frame (GstVideoDecoder * decoder, goto unmap_and_error; } - g_assert (klass->duplicate_picture); + /* If not implemented by subclass, we can just drop this picture + * since this frame header indicates the frame index to be duplicated + * and also this frame header doesn't affect reference management */ + if (!klass->duplicate_picture) { + gst_buffer_unmap (in_buf, &map); + GST_VIDEO_CODEC_FRAME_SET_DECODE_ONLY (frame); + + gst_video_decoder_finish_frame (GST_VIDEO_DECODER (self), frame); + } + pic_to_dup = priv->dpb->pic_list[frame_hdr.frame_to_show_map_idx]; picture = klass->duplicate_picture (self, frame, pic_to_dup); |