mirror of https://github.com/mpv-player/mpv
vf_yadif: expose interlaced frame mode
Also remove the enabled suboption, which did nothing. (It was probably broken at some point.)
This commit is contained in:
parent
92727e7332
commit
25755f5fe7
|
@ -518,7 +518,7 @@ Available filters are:
|
|||
video. The main purpose of setting ``mp`` to a chroma plane is to reduce
|
||||
CPU load and make pullup usable in realtime on slow machines.
|
||||
|
||||
``yadif=[mode[:enabled=yes|no]]``
|
||||
``yadif=[mode:interlaced-only]``
|
||||
Yet another deinterlacing filter
|
||||
|
||||
``<mode>``
|
||||
|
@ -527,10 +527,9 @@ Available filters are:
|
|||
:frame-nospatial: Like ``frame`` but skips spatial interlacing check.
|
||||
:field-nospatial: Like ``field`` but skips spatial interlacing check.
|
||||
|
||||
``<enabled>``
|
||||
:yes: Filter is active (default).
|
||||
:no: Filter is not active, but can be activated with the ``D`` key
|
||||
(or any other key that toggles the ``deinterlace`` property).
|
||||
``<interlaced-only>``
|
||||
:no: Deinterlace all frames (default).
|
||||
:yes: Only deinterlace frames marked as interlaced.
|
||||
|
||||
This filter, is automatically inserted when using the ``D`` key (or any
|
||||
other key that toggles the ``deinterlace`` property or when using the
|
||||
|
|
|
@ -28,14 +28,10 @@
|
|||
|
||||
struct vf_priv_s {
|
||||
int mode;
|
||||
int do_deinterlace;
|
||||
int interlaced_only;
|
||||
struct vf_lw_opts *lw_opts;
|
||||
};
|
||||
|
||||
static const struct vf_priv_s vf_priv_default = {
|
||||
.do_deinterlace = 1,
|
||||
};
|
||||
|
||||
static int vf_open(vf_instance_t *vf)
|
||||
{
|
||||
struct vf_priv_s *p = vf->priv;
|
||||
|
@ -43,10 +39,11 @@ static int vf_open(vf_instance_t *vf)
|
|||
// Earlier libavfilter yadif versions used pure integers for the first
|
||||
// option. We can't/don't handle this, but at least allow usage of the
|
||||
// filter with default settings. So use an empty string for "send_frame".
|
||||
const char *mode[] = {"", "send_field", "send_frame_nospatial",
|
||||
const char *mode[] = {"send_frame", "send_field", "send_frame_nospatial",
|
||||
"send_field_nospatial"};
|
||||
|
||||
if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "%s", mode[p->mode]) >= 0)
|
||||
if (vf_lw_set_graph(vf, p->lw_opts, "yadif", "mode=%s:deint=%s", mode[p->mode],
|
||||
p->interlaced_only ? "interlaced" : "all") >= 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
@ -62,7 +59,7 @@ static const m_option_t vf_opts_fields[] = {
|
|||
{"field", 1},
|
||||
{"frame-nospatial", 2},
|
||||
{"field-nospatial", 3})),
|
||||
OPT_FLAG("enabled", do_deinterlace, 0),
|
||||
OPT_FLAG("interlaced-only", interlaced_only, 0),
|
||||
OPT_SUBSTRUCT("", lw_opts, vf_lw_conf, 0),
|
||||
{0}
|
||||
};
|
||||
|
@ -72,6 +69,5 @@ const vf_info_t vf_info_yadif = {
|
|||
.name = "yadif",
|
||||
.open = vf_open,
|
||||
.priv_size = sizeof(struct vf_priv_s),
|
||||
.priv_defaults = &vf_priv_default,
|
||||
.options = vf_opts_fields,
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue