*/
/** @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 <libavfilter/avfilter.h>
}
+#include <boost/foreach.hpp>
#include "i18n.h"
/** @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)
{
}
return _filters;
}
-
/** Set up the static _filters vector; must be called before from_*
* methods are used.
*/
{
/* 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));
}
}
string
Filter::ffmpeg_string (vector<Filter const *> const & filters)
{
- string vf;
+ string ff;
- for (vector<Filter const *>::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.
return *i;
}
-
/*
- Copyright (C) 2012 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2012-2015 Carl Hetherington <cth@carlh.net>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
*/
/** @file src/filter.h
- * @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.
*/
#ifndef DCPOMATIC_FILTER_H
#include <vector>
/** @class Filter
- * @brief A class to describe one of FFmpeg's video filters.
+ * @brief A class to describe one of FFmpeg's video or audio filters.
*
* We don't support FFmpeg's post-processing filters here as they cannot cope with greater than
* 8bpp. FFmpeg quantizes e.g. yuv422p10le down to yuv422p before running such filters, which
return _name;
}
- /** @return string for a FFmpeg video filter descriptor */
- std::string vf () const {
- return _vf;
+ /** @return string for a FFmpeg filter descriptor */
+ std::string ffmpeg () const {
+ return _ffmpeg;
}
std::string category () const {
/** user-visible name */
std::string _name;
std::string _category;
- /** string for a FFmpeg video filter descriptor */
- std::string _vf;
+ /** string for a FFmpeg filter descriptor */
+ std::string _ffmpeg;
/** all available filters */
static std::vector<Filter const *> _filters;