lavfi/sendcmd: switch to an AVOptions-based system.
This commit is contained in:
parent
389eb0a919
commit
7eb1ea2ae6
@ -678,7 +678,6 @@ static const char *const filters_left_to_update[] = {
|
|||||||
"amerge",
|
"amerge",
|
||||||
"anullsrc",
|
"anullsrc",
|
||||||
"aresample",
|
"aresample",
|
||||||
"asendcmd",
|
|
||||||
"asetnsamples",
|
"asetnsamples",
|
||||||
"astreamsync",
|
"astreamsync",
|
||||||
"atempo",
|
"atempo",
|
||||||
@ -691,7 +690,6 @@ static const char *const filters_left_to_update[] = {
|
|||||||
"pan",
|
"pan",
|
||||||
"removelogo",
|
"removelogo",
|
||||||
"scale",
|
"scale",
|
||||||
"sendcmd",
|
|
||||||
"setdar",
|
"setdar",
|
||||||
"setsar",
|
"setsar",
|
||||||
};
|
};
|
||||||
|
@ -368,17 +368,11 @@ static int cmp_intervals(const void *a, const void *b)
|
|||||||
return ret == 0 ? i1->index - i2->index : ret;
|
return ret == 0 ? i1->index - i2->index : ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static av_cold int init(AVFilterContext *ctx, const char *args, const AVClass *class)
|
static av_cold int init(AVFilterContext *ctx)
|
||||||
{
|
{
|
||||||
SendCmdContext *sendcmd = ctx->priv;
|
SendCmdContext *sendcmd = ctx->priv;
|
||||||
int ret, i, j;
|
int ret, i, j;
|
||||||
|
|
||||||
sendcmd->class = class;
|
|
||||||
av_opt_set_defaults(sendcmd);
|
|
||||||
|
|
||||||
if ((ret = av_set_options_string(sendcmd, args, "=", ":")) < 0)
|
|
||||||
return ret;
|
|
||||||
|
|
||||||
if (sendcmd->commands_filename && sendcmd->commands_str) {
|
if (sendcmd->commands_filename && sendcmd->commands_str) {
|
||||||
av_log(ctx, AV_LOG_ERROR,
|
av_log(ctx, AV_LOG_ERROR,
|
||||||
"Only one of the filename or commands options must be specified\n");
|
"Only one of the filename or commands options must be specified\n");
|
||||||
@ -433,8 +427,6 @@ static void av_cold uninit(AVFilterContext *ctx)
|
|||||||
SendCmdContext *sendcmd = ctx->priv;
|
SendCmdContext *sendcmd = ctx->priv;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
av_opt_free(sendcmd);
|
|
||||||
|
|
||||||
for (i = 0; i < sendcmd->nb_intervals; i++) {
|
for (i = 0; i < sendcmd->nb_intervals; i++) {
|
||||||
Interval *interval = &sendcmd->intervals[i];
|
Interval *interval = &sendcmd->intervals[i];
|
||||||
for (j = 0; j < interval->nb_commands; j++) {
|
for (j = 0; j < interval->nb_commands; j++) {
|
||||||
@ -520,7 +512,7 @@ AVFILTER_DEFINE_CLASS(sendcmd);
|
|||||||
|
|
||||||
static av_cold int sendcmd_init(AVFilterContext *ctx, const char *args)
|
static av_cold int sendcmd_init(AVFilterContext *ctx, const char *args)
|
||||||
{
|
{
|
||||||
return init(ctx, args, &sendcmd_class);
|
return init(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const AVFilterPad sendcmd_inputs[] = {
|
static const AVFilterPad sendcmd_inputs[] = {
|
||||||
@ -562,7 +554,7 @@ AVFILTER_DEFINE_CLASS(asendcmd);
|
|||||||
|
|
||||||
static av_cold int asendcmd_init(AVFilterContext *ctx, const char *args)
|
static av_cold int asendcmd_init(AVFilterContext *ctx, const char *args)
|
||||||
{
|
{
|
||||||
return init(ctx, args, &asendcmd_class);
|
return init(ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const AVFilterPad asendcmd_inputs[] = {
|
static const AVFilterPad asendcmd_inputs[] = {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user