From: Seungha Yang Date: Tue, 8 Mar 2022 18:45:18 +0000 (+0900) Subject: codecs: Rename picture clear functions X-Git-Tag: 1.22.0~2167 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=aa476452fb8ef703fc1afc158e4d1ce19ba5c131;p=platform%2Fupstream%2Fgstreamer.git codecs: Rename picture clear functions Our convention for clear method is gst_clear_foo_bar(). Part-of: --- 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 cb1e011..df72750 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1decoder.c @@ -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; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.c index c2fa022..733522f 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.c @@ -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]); } /** diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h index 916f97f..3131718 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstav1picture.h @@ -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); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c index 64d69a2..b9abcf8 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264decoder.c @@ -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; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.c index b793073..1670732 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.c @@ -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; } diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h index a028c00..3546800 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth264picture.h @@ -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); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c index 231655b..a8ff59d 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265decoder.c @@ -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; } diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.c index 699ddb5..5bec8b7 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.c @@ -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; } diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h index 5b007fd..652c731 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gsth265picture.h @@ -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); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c index cb60a9f..d6571fa 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c @@ -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; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.c index 174da10..7a72cab 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.c @@ -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; diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.h index 77244a5..bd5ac37 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2picture.h @@ -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); diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c index 21fa144..379e8d7 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c @@ -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 diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8picture.h index 5de240b..abfc07a 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8picture.h @@ -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); 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 72f55ed..089851f 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c @@ -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 diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.c index ffaf6af..64b5a18 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.c @@ -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]); } /** diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.h b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.h index 29bcd18..6caf18b 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.h +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9picture.h @@ -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); diff --git a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c index b17dfba..5e44fda 100644 --- a/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c +++ b/subprojects/gst-plugins-bad/sys/nvcodec/gstnvh264dec.c @@ -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 diff --git a/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c b/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c index 80e95cc..e47c86f 100644 --- a/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c +++ b/subprojects/gst-plugins-bad/sys/va/gstvah264dec.c @@ -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