[vlc-commits] ci_filters: add way to load a specific CIFilter
Thomas Guillem
git at videolan.org
Fri Sep 29 13:18:39 CEST 2017
vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Fri Sep 29 13:11:02 2017 +0200| [7a863b6c153d69893dccb029584de0b7130c2d29] | committer: Thomas Guillem
ci_filters: add way to load a specific CIFilter
For example:
vlc --video-filter ci --ci-filter CICrystallize
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7a863b6c153d69893dccb029584de0b7130c2d29
---
modules/video_filter/ci_filters.m | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/modules/video_filter/ci_filters.m b/modules/video_filter/ci_filters.m
index c999fcd00e..5c77fccfa6 100644
--- a/modules/video_filter/ci_filters.m
+++ b/modules/video_filter/ci_filters.m
@@ -52,6 +52,7 @@ enum filter_type
FILTER_SEPIA,
FILTER_SHARPEN,
FILTER_PSYCHEDELIC,
+ FILTER_CUSTOM,
NUM_FILTERS,
NUM_MAX_EQUIVALENT_VLC_FILTERS = 3
};
@@ -184,6 +185,12 @@ static struct filter_desc filter_desc_table[] =
filter_PsychedelicInit,
filter_PsychedelicControl
},
+ [FILTER_CUSTOM] =
+ {
+ { "custom" }, { { } },
+ filter_PsychedelicInit,
+ filter_PsychedelicControl
+ },
};
#define GET_CI_VALUE(vlc_value, vlc_range, ci_range) \
@@ -740,6 +747,12 @@ OpenPsychedelic(vlc_object_t *obj)
return Open(obj, "psychedelic");
}
+static int
+OpenCustom(vlc_object_t *obj)
+{
+ return Open(obj, "custom");
+}
+
static void
Close(vlc_object_t *obj)
{
@@ -766,6 +779,10 @@ Close(vlc_object_t *obj)
free(filter->p_sys);
}
+#define CI_CUSTOM_FILTER_TEXT N_("Use a specific Core Image Filter")
+#define CI_CUSTOM_FILTER_LONGTEXT N_( \
+ "Example: 'CICrystallize', 'CIBumpDistortion', 'CIThermal', 'CIComicEffect'")
+
vlc_module_begin()
set_capability("video filter", 0)
set_category(CAT_VIDEO)
@@ -795,4 +812,9 @@ vlc_module_begin()
add_submodule()
set_callbacks(OpenPsychedelic, Close)
add_shortcut("psychedelic")
+
+ add_submodule()
+ set_callbacks(OpenCustom, Close)
+ add_shortcut("ci")
+ add_string("ci-filter", "CIComicEffect", CI_CUSTOM_FILTER_TEXT, CI_CUSTOM_FILTER_LONGTEXT, true);
vlc_module_end()
More information about the vlc-commits
mailing list