various: make filter internal function names more descriptive

Lots of filters have generic internal function names like "process".
On a stack trace, all of the different filters use this name,
which causes confusion of the actual filter being processed.

This renames these internal function names to carry the filter names.
This matches what had already been done for some filters.
This commit is contained in:
nanahi 2024-04-10 01:47:05 -04:00 committed by Kacper Michajłow
parent 06f88dfb3a
commit 9bb7d96bf9
15 changed files with 102 additions and 102 deletions

View File

@ -156,7 +156,7 @@ static bool init(struct mp_filter *da, struct mp_codec_params *codec,
return true;
}
static void destroy(struct mp_filter *da)
static void ad_lavc_destroy(struct mp_filter *da)
{
struct priv *ctx = da->priv;
@ -165,7 +165,7 @@ static void destroy(struct mp_filter *da)
mp_free_av_packet(&ctx->avpkt);
}
static void reset(struct mp_filter *da)
static void ad_lavc_reset(struct mp_filter *da)
{
struct priv *ctx = da->priv;
@ -276,7 +276,7 @@ static int receive_frame(struct mp_filter *da, struct mp_frame *out)
return ret;
}
static void process(struct mp_filter *ad)
static void ad_lavc_process(struct mp_filter *ad)
{
struct priv *priv = ad->priv;
@ -286,9 +286,9 @@ static void process(struct mp_filter *ad)
static const struct mp_filter_info ad_lavc_filter = {
.name = "ad_lavc",
.priv_size = sizeof(struct priv),
.process = process,
.reset = reset,
.destroy = destroy,
.process = ad_lavc_process,
.reset = ad_lavc_reset,
.destroy = ad_lavc_destroy,
};
static struct mp_decoder *create(struct mp_filter *parent,

View File

@ -79,7 +79,7 @@ static int write_packet(void *p, const uint8_t *buf, int buf_size)
}
// (called on both filter destruction _and_ if lavf fails to init)
static void destroy(struct mp_filter *da)
static void ad_spdif_destroy(struct mp_filter *da)
{
struct spdifContext *spdif_ctx = da->priv;
AVFormatContext *lavf_ctx = spdif_ctx->lavf_ctx;
@ -283,12 +283,12 @@ static int init_filter(struct mp_filter *da)
return 0;
fail:
destroy(da);
ad_spdif_destroy(da);
mp_filter_internal_mark_failed(da);
return -1;
}
static void process(struct mp_filter *da)
static void ad_spdif_process(struct mp_filter *da)
{
struct spdifContext *spdif_ctx = da->priv;
@ -413,8 +413,8 @@ struct mp_decoder_list *select_spdif_codec(const char *codec, const char *pref)
static const struct mp_filter_info ad_spdif_filter = {
.name = "ad_spdif",
.priv_size = sizeof(struct spdifContext),
.process = process,
.destroy = destroy,
.process = ad_spdif_process,
.destroy = ad_spdif_destroy,
};
static struct mp_decoder *create(struct mp_filter *parent,

View File

@ -11,7 +11,7 @@ struct priv {
struct mp_aframe *last; // for repeating
};
static void process(struct mp_filter *f)
static void af_drop_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -52,7 +52,7 @@ static void process(struct mp_filter *f)
mp_pin_in_write(f->ppins[1], frame);
}
static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
static bool af_drop_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@ -65,7 +65,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
static void reset(struct mp_filter *f)
static void af_drop_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -73,18 +73,18 @@ static void reset(struct mp_filter *f)
p->diff = 0;
}
static void destroy(struct mp_filter *f)
static void af_drop_destroy(struct mp_filter *f)
{
reset(f);
af_drop_reset(f);
}
static const struct mp_filter_info af_drop_filter = {
.name = "drop",
.priv_size = sizeof(struct priv),
.process = process,
.command = command,
.reset = reset,
.destroy = destroy,
.process = af_drop_process,
.command = af_drop_command,
.reset = af_drop_reset,
.destroy = af_drop_destroy,
};
static struct mp_filter *af_drop_create(struct mp_filter *parent, void *options)

View File

@ -38,7 +38,7 @@ struct priv {
struct mp_pin *in_pin;
};
static void process(struct mp_filter *f)
static void af_format_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -85,7 +85,7 @@ error:
static const struct mp_filter_info af_format_filter = {
.name = "format",
.priv_size = sizeof(struct priv),
.process = process,
.process = af_format_process,
};
static struct mp_filter *af_format_create(struct mp_filter *parent,

View File

@ -139,18 +139,18 @@ static bool reinit(struct mp_filter *f)
return true;
}
static void reset(struct mp_filter *f)
static void af_lavcac3enc_reset(struct mp_filter *f)
{
struct priv *s = f->priv;
TA_FREEP(&s->in_frame);
}
static void destroy(struct mp_filter *f)
static void af_lavcac3enc_destroy(struct mp_filter *f)
{
struct priv *s = f->priv;
reset(f);
af_lavcac3enc_reset(f);
av_packet_free(&s->lavc_pkt);
avcodec_free_context(&s->lavc_actx);
}
@ -161,7 +161,7 @@ static void swap_16(uint16_t *ptr, size_t size)
ptr[n] = av_bswap16(ptr[n]);
}
static void process(struct mp_filter *f)
static void af_lavcac3enc_process(struct mp_filter *f)
{
struct priv *s = f->priv;
@ -281,9 +281,9 @@ error:
static const struct mp_filter_info af_lavcac3enc_filter = {
.name = "lavcac3enc",
.priv_size = sizeof(struct priv),
.process = process,
.reset = reset,
.destroy = destroy,
.process = af_lavcac3enc_process,
.reset = af_lavcac3enc_reset,
.destroy = af_lavcac3enc_destroy,
};
static void add_chmaps_to_autoconv(struct mp_filter *f,

View File

@ -105,7 +105,7 @@ static bool init_rubberband(struct mp_filter *f)
return true;
}
static void process(struct mp_filter *f)
static void af_rubberband_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -233,7 +233,7 @@ error:
mp_filter_internal_mark_failed(f);
}
static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
static bool af_rubberband_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@ -263,7 +263,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
static void reset(struct mp_filter *f)
static void af_rubberband_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -274,7 +274,7 @@ static void reset(struct mp_filter *f)
TA_FREEP(&p->pending);
}
static void destroy(struct mp_filter *f)
static void af_rubberband_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -286,10 +286,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info af_rubberband_filter = {
.name = "rubberband",
.priv_size = sizeof(struct priv),
.process = process,
.command = command,
.reset = reset,
.destroy = destroy,
.process = af_rubberband_process,
.command = af_rubberband_command,
.reset = af_rubberband_reset,
.destroy = af_rubberband_destroy,
};
static struct mp_filter *af_rubberband_create(struct mp_filter *parent,

View File

@ -229,7 +229,7 @@ static void output_overlap_s16(struct priv *s, void *buf_out,
}
}
static void process(struct mp_filter *f)
static void af_scaletempo_process(struct mp_filter *f)
{
struct priv *s = f->priv;
@ -511,7 +511,7 @@ static bool reinit(struct mp_filter *f)
return true;
}
static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
static bool af_scaletempo_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *s = f->priv;
@ -530,7 +530,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
static void reset(struct mp_filter *f)
static void af_scaletempo_reset(struct mp_filter *f)
{
struct priv *s = f->priv;
@ -543,7 +543,7 @@ static void reset(struct mp_filter *f)
TA_FREEP(&s->in);
}
static void destroy(struct mp_filter *f)
static void af_scaletempo_destroy(struct mp_filter *f)
{
struct priv *s = f->priv;
free(s->buf_queue);
@ -558,10 +558,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info af_scaletempo_filter = {
.name = "scaletempo",
.priv_size = sizeof(struct priv),
.process = process,
.command = command,
.reset = reset,
.destroy = destroy,
.process = af_scaletempo_process,
.command = af_scaletempo_command,
.reset = af_scaletempo_reset,
.destroy = af_scaletempo_destroy,
};
static struct mp_filter *af_scaletempo_create(struct mp_filter *parent,

View File

@ -19,9 +19,9 @@ struct priv {
};
static bool init_scaletempo2(struct mp_filter *f);
static void reset(struct mp_filter *f);
static void af_scaletempo2_reset(struct mp_filter *f);
static void process(struct mp_filter *f)
static void af_scaletempo2_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -156,7 +156,7 @@ static bool init_scaletempo2(struct mp_filter *f)
return true;
}
static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
static bool af_scaletempo2_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@ -169,7 +169,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
static void reset(struct mp_filter *f)
static void af_scaletempo2_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
mp_scaletempo2_reset(&p->data);
@ -177,7 +177,7 @@ static void reset(struct mp_filter *f)
TA_FREEP(&p->pending);
}
static void destroy(struct mp_filter *f)
static void af_scaletempo2_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
mp_scaletempo2_destroy(&p->data);
@ -187,10 +187,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info af_scaletempo2_filter = {
.name = "scaletempo2",
.priv_size = sizeof(struct priv),
.process = process,
.command = command,
.reset = reset,
.destroy = destroy,
.process = af_scaletempo2_process,
.command = af_scaletempo2_command,
.reset = af_scaletempo2_reset,
.destroy = af_scaletempo2_destroy,
};
static struct mp_filter *af_scaletempo2_create(

View File

@ -477,7 +477,7 @@ cont:
mp_subfilter_continue(&p->sub);
}
static void process(struct mp_filter *f)
static void autoconvert_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -508,7 +508,7 @@ void mp_autoconvert_format_change_continue(struct mp_autoconvert *c)
}
}
static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
static bool autoconvert_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@ -529,7 +529,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
static void reset(struct mp_filter *f)
static void autoconvert_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -539,7 +539,7 @@ static void reset(struct mp_filter *f)
p->format_change_blocked = false;
}
static void destroy(struct mp_filter *f)
static void autoconvert_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -550,10 +550,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info autoconvert_filter = {
.name = "autoconvert",
.priv_size = sizeof(struct priv),
.process = process,
.command = command,
.reset = reset,
.destroy = destroy,
.process = autoconvert_process,
.command = autoconvert_command,
.reset = autoconvert_reset,
.destroy = autoconvert_destroy,
};
struct mp_autoconvert *mp_autoconvert_create(struct mp_filter *parent)

View File

@ -17,7 +17,7 @@ static void wakeup(void *ctx)
mp_filter_wakeup(f);
}
static void process(struct mp_filter *f)
static void demux_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -45,14 +45,14 @@ static void process(struct mp_filter *f)
mp_pin_in_write(f->ppins[0], frame);
}
static void reset(struct mp_filter *f)
static void demux_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
p->eof_returned = false;
}
static void destroy(struct mp_filter *f)
static void demux_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -62,9 +62,9 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info demux_filter = {
.name = "demux_in",
.priv_size = sizeof(struct priv),
.process = process,
.reset = reset,
.destroy = destroy,
.process = demux_process,
.reset = demux_reset,
.destroy = demux_destroy,
};
struct mp_filter *mp_demux_in_create(struct mp_filter *parent,

View File

@ -143,7 +143,7 @@ static bool select_format(struct priv *p, int input_fmt,
return true;
}
static void process(struct mp_filter *f)
static void hwupload_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -236,7 +236,7 @@ error:
mp_filter_internal_mark_failed(f);
}
static void destroy(struct mp_filter *f)
static void hwupload_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -247,8 +247,8 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info hwupload_filter = {
.name = "hwupload",
.priv_size = sizeof(struct priv),
.process = process,
.destroy = destroy,
.process = hwupload_process,
.destroy = hwupload_destroy,
};
// The VO layer might have restricted format support. It might actually

View File

@ -145,7 +145,7 @@ static void check_in_format_change(struct mp_user_filter *u,
}
}
static void process_user(struct mp_filter *f)
static void user_wrapper_process(struct mp_filter *f)
{
struct mp_user_filter *u = f->priv;
struct chain *p = u->p;
@ -212,7 +212,7 @@ static void process_user(struct mp_filter *f)
}
}
static void reset_user(struct mp_filter *f)
static void user_wrapper_reset(struct mp_filter *f)
{
struct mp_user_filter *u = f->priv;
@ -220,7 +220,7 @@ static void reset_user(struct mp_filter *f)
u->last_in_pts = u->last_out_pts = MP_NOPTS_VALUE;
}
static void destroy_user(struct mp_filter *f)
static void user_wrapper_destroy(struct mp_filter *f)
{
struct mp_user_filter *u = f->priv;
@ -233,9 +233,9 @@ static void destroy_user(struct mp_filter *f)
static const struct mp_filter_info user_wrapper_filter = {
.name = "user_filter_wrapper",
.priv_size = sizeof(struct mp_user_filter),
.process = process_user,
.reset = reset_user,
.destroy = destroy_user,
.process = user_wrapper_process,
.reset = user_wrapper_reset,
.destroy = user_wrapper_destroy,
};
static struct mp_user_filter *create_wrapper_filter(struct chain *p)
@ -282,7 +282,7 @@ static void relink_filter_list(struct chain *p)
}
}
static void process(struct mp_filter *f)
static void output_chain_process(struct mp_filter *f)
{
struct chain *p = f->priv;
@ -311,7 +311,7 @@ static void process(struct mp_filter *f)
}
}
static void reset(struct mp_filter *f)
static void output_chain_reset(struct mp_filter *f)
{
struct chain *p = f->priv;
@ -341,17 +341,17 @@ void mp_output_chain_reset_harder(struct mp_output_chain *c)
}
}
static void destroy(struct mp_filter *f)
static void output_chain_destroy(struct mp_filter *f)
{
reset(f);
output_chain_reset(f);
}
static const struct mp_filter_info output_chain_filter = {
.name = "output_chain",
.priv_size = sizeof(struct chain),
.process = process,
.reset = reset,
.destroy = destroy,
.process = output_chain_process,
.reset = output_chain_reset,
.destroy = output_chain_destroy,
};
static double get_display_fps(struct mp_stream_info *i)
@ -736,7 +736,7 @@ struct mp_output_chain *mp_output_chain_create(struct mp_filter *parent,
relink_filter_list(p);
reset(f);
output_chain_reset(f);
return c;
}

View File

@ -327,7 +327,7 @@ error:
return false;
}
static void reset(struct mp_filter *f)
static void swresample_reset(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -473,7 +473,7 @@ error:
return MP_NO_FRAME;
}
static void process(struct mp_filter *f)
static void swresample_process(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -634,7 +634,7 @@ double mp_swresample_get_delay(struct mp_swresample *s)
return get_delay(p);
}
static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
static bool swresample_command(struct mp_filter *f, struct mp_filter_command *cmd)
{
struct priv *p = f->priv;
@ -646,7 +646,7 @@ static bool command(struct mp_filter *f, struct mp_filter_command *cmd)
return false;
}
static void destroy(struct mp_filter *f)
static void swresample_destroy(struct mp_filter *f)
{
struct priv *p = f->priv;
@ -657,10 +657,10 @@ static void destroy(struct mp_filter *f)
static const struct mp_filter_info swresample_filter = {
.name = "swresample",
.priv_size = sizeof(struct priv),
.process = process,
.command = command,
.reset = reset,
.destroy = destroy,
.process = swresample_process,
.command = swresample_command,
.reset = swresample_reset,
.destroy = swresample_destroy,
};
struct mp_swresample *mp_swresample_create(struct mp_filter *parent,

View File

@ -68,7 +68,7 @@ bool mp_sws_supports_input(int imgfmt)
return sws_isSupportedInput(imgfmt2pixfmt(imgfmt));
}
static void process(struct mp_filter *f)
static void sws_process(struct mp_filter *f)
{
struct mp_sws_filter *s = f->priv;
@ -130,7 +130,7 @@ error:
static const struct mp_filter_info sws_filter = {
.name = "swscale",
.priv_size = sizeof(struct mp_sws_filter),
.process = process,
.process = sws_process,
};
struct mp_sws_filter *mp_sws_filter_create(struct mp_filter *parent)

View File

@ -1369,14 +1369,14 @@ static int control(struct mp_filter *vd, enum dec_ctrl cmd, void *arg)
return CONTROL_UNKNOWN;
}
static void process(struct mp_filter *vd)
static void vd_lavc_process(struct mp_filter *vd)
{
vd_ffmpeg_ctx *ctx = vd->priv;
lavc_process(vd, &ctx->state, send_packet, receive_frame);
}
static void reset(struct mp_filter *vd)
static void vd_lavc_reset(struct mp_filter *vd)
{
vd_ffmpeg_ctx *ctx = vd->priv;
@ -1386,7 +1386,7 @@ static void reset(struct mp_filter *vd)
ctx->framedrop_flags = 0;
}
static void destroy(struct mp_filter *vd)
static void vd_lavc_destroy(struct mp_filter *vd)
{
vd_ffmpeg_ctx *ctx = vd->priv;
@ -1398,9 +1398,9 @@ static void destroy(struct mp_filter *vd)
static const struct mp_filter_info vd_lavc_filter = {
.name = "vd_lavc",
.priv_size = sizeof(vd_ffmpeg_ctx),
.process = process,
.reset = reset,
.destroy = destroy,
.process = vd_lavc_process,
.reset = vd_lavc_reset,
.destroy = vd_lavc_destroy,
};
static struct mp_decoder *create(struct mp_filter *parent,