mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-07 07:58:51 +00:00
resampler: add some options
This commit is contained in:
parent
b4a5001e3c
commit
ad0e0006b2
2 changed files with 39 additions and 3 deletions
|
@ -290,9 +290,18 @@ gst_resampler_init (GstResampler * resampler,
|
||||||
{
|
{
|
||||||
gdouble resample_inc = in_size / (gdouble) out_size;
|
gdouble resample_inc = in_size / (gdouble) out_size;
|
||||||
|
|
||||||
params.envelope = 2.0;
|
if (!options
|
||||||
params.sharpness = 1.0;
|
|| !gst_structure_get_double (options, GST_RESAMPLER_OPT_ENVELOPE,
|
||||||
params.sharpen = 0.0;
|
¶ms.envelope))
|
||||||
|
params.envelope = 2.0;
|
||||||
|
if (!options
|
||||||
|
|| !gst_structure_get_double (options, GST_RESAMPLER_OPT_SHARPNESS,
|
||||||
|
¶ms.sharpness))
|
||||||
|
params.sharpness = 1.0;
|
||||||
|
if (!options
|
||||||
|
|| !gst_structure_get_double (options, GST_RESAMPLER_OPT_SHARPEN,
|
||||||
|
¶ms.sharpen))
|
||||||
|
params.sharpen = 0.0;
|
||||||
|
|
||||||
if (resample_inc > 1.0) {
|
if (resample_inc > 1.0) {
|
||||||
params.fx = (1.0 / resample_inc) * params.sharpness;
|
params.fx = (1.0 / resample_inc) * params.sharpness;
|
||||||
|
|
|
@ -48,6 +48,33 @@ typedef enum {
|
||||||
GST_RESAMPLER_METHOD_LANCZOS,
|
GST_RESAMPLER_METHOD_LANCZOS,
|
||||||
} GstResamplerMethod;
|
} GstResamplerMethod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_RESAMPLER_OPT_ENVELOPE:
|
||||||
|
*
|
||||||
|
* G_TYPE_DOUBLE, specifies the size of filter envelope for
|
||||||
|
* @GST_RESAMPLER_METHOD_LANCZOS. values are clamped between
|
||||||
|
* 1.0 and 5.0. 2.0 is the default.
|
||||||
|
*/
|
||||||
|
#define GST_RESAMPLER_OPT_ENVELOPE "GstResampler.envelope"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_RESAMPLER_OPT_SHARPNESS:
|
||||||
|
*
|
||||||
|
* G_TYPE_DOUBLE, specifies sharpness of the filter for
|
||||||
|
* @GST_RESAMPLER_METHOD_LANCZOS. values are clamped between
|
||||||
|
* 0.5 and 1.5. 1.0 is the default.
|
||||||
|
*/
|
||||||
|
#define GST_RESAMPLER_OPT_SHARPNESS "GstResampler.sharpness"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GST_RESAMPLER_OPT_SHARPEN:
|
||||||
|
*
|
||||||
|
* G_TYPE_DOUBLE, specifies sharpening of the filter for
|
||||||
|
* @GST_RESAMPLER_METHOD_LANCZOS. values are clamped between
|
||||||
|
* 0.0 and 1.0. 0.0 is the default.
|
||||||
|
*/
|
||||||
|
#define GST_RESAMPLER_OPT_SHARPEN "GstResampler.sharpen"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* GstResamplerFlags:
|
* GstResamplerFlags:
|
||||||
* @GST_RESAMPLER_FLAG_NONE: no flags
|
* @GST_RESAMPLER_FLAG_NONE: no flags
|
||||||
|
|
Loading…
Reference in a new issue