diff options
Diffstat (limited to 'video')
-rw-r--r-- | video/filter/vf.c | 15 | ||||
-rw-r--r-- | video/filter/vf.h | 4 |
2 files changed, 18 insertions, 1 deletions
diff --git a/video/filter/vf.c b/video/filter/vf.c index 215bf0dc0e..94df76c0e1 100644 --- a/video/filter/vf.c +++ b/video/filter/vf.c @@ -487,13 +487,26 @@ vf_instance_t *append_filters(vf_instance_t *last, //printf("Open filter %s\n",vf_settings[i].name); vf = vf_open_filter(opts, last, vf_settings[i].name, vf_settings[i].attribs); - if (vf) + if (vf) { + if (vf_settings[i].label) + vf->label = talloc_strdup(vf, vf_settings[i].label); last = vf; + } } } return last; } +vf_instance_t *vf_find_by_label(vf_instance_t *chain, const char *label) +{ + while (chain) { + if (chain->label && label && strcmp(chain->label, label) == 0) + return chain; + chain = chain->next; + } + return NULL; +} + //============================================================================ void vf_uninit_filter(vf_instance_t *vf) diff --git a/video/filter/vf.h b/video/filter/vf.h index 3ff4b5ea87..fd0118e152 100644 --- a/video/filter/vf.h +++ b/video/filter/vf.h @@ -66,6 +66,8 @@ typedef struct vf_instance { void (*uninit)(struct vf_instance *vf); + char *label; + // data: struct vf_format fmt_in, fmt_out; struct vf_instance *next; @@ -133,6 +135,8 @@ struct m_obj_settings; vf_instance_t *append_filters(vf_instance_t *last, struct m_obj_settings *vf_settings); +vf_instance_t *vf_find_by_label(vf_instance_t *chain, const char *label); + void vf_uninit_filter(vf_instance_t *vf); void vf_uninit_filter_chain(vf_instance_t *vf); |