codecs: set sys frame num before new_picture()

Derive classes might need to operate on the current frame at their
new_picture() vmethod, so it would be needed to set system_frame_number
on picture before calling the vmethod.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1209>
This commit is contained in:
Víctor Manuel Jáquez Leal 2020-04-23 12:00:15 +02:00 committed by Nicolas Dufresne
parent 0d637c14c5
commit 23e99a7a77
2 changed files with 4 additions and 4 deletions

View file

@ -671,6 +671,8 @@ gst_h264_decoder_parse_slice (GstH264Decoder * self, GstH264NalUnit * nalu,
picture = gst_h264_picture_new ();
picture->pts = pts;
/* This allows accessing the frame from the picture. */
picture->system_frame_number = priv->current_frame->system_frame_number;
if (klass->new_picture)
ret = klass->new_picture (self, picture);
@ -681,8 +683,6 @@ gst_h264_decoder_parse_slice (GstH264Decoder * self, GstH264NalUnit * nalu,
return FALSE;
}
/* This allows accessing the frame from the picture. */
picture->system_frame_number = priv->current_frame->system_frame_number;
priv->current_picture = picture;
gst_video_codec_frame_set_user_data (priv->current_frame,
gst_h264_picture_ref (priv->current_picture),

View file

@ -395,6 +395,8 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu,
picture = gst_h265_picture_new ();
picture->pts = pts;
/* This allows accessing the frame from the picture. */
picture->system_frame_number = priv->current_frame->system_frame_number;
if (klass->new_picture)
ret = klass->new_picture (self, picture);
@ -405,8 +407,6 @@ gst_h265_decoder_parse_slice (GstH265Decoder * self, GstH265NalUnit * nalu,
return FALSE;
}
/* This allows accessing the frame from the picture. */
picture->system_frame_number = priv->current_frame->system_frame_number;
priv->current_picture = picture;
gst_video_codec_frame_set_user_data (priv->current_frame,
gst_h265_picture_ref (priv->current_picture),