Our convention for clear method is gst_clear_foo_bar().
Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1897>
priv->max_width = 0;
priv->max_height = 0;
- gst_av1_picture_clear (&priv->current_picture);
+ gst_clear_av1_picture (&priv->current_picture);
priv->current_frame = NULL;
priv->profile = GST_AV1_PROFILE_UNDEFINED;
g_return_if_fail (dpb != NULL);
for (i = 0; i < GST_AV1_NUM_REF_FRAMES; i++)
- gst_av1_picture_clear (&dpb->pic_list[i]);
+ gst_clear_av1_picture (&dpb->pic_list[i]);
}
/**
}
static inline void
-gst_av1_picture_clear (GstAV1Picture ** picture)
+gst_clear_av1_picture (GstAV1Picture ** picture)
{
if (picture && *picture) {
gst_av1_picture_unref (*picture);
priv->ref_pic_list_p0 = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_array_set_clear_func (priv->ref_pic_list_p0,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
priv->ref_pic_list_b0 = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_array_set_clear_func (priv->ref_pic_list_b0,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
priv->ref_pic_list_b1 = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_array_set_clear_func (priv->ref_pic_list_b1,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
priv->ref_frame_list_0_short_term = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_array_set_clear_func (priv->ref_frame_list_0_short_term,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
priv->ref_frame_list_1_short_term = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_array_set_clear_func (priv->ref_frame_list_1_short_term,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
priv->ref_frame_list_long_term = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_array_set_clear_func (priv->ref_frame_list_long_term,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
priv->ref_pic_list0 = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 32);
g_clear_pointer (&self->input_state, gst_video_codec_state_unref);
g_clear_pointer (&priv->parser, gst_h264_nal_parser_free);
g_clear_pointer (&priv->dpb, gst_h264_dpb_free);
- gst_h264_picture_clear (&priv->last_field);
+ gst_clear_h264_picture (&priv->last_field);
priv->profile_idc = 0;
priv->width = 0;
output_frame->frame = NULL;
}
- gst_h264_picture_clear (&output_frame->picture);
+ gst_clear_h264_picture (&output_frame->picture);
}
static void
gst_queue_array_clear (priv->output_queue);
gst_h264_decoder_clear_ref_pic_lists (self);
- gst_h264_picture_clear (&priv->last_field);
+ gst_clear_h264_picture (&priv->last_field);
gst_h264_dpb_clear (priv->dpb);
priv->last_output_poc = G_MININT32;
}
}
gst_video_decoder_drop_frame (decoder, frame);
- gst_h264_picture_clear (&priv->current_picture);
+ gst_clear_h264_picture (&priv->current_picture);
priv->current_frame = NULL;
return decode_ret;
priv->last_field, priv->last_field->pic_order_cnt,
picture, picture->pic_order_cnt);
- gst_h264_picture_clear (&priv->last_field);
+ gst_clear_h264_picture (&priv->last_field);
flow_ret = GST_FLOW_ERROR;
goto output;
}
gst_h264_decoder_do_output_picture (self, out_pic, &flow_ret);
}
- gst_h264_picture_clear (&picture);
+ gst_clear_h264_picture (&picture);
UPDATE_FLOW_RETURN (ret, flow_ret);
}
error:
if (!in_dpb) {
- gst_h264_picture_clear (&priv->last_field);
+ gst_clear_h264_picture (&priv->last_field);
} else {
/* FIXME: implement fill gap field picture if it is already in DPB */
}
gst_h264_decoder_drain_output_queue (self, 0, &ret);
- gst_h264_picture_clear (&priv->last_field);
+ gst_clear_h264_picture (&priv->last_field);
gst_h264_dpb_clear (priv->dpb);
priv->last_output_poc = G_MININT32;
g_array_sized_new (FALSE, TRUE, sizeof (GstH264Picture *),
GST_H264_DPB_MAX_SIZE);
g_array_set_clear_func (dpb->pic_list,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
return dpb;
}
}
static inline void
-gst_h264_picture_clear (GstH264Picture ** picture)
+gst_clear_h264_picture (GstH264Picture ** picture)
{
if (picture && *picture) {
gst_h264_picture_unref (*picture);
}
gst_video_decoder_drop_frame (decoder, frame);
- gst_h265_picture_clear (&priv->current_picture);
+ gst_clear_h265_picture (&priv->current_picture);
return decode_ret;
}
g_array_sized_new (FALSE, TRUE, sizeof (GstH265Picture *),
GST_H265_DPB_MAX_SIZE);
g_array_set_clear_func (dpb->pic_list,
- (GDestroyNotify) gst_h265_picture_clear);
+ (GDestroyNotify) gst_clear_h265_picture);
return dpb;
}
}
static inline void
-gst_h265_picture_clear (GstH265Picture ** picture)
+gst_clear_h265_picture (GstH265Picture ** picture)
{
if (picture && *picture) {
gst_h265_picture_unref (*picture);
if (priv->first_field) {
GST_WARNING_OBJECT (decoder, "An unmatched first field");
- gst_mpeg2_picture_clear (&priv->first_field);
+ gst_clear_mpeg2_picture (&priv->first_field);
}
picture = gst_mpeg2_picture_new ();
priv->current_picture, priv->current_picture->structure ==
GST_MPEG_VIDEO_PICTURE_STRUCTURE_FRAME ?
" a field" : "the first field");
- gst_mpeg2_picture_clear (&priv->current_picture);
+ gst_clear_mpeg2_picture (&priv->current_picture);
}
return GST_FLOW_OK;
output_frame->frame = NULL;
}
- gst_mpeg2_picture_clear (&output_frame->picture);
+ gst_clear_mpeg2_picture (&output_frame->picture);
}
static GstFlowReturn
}
ret = gst_mpeg2_decoder_output_current_picture (self);
- gst_mpeg2_picture_clear (&priv->current_picture);
- gst_mpeg2_picture_clear (&priv->first_field);
+ gst_clear_mpeg2_picture (&priv->current_picture);
+ gst_clear_mpeg2_picture (&priv->first_field);
gst_video_codec_frame_unref (priv->current_frame);
priv->current_frame = NULL;
return ret;
}
gst_video_decoder_drop_frame (decoder, frame);
- gst_mpeg2_picture_clear (&priv->current_picture);
- gst_mpeg2_picture_clear (&priv->first_field);
+ gst_clear_mpeg2_picture (&priv->current_picture);
+ gst_clear_mpeg2_picture (&priv->first_field);
priv->current_frame = NULL;
return ret;
g_return_if_fail (dpb != NULL);
- gst_mpeg2_picture_clear (&dpb->new_pic);
+ gst_clear_mpeg2_picture (&dpb->new_pic);
g_assert (dpb->num_ref_pictures <= 2);
for (i = 0; i < dpb->num_ref_pictures; i++)
- gst_mpeg2_picture_clear (&dpb->ref_pic_list[i]);
+ gst_clear_mpeg2_picture (&dpb->ref_pic_list[i]);
g_free (dpb);
}
g_return_if_fail (dpb != NULL);
- gst_mpeg2_picture_clear (&dpb->new_pic);
+ gst_clear_mpeg2_picture (&dpb->new_pic);
g_assert (dpb->num_ref_pictures <= 2);
for (i = 0; i < dpb->num_ref_pictures; i++)
- gst_mpeg2_picture_clear (&dpb->ref_pic_list[i]);
+ gst_clear_mpeg2_picture (&dpb->ref_pic_list[i]);
dpb->num_ref_pictures = 0;
}
/* Then, replace the reference if needed. */
if (dpb->new_pic && GST_MPEG2_PICTURE_IS_REF (dpb->new_pic)) {
_dpb_add_to_reference (dpb, dpb->new_pic);
- gst_mpeg2_picture_clear (&dpb->new_pic);
+ gst_clear_mpeg2_picture (&dpb->new_pic);
}
if (pic) {
pic->needed_for_output = FALSE;
if (pic == dpb->new_pic)
- gst_mpeg2_picture_clear (&dpb->new_pic);
+ gst_clear_mpeg2_picture (&dpb->new_pic);
}
return pic;
}
static inline void
-gst_mpeg2_picture_clear (GstMpeg2Picture ** picture)
+gst_clear_mpeg2_picture (GstMpeg2Picture ** picture)
{
if (picture && *picture) {
gst_mpeg2_picture_unref (*picture);
{
GstVp8DecoderPrivate *priv = self->priv;
- gst_vp8_picture_clear (&self->last_picture);
- gst_vp8_picture_clear (&self->golden_ref_picture);
- gst_vp8_picture_clear (&self->alt_ref_picture);
+ gst_clear_vp8_picture (&self->last_picture);
+ gst_clear_vp8_picture (&self->golden_ref_picture);
+ gst_clear_vp8_picture (&self->alt_ref_picture);
priv->wait_keyframe = TRUE;
gst_queue_array_clear (priv->output_queue);
GstVp8DecoderPrivate *priv = self->priv;
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_clear_vp8_picture (&self->last_picture);
+ gst_clear_vp8_picture (&self->golden_ref_picture);
+ gst_clear_vp8_picture (&self->alt_ref_picture);
priv->wait_keyframe = wait_keyframe;
output_frame->frame = NULL;
}
- gst_vp8_picture_clear (&output_frame->picture);
+ gst_clear_vp8_picture (&output_frame->picture);
}
static GstFlowReturn
}
static inline void
-gst_vp8_picture_clear (GstVp8Picture ** picture)
+gst_clear_vp8_picture (GstVp8Picture ** picture)
{
if (picture && *picture) {
gst_vp8_picture_unref (*picture);
output_frame->frame = NULL;
}
- gst_vp9_picture_clear (&output_frame->picture);
+ gst_clear_vp9_picture (&output_frame->picture);
}
static GstFlowReturn
g_return_if_fail (dpb != NULL);
for (i = 0; i < GST_VP9_REF_FRAMES; i++)
- gst_vp9_picture_clear (&dpb->pic_list[i]);
+ gst_clear_vp9_picture (&dpb->pic_list[i]);
}
/**
}
static inline void
-gst_vp9_picture_clear (GstVp9Picture ** picture)
+gst_clear_vp9_picture (GstVp9Picture ** picture)
{
if (picture && *picture) {
gst_vp9_picture_unref (*picture);
self->ref_list = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 16);
g_array_set_clear_func (self->ref_list,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
}
static void
self->ref_list = g_array_sized_new (FALSE, TRUE,
sizeof (GstH264Picture *), 16);
g_array_set_clear_func (self->ref_list,
- (GDestroyNotify) gst_h264_picture_clear);
+ (GDestroyNotify) gst_clear_h264_picture);
}
static gpointer