mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	remove the rate_match io
Now that the stream provides us with a requested size, we don't need to use the rate_match anymore.
This commit is contained in:
		
							parent
							
								
									5192fcb16c
								
							
						
					
					
						commit
						7e42c905a8
					
				
					 8 changed files with 12 additions and 104 deletions
				
			
		| 
						 | 
				
			
			@ -169,7 +169,6 @@ struct impl {
 | 
			
		|||
	void *rec_buffer[SPA_AUDIO_MAX_CHANNELS];
 | 
			
		||||
	uint32_t rec_ringsize;
 | 
			
		||||
	struct spa_ringbuffer rec_ring;
 | 
			
		||||
	struct spa_io_rate_match *rec_rate_match;
 | 
			
		||||
 | 
			
		||||
	struct pw_stream *playback;
 | 
			
		||||
	struct spa_hook playback_listener;
 | 
			
		||||
| 
						 | 
				
			
			@ -180,7 +179,6 @@ struct impl {
 | 
			
		|||
	uint32_t play_ringsize;
 | 
			
		||||
	struct spa_ringbuffer play_ring;
 | 
			
		||||
	struct spa_ringbuffer play_delayed_ring;
 | 
			
		||||
	struct spa_io_rate_match *play_rate_match;
 | 
			
		||||
 | 
			
		||||
	void *out_buffer[SPA_AUDIO_MAX_CHANNELS];
 | 
			
		||||
	uint32_t out_ringsize;
 | 
			
		||||
| 
						 | 
				
			
			@ -338,17 +336,6 @@ static void capture_destroy(void *d)
 | 
			
		|||
	impl->capture = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void capture_io_changed(void *data, uint32_t id, void *area, uint32_t size)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *impl = data;
 | 
			
		||||
 | 
			
		||||
	switch (id) {
 | 
			
		||||
	case SPA_IO_RateMatch:
 | 
			
		||||
		impl->rec_rate_match = area;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void capture_process(void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *impl = data;
 | 
			
		||||
| 
						 | 
				
			
			@ -382,7 +369,7 @@ static void capture_process(void *data)
 | 
			
		|||
	 * if it has a specific requirement, else keep the block size the same
 | 
			
		||||
	 * on input and output or what the resampler needs */
 | 
			
		||||
	if (impl->aec_blocksize == 0) {
 | 
			
		||||
		impl->aec_blocksize = SPA_MAX(size, impl->rec_rate_match->size);
 | 
			
		||||
		impl->aec_blocksize = size;
 | 
			
		||||
		pw_log_debug("Setting AEC block size to %u", impl->aec_blocksize);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -454,7 +441,6 @@ static const struct pw_stream_events capture_events = {
 | 
			
		|||
	PW_VERSION_STREAM_EVENTS,
 | 
			
		||||
	.destroy = capture_destroy,
 | 
			
		||||
	.state_changed = input_state_changed,
 | 
			
		||||
	.io_changed = capture_io_changed,
 | 
			
		||||
	.process = capture_process,
 | 
			
		||||
	.param_changed = input_param_changed
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			@ -523,17 +509,6 @@ static void sink_destroy(void *d)
 | 
			
		|||
	impl->sink = NULL;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void sink_io_changed(void *data, uint32_t id, void *area, uint32_t size)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *impl = data;
 | 
			
		||||
 | 
			
		||||
	switch (id) {
 | 
			
		||||
	case SPA_IO_RateMatch:
 | 
			
		||||
		impl->play_rate_match = area;
 | 
			
		||||
		break;
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
static void sink_process(void *data)
 | 
			
		||||
{
 | 
			
		||||
	struct impl *impl = data;
 | 
			
		||||
| 
						 | 
				
			
			@ -567,7 +542,7 @@ static void sink_process(void *data)
 | 
			
		|||
	}
 | 
			
		||||
 | 
			
		||||
	if (impl->aec_blocksize == 0) {
 | 
			
		||||
		impl->aec_blocksize = SPA_MAX(size, impl->rec_rate_match->size);
 | 
			
		||||
		impl->aec_blocksize = size;
 | 
			
		||||
		pw_log_debug("Setting AEC block size to %u", impl->aec_blocksize);
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -608,7 +583,6 @@ static const struct pw_stream_events playback_events = {
 | 
			
		|||
static const struct pw_stream_events sink_events = {
 | 
			
		||||
	PW_VERSION_STREAM_EVENTS,
 | 
			
		||||
	.destroy = sink_destroy,
 | 
			
		||||
	.io_changed = sink_io_changed,
 | 
			
		||||
	.process = sink_process,
 | 
			
		||||
	.state_changed = output_state_changed,
 | 
			
		||||
	.param_changed = output_param_changed
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue