This allows the iteration callbacks to discover the internal class and options, and show them when required.tags/n1.0
| @@ -47,10 +47,11 @@ typedef struct AFormatContext { | |||||
| #define OFFSET(x) offsetof(AFormatContext, x) | #define OFFSET(x) offsetof(AFormatContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | #define A AV_OPT_FLAG_AUDIO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption aformat_options[] = { | static const AVOption aformat_options[] = { | ||||
| { "sample_fmts", "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| { "sample_rates", "A comma-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| { "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| { "sample_fmts", "A comma-separated list of sample formats.", OFFSET(formats_str), AV_OPT_TYPE_STRING, .flags = A|F }, | |||||
| { "sample_rates", "A comma-separated list of sample rates.", OFFSET(sample_rates_str), AV_OPT_TYPE_STRING, .flags = A|F }, | |||||
| { "channel_layouts", "A comma-separated list of channel layouts.", OFFSET(channel_layouts_str), AV_OPT_TYPE_STRING, .flags = A|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -138,4 +139,5 @@ AVFilter avfilter_af_aformat = { | |||||
| .outputs = (const AVFilterPad[]) {{ .name = "default", | .outputs = (const AVFilterPad[]) {{ .name = "default", | ||||
| .type = AVMEDIA_TYPE_AUDIO}, | .type = AVMEDIA_TYPE_AUDIO}, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &aformat_class, | |||||
| }; | }; | ||||
| @@ -46,10 +46,11 @@ typedef struct { | |||||
| } AMergeContext; | } AMergeContext; | ||||
| #define OFFSET(x) offsetof(AMergeContext, x) | #define OFFSET(x) offsetof(AMergeContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption amerge_options[] = { | static const AVOption amerge_options[] = { | ||||
| { "inputs", "specify the number of inputs", OFFSET(nb_inputs), | { "inputs", "specify the number of inputs", OFFSET(nb_inputs), | ||||
| AV_OPT_TYPE_INT, { .dbl = 2 }, 2, SWR_CH_MAX }, | |||||
| AV_OPT_TYPE_INT, { .dbl = 2 }, 2, SWR_CH_MAX, FLAGS }, | |||||
| {0} | {0} | ||||
| }; | }; | ||||
| @@ -334,4 +335,5 @@ AVFilter avfilter_af_amerge = { | |||||
| .request_frame = request_frame, }, | .request_frame = request_frame, }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &amerge_class, | |||||
| }; | }; | ||||
| @@ -174,17 +174,18 @@ typedef struct MixContext { | |||||
| #define OFFSET(x) offsetof(MixContext, x) | #define OFFSET(x) offsetof(MixContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | #define A AV_OPT_FLAG_AUDIO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption amix_options[] = { | static const AVOption amix_options[] = { | ||||
| { "inputs", "Number of inputs.", | { "inputs", "Number of inputs.", | ||||
| OFFSET(nb_inputs), AV_OPT_TYPE_INT, { 2 }, 1, 32, A }, | |||||
| OFFSET(nb_inputs), AV_OPT_TYPE_INT, { 2 }, 1, 32, A|F }, | |||||
| { "duration", "How to determine the end-of-stream.", | { "duration", "How to determine the end-of-stream.", | ||||
| OFFSET(duration_mode), AV_OPT_TYPE_INT, { DURATION_LONGEST }, 0, 2, A, "duration" }, | |||||
| { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, { DURATION_LONGEST }, INT_MIN, INT_MAX, A, "duration" }, | |||||
| { "shortest", "Duration of shortest input.", 0, AV_OPT_TYPE_CONST, { DURATION_SHORTEST }, INT_MIN, INT_MAX, A, "duration" }, | |||||
| { "first", "Duration of first input.", 0, AV_OPT_TYPE_CONST, { DURATION_FIRST }, INT_MIN, INT_MAX, A, "duration" }, | |||||
| OFFSET(duration_mode), AV_OPT_TYPE_INT, { DURATION_LONGEST }, 0, 2, A|F, "duration" }, | |||||
| { "longest", "Duration of longest input.", 0, AV_OPT_TYPE_CONST, { DURATION_LONGEST }, INT_MIN, INT_MAX, A|F, "duration" }, | |||||
| { "shortest", "Duration of shortest input.", 0, AV_OPT_TYPE_CONST, { DURATION_SHORTEST }, INT_MIN, INT_MAX, A|F, "duration" }, | |||||
| { "first", "Duration of first input.", 0, AV_OPT_TYPE_CONST, { DURATION_FIRST }, INT_MIN, INT_MAX, A|F, "duration" }, | |||||
| { "dropout_transition", "Transition time, in seconds, for volume " | { "dropout_transition", "Transition time, in seconds, for volume " | ||||
| "renormalization when an input stream ends.", | "renormalization when an input stream ends.", | ||||
| OFFSET(dropout_transition), AV_OPT_TYPE_FLOAT, { 2.0 }, 0, INT_MAX, A }, | |||||
| OFFSET(dropout_transition), AV_OPT_TYPE_FLOAT, { 2.0 }, 0, INT_MAX, A|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -554,4 +555,5 @@ AVFilter avfilter_af_amix = { | |||||
| .config_props = config_output, | .config_props = config_output, | ||||
| .request_frame = request_frame }, | .request_frame = request_frame }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &amix_class, | |||||
| }; | }; | ||||
| @@ -43,12 +43,13 @@ typedef struct { | |||||
| } ASNSContext; | } ASNSContext; | ||||
| #define OFFSET(x) offsetof(ASNSContext, x) | #define OFFSET(x) offsetof(ASNSContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption asetnsamples_options[] = { | static const AVOption asetnsamples_options[] = { | ||||
| { "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 }, | |||||
| { "p", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 }, | |||||
| { "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.dbl=1024}, 1, INT_MAX }, | |||||
| { "n", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.dbl=1024}, 1, INT_MAX }, | |||||
| { "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1, FLAGS }, | |||||
| { "p", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1, FLAGS }, | |||||
| { "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.dbl=1024}, 1, INT_MAX, FLAGS }, | |||||
| { "n", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.dbl=1024}, 1, INT_MAX, FLAGS }, | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| @@ -200,4 +201,5 @@ AVFilter avfilter_af_asetnsamples = { | |||||
| }, | }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &asetnsamples_class, | |||||
| }; | }; | ||||
| @@ -45,12 +45,13 @@ typedef struct ASyncContext { | |||||
| #define OFFSET(x) offsetof(ASyncContext, x) | #define OFFSET(x) offsetof(ASyncContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | #define A AV_OPT_FLAG_AUDIO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption asyncts_options[] = { | static const AVOption asyncts_options[] = { | ||||
| { "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_INT, { 0 }, 0, 1, A }, | |||||
| { "compensate", "Stretch/squeeze the data to make it match the timestamps", OFFSET(resample), AV_OPT_TYPE_INT, { 0 }, 0, 1, A|F }, | |||||
| { "min_delta", "Minimum difference between timestamps and audio data " | { "min_delta", "Minimum difference between timestamps and audio data " | ||||
| "(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { 0.1 }, 0, INT_MAX, A }, | |||||
| { "max_comp", "Maximum compensation in samples per second.", OFFSET(max_comp), AV_OPT_TYPE_INT, { 500 }, 0, INT_MAX, A }, | |||||
| { "first_pts", "Assume the first pts should be this value.", OFFSET(pts), AV_OPT_TYPE_INT64, { AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, A }, | |||||
| "(in seconds) to trigger padding/trimmin the data.", OFFSET(min_delta_sec), AV_OPT_TYPE_FLOAT, { 0.1 }, 0, INT_MAX, A|F }, | |||||
| { "max_comp", "Maximum compensation in samples per second.", OFFSET(max_comp), AV_OPT_TYPE_INT, { 500 }, 0, INT_MAX, A|F }, | |||||
| { "first_pts", "Assume the first pts should be this value.", OFFSET(pts), AV_OPT_TYPE_INT64, { AV_NOPTS_VALUE }, INT64_MIN, INT64_MAX, A|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -245,4 +246,5 @@ AVFilter avfilter_af_asyncts = { | |||||
| .config_props = config_props, | .config_props = config_props, | ||||
| .request_frame = request_frame }, | .request_frame = request_frame }, | ||||
| { NULL }}, | { NULL }}, | ||||
| .priv_size = &asyncts_class, | |||||
| }; | }; | ||||
| @@ -68,11 +68,12 @@ typedef struct ChannelMapContext { | |||||
| #define OFFSET(x) offsetof(ChannelMapContext, x) | #define OFFSET(x) offsetof(ChannelMapContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | #define A AV_OPT_FLAG_AUDIO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption options[] = { | static const AVOption options[] = { | ||||
| { "map", "A comma-separated list of input channel numbers in output order.", | { "map", "A comma-separated list of input channel numbers in output order.", | ||||
| OFFSET(mapping_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| OFFSET(mapping_str), AV_OPT_TYPE_STRING, .flags = A|F }, | |||||
| { "channel_layout", "Output channel layout.", | { "channel_layout", "Output channel layout.", | ||||
| OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -400,4 +401,5 @@ AVFilter avfilter_af_channelmap = { | |||||
| .outputs = (const AVFilterPad[]) {{ .name = "default", | .outputs = (const AVFilterPad[]) {{ .name = "default", | ||||
| .type = AVMEDIA_TYPE_AUDIO }, | .type = AVMEDIA_TYPE_AUDIO }, | ||||
| { .name = NULL }}, | { .name = NULL }}, | ||||
| .priv_class = &channelmap_class, | |||||
| }; | }; | ||||
| @@ -41,8 +41,9 @@ typedef struct ChannelSplitContext { | |||||
| #define OFFSET(x) offsetof(ChannelSplitContext, x) | #define OFFSET(x) offsetof(ChannelSplitContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | #define A AV_OPT_FLAG_AUDIO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption channelsplit_options[] = { | static const AVOption channelsplit_options[] = { | ||||
| { "channel_layout", "Input channel layout.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, { .str = "stereo" }, .flags = A }, | |||||
| { "channel_layout", "Input channel layout.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, { .str = "stereo" }, .flags = A|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -142,4 +143,5 @@ AVFilter avfilter_af_channelsplit = { | |||||
| .filter_samples = filter_samples, }, | .filter_samples = filter_samples, }, | ||||
| { NULL }}, | { NULL }}, | ||||
| .outputs = (const AVFilterPad[]){{ NULL }}, | .outputs = (const AVFilterPad[]){{ NULL }}, | ||||
| .priv_class = &channelsplit_class, | |||||
| }; | }; | ||||
| @@ -76,13 +76,14 @@ typedef struct JoinBufferPriv { | |||||
| #define OFFSET(x) offsetof(JoinContext, x) | #define OFFSET(x) offsetof(JoinContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | #define A AV_OPT_FLAG_AUDIO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption join_options[] = { | static const AVOption join_options[] = { | ||||
| { "inputs", "Number of input streams.", OFFSET(inputs), AV_OPT_TYPE_INT, { 2 }, 1, INT_MAX, A }, | |||||
| { "inputs", "Number of input streams.", OFFSET(inputs), AV_OPT_TYPE_INT, { 2 }, 1, INT_MAX, A|F }, | |||||
| { "channel_layout", "Channel layout of the " | { "channel_layout", "Channel layout of the " | ||||
| "output stream.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0, A }, | |||||
| "output stream.", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0, A|F }, | |||||
| { "map", "A comma-separated list of channels maps in the format " | { "map", "A comma-separated list of channels maps in the format " | ||||
| "'input_stream.input_channel-output_channel.", | "'input_stream.input_channel-output_channel.", | ||||
| OFFSET(map), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| OFFSET(map), AV_OPT_TYPE_STRING, .flags = A|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -499,4 +500,5 @@ AVFilter avfilter_af_join = { | |||||
| .config_props = join_config_output, | .config_props = join_config_output, | ||||
| .request_frame = join_request_frame, }, | .request_frame = join_request_frame, }, | ||||
| { NULL }}, | { NULL }}, | ||||
| .priv_class = &join_class, | |||||
| }; | }; | ||||
| @@ -42,11 +42,12 @@ typedef struct { | |||||
| } SilenceDetectContext; | } SilenceDetectContext; | ||||
| #define OFFSET(x) offsetof(SilenceDetectContext, x) | #define OFFSET(x) offsetof(SilenceDetectContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM | |||||
| static const AVOption silencedetect_options[] = { | static const AVOption silencedetect_options[] = { | ||||
| { "n", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "noise", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "d", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX}, | |||||
| { "duration", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX}, | |||||
| { "n", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "noise", "set noise tolerance", OFFSET(noise_str), AV_OPT_TYPE_STRING, {.str="-60dB"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "d", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX, FLAGS }, | |||||
| { "duration", "set minimum duration in seconds", OFFSET(duration), AV_OPT_TYPE_INT, {.dbl=2}, 0, INT_MAX, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -165,4 +166,5 @@ AVFilter avfilter_af_silencedetect = { | |||||
| .type = AVMEDIA_TYPE_AUDIO, }, | .type = AVMEDIA_TYPE_AUDIO, }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &silencedetect_class, | |||||
| }; | }; | ||||
| @@ -65,16 +65,17 @@ typedef struct { | |||||
| } EvalContext; | } EvalContext; | ||||
| #define OFFSET(x) offsetof(EvalContext, x) | #define OFFSET(x) offsetof(EvalContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption aevalsrc_options[]= { | static const AVOption aevalsrc_options[]= { | ||||
| { "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX }, | |||||
| { "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX }, | |||||
| { "sample_rate", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "s", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "duration", "set audio duration", OFFSET(duration_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "d", "set audio duration", OFFSET(duration_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "channel_layout", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "c", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX, FLAGS }, | |||||
| { "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX, FLAGS }, | |||||
| { "sample_rate", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "s", "set the sample rate", OFFSET(sample_rate_str), AV_OPT_TYPE_STRING, {.str = "44100"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "duration", "set audio duration", OFFSET(duration_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "d", "set audio duration", OFFSET(duration_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "channel_layout", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "c", "set channel layout", OFFSET(chlayout_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -251,4 +252,5 @@ AVFilter avfilter_asrc_aevalsrc = { | |||||
| .config_props = config_props, | .config_props = config_props, | ||||
| .request_frame = request_frame, }, | .request_frame = request_frame, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &aevalsrc_class, | |||||
| }; | }; | ||||
| @@ -46,14 +46,15 @@ typedef struct { | |||||
| } ANullContext; | } ANullContext; | ||||
| #define OFFSET(x) offsetof(ANullContext, x) | #define OFFSET(x) offsetof(ANullContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption anullsrc_options[]= { | static const AVOption anullsrc_options[]= { | ||||
| { "channel_layout", "set channel_layout", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0 }, | |||||
| { "cl", "set channel_layout", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0 }, | |||||
| { "sample_rate", "set sample rate", OFFSET(sample_rate_str) , AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0 }, | |||||
| { "r", "set sample rate", OFFSET(sample_rate_str) , AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0 }, | |||||
| { "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX }, | |||||
| { "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX }, | |||||
| { "channel_layout", "set channel_layout", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0, FLAGS }, | |||||
| { "cl", "set channel_layout", OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, {.str = "stereo"}, 0, 0, FLAGS }, | |||||
| { "sample_rate", "set sample rate", OFFSET(sample_rate_str) , AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0, FLAGS }, | |||||
| { "r", "set sample rate", OFFSET(sample_rate_str) , AV_OPT_TYPE_STRING, {.str = "44100"}, 0, 0, FLAGS }, | |||||
| { "nb_samples", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX, FLAGS }, | |||||
| { "n", "set the number of samples per requested frame", OFFSET(nb_samples), AV_OPT_TYPE_INT, {.dbl = 1024}, 0, INT_MAX, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -132,4 +133,5 @@ AVFilter avfilter_asrc_anullsrc = { | |||||
| .config_props = config_props, | .config_props = config_props, | ||||
| .request_frame = request_frame, }, | .request_frame = request_frame, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &anullsrc_class, | |||||
| }; | }; | ||||
| @@ -48,15 +48,16 @@ typedef struct { | |||||
| } FliteContext; | } FliteContext; | ||||
| #define OFFSET(x) offsetof(FliteContext, x) | #define OFFSET(x) offsetof(FliteContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption flite_options[] = { | static const AVOption flite_options[] = { | ||||
| { "list_voices", "list voices and exit", OFFSET(list_voices), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 }, | |||||
| { "nb_samples", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.dbl=512}, 0, INT_MAX }, | |||||
| { "n", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.dbl=512}, 0, INT_MAX }, | |||||
| { "text", "set text to speak", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| { "textfile", "set filename of the text to speak", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| { "v", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "voice", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "list_voices", "list voices and exit", OFFSET(list_voices), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, FLAGS }, | |||||
| { "nb_samples", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.dbl=512}, 0, INT_MAX, FLAGS }, | |||||
| { "n", "set number of samples per frame", OFFSET(frame_nb_samples), AV_OPT_TYPE_INT, {.dbl=512}, 0, INT_MAX, FLAGS }, | |||||
| { "text", "set text to speak", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "textfile", "set filename of the text to speak", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "v", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "voice", "set voice", OFFSET(voice_str), AV_OPT_TYPE_STRING, {.str="kal"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| @@ -286,4 +287,6 @@ AVFilter avfilter_asrc_flite = { | |||||
| }, | }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &flite_class, | |||||
| }; | }; | ||||
| @@ -51,16 +51,19 @@ typedef struct { | |||||
| } ConcatContext; | } ConcatContext; | ||||
| #define OFFSET(x) offsetof(ConcatContext, x) | #define OFFSET(x) offsetof(ConcatContext, x) | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | |||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| #define V AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption concat_options[] = { | static const AVOption concat_options[] = { | ||||
| { "n", "specify the number of segments", OFFSET(nb_segments), | { "n", "specify the number of segments", OFFSET(nb_segments), | ||||
| AV_OPT_TYPE_INT, { .dbl = 2 }, 2, INT_MAX }, | |||||
| AV_OPT_TYPE_INT, { .dbl = 2 }, 2, INT_MAX, V|A|F}, | |||||
| { "v", "specify the number of video streams", | { "v", "specify the number of video streams", | ||||
| OFFSET(nb_streams[AVMEDIA_TYPE_VIDEO]), | OFFSET(nb_streams[AVMEDIA_TYPE_VIDEO]), | ||||
| AV_OPT_TYPE_INT, { .dbl = 1 }, 0, INT_MAX }, | |||||
| AV_OPT_TYPE_INT, { .dbl = 1 }, 0, INT_MAX, V|F }, | |||||
| { "a", "specify the number of audio streams", | { "a", "specify the number of audio streams", | ||||
| OFFSET(nb_streams[AVMEDIA_TYPE_AUDIO]), | OFFSET(nb_streams[AVMEDIA_TYPE_AUDIO]), | ||||
| AV_OPT_TYPE_INT, { .dbl = 0 }, 0, INT_MAX }, | |||||
| AV_OPT_TYPE_INT, { .dbl = 0 }, 0, INT_MAX, A|F}, | |||||
| { 0 } | { 0 } | ||||
| }; | }; | ||||
| @@ -439,4 +442,5 @@ AVFilter avfilter_avf_concat = { | |||||
| .priv_size = sizeof(ConcatContext), | .priv_size = sizeof(ConcatContext), | ||||
| .inputs = (const AVFilterPad[]) { { .name = NULL } }, | .inputs = (const AVFilterPad[]) { { .name = NULL } }, | ||||
| .outputs = (const AVFilterPad[]) { { .name = NULL } }, | .outputs = (const AVFilterPad[]) { { .name = NULL } }, | ||||
| .priv_class = &concat_class, | |||||
| }; | }; | ||||
| @@ -45,13 +45,14 @@ typedef struct { | |||||
| } ShowWavesContext; | } ShowWavesContext; | ||||
| #define OFFSET(x) offsetof(ShowWavesContext, x) | #define OFFSET(x) offsetof(ShowWavesContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption showwaves_options[] = { | static const AVOption showwaves_options[] = { | ||||
| { "rate", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "r", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "600x240"}, 0, 0 }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "600x240"}, 0, 0 }, | |||||
| { "n", "set how many samples to show in the same point", OFFSET(n), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX}, | |||||
| { "rate", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "r", "set video rate", OFFSET(rate_str), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "600x240"}, 0, 0, FLAGS }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "600x240"}, 0, 0, FLAGS }, | |||||
| { "n", "set how many samples to show in the same point", OFFSET(n), AV_OPT_TYPE_INT, {.dbl = 0}, 0, INT_MAX, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -252,4 +253,6 @@ AVFilter avfilter_avf_showwaves = { | |||||
| }, | }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &showwaves_class, | |||||
| }; | }; | ||||
| @@ -164,17 +164,17 @@ unsigned av_buffersrc_get_nb_failed_requests(AVFilterContext *buffer_src) | |||||
| } | } | ||||
| #define OFFSET(x) offsetof(BufferSourceContext, x) | #define OFFSET(x) offsetof(BufferSourceContext, x) | ||||
| #define V AV_OPT_FLAG_VIDEO_PARAM | |||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption buffer_options[] = { | static const AVOption buffer_options[] = { | ||||
| { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V }, | |||||
| { "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V }, | |||||
| { "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = V }, | |||||
| { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, .flags = V }, | |||||
| { "pixel_aspect", NULL, OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, V }, | |||||
| { "sws_param", NULL, OFFSET(sws_param), AV_OPT_TYPE_STRING, .flags = V }, | |||||
| { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "frame_rate", NULL, OFFSET(frame_rate), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "video_size", NULL, OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, .flags = FLAGS }, | |||||
| { "pix_fmt", NULL, OFFSET(pix_fmt), AV_OPT_TYPE_PIXEL_FMT, .flags = FLAGS }, | |||||
| { "pixel_aspect", NULL, OFFSET(pixel_aspect), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "sws_param", NULL, OFFSET(sws_param), AV_OPT_TYPE_STRING, .flags = FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| #undef V | |||||
| #undef FLAGS | |||||
| AVFILTER_DEFINE_CLASS(buffer); | AVFILTER_DEFINE_CLASS(buffer); | ||||
| @@ -233,12 +233,12 @@ fail: | |||||
| return ret; | return ret; | ||||
| } | } | ||||
| #define A AV_OPT_FLAG_AUDIO_PARAM | |||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_AUDIO_PARAM | |||||
| static const AVOption abuffer_options[] = { | static const AVOption abuffer_options[] = { | ||||
| { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, A }, | |||||
| { "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, A }, | |||||
| { "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| { "channel_layout", NULL, OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = A }, | |||||
| { "time_base", NULL, OFFSET(time_base), AV_OPT_TYPE_RATIONAL, { 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "sample_rate", NULL, OFFSET(sample_rate), AV_OPT_TYPE_INT, { 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "sample_fmt", NULL, OFFSET(sample_fmt_str), AV_OPT_TYPE_STRING, .flags = FLAGS }, | |||||
| { "channel_layout", NULL, OFFSET(channel_layout_str), AV_OPT_TYPE_STRING, .flags = FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -412,6 +412,7 @@ AVFilter avfilter_vsrc_buffer = { | |||||
| .poll_frame = poll_frame, | .poll_frame = poll_frame, | ||||
| .config_props = config_props, }, | .config_props = config_props, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &buffer_class, | |||||
| }; | }; | ||||
| AVFilter avfilter_asrc_abuffer = { | AVFilter avfilter_asrc_abuffer = { | ||||
| @@ -430,4 +431,5 @@ AVFilter avfilter_asrc_abuffer = { | |||||
| .poll_frame = poll_frame, | .poll_frame = poll_frame, | ||||
| .config_props = config_props, }, | .config_props = config_props, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &abuffer_class, | |||||
| }; | }; | ||||
| @@ -70,17 +70,18 @@ typedef struct { | |||||
| } MovieContext; | } MovieContext; | ||||
| #define OFFSET(x) offsetof(MovieContext, x) | #define OFFSET(x) offsetof(MovieContext, x) | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption movie_options[]= { | static const AVOption movie_options[]= { | ||||
| {"format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX }, | |||||
| {"f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX }, | |||||
| {"streams", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX }, | |||||
| {"s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX }, | |||||
| {"si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX }, | |||||
| {"stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX }, | |||||
| {"seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000 }, | |||||
| {"sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000 }, | |||||
| {"loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.dbl = 1}, 0, INT_MAX }, | |||||
| {"format_name", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX, F }, | |||||
| {"f", "set format name", OFFSET(format_name), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MIN, CHAR_MAX, F }, | |||||
| {"streams", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, F }, | |||||
| {"s", "set streams", OFFSET(stream_specs), AV_OPT_TYPE_STRING, {.str = 0}, CHAR_MAX, CHAR_MAX, F }, | |||||
| {"si", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX, F }, | |||||
| {"stream_index", "set stream index", OFFSET(stream_index), AV_OPT_TYPE_INT, {.dbl = -1}, -1, INT_MAX, F }, | |||||
| {"seek_point", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000, F }, | |||||
| {"sp", "set seekpoint (seconds)", OFFSET(seek_point_d), AV_OPT_TYPE_DOUBLE, {.dbl = 0}, 0, (INT64_MAX-1) / 1000000, F }, | |||||
| {"loop", "set loop count", OFFSET(loop_count), AV_OPT_TYPE_INT, {.dbl = 1}, 0, INT_MAX, F }, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -612,6 +613,7 @@ AVFilter avfilter_avsrc_movie = { | |||||
| .inputs = (const AVFilterPad[]) {{ .name = NULL }}, | .inputs = (const AVFilterPad[]) {{ .name = NULL }}, | ||||
| .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | ||||
| .priv_class = &movie_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_MOVIE_FILTER */ | #endif /* CONFIG_MOVIE_FILTER */ | ||||
| @@ -636,6 +638,7 @@ AVFilter avfilter_avsrc_amovie = { | |||||
| .inputs = (const AVFilterPad[]) {{ .name = NULL }}, | .inputs = (const AVFilterPad[]) {{ .name = NULL }}, | ||||
| .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | .outputs = (const AVFilterPad[]) {{ .name = NULL }}, | ||||
| .priv_class = &amovie_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_AMOVIE_FILTER */ | #endif /* CONFIG_AMOVIE_FILTER */ | ||||
| @@ -51,9 +51,10 @@ typedef struct { | |||||
| } AssContext; | } AssContext; | ||||
| #define OFFSET(x) offsetof(AssContext, x) | #define OFFSET(x) offsetof(AssContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption ass_options[] = { | static const AVOption ass_options[] = { | ||||
| {"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| {"original_size", "set the size of the original video (used to scale fonts)", OFFSET(original_w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -222,4 +223,5 @@ AVFilter avfilter_vf_ass = { | |||||
| .type = AVMEDIA_TYPE_VIDEO, }, | .type = AVMEDIA_TYPE_VIDEO, }, | ||||
| { .name = NULL} | { .name = NULL} | ||||
| }, | }, | ||||
| .priv_class = &ass_class, | |||||
| }; | }; | ||||
| @@ -48,13 +48,15 @@ typedef struct { | |||||
| } BlackDetectContext; | } BlackDetectContext; | ||||
| #define OFFSET(x) offsetof(BlackDetectContext, x) | #define OFFSET(x) offsetof(BlackDetectContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption blackdetect_options[] = { | static const AVOption blackdetect_options[] = { | ||||
| { "d", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX}, | |||||
| { "black_min_duration", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX}, | |||||
| { "picture_black_ratio_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1}, | |||||
| { "pic_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1}, | |||||
| { "pixel_black_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1}, | |||||
| { "pix_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1}, | |||||
| { "d", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX, FLAGS }, | |||||
| { "black_min_duration", "set minimum detected black duration in seconds", OFFSET(black_min_duration_time), AV_OPT_TYPE_DOUBLE, {.dbl=2}, 0, DBL_MAX, FLAGS }, | |||||
| { "picture_black_ratio_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1, FLAGS }, | |||||
| { "pic_th", "set the picture black ratio threshold", OFFSET(picture_black_ratio_th), AV_OPT_TYPE_DOUBLE, {.dbl=.98}, 0, 1, FLAGS }, | |||||
| { "pixel_black_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1, FLAGS }, | |||||
| { "pix_th", "set the pixel black threshold", OFFSET(pixel_black_th), AV_OPT_TYPE_DOUBLE, {.dbl=.10}, 0, 1, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -219,4 +221,5 @@ AVFilter avfilter_vf_blackdetect = { | |||||
| .request_frame = request_frame, }, | .request_frame = request_frame, }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &blackdetect_class, | |||||
| }; | }; | ||||
| @@ -140,15 +140,16 @@ typedef struct { | |||||
| } DelogoContext; | } DelogoContext; | ||||
| #define OFFSET(x) offsetof(DelogoContext, x) | #define OFFSET(x) offsetof(DelogoContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption delogo_options[]= { | static const AVOption delogo_options[]= { | ||||
| {"x", "set logo x position", OFFSET(x), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX }, | |||||
| {"y", "set logo y position", OFFSET(y), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX }, | |||||
| {"w", "set logo width", OFFSET(w), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX }, | |||||
| {"h", "set logo height", OFFSET(h), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX }, | |||||
| {"band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.dbl= 4}, -1, INT_MAX }, | |||||
| {"t", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.dbl= 4}, -1, INT_MAX }, | |||||
| {"show", "show delogo area", OFFSET(show), AV_OPT_TYPE_INT, {.dbl= 0}, 0, 1 }, | |||||
| {"x", "set logo x position", OFFSET(x), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX, FLAGS}, | |||||
| {"y", "set logo y position", OFFSET(y), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX, FLAGS}, | |||||
| {"w", "set logo width", OFFSET(w), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX, FLAGS}, | |||||
| {"h", "set logo height", OFFSET(h), AV_OPT_TYPE_INT, {.dbl=-1}, -1, INT_MAX, FLAGS}, | |||||
| {"band", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.dbl= 4}, -1, INT_MAX, FLAGS}, | |||||
| {"t", "set delogo area band size", OFFSET(band), AV_OPT_TYPE_INT, {.dbl= 4}, -1, INT_MAX, FLAGS}, | |||||
| {"show", "show delogo area", OFFSET(show), AV_OPT_TYPE_INT, {.dbl= 0}, 0, 1, FLAGS}, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -163,48 +163,48 @@ typedef struct { | |||||
| } DrawTextContext; | } DrawTextContext; | ||||
| #define OFFSET(x) offsetof(DrawTextContext, x) | #define OFFSET(x) offsetof(DrawTextContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption drawtext_options[]= { | static const AVOption drawtext_options[]= { | ||||
| {"fontfile", "set font file", OFFSET(fontfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| {"text", "set text", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| {"textfile", "set text file", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| {"fontcolor", "set foreground color", OFFSET(fontcolor_string), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"boxcolor", "set box color", OFFSET(boxcolor_string), AV_OPT_TYPE_STRING, {.str="white"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"shadowcolor", "set shadow color", OFFSET(shadowcolor_string), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"box", "set box", OFFSET(draw_box), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 }, | |||||
| {"fontsize", "set font size", OFFSET(fontsize), AV_OPT_TYPE_INT, {.dbl=0}, 0, INT_MAX }, | |||||
| {"x", "set x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"y", "set y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"shadowx", "set x", OFFSET(shadowx), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX }, | |||||
| {"shadowy", "set y", OFFSET(shadowy), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX }, | |||||
| {"tabsize", "set tab size", OFFSET(tabsize), AV_OPT_TYPE_INT, {.dbl=4}, 0, INT_MAX }, | |||||
| {"basetime", "set base time", OFFSET(basetime), AV_OPT_TYPE_INT64, {.dbl=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX }, | |||||
| {"draw", "if false do not draw", OFFSET(draw_expr), AV_OPT_TYPE_STRING, {.str="1"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"timecode", "set initial timecode", OFFSET(tc_opt_string), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| {"tc24hmax", "set 24 hours max (timecode only)", OFFSET(tc24hmax), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 }, | |||||
| {"timecode_rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX }, | |||||
| {"r", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX }, | |||||
| {"rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX }, | |||||
| {"fix_bounds", "if true, check and fix text coords to avoid clipping", | |||||
| OFFSET(fix_bounds), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 }, | |||||
| {"fontfile", "set font file", OFFSET(fontfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"text", "set text", OFFSET(text), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"textfile", "set text file", OFFSET(textfile), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"fontcolor", "set foreground color", OFFSET(fontcolor_string), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"boxcolor", "set box color", OFFSET(boxcolor_string), AV_OPT_TYPE_STRING, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"shadowcolor", "set shadow color", OFFSET(shadowcolor_string), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"box", "set box", OFFSET(draw_box), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 , FLAGS}, | |||||
| {"fontsize", "set font size", OFFSET(fontsize), AV_OPT_TYPE_INT, {.dbl=0}, 0, INT_MAX , FLAGS}, | |||||
| {"x", "set x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"y", "set y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str="0"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"shadowx", "set x", OFFSET(shadowx), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX , FLAGS}, | |||||
| {"shadowy", "set y", OFFSET(shadowy), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX , FLAGS}, | |||||
| {"tabsize", "set tab size", OFFSET(tabsize), AV_OPT_TYPE_INT, {.dbl=4}, 0, INT_MAX , FLAGS}, | |||||
| {"basetime", "set base time", OFFSET(basetime), AV_OPT_TYPE_INT64, {.dbl=AV_NOPTS_VALUE}, INT64_MIN, INT64_MAX , FLAGS}, | |||||
| {"draw", "if false do not draw", OFFSET(draw_expr), AV_OPT_TYPE_STRING, {.str="1"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"timecode", "set initial timecode", OFFSET(tc_opt_string), AV_OPT_TYPE_STRING, {.str=NULL}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"tc24hmax", "set 24 hours max (timecode only)", OFFSET(tc24hmax), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, FLAGS}, | |||||
| {"timecode_rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS}, | |||||
| {"r", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS}, | |||||
| {"rate", "set rate (timecode only)", OFFSET(tc_rate), AV_OPT_TYPE_RATIONAL, {.dbl=0}, 0, INT_MAX, FLAGS}, | |||||
| {"fix_bounds", "if true, check and fix text coords to avoid clipping", OFFSET(fix_bounds), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1, FLAGS}, | |||||
| /* FT_LOAD_* flags */ | /* FT_LOAD_* flags */ | ||||
| {"ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, {.dbl=FT_LOAD_DEFAULT|FT_LOAD_RENDER}, 0, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"default", "set default", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_DEFAULT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"no_scale", "set no_scale", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_SCALE}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"no_hinting", "set no_hinting", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_HINTING}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"render", "set render", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_RENDER}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"no_bitmap", "set no_bitmap", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_BITMAP}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"vertical_layout", "set vertical_layout", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_VERTICAL_LAYOUT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"force_autohint", "set force_autohint", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_FORCE_AUTOHINT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"crop_bitmap", "set crop_bitmap", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_CROP_BITMAP}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"pedantic", "set pedantic", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_PEDANTIC}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"ignore_global_advance_width", "set ignore_global_advance_width", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"no_recurse", "set no_recurse", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_RECURSE}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"ignore_transform", "set ignore_transform", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_TRANSFORM}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"monochrome", "set monochrome", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_MONOCHROME}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"linear_design", "set linear_design", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_LINEAR_DESIGN}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"no_autohint", "set no_autohint", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_AUTOHINT}, INT_MIN, INT_MAX, 0, "ft_load_flags" }, | |||||
| {"ft_load_flags", "set font loading flags for libfreetype", OFFSET(ft_load_flags), AV_OPT_TYPE_FLAGS, {.dbl=FT_LOAD_DEFAULT|FT_LOAD_RENDER}, 0, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"default", "set default", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_DEFAULT}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"no_scale", "set no_scale", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_SCALE}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"no_hinting", "set no_hinting", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_HINTING}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"render", "set render", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_RENDER}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"no_bitmap", "set no_bitmap", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_BITMAP}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"vertical_layout", "set vertical_layout", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_VERTICAL_LAYOUT}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"force_autohint", "set force_autohint", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_FORCE_AUTOHINT}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"crop_bitmap", "set crop_bitmap", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_CROP_BITMAP}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"pedantic", "set pedantic", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_PEDANTIC}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"ignore_global_advance_width", "set ignore_global_advance_width", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"no_recurse", "set no_recurse", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_RECURSE}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"ignore_transform", "set ignore_transform", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_IGNORE_TRANSFORM}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"monochrome", "set monochrome", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_MONOCHROME}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"linear_design", "set linear_design", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_LINEAR_DESIGN}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {"no_autohint", "set no_autohint", 0, AV_OPT_TYPE_CONST, {.dbl=FT_LOAD_NO_AUTOHINT}, INT_MIN, INT_MAX, FLAGS, "ft_load_flags"}, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -832,4 +832,5 @@ AVFilter avfilter_vf_drawtext = { | |||||
| .type = AVMEDIA_TYPE_VIDEO, }, | .type = AVMEDIA_TYPE_VIDEO, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .process_command = command, | .process_command = command, | ||||
| .priv_class = &drawtext_class, | |||||
| }; | }; | ||||
| @@ -41,9 +41,10 @@ typedef struct { | |||||
| } EdgeDetectContext; | } EdgeDetectContext; | ||||
| #define OFFSET(x) offsetof(EdgeDetectContext, x) | #define OFFSET(x) offsetof(EdgeDetectContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption edgedetect_options[] = { | static const AVOption edgedetect_options[] = { | ||||
| { "high", "set high threshold", OFFSET(high), AV_OPT_TYPE_DOUBLE, {.dbl=50/255.}, 0, 1 }, | |||||
| { "low", "set low threshold", OFFSET(low), AV_OPT_TYPE_DOUBLE, {.dbl=20/255.}, 0, 1 }, | |||||
| { "high", "set high threshold", OFFSET(high), AV_OPT_TYPE_DOUBLE, {.dbl=50/255.}, 0, 1, FLAGS }, | |||||
| { "low", "set low threshold", OFFSET(low), AV_OPT_TYPE_DOUBLE, {.dbl=20/255.}, 0, 1, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -60,15 +60,16 @@ typedef struct { | |||||
| } FadeContext; | } FadeContext; | ||||
| #define OFFSET(x) offsetof(FadeContext, x) | #define OFFSET(x) offsetof(FadeContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption fade_options[] = { | static const AVOption fade_options[] = { | ||||
| { "type", "set the fade direction", OFFSET(type), AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX }, | |||||
| { "t", "set the fade direction", OFFSET(type), AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX }, | |||||
| { "start_frame", "set expression of frame to start fading", OFFSET(start_frame), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX }, | |||||
| { "s", "set expression of frame to start fading", OFFSET(start_frame), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX }, | |||||
| { "nb_frames", "set expression for fade duration in frames", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.dbl = 25 }, 0, INT_MAX }, | |||||
| { "n", "set expression for fade duration in frames", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.dbl = 25 }, 0, INT_MAX }, | |||||
| { "alpha", "fade alpha if it is available on the input", OFFSET(alpha), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, 1 }, | |||||
| { "type", "set the fade direction", OFFSET(type), AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "t", "set the fade direction", OFFSET(type), AV_OPT_TYPE_STRING, {.str = "in" }, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "start_frame", "set expression of frame to start fading", OFFSET(start_frame), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "s", "set expression of frame to start fading", OFFSET(start_frame), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, INT_MAX, FLAGS }, | |||||
| { "nb_frames", "set expression for fade duration in frames", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.dbl = 25 }, 0, INT_MAX, FLAGS }, | |||||
| { "n", "set expression for fade duration in frames", OFFSET(nb_frames), AV_OPT_TYPE_INT, {.dbl = 25 }, 0, INT_MAX, FLAGS }, | |||||
| { "alpha", "fade alpha if it is available on the input", OFFSET(alpha), AV_OPT_TYPE_INT, {.dbl = 0 }, 0, 1, FLAGS }, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -295,4 +296,5 @@ AVFilter avfilter_vf_fade = { | |||||
| .outputs = (const AVFilterPad[]) {{ .name = "default", | .outputs = (const AVFilterPad[]) {{ .name = "default", | ||||
| .type = AVMEDIA_TYPE_VIDEO, }, | .type = AVMEDIA_TYPE_VIDEO, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &fade_class, | |||||
| }; | }; | ||||
| @@ -56,8 +56,9 @@ typedef struct FPSContext { | |||||
| #define OFFSET(x) offsetof(FPSContext, x) | #define OFFSET(x) offsetof(FPSContext, x) | ||||
| #define V AV_OPT_FLAG_VIDEO_PARAM | #define V AV_OPT_FLAG_VIDEO_PARAM | ||||
| #define F AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption fps_options[] = { | static const AVOption fps_options[] = { | ||||
| { "fps", "A string describing desired output framerate", OFFSET(fps), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = V }, | |||||
| { "fps", "A string describing desired output framerate", OFFSET(fps), AV_OPT_TYPE_STRING, { .str = "25" }, .flags = V|F }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -300,4 +301,5 @@ AVFilter avfilter_vf_fps = { | |||||
| .request_frame = request_frame, | .request_frame = request_frame, | ||||
| .config_props = config_props}, | .config_props = config_props}, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &fps_class, | |||||
| }; | }; | ||||
| @@ -50,13 +50,14 @@ typedef struct { | |||||
| } HueContext; | } HueContext; | ||||
| #define OFFSET(x) offsetof(HueContext, x) | #define OFFSET(x) offsetof(HueContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption hue_options[] = { | static const AVOption hue_options[] = { | ||||
| { "h", "set the hue angle degrees", OFFSET(hue_deg), AV_OPT_TYPE_FLOAT, | { "h", "set the hue angle degrees", OFFSET(hue_deg), AV_OPT_TYPE_FLOAT, | ||||
| { -FLT_MAX }, -FLT_MAX, FLT_MAX, AV_OPT_FLAG_VIDEO_PARAM }, | |||||
| { -FLT_MAX }, -FLT_MAX, FLT_MAX, FLAGS }, | |||||
| { "H", "set the hue angle radians", OFFSET(hue), AV_OPT_TYPE_FLOAT, | { "H", "set the hue angle radians", OFFSET(hue), AV_OPT_TYPE_FLOAT, | ||||
| { -FLT_MAX }, -FLT_MAX, FLT_MAX, AV_OPT_FLAG_VIDEO_PARAM }, | |||||
| { -FLT_MAX }, -FLT_MAX, FLT_MAX, FLAGS }, | |||||
| { "s", "set the saturation value", OFFSET(saturation), AV_OPT_TYPE_FLOAT, | { "s", "set the saturation value", OFFSET(saturation), AV_OPT_TYPE_FLOAT, | ||||
| { SAT_DEFAULT_VAL }, -10, 10, AV_OPT_FLAG_VIDEO_PARAM }, | |||||
| { SAT_DEFAULT_VAL }, -10, 10, FLAGS }, | |||||
| { NULL } | { NULL } | ||||
| }; | }; | ||||
| @@ -248,5 +249,6 @@ AVFilter avfilter_vf_hue = { | |||||
| .type = AVMEDIA_TYPE_VIDEO, | .type = AVMEDIA_TYPE_VIDEO, | ||||
| }, | }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| } | |||||
| }, | |||||
| .priv_class = &hue_class, | |||||
| }; | }; | ||||
| @@ -76,19 +76,20 @@ typedef struct { | |||||
| #define A 3 | #define A 3 | ||||
| #define OFFSET(x) offsetof(LutContext, x) | #define OFFSET(x) offsetof(LutContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption options[] = { | static const AVOption options[] = { | ||||
| {"c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"y", "set Y expression", OFFSET(comp_expr_str[Y]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"u", "set U expression", OFFSET(comp_expr_str[U]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"v", "set V expression", OFFSET(comp_expr_str[V]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"r", "set R expression", OFFSET(comp_expr_str[R]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"g", "set G expression", OFFSET(comp_expr_str[G]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"b", "set B expression", OFFSET(comp_expr_str[B]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"a", "set A expression", OFFSET(comp_expr_str[A]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX}, | |||||
| {"c0", "set component #0 expression", OFFSET(comp_expr_str[0]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"c1", "set component #1 expression", OFFSET(comp_expr_str[1]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"c2", "set component #2 expression", OFFSET(comp_expr_str[2]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"c3", "set component #3 expression", OFFSET(comp_expr_str[3]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"y", "set Y expression", OFFSET(comp_expr_str[Y]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"u", "set U expression", OFFSET(comp_expr_str[U]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"v", "set V expression", OFFSET(comp_expr_str[V]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"r", "set R expression", OFFSET(comp_expr_str[R]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"g", "set G expression", OFFSET(comp_expr_str[G]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"b", "set B expression", OFFSET(comp_expr_str[B]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {"a", "set A expression", OFFSET(comp_expr_str[A]), AV_OPT_TYPE_STRING, {.str="val"}, CHAR_MIN, CHAR_MAX, FLAGS}, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -96,11 +96,12 @@ typedef struct { | |||||
| } OverlayContext; | } OverlayContext; | ||||
| #define OFFSET(x) offsetof(OverlayContext, x) | #define OFFSET(x) offsetof(OverlayContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption overlay_options[] = { | static const AVOption overlay_options[] = { | ||||
| { "x", "set the x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "y", "set the y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"rgb", "force packed RGB in input and output", OFFSET(allow_packed_rgb), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1 }, | |||||
| { "x", "set the x expression", OFFSET(x_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "y", "set the y expression", OFFSET(y_expr), AV_OPT_TYPE_STRING, {.str = "0"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| {"rgb", "force packed RGB in input and output", OFFSET(allow_packed_rgb), AV_OPT_TYPE_INT, {.dbl=0}, 0, 1, FLAGS }, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -637,4 +638,5 @@ AVFilter avfilter_vf_overlay = { | |||||
| .config_props = config_output, | .config_props = config_output, | ||||
| .request_frame = request_frame, }, | .request_frame = request_frame, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &overlay_class, | |||||
| }; | }; | ||||
| @@ -57,25 +57,26 @@ typedef struct { | |||||
| } CellAutoContext; | } CellAutoContext; | ||||
| #define OFFSET(x) offsetof(CellAutoContext, x) | #define OFFSET(x) offsetof(CellAutoContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_FILTERING_PARAM|AV_OPT_FLAG_VIDEO_PARAM | |||||
| static const AVOption cellauto_options[] = { | static const AVOption cellauto_options[] = { | ||||
| { "filename", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "f", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "pattern", "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "p", "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | |||||
| { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0 }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0 }, | |||||
| { "rule", "set rule", OFFSET(rule), AV_OPT_TYPE_INT, {.dbl = 110}, 0, 255 }, | |||||
| { "random_fill_ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1 }, | |||||
| { "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1 }, | |||||
| { "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl = -1}, -1, UINT32_MAX }, | |||||
| { "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl = -1}, -1, UINT32_MAX }, | |||||
| { "scroll", "scroll pattern downward", OFFSET(scroll), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1 }, | |||||
| { "start_full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1 }, | |||||
| { "full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1 }, | |||||
| { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1 }, | |||||
| { "filename", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "f", "read initial pattern from file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "pattern", "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "p", "set initial pattern", OFFSET(pattern), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, | |||||
| { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "rule", "set rule", OFFSET(rule), AV_OPT_TYPE_INT, {.dbl = 110}, 0, 255, FLAGS }, | |||||
| { "random_fill_ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1, FLAGS }, | |||||
| { "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl = 1/M_PHI}, 0, 1, FLAGS }, | |||||
| { "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl = -1}, -1, UINT32_MAX, FLAGS }, | |||||
| { "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl = -1}, -1, UINT32_MAX, FLAGS }, | |||||
| { "scroll", "scroll pattern downward", OFFSET(scroll), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1, FLAGS }, | |||||
| { "start_full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.dbl = 0}, 0, 1, FLAGS }, | |||||
| { "full", "start filling the whole video", OFFSET(start_full), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1, FLAGS }, | |||||
| { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT, {.dbl = 1}, 0, 1, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -352,4 +353,5 @@ AVFilter avfilter_vsrc_cellauto = { | |||||
| .config_props = config_props }, | .config_props = config_props }, | ||||
| { .name = NULL} | { .name = NULL} | ||||
| }, | }, | ||||
| .priv_class = &cellauto_class, | |||||
| }; | }; | ||||
| @@ -77,24 +77,25 @@ typedef struct { | |||||
| #define ALIVE_CELL 0xFF | #define ALIVE_CELL 0xFF | ||||
| #define OFFSET(x) offsetof(LifeContext, x) | #define OFFSET(x) offsetof(LifeContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption life_options[] = { | static const AVOption life_options[] = { | ||||
| { "filename", "set source file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "f", "set source file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0 }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0 }, | |||||
| { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | |||||
| { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | |||||
| { "rule", "set rule", OFFSET(rule_str), AV_OPT_TYPE_STRING, {.str = "B3/S23"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "random_fill_ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1/M_PHI}, 0, 1 }, | |||||
| { "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1/M_PHI}, 0, 1 }, | |||||
| { "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl=-1}, -1, UINT32_MAX }, | |||||
| { "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl=-1}, -1, UINT32_MAX }, | |||||
| { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1 }, | |||||
| { "mold", "set mold speed for dead cells", OFFSET(mold), AV_OPT_TYPE_INT, {.dbl=0}, 0, 0xFF }, | |||||
| { "life_color", "set life color", OFFSET( life_color_str), AV_OPT_TYPE_STRING, {.str="white"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "death_color", "set death color", OFFSET(death_color_str), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "mold_color", "set mold color", OFFSET( mold_color_str), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX }, | |||||
| { "filename", "set source file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "f", "set source file", OFFSET(filename), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, | |||||
| { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, | |||||
| { "rule", "set rule", OFFSET(rule_str), AV_OPT_TYPE_STRING, {.str = "B3/S23"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "random_fill_ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1/M_PHI}, 0, 1, FLAGS }, | |||||
| { "ratio", "set fill ratio for filling initial grid randomly", OFFSET(random_fill_ratio), AV_OPT_TYPE_DOUBLE, {.dbl=1/M_PHI}, 0, 1, FLAGS }, | |||||
| { "random_seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl=-1}, -1, UINT32_MAX, FLAGS }, | |||||
| { "seed", "set the seed for filling the initial grid randomly", OFFSET(random_seed), AV_OPT_TYPE_INT, {.dbl=-1}, -1, UINT32_MAX, FLAGS }, | |||||
| { "stitch", "stitch boundaries", OFFSET(stitch), AV_OPT_TYPE_INT, {.dbl=1}, 0, 1, FLAGS }, | |||||
| { "mold", "set mold speed for dead cells", OFFSET(mold), AV_OPT_TYPE_INT, {.dbl=0}, 0, 0xFF, FLAGS }, | |||||
| { "life_color", "set life color", OFFSET( life_color_str), AV_OPT_TYPE_STRING, {.str="white"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "death_color", "set death color", OFFSET(death_color_str), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "mold_color", "set mold color", OFFSET( mold_color_str), AV_OPT_TYPE_STRING, {.str="black"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -481,4 +482,5 @@ AVFilter avfilter_vsrc_life = { | |||||
| .config_props = config_props }, | .config_props = config_props }, | ||||
| { .name = NULL} | { .name = NULL} | ||||
| }, | }, | ||||
| .priv_class = &life_class, | |||||
| }; | }; | ||||
| @@ -79,29 +79,30 @@ typedef struct { | |||||
| } MBContext; | } MBContext; | ||||
| #define OFFSET(x) offsetof(MBContext, x) | #define OFFSET(x) offsetof(MBContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption mandelbrot_options[] = { | static const AVOption mandelbrot_options[] = { | ||||
| {"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"s", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"rate", "set frame rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str="25"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"r", "set frame rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str="25"}, CHAR_MIN, CHAR_MAX }, | |||||
| {"maxiter", "set max iterations number", OFFSET(maxiter), AV_OPT_TYPE_INT, {.dbl=7189}, 1, INT_MAX }, | |||||
| {"start_x", "set the initial x position", OFFSET(start_x), AV_OPT_TYPE_DOUBLE, {.dbl=-0.743643887037158704752191506114774}, -100, 100 }, | |||||
| {"start_y", "set the initial y position", OFFSET(start_y), AV_OPT_TYPE_DOUBLE, {.dbl=-0.131825904205311970493132056385139}, -100, 100 }, | |||||
| {"start_scale", "set the initial scale value", OFFSET(start_scale), AV_OPT_TYPE_DOUBLE, {.dbl=3.0}, 0, FLT_MAX }, | |||||
| {"end_scale", "set the terminal scale value", OFFSET(end_scale), AV_OPT_TYPE_DOUBLE, {.dbl=0.3}, 0, FLT_MAX }, | |||||
| {"end_pts", "set the terminal pts value", OFFSET(end_pts), AV_OPT_TYPE_DOUBLE, {.dbl=400}, 0, INT64_MAX }, | |||||
| {"bailout", "set the bailout value", OFFSET(bailout), AV_OPT_TYPE_DOUBLE, {.dbl=10}, 0, FLT_MAX }, | |||||
| {"outer", "set outer coloring mode", OFFSET(outer), AV_OPT_TYPE_INT, {.dbl=NORMALIZED_ITERATION_COUNT}, 0, INT_MAX, 0, "outer"}, | |||||
| {"iteration_count", "set iteration count mode", 0, AV_OPT_TYPE_CONST, {.dbl=ITERATION_COUNT}, INT_MIN, INT_MAX, 0, "outer" }, | |||||
| {"normalized_iteration_count", "set normalized iteration count mode", 0, AV_OPT_TYPE_CONST, {.dbl=NORMALIZED_ITERATION_COUNT}, INT_MIN, INT_MAX, 0, "outer" }, | |||||
| {"inner", "set inner coloring mode", OFFSET(inner), AV_OPT_TYPE_INT, {.dbl=MINCOL}, 0, INT_MAX, 0, "inner"}, | |||||
| {"black", "set black mode", 0, AV_OPT_TYPE_CONST, {.dbl=BLACK}, INT_MIN, INT_MAX, 0, "inner" }, | |||||
| {"period", "set period mode", 0, AV_OPT_TYPE_CONST, {.dbl=PERIOD}, INT_MIN, INT_MAX, 0, "inner" }, | |||||
| {"convergence", "show time until convergence", 0, AV_OPT_TYPE_CONST, {.dbl=CONVTIME}, INT_MIN, INT_MAX, 0, "inner" }, | |||||
| {"mincol", "color based on point closest to the origin of the iterations", 0, AV_OPT_TYPE_CONST, {.dbl=MINCOL}, INT_MIN, INT_MAX, 0, "inner" }, | |||||
| {"size", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| {"s", "set frame size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str="640x480"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| {"rate", "set frame rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str="25"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| {"r", "set frame rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str="25"}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| {"maxiter", "set max iterations number", OFFSET(maxiter), AV_OPT_TYPE_INT, {.dbl=7189}, 1, INT_MAX, FLAGS }, | |||||
| {"start_x", "set the initial x position", OFFSET(start_x), AV_OPT_TYPE_DOUBLE, {.dbl=-0.743643887037158704752191506114774}, -100, 100, FLAGS }, | |||||
| {"start_y", "set the initial y position", OFFSET(start_y), AV_OPT_TYPE_DOUBLE, {.dbl=-0.131825904205311970493132056385139}, -100, 100, FLAGS }, | |||||
| {"start_scale", "set the initial scale value", OFFSET(start_scale), AV_OPT_TYPE_DOUBLE, {.dbl=3.0}, 0, FLT_MAX, FLAGS }, | |||||
| {"end_scale", "set the terminal scale value", OFFSET(end_scale), AV_OPT_TYPE_DOUBLE, {.dbl=0.3}, 0, FLT_MAX, FLAGS }, | |||||
| {"end_pts", "set the terminal pts value", OFFSET(end_pts), AV_OPT_TYPE_DOUBLE, {.dbl=400}, 0, INT64_MAX, FLAGS }, | |||||
| {"bailout", "set the bailout value", OFFSET(bailout), AV_OPT_TYPE_DOUBLE, {.dbl=10}, 0, FLT_MAX, FLAGS }, | |||||
| {"outer", "set outer coloring mode", OFFSET(outer), AV_OPT_TYPE_INT, {.dbl=NORMALIZED_ITERATION_COUNT}, 0, INT_MAX, FLAGS, "outer" }, | |||||
| {"iteration_count", "set iteration count mode", 0, AV_OPT_TYPE_CONST, {.dbl=ITERATION_COUNT}, INT_MIN, INT_MAX, FLAGS, "outer" }, | |||||
| {"normalized_iteration_count", "set normalized iteration count mode", 0, AV_OPT_TYPE_CONST, {.dbl=NORMALIZED_ITERATION_COUNT}, INT_MIN, INT_MAX, FLAGS, "outer" }, | |||||
| {"inner", "set inner coloring mode", OFFSET(inner), AV_OPT_TYPE_INT, {.dbl=MINCOL}, 0, INT_MAX, FLAGS, "inner" }, | |||||
| {"black", "set black mode", 0, AV_OPT_TYPE_CONST, {.dbl=BLACK}, INT_MIN, INT_MAX, FLAGS, "inner"}, | |||||
| {"period", "set period mode", 0, AV_OPT_TYPE_CONST, {.dbl=PERIOD}, INT_MIN, INT_MAX, FLAGS, "inner"}, | |||||
| {"convergence", "show time until convergence", 0, AV_OPT_TYPE_CONST, {.dbl=CONVTIME}, INT_MIN, INT_MAX, FLAGS, "inner"}, | |||||
| {"mincol", "color based on point closest to the origin of the iterations", 0, AV_OPT_TYPE_CONST, {.dbl=MINCOL}, INT_MIN, INT_MAX, FLAGS, "inner"}, | |||||
| {NULL}, | {NULL}, | ||||
| }; | }; | ||||
| @@ -72,23 +72,24 @@ typedef struct { | |||||
| } TestSourceContext; | } TestSourceContext; | ||||
| #define OFFSET(x) offsetof(TestSourceContext, x) | #define OFFSET(x) offsetof(TestSourceContext, x) | ||||
| #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM | |||||
| static const AVOption options[] = { | static const AVOption options[] = { | ||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0 }, | |||||
| { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | |||||
| { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0 }, | |||||
| { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0 }, | |||||
| { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX }, | |||||
| { "size", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS }, | |||||
| { "s", "set video size", OFFSET(w), AV_OPT_TYPE_IMAGE_SIZE, {.str = "320x240"}, 0, 0, FLAGS }, | |||||
| { "rate", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, | |||||
| { "r", "set video rate", OFFSET(rate), AV_OPT_TYPE_STRING, {.str = "25"}, 0, 0, FLAGS }, | |||||
| { "duration", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "d", "set video duration", OFFSET(duration), AV_OPT_TYPE_STRING, {.str = NULL}, 0, 0, FLAGS }, | |||||
| { "sar", "set video sample aspect ratio", OFFSET(sar), AV_OPT_TYPE_RATIONAL, {.dbl= 1}, 0, INT_MAX, FLAGS }, | |||||
| /* only used by color */ | /* only used by color */ | ||||
| { "color", "set color", OFFSET(color_str), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| { "c", "set color", OFFSET(color_str), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX }, | |||||
| { "color", "set color", OFFSET(color_str), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| { "c", "set color", OFFSET(color_str), AV_OPT_TYPE_STRING, {.str = NULL}, CHAR_MIN, CHAR_MAX, FLAGS }, | |||||
| /* only used by testsrc */ | /* only used by testsrc */ | ||||
| { "decimals", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX }, | |||||
| { "n", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX }, | |||||
| { "decimals", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX, FLAGS }, | |||||
| { "n", "set number of decimals to show", OFFSET(nb_decimals), AV_OPT_TYPE_INT, {.dbl=0}, INT_MIN, INT_MAX, FLAGS }, | |||||
| { NULL }, | { NULL }, | ||||
| }; | }; | ||||
| @@ -284,6 +285,8 @@ AVFilter avfilter_vsrc_color = { | |||||
| }, | }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &color_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_COLOR_FILTER */ | #endif /* CONFIG_COLOR_FILTER */ | ||||
| @@ -317,6 +320,7 @@ AVFilter avfilter_vsrc_nullsrc = { | |||||
| .request_frame = request_frame, | .request_frame = request_frame, | ||||
| .config_props = config_props, }, | .config_props = config_props, }, | ||||
| { .name = NULL}}, | { .name = NULL}}, | ||||
| .priv_class = &nullsrc_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_NULLSRC_FILTER */ | #endif /* CONFIG_NULLSRC_FILTER */ | ||||
| @@ -537,6 +541,7 @@ AVFilter avfilter_vsrc_testsrc = { | |||||
| .request_frame = request_frame, | .request_frame = request_frame, | ||||
| .config_props = config_props, }, | .config_props = config_props, }, | ||||
| { .name = NULL }}, | { .name = NULL }}, | ||||
| .priv_class = &testsrc_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_TESTSRC_FILTER */ | #endif /* CONFIG_TESTSRC_FILTER */ | ||||
| @@ -650,6 +655,7 @@ AVFilter avfilter_vsrc_rgbtestsrc = { | |||||
| .request_frame = request_frame, | .request_frame = request_frame, | ||||
| .config_props = rgbtest_config_props, }, | .config_props = rgbtest_config_props, }, | ||||
| { .name = NULL }}, | { .name = NULL }}, | ||||
| .priv_class = &rgbtestsrc_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_RGBTESTSRC_FILTER */ | #endif /* CONFIG_RGBTESTSRC_FILTER */ | ||||
| @@ -778,6 +784,8 @@ AVFilter avfilter_vsrc_smptebars = { | |||||
| }, | }, | ||||
| { .name = NULL } | { .name = NULL } | ||||
| }, | }, | ||||
| .priv_class = &smptebars_class, | |||||
| }; | }; | ||||
| #endif /* CONFIG_SMPTEBARS_FILTER */ | #endif /* CONFIG_SMPTEBARS_FILTER */ | ||||