mirror of
https://github.com/mpv-player/mpv
synced 2025-02-20 23:07:02 +00:00
vf: add vf_control_by_label to send vfctrl to specific filter
This commit is contained in:
parent
b11fdeab9e
commit
7ae2eb8e2c
@ -156,6 +156,17 @@ int vf_control_any(struct vf_chain *c, int cmd, void *arg)
|
||||
return CONTROL_UNKNOWN;
|
||||
}
|
||||
|
||||
int vf_control_by_label(struct vf_chain *c,int cmd, void *arg, bstr label)
|
||||
{
|
||||
char *label_str = bstrdup0(NULL, label);
|
||||
struct vf_instance *cur = vf_find_by_label(c, label_str);
|
||||
talloc_free(label_str);
|
||||
if (cur)
|
||||
return cur->control(cur, cmd, arg);
|
||||
else
|
||||
return CONTROL_UNKNOWN;
|
||||
}
|
||||
|
||||
static void vf_fix_img_params(struct mp_image *img, struct mp_image_params *p)
|
||||
{
|
||||
// Filters must absolutely set these correctly.
|
||||
|
@ -129,6 +129,7 @@ struct vf_chain *vf_new(struct mpv_global *global);
|
||||
void vf_destroy(struct vf_chain *c);
|
||||
int vf_reconfig(struct vf_chain *c, const struct mp_image_params *params);
|
||||
int vf_control_any(struct vf_chain *c, int cmd, void *arg);
|
||||
int vf_control_by_label(struct vf_chain *c, int cmd, void *arg, bstr label);
|
||||
int vf_filter_frame(struct vf_chain *c, struct mp_image *img);
|
||||
struct mp_image *vf_output_queued_frame(struct vf_chain *c);
|
||||
void vf_seek_reset(struct vf_chain *c);
|
||||
|
Loading…
Reference in New Issue
Block a user