mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
codecs: Rename picture clear functions
Our convention for clear method is gst_clear_foo_bar(). Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1897>
This commit is contained in:
parent
2b827948d5
commit
aa476452fb
19 changed files with 49 additions and 49 deletions
|
@ -110,7 +110,7 @@ gst_av1_decoder_reset (GstAV1Decoder * self)
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -160,7 +160,7 @@ gst_av1_dpb_clear (GstAV1Dpb * dpb)
|
|||
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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -110,7 +110,7 @@ gst_av1_picture_replace (GstAV1Picture ** old_picture,
|
|||
}
|
||||
|
||||
static inline void
|
||||
gst_av1_picture_clear (GstAV1Picture ** picture)
|
||||
gst_clear_av1_picture (GstAV1Picture ** picture)
|
||||
{
|
||||
if (picture && *picture) {
|
||||
gst_av1_picture_unref (*picture);
|
||||
|
|
|
@ -346,32 +346,32 @@ gst_h264_decoder_init (GstH264Decoder * self)
|
|||
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);
|
||||
|
@ -412,7 +412,7 @@ gst_h264_decoder_reset (GstH264Decoder * self)
|
|||
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;
|
||||
|
@ -456,7 +456,7 @@ gst_h264_decoder_clear_output_frame (GstH264DecoderOutputFrame * output_frame)
|
|||
output_frame->frame = NULL;
|
||||
}
|
||||
|
||||
gst_h264_picture_clear (&output_frame->picture);
|
||||
gst_clear_h264_picture (&output_frame->picture);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -481,7 +481,7 @@ gst_h264_decoder_clear_dpb (GstH264Decoder * self, gboolean flush)
|
|||
|
||||
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;
|
||||
}
|
||||
|
@ -569,7 +569,7 @@ gst_h264_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -862,7 +862,7 @@ output_picture_directly (GstH264Decoder * self, GstH264Picture * picture,
|
|||
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;
|
||||
}
|
||||
|
@ -884,7 +884,7 @@ 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);
|
||||
}
|
||||
|
@ -1216,7 +1216,7 @@ gst_h264_decoder_find_first_field_picture (GstH264Decoder * self,
|
|||
|
||||
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 */
|
||||
}
|
||||
|
@ -1899,7 +1899,7 @@ gst_h264_decoder_drain_internal (GstH264Decoder * self)
|
|||
|
||||
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;
|
||||
|
||||
|
|
|
@ -142,7 +142,7 @@ gst_h264_dpb_new (void)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -206,7 +206,7 @@ gst_h264_picture_replace (GstH264Picture ** old_picture,
|
|||
}
|
||||
|
||||
static inline void
|
||||
gst_h264_picture_clear (GstH264Picture ** picture)
|
||||
gst_clear_h264_picture (GstH264Picture ** picture)
|
||||
{
|
||||
if (picture && *picture) {
|
||||
gst_h264_picture_unref (*picture);
|
||||
|
|
|
@ -1816,7 +1816,7 @@ gst_h265_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||
}
|
||||
|
||||
gst_video_decoder_drop_frame (decoder, frame);
|
||||
gst_h265_picture_clear (&priv->current_picture);
|
||||
gst_clear_h265_picture (&priv->current_picture);
|
||||
|
||||
return decode_ret;
|
||||
}
|
||||
|
|
|
@ -130,7 +130,7 @@ gst_h265_dpb_new (void)
|
|||
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;
|
||||
}
|
||||
|
|
|
@ -115,7 +115,7 @@ gst_h265_picture_replace (GstH265Picture ** old_picture,
|
|||
}
|
||||
|
||||
static inline void
|
||||
gst_h265_picture_clear (GstH265Picture ** picture)
|
||||
gst_clear_h265_picture (GstH265Picture ** picture)
|
||||
{
|
||||
if (picture && *picture) {
|
||||
gst_h265_picture_unref (*picture);
|
||||
|
|
|
@ -856,7 +856,7 @@ gst_mpeg2_decoder_ensure_current_picture (GstMpeg2Decoder * decoder,
|
|||
|
||||
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 ();
|
||||
|
@ -955,7 +955,7 @@ gst_mpeg2_decoder_finish_current_field (GstMpeg2Decoder * decoder)
|
|||
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;
|
||||
|
@ -1191,7 +1191,7 @@ gst_mpeg2_decoder_clear_output_frame (GstMpeg2DecoderOutputFrame * output_frame)
|
|||
output_frame->frame = NULL;
|
||||
}
|
||||
|
||||
gst_mpeg2_picture_clear (&output_frame->picture);
|
||||
gst_clear_mpeg2_picture (&output_frame->picture);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
@ -1259,8 +1259,8 @@ gst_mpeg2_decoder_handle_frame (GstVideoDecoder * decoder,
|
|||
}
|
||||
|
||||
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;
|
||||
|
@ -1274,8 +1274,8 @@ failed:
|
|||
}
|
||||
|
||||
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;
|
||||
|
|
|
@ -153,11 +153,11 @@ gst_mpeg2_dpb_free (GstMpeg2Dpb * 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]);
|
||||
|
||||
g_free (dpb);
|
||||
}
|
||||
|
@ -177,11 +177,11 @@ gst_mpeg2_dpb_clear (GstMpeg2Dpb * 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;
|
||||
}
|
||||
|
@ -289,13 +289,13 @@ gst_mpeg2_dpb_bump (GstMpeg2Dpb * dpb)
|
|||
/* 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;
|
||||
|
|
|
@ -137,7 +137,7 @@ gst_mpeg2_picture_replace (GstMpeg2Picture ** old_picture,
|
|||
}
|
||||
|
||||
static inline void
|
||||
gst_mpeg2_picture_clear (GstMpeg2Picture ** picture)
|
||||
gst_clear_mpeg2_picture (GstMpeg2Picture ** picture)
|
||||
{
|
||||
if (picture && *picture) {
|
||||
gst_mpeg2_picture_unref (*picture);
|
||||
|
|
|
@ -124,9 +124,9 @@ gst_vp8_decoder_reset (GstVp8Decoder * self)
|
|||
{
|
||||
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);
|
||||
|
@ -288,9 +288,9 @@ gst_vp8_decoder_drain_internal (GstVp8Decoder * self, gboolean wait_keyframe)
|
|||
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;
|
||||
|
||||
|
@ -337,7 +337,7 @@ gst_vp8_decoder_clear_output_frame (GstVp8DecoderOutputFrame * output_frame)
|
|||
output_frame->frame = NULL;
|
||||
}
|
||||
|
||||
gst_vp8_picture_clear (&output_frame->picture);
|
||||
gst_clear_vp8_picture (&output_frame->picture);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
|
@ -77,7 +77,7 @@ gst_vp8_picture_replace (GstVp8Picture ** old_picture,
|
|||
}
|
||||
|
||||
static inline void
|
||||
gst_vp8_picture_clear (GstVp8Picture ** picture)
|
||||
gst_clear_vp8_picture (GstVp8Picture ** picture)
|
||||
{
|
||||
if (picture && *picture) {
|
||||
gst_vp8_picture_unref (*picture);
|
||||
|
|
|
@ -340,7 +340,7 @@ gst_vp9_decoder_clear_output_frame (GstVp9DecoderOutputFrame * output_frame)
|
|||
output_frame->frame = NULL;
|
||||
}
|
||||
|
||||
gst_vp9_picture_clear (&output_frame->picture);
|
||||
gst_clear_vp9_picture (&output_frame->picture);
|
||||
}
|
||||
|
||||
static GstFlowReturn
|
||||
|
|
|
@ -148,7 +148,7 @@ gst_vp9_dpb_clear (GstVp9Dpb * dpb)
|
|||
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]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -77,7 +77,7 @@ gst_vp9_picture_replace (GstVp9Picture ** old_picture,
|
|||
}
|
||||
|
||||
static inline void
|
||||
gst_vp9_picture_clear (GstVp9Picture ** picture)
|
||||
gst_clear_vp9_picture (GstVp9Picture ** picture)
|
||||
{
|
||||
if (picture && *picture) {
|
||||
gst_vp9_picture_unref (*picture);
|
||||
|
|
|
@ -212,7 +212,7 @@ gst_nv_h264_dec_init (GstNvH264Dec * self)
|
|||
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
|
||||
|
|
|
@ -946,7 +946,7 @@ gst_va_h264_dec_init (GTypeInstance * instance, gpointer g_class)
|
|||
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
|
||||
|
|
Loading…
Reference in a new issue