summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-12-10 16:20:02 +0100
committerCarl Hetherington <cth@carlh.net>2023-12-12 15:03:23 +0100
commit37b29fdf9028e6848470a19d189697fc58278990 (patch)
tree93170bd4a9e98864e700d577df19d06de11c67d4 /src
parentf5c1d56e9a15975f587a8d9c5255aea608d8abe9 (diff)
Cleanup: use a lambda.
Diffstat (limited to 'src')
-rw-r--r--src/lib/filter.cc28
-rw-r--r--src/lib/filter.h1
2 files changed, 13 insertions, 16 deletions
diff --git a/src/lib/filter.cc b/src/lib/filter.cc
index 18faa747a..5a94c0b43 100644
--- a/src/lib/filter.cc
+++ b/src/lib/filter.cc
@@ -75,6 +75,19 @@ Filter::setup_filters ()
{
/* Note: "none" is a magic id name, so don't use it here */
+ auto maybe_add = [](string id, string name, string category, string ffmpeg)
+ {
+ string check_name = ffmpeg;
+ size_t end = check_name.find("=");
+ if (end != string::npos) {
+ check_name = check_name.substr(0, end);
+ }
+
+ if (avfilter_get_by_name(check_name.c_str())) {
+ _filters.push_back(Filter(id, name, category, ffmpeg));
+ }
+ };
+
maybe_add (N_("vflip"), _("Vertical flip"), _("Orientation"), N_("vflip"));
maybe_add (N_("hflip"), _("Horizontal flip"), _("Orientation"), N_("hflip"));
maybe_add (N_("90clock"), _("Rotate 90 degrees clockwise"), _("Orientation"), N_("transpose=dir=clock"));
@@ -93,21 +106,6 @@ Filter::setup_filters ()
}
-void
-Filter::maybe_add (string i, string n, string c, string f)
-{
- string check_name = f;
- size_t end = check_name.find("=");
- if (end != string::npos) {
- check_name = check_name.substr (0, end);
- }
-
- if (avfilter_get_by_name(check_name.c_str())) {
- _filters.push_back (Filter(i, n, c, f));
- }
-}
-
-
/** @param filters Set of filters.
* @return String to pass to FFmpeg for the video filters.
*/
diff --git a/src/lib/filter.h b/src/lib/filter.h
index a24d0e0d6..bcc40dad7 100644
--- a/src/lib/filter.h
+++ b/src/lib/filter.h
@@ -81,7 +81,6 @@ private:
/** all available filters */
static std::vector<Filter> _filters;
- static void maybe_add (std::string, std::string, std::string, std::string);
};