mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	resample: add quality property
This commit is contained in:
		
							parent
							
								
									0023aac9b9
								
							
						
					
					
						commit
						3fab544d3d
					
				
					 3 changed files with 8 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -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,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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 },
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -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;
 | 
			
		||||
		}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue