mirror of
https://github.com/mpv-player/mpv
synced 2024-12-27 09:32:40 +00:00
vf_ilpack: use option parser
This commit is contained in:
parent
e92f4d4726
commit
a605fae6fa
@ -24,6 +24,7 @@
|
||||
#include "config.h"
|
||||
#include "mpvcore/mp_msg.h"
|
||||
#include "mpvcore/cpudetect.h"
|
||||
#include "mpvcore/m_option.h"
|
||||
|
||||
#include "video/img_format.h"
|
||||
#include "video/mp_image.h"
|
||||
@ -408,9 +409,6 @@ static int vf_open(vf_instance_t *vf, char *args)
|
||||
vf->config=config;
|
||||
vf->query_format=query_format;
|
||||
vf->filter=filter;
|
||||
vf->priv = calloc(1, sizeof(struct vf_priv_s));
|
||||
vf->priv->mode = 1;
|
||||
if (args) sscanf(args, "%d", &vf->priv->mode);
|
||||
|
||||
pack_nn = pack_nn_C;
|
||||
pack_li_0 = pack_li_0_C;
|
||||
@ -429,11 +427,6 @@ static int vf_open(vf_instance_t *vf, char *args)
|
||||
case 0:
|
||||
vf->priv->pack[0] = vf->priv->pack[1] = pack_nn;
|
||||
break;
|
||||
default:
|
||||
mp_msg(MSGT_VFILTER, MSGL_WARN,
|
||||
"ilpack: unknown mode %d (fallback to linear)\n",
|
||||
vf->priv->mode);
|
||||
/* Fallthrough */
|
||||
case 1:
|
||||
vf->priv->pack[0] = pack_li_0;
|
||||
vf->priv->pack[1] = pack_li_1;
|
||||
@ -443,8 +436,17 @@ static int vf_open(vf_instance_t *vf, char *args)
|
||||
return 1;
|
||||
}
|
||||
|
||||
#define OPT_BASE_STRUCT struct vf_priv_s
|
||||
const vf_info_t vf_info_ilpack = {
|
||||
.description = "4:2:0 planar -> 4:2:2 packed reinterlacer",
|
||||
.name = "ilpack",
|
||||
.open = vf_open,
|
||||
.priv_size = sizeof(struct vf_priv_s),
|
||||
.priv_defaults = &(const struct vf_priv_s){
|
||||
.mode = 1,
|
||||
},
|
||||
.options = (const struct m_option[]){
|
||||
OPT_INTRANGE("mode", mode, 0, 0, 1),
|
||||
{0}
|
||||
},
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user