summaryrefslogtreecommitdiffstats
path: root/filters
diff options
context:
space:
mode:
Diffstat (limited to 'filters')
-rw-r--r--filters/f_decoder_wrapper.c41
-rw-r--r--filters/f_lavfi.c22
-rw-r--r--filters/f_swresample.c15
3 files changed, 40 insertions, 38 deletions
diff --git a/filters/f_decoder_wrapper.c b/filters/f_decoder_wrapper.c
index 6b297b671f..b49ec921c1 100644
--- a/filters/f_decoder_wrapper.c
+++ b/filters/f_decoder_wrapper.c
@@ -63,10 +63,10 @@ struct dec_queue_opts {
#define OPT_BASE_STRUCT struct dec_queue_opts
static const struct m_option dec_queue_opts_list[] = {
- OPT_FLAG("enable", use_queue, 0),
- OPT_DOUBLE("max-secs", max_duration, 0, .min = 0, .max = DBL_MAX),
- OPT_BYTE_SIZE("max-bytes", max_bytes, 0, 0, (size_t)-1),
- OPT_INT64("max-samples", max_samples, 0, .min = 0, .max = DBL_MAX),
+ {"enable", OPT_FLAG(use_queue)},
+ {"max-secs", OPT_DOUBLE(max_duration), M_RANGE(0, DBL_MAX)},
+ {"max-bytes", OPT_BYTE_SIZE(max_bytes), M_RANGE(0, (size_t)-1)},
+ {"max-samples", OPT_INT64(max_samples), M_RANGE(0, DBL_MAX)},
{0}
};
@@ -115,21 +115,24 @@ static int decoder_list_opt(struct mp_log *log, const m_option_t *opt,
const struct m_sub_options dec_wrapper_conf = {
.opts = (const struct m_option[]){
- OPT_FLAG("correct-pts", correct_pts, 0),
- OPT_DOUBLE("fps", force_fps, 0, .min = 0, .max = DBL_MAX),
- OPT_STRING_VALIDATE("ad", audio_decoders, 0, decoder_list_opt),
- OPT_STRING_VALIDATE("vd", video_decoders, 0, decoder_list_opt),
- OPT_STRING_VALIDATE("audio-spdif", audio_spdif, 0, decoder_list_opt),
- OPT_CHOICE_OR_INT("video-rotate", video_rotate, UPDATE_IMGPAR, 0, 359,
- ({"no", -1})),
- OPT_ASPECT("video-aspect-override", movie_aspect,
- UPDATE_IMGPAR, .min = -1, .max = 10),
- OPT_CHOICE("video-aspect-method", aspect_method, UPDATE_IMGPAR,
- ({"bitstream", 1}, {"container", 2})),
- OPT_SUBSTRUCT("vd-queue", vdec_queue_opts, vdec_queue_conf, 0),
- OPT_SUBSTRUCT("ad-queue", adec_queue_opts, adec_queue_conf, 0),
- OPT_BYTE_SIZE("video-reversal-buffer", video_reverse_size, 0, 0, (size_t)-1),
- OPT_BYTE_SIZE("audio-reversal-buffer", audio_reverse_size, 0, 0, (size_t)-1),
+ {"correct-pts", OPT_FLAG(correct_pts)},
+ {"fps", OPT_DOUBLE(force_fps), M_RANGE(0, DBL_MAX)},
+ {"ad", OPT_STRING_VALIDATE(audio_decoders, decoder_list_opt)},
+ {"vd", OPT_STRING_VALIDATE(video_decoders, decoder_list_opt)},
+ {"audio-spdif", OPT_STRING_VALIDATE(audio_spdif, decoder_list_opt)},
+ {"video-rotate", OPT_CHOICE(video_rotate, {"no", -1}),
+ .flags = UPDATE_IMGPAR, M_RANGE(0, 359)},
+ {"video-aspect-override", OPT_ASPECT(movie_aspect),
+ .flags = UPDATE_IMGPAR, M_RANGE(-1, 10)},
+ {"video-aspect-method", OPT_CHOICE(aspect_method,
+ {"bitstream", 1}, {"container", 2}),
+ .flags = UPDATE_IMGPAR},
+ {"vd-queue", OPT_SUBSTRUCT(vdec_queue_opts, vdec_queue_conf)},
+ {"ad-queue", OPT_SUBSTRUCT(adec_queue_opts, adec_queue_conf)},
+ {"video-reversal-buffer", OPT_BYTE_SIZE(video_reverse_size),
+ M_RANGE(0, (size_t)-1)},
+ {"audio-reversal-buffer", OPT_BYTE_SIZE(audio_reverse_size),
+ M_RANGE(0, (size_t)-1)},
{0}
},
.size = sizeof(struct dec_wrapper_opts),
diff --git a/filters/f_lavfi.c b/filters/f_lavfi.c
index 2e612d14fc..9e64215f39 100644
--- a/filters/f_lavfi.c
+++ b/filters/f_lavfi.c
@@ -1091,9 +1091,9 @@ const struct mp_user_filter_entry af_lavfi = {
.name = "lavfi",
.priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const m_option_t[]){
- OPT_STRING("graph", graph, 0),
- OPT_FLAG("fix-pts", fix_pts, 0),
- OPT_KEYVALUELIST("o", avopts, 0),
+ {"graph", OPT_STRING(graph)},
+ {"fix-pts", OPT_FLAG(fix_pts)},
+ {"o", OPT_KEYVALUELIST(avopts)},
{0}
},
.priv_defaults = &(const OPT_BASE_STRUCT){
@@ -1110,9 +1110,9 @@ const struct mp_user_filter_entry af_lavfi_bridge = {
.name = "lavfi-bridge",
.priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const m_option_t[]){
- OPT_STRING("name", filter_name, 0),
- OPT_KEYVALUELIST("opts", filter_opts, 0),
- OPT_KEYVALUELIST("o", avopts, 0),
+ {"name", OPT_STRING(filter_name)},
+ {"opts", OPT_KEYVALUELIST(filter_opts)},
+ {"o", OPT_KEYVALUELIST(avopts)},
{0}
},
.priv_defaults = &(const OPT_BASE_STRUCT){
@@ -1130,8 +1130,8 @@ const struct mp_user_filter_entry vf_lavfi = {
.name = "lavfi",
.priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const m_option_t[]){
- OPT_STRING("graph", graph, 0),
- OPT_KEYVALUELIST("o", avopts, 0),
+ {"graph", OPT_STRING(graph)},
+ {"o", OPT_KEYVALUELIST(avopts)},
{0}
},
.priv_defaults = &(const OPT_BASE_STRUCT){
@@ -1148,9 +1148,9 @@ const struct mp_user_filter_entry vf_lavfi_bridge = {
.name = "lavfi-bridge",
.priv_size = sizeof(OPT_BASE_STRUCT),
.options = (const m_option_t[]){
- OPT_STRING("name", filter_name, 0),
- OPT_KEYVALUELIST("opts", filter_opts, 0),
- OPT_KEYVALUELIST("o", avopts, 0),
+ {"name", OPT_STRING(filter_name)},
+ {"opts", OPT_KEYVALUELIST(filter_opts)},
+ {"o", OPT_KEYVALUELIST(avopts)},
{0}
},
.priv_defaults = &(const OPT_BASE_STRUCT){
diff --git a/filters/f_swresample.c b/filters/f_swresample.c
index 0197ca9662..4f26d82a59 100644
--- a/filters/f_swresample.c
+++ b/filters/f_swresample.c
@@ -71,14 +71,13 @@ struct priv {
#define OPT_BASE_STRUCT struct mp_resample_opts
const struct m_sub_options resample_conf = {
.opts = (const m_option_t[]) {
- OPT_INTRANGE("audio-resample-filter-size", filter_size, 0, 0, 32),
- OPT_INTRANGE("audio-resample-phase-shift", phase_shift, 0, 0, 30),
- OPT_FLAG("audio-resample-linear", linear, 0),
- OPT_DOUBLE("audio-resample-cutoff", cutoff, 0,
- .min = 0, .max = 1),
- OPT_FLAG("audio-normalize-downmix", normalize, 0),
- OPT_DOUBLE("audio-resample-max-output-size", max_output_frame_size, 0),
- OPT_KEYVALUELIST("audio-swresample-o", avopts, 0),
+ {"audio-resample-filter-size", OPT_INT(filter_size), M_RANGE(0, 32)},
+ {"audio-resample-phase-shift", OPT_INT(phase_shift), M_RANGE(0, 30)},
+ {"audio-resample-linear", OPT_FLAG(linear)},
+ {"audio-resample-cutoff", OPT_DOUBLE(cutoff), M_RANGE(0, 1)},
+ {"audio-normalize-downmix", OPT_FLAG(normalize)},
+ {"audio-resample-max-output-size", OPT_DOUBLE(max_output_frame_size)},
+ {"audio-swresample-o", OPT_KEYVALUELIST(avopts)},
{0}
},
.size = sizeof(struct mp_resample_opts),