diff --git a/spa/include/spa/param/props.h b/spa/include/spa/param/props.h index 257caf707..e7f7e5511 100644 --- a/spa/include/spa/param/props.h +++ b/spa/include/spa/param/props.h @@ -64,6 +64,7 @@ enum spa_prop { SPA_PROP_periodEvent, SPA_PROP_live, SPA_PROP_rate, + SPA_PROP_quality, SPA_PROP_START_Audio = 0x10000, /**< audio related properties */ SPA_PROP_waveType, diff --git a/spa/include/spa/param/type-info.h b/spa/include/spa/param/type-info.h index 00fd8167c..d8b1e6639 100644 --- a/spa/include/spa/param/type-info.h +++ b/spa/include/spa/param/type-info.h @@ -79,6 +79,7 @@ static const struct spa_type_info spa_type_props[] = { { SPA_PROP_periodEvent, SPA_TYPE_Bool, SPA_TYPE_INFO_PROPS_BASE "periodEvent", NULL }, { SPA_PROP_live, SPA_TYPE_Bool, SPA_TYPE_INFO_PROPS_BASE "live", NULL }, { SPA_PROP_rate, SPA_TYPE_Double, SPA_TYPE_INFO_PROPS_BASE "rate", NULL }, + { SPA_PROP_quality, SPA_TYPE_Int, SPA_TYPE_INFO_PROPS_BASE "quality", NULL }, { SPA_PROP_waveType, SPA_TYPE_Id, SPA_TYPE_INFO_PROPS_BASE "waveType", NULL }, { SPA_PROP_frequency, SPA_TYPE_Int, SPA_TYPE_INFO_PROPS_BASE "frequency", NULL }, diff --git a/spa/plugins/audioconvert/resample.c b/spa/plugins/audioconvert/resample.c index 3e3996702..f57741558 100644 --- a/spa/plugins/audioconvert/resample.c +++ b/spa/plugins/audioconvert/resample.c @@ -55,11 +55,13 @@ struct impl; struct props { double rate; + int quality; }; static void props_reset(struct props *props) { props->rate = 1.0; + props->quality = RESAMPLE_DEFAULT_QUALITY; } struct buffer { @@ -161,7 +163,7 @@ static int setup_convert(struct impl *this, this->resample.i_rate = src_info->info.raw.rate; this->resample.o_rate = dst_info->info.raw.rate; this->resample.log = this->log; - this->resample.quality = RESAMPLE_DEFAULT_QUALITY; + this->resample.quality = this->props.quality; if (this->peaks) err = impl_peaks_init(&this->resample); @@ -191,6 +193,9 @@ static int apply_props(struct impl *this, const struct spa_pod *param) resample_update_rate(&this->resample, p->rate); } break; + case SPA_PROP_quality: + spa_pod_get_int(&prop->value, &p->quality); + break; default: break; }