X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Ffilter.cc;h=946dd51065b64cb531c1fabeaca734d15f1553e9;hb=7d9321ff829498c2c87d924a9b660acbfdafa6b3;hp=a7dd9c5cee61c1f2e935705681f574a2a847ce17;hpb=816b3c2dda2c5e33900f5d90a001284045040b5f;p=dcpomatic.git diff --git a/src/lib/filter.cc b/src/lib/filter.cc index a7dd9c5ce..946dd5106 100644 --- a/src/lib/filter.cc +++ b/src/lib/filter.cc @@ -1,30 +1,32 @@ /* Copyright (C) 2012 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ /** @file src/filter.cc - * @brief A class to describe one of FFmpeg's video or post-processing filters. + * @brief A class to describe one of FFmpeg's video or audio filters. */ #include "filter.h" extern "C" { #include } +#include #include "i18n.h" @@ -35,13 +37,13 @@ vector Filter::_filters; /** @param i Our id. * @param n User-visible name. * @param c User-visible category. - * @param v String for a FFmpeg video filter descriptor. + * @param f String for a FFmpeg filter descriptor. */ -Filter::Filter (string i, string n, string c, string v) +Filter::Filter (string i, string n, string c, string f) : _id (i) , _name (n) , _category (c) - , _vf (v) + , _ffmpeg (f) { } @@ -53,7 +55,6 @@ Filter::all () return _filters; } - /** Set up the static _filters vector; must be called before from_* * methods are used. */ @@ -61,23 +62,23 @@ void Filter::setup_filters () { /* Note: "none" is a magic id name, so don't use it here */ - - maybe_add (N_("mcdeint"), _("Motion compensating deinterlacer"), _("De-interlacing"), N_("mcdeint")); - maybe_add (N_("kerndeint"), _("Kernel deinterlacer"), _("De-interlacing"), N_("kerndeint")); - maybe_add (N_("yadif"), _("Yet Another Deinterlacing Filter"), _("De-interlacing"), N_("yadif")); - maybe_add (N_("gradfun"), _("Gradient debander"), _("Misc"), N_("gradfun")); - maybe_add (N_("unsharp"), _("Unsharp mask and Gaussian blur"), _("Misc"), N_("unsharp")); - maybe_add (N_("denoise3d"), _("3D denoiser"), _("Noise reduction"), N_("denoise3d")); - maybe_add (N_("hqdn3d"), _("High quality 3D denoiser"), _("Noise reduction"), N_("hqdn3d")); - maybe_add (N_("telecine"), _("Telecine filter"), _("Misc"), N_("telecine")); - maybe_add (N_("ow"), _("Overcomplete wavelet denoiser"), _("Noise reduction"), N_("mp=ow")); + + maybe_add (N_("mcdeint"), _("Motion compensating deinterlacer"), _("De-interlacing"), N_("mcdeint")); + maybe_add (N_("kerndeint"), _("Kernel deinterlacer"), _("De-interlacing"), N_("kerndeint")); + maybe_add (N_("yadif"), _("Yet Another Deinterlacing Filter"), _("De-interlacing"), N_("yadif")); + maybe_add (N_("gradfun"), _("Gradient debander"), _("Misc"), N_("gradfun")); + maybe_add (N_("unsharp"), _("Unsharp mask and Gaussian blur"), _("Misc"), N_("unsharp")); + maybe_add (N_("denoise3d"), _("3D denoiser"), _("Noise reduction"), N_("denoise3d")); + maybe_add (N_("hqdn3d"), _("High quality 3D denoiser"), _("Noise reduction"), N_("hqdn3d")); + maybe_add (N_("telecine"), _("Telecine filter"), _("Misc"), N_("telecine")); + maybe_add (N_("ow"), _("Overcomplete wavelet denoiser"), _("Noise reduction"), N_("mp=ow")); } void -Filter::maybe_add (string i, string n, string c, string v) +Filter::maybe_add (string i, string n, string c, string f) { if (avfilter_get_by_name (i.c_str())) { - _filters.push_back (new Filter (i, n, c, v)); + _filters.push_back (new Filter (i, n, c, f)); } } @@ -87,16 +88,16 @@ Filter::maybe_add (string i, string n, string c, string v) string Filter::ffmpeg_string (vector const & filters) { - string vf; + string ff; - for (vector::const_iterator i = filters.begin(); i != filters.end(); ++i) { - if (!vf.empty ()) { - vf += N_(","); + BOOST_FOREACH (Filter const * i, filters) { + if (!ff.empty ()) { + ff += N_(","); } - vf += (*i)->vf (); + ff += i->ffmpeg (); } - return vf; + return ff; } /** @param d Our id. @@ -116,4 +117,3 @@ Filter::from_id (string d) return *i; } -