mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-10-29 05:40:27 -04:00 
			
		
		
		
	rename HAVE/NEED_BUFFER -> HAVE/NEED_DATA
It is more generic and works with control-only ports as well
This commit is contained in:
		
							parent
							
								
									d648ea4ad3
								
							
						
					
					
						commit
						8b85cc225e
					
				
					 40 changed files with 176 additions and 176 deletions
				
			
		|  | @ -1 +1 @@ | |||
| Subproject commit 4bd1e9a9ff70bf50611e85d9244e70da04dfd13c | ||||
| Subproject commit 1d2db89b9c80153f94ace12572f16678694fafc9 | ||||
|  | @ -155,7 +155,7 @@ static int on_source_ready(void *_data, int status) | |||
| 	struct spa_data *datas; | ||||
| 	struct spa_io_buffers *io = &data->source_output[0]; | ||||
| 
 | ||||
| 	if (io->status != SPA_STATUS_HAVE_BUFFER || | ||||
| 	if (io->status != SPA_STATUS_HAVE_DATA || | ||||
| 	    io->buffer_id > MAX_BUFFERS) | ||||
| 		return -EINVAL; | ||||
| 
 | ||||
|  | @ -214,7 +214,7 @@ static int on_source_ready(void *_data, int status) | |||
| 			munmap(map, datas[0].maxsize + datas[0].mapoffset); | ||||
| 	} | ||||
| 
 | ||||
| 	io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	if ((res = spa_node_process(data->source)) < 0) | ||||
| 		printf("got process error %d\n", res); | ||||
|  |  | |||
|  | @ -54,8 +54,8 @@ enum spa_io_type { | |||
| 
 | ||||
| struct spa_io_buffers { | ||||
| #define SPA_STATUS_OK			0 | ||||
| #define SPA_STATUS_NEED_BUFFER		(1<<0) | ||||
| #define SPA_STATUS_HAVE_BUFFER		(1<<1) | ||||
| #define SPA_STATUS_NEED_DATA		(1<<0) | ||||
| #define SPA_STATUS_HAVE_DATA		(1<<1) | ||||
| #define SPA_STATUS_STOPPED		(1<<2) | ||||
| 	int32_t status;			/**< the status code */ | ||||
| 	uint32_t buffer_id;		/**< a buffer id */ | ||||
|  |  | |||
|  | @ -536,7 +536,7 @@ struct spa_node_methods { | |||
| 	 * the port. | ||||
| 	 * | ||||
| 	 * For output ports, all buffers will be queued in the port. When process | ||||
| 	 * returns SPA_STATUS_HAVE_BUFFER, buffers are available in one or more | ||||
| 	 * returns SPA_STATUS_HAVE_DATA, buffers are available in one or more | ||||
| 	 * of the spa_io_buffers areas. | ||||
| 	 * | ||||
| 	 * When a buffer can be reused, port_reuse_buffer() should be called or the | ||||
|  | @ -608,17 +608,17 @@ struct spa_node_methods { | |||
| 	/**
 | ||||
| 	 * Process the node | ||||
| 	 * | ||||
| 	 * Output io areas with SPA_STATUS_NEED_BUFFER will recycle the | ||||
| 	 * Output io areas with SPA_STATUS_NEED_DATA will recycle the | ||||
| 	 * buffers if any. | ||||
| 	 * | ||||
| 	 * Input areas with SPA_STATUS_HAVE_BUFFER are consumed if possible | ||||
| 	 * and the status is set to SPA_STATUS_NEED_BUFFER or SPA_STATUS_OK. | ||||
| 	 * Input areas with SPA_STATUS_HAVE_DATA are consumed if possible | ||||
| 	 * and the status is set to SPA_STATUS_NEED_DATA or SPA_STATUS_OK. | ||||
| 	 * | ||||
| 	 * When the node has new output buffers, the SPA_STATUS_HAVE_BUFFER | ||||
| 	 * When the node has new output buffers, the SPA_STATUS_HAVE_DATA | ||||
| 	 * bit will be set. | ||||
| 	 * | ||||
| 	 * When the node can accept new input in the next cycle, the | ||||
| 	 * SPA_STATUS_NEED_BUFFER bit will be set. | ||||
| 	 * SPA_STATUS_NEED_DATA bit will be set. | ||||
| 	 */ | ||||
| 	int (*process) (void *object); | ||||
| }; | ||||
|  |  | |||
|  | @ -613,7 +613,7 @@ static int impl_node_process(void *object) | |||
| 			input->buffer_id, | ||||
| 			this->n_buffers); | ||||
| 
 | ||||
| 	if (input->status == SPA_STATUS_HAVE_BUFFER && | ||||
| 	if (input->status == SPA_STATUS_HAVE_DATA && | ||||
| 	    input->buffer_id < this->n_buffers) { | ||||
| 		struct buffer *b = &this->buffers[input->buffer_id]; | ||||
| 
 | ||||
|  | @ -632,7 +632,7 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 		input->status = SPA_STATUS_OK; | ||||
| 	} | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -635,8 +635,8 @@ static int impl_node_process(void *object) | |||
| 	io = this->io; | ||||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < this->n_buffers) { | ||||
| 		recycle_buffer(this, io->buffer_id); | ||||
|  | @ -655,9 +655,9 @@ static int impl_node_process(void *object) | |||
| 	spa_log_trace_fp(this->log, NAME " %p: dequeue buffer %d", this, b->id); | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -987,9 +987,9 @@ static int handle_play(struct state *state, uint64_t nsec, | |||
| 
 | ||||
| 		spa_log_trace_fp(state->log, "alsa-util %p: %d", state, io->status); | ||||
| 
 | ||||
| 		io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 		res = spa_node_call_ready(&state->callbacks, SPA_STATUS_NEED_BUFFER); | ||||
| 		res = spa_node_call_ready(&state->callbacks, SPA_STATUS_NEED_DATA); | ||||
| 	} | ||||
| 	else { | ||||
| 		res = spa_alsa_write(state, 0); | ||||
|  | @ -1018,15 +1018,15 @@ static int handle_capture(struct state *state, uint64_t nsec, | |||
| 
 | ||||
| 	if (!spa_list_is_empty(&state->ready)) { | ||||
| 		io = state->io; | ||||
| 		if (io != NULL && io->status != SPA_STATUS_HAVE_BUFFER) { | ||||
| 		if (io != NULL && io->status != SPA_STATUS_HAVE_DATA) { | ||||
| 			struct buffer *b = spa_list_first(&state->ready, struct buffer, link); | ||||
| 			spa_list_remove(&b->link); | ||||
| 
 | ||||
| 			io->buffer_id = b->id; | ||||
| 			io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 			io->status = SPA_STATUS_HAVE_DATA; | ||||
| 		} | ||||
| 	} | ||||
| 	spa_node_call_ready(&state->callbacks, SPA_STATUS_HAVE_BUFFER); | ||||
| 	spa_node_call_ready(&state->callbacks, SPA_STATUS_HAVE_DATA); | ||||
| 	return 0; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -138,7 +138,7 @@ static int make_link(struct impl *this, | |||
| 	l->in_port = in_port; | ||||
| 	l->in_flags = 0; | ||||
| 	l->negotiated = false; | ||||
| 	l->io.status = SPA_STATUS_NEED_BUFFER; | ||||
| 	l->io.status = SPA_STATUS_NEED_DATA; | ||||
| 	l->io.buffer_id = SPA_ID_INVALID; | ||||
| 	l->n_buffers = 0; | ||||
| 	l->min_buffers = min_buffers; | ||||
|  | @ -1082,15 +1082,15 @@ static int impl_node_process(void *object) | |||
| 			if (r < 0) | ||||
| 				return r; | ||||
| 
 | ||||
| 			if (r & SPA_STATUS_HAVE_BUFFER) | ||||
| 			if (r & SPA_STATUS_HAVE_DATA) | ||||
| 				ready++; | ||||
| 
 | ||||
| 			if (i == 0) | ||||
| 				res |= r & SPA_STATUS_NEED_BUFFER; | ||||
| 				res |= r & SPA_STATUS_NEED_DATA; | ||||
| 			if (i == this->n_nodes-1) | ||||
| 				res |= r & SPA_STATUS_HAVE_BUFFER; | ||||
| 				res |= r & SPA_STATUS_HAVE_DATA; | ||||
| 		} | ||||
| 		if (res & SPA_STATUS_HAVE_BUFFER) | ||||
| 		if (res & SPA_STATUS_HAVE_DATA) | ||||
| 			break; | ||||
| 		if (ready == 0) | ||||
| 			break; | ||||
|  |  | |||
|  | @ -887,11 +887,11 @@ static int impl_node_process(void *object) | |||
| 	if (outport->control) | ||||
| 		process_control(this, outport, &outport->control->sequence); | ||||
| 
 | ||||
| 	if (outio->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (outio->status == SPA_STATUS_HAVE_DATA) | ||||
| 		goto done; | ||||
| 
 | ||||
| 	if (inio->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 	if (inio->status != SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	/* recycle */ | ||||
| 	if (outio->buffer_id < outport->n_buffers) { | ||||
|  | @ -933,13 +933,13 @@ static int impl_node_process(void *object) | |||
| 				    n_src_datas, src_datas, n_samples); | ||||
| 	} | ||||
| 
 | ||||
| 	outio->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	outio->status = SPA_STATUS_HAVE_DATA; | ||||
| 	outio->buffer_id = dbuf->id; | ||||
| 
 | ||||
| 	inio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	inio->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
|       done: | ||||
| 	return SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA | SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -814,15 +814,15 @@ static int impl_node_process(void *object) | |||
| 			inio, inio->status, inio->buffer_id, | ||||
| 			outio, outio->status, outio->buffer_id); | ||||
| 
 | ||||
| 	if (outio->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (outio->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return inio->status | outio->status; | ||||
| 
 | ||||
| 	if (outio->buffer_id < outport->n_buffers) { | ||||
| 		recycle_buffer(this, outport, outio->buffer_id); | ||||
| 		outio->buffer_id = SPA_ID_INVALID; | ||||
| 	} | ||||
| 	if (inio->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 	if (inio->status != SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 	if (inio->buffer_id >= inport->n_buffers) | ||||
| 		return inio->status = -EINVAL; | ||||
| 
 | ||||
|  | @ -867,12 +867,12 @@ static int impl_node_process(void *object) | |||
| 	if (!this->is_passthrough) | ||||
| 		convert_process(&this->conv, dst_datas, src_datas, n_samples); | ||||
| 
 | ||||
| 	inio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	res |= SPA_STATUS_NEED_BUFFER; | ||||
| 	inio->status = SPA_STATUS_NEED_DATA; | ||||
| 	res |= SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	outio->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	outio->status = SPA_STATUS_HAVE_DATA; | ||||
| 	outio->buffer_id = outbuf->id; | ||||
| 	res |= SPA_STATUS_HAVE_BUFFER; | ||||
| 	res |= SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return res; | ||||
| } | ||||
|  |  | |||
|  | @ -865,7 +865,7 @@ static inline int get_in_buffer(struct impl *this, struct port *port, struct buf | |||
| 				this, port->id); | ||||
| 		return -EIO; | ||||
| 	} | ||||
| 	if (io->status != SPA_STATUS_HAVE_BUFFER || | ||||
| 	if (io->status != SPA_STATUS_HAVE_DATA || | ||||
| 	    io->buffer_id >= port->n_buffers) { | ||||
| 		spa_log_trace_fp(this->log, NAME " %p: empty port %d %p %d %d %d", | ||||
| 				this, port->id, io, io->status, io->buffer_id, | ||||
|  | @ -874,7 +874,7 @@ static inline int get_in_buffer(struct impl *this, struct port *port, struct buf | |||
| 	} | ||||
| 
 | ||||
| 	*buf = &port->buffers[io->buffer_id]; | ||||
| 	io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	return 0; | ||||
| } | ||||
|  | @ -884,8 +884,8 @@ static inline int get_out_buffer(struct impl *this, struct port *port, struct bu | |||
| 	struct spa_io_buffers *io; | ||||
| 
 | ||||
| 	if ((io = port->io) == NULL || | ||||
| 	    io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	    io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) | ||||
| 		queue_buffer(this, port, io->buffer_id); | ||||
|  | @ -893,7 +893,7 @@ static inline int get_out_buffer(struct impl *this, struct port *port, struct bu | |||
| 	if ((*buf = dequeue_buffer(this, port)) == NULL) | ||||
| 		return -EPIPE; | ||||
| 
 | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 	io->buffer_id = (*buf)->id; | ||||
| 
 | ||||
| 	return 0; | ||||
|  | @ -978,7 +978,7 @@ static int impl_node_process(void *object) | |||
| 		spa_log_trace_fp(this->log, NAME " %p: %d %d %d %p", this, | ||||
| 				sd->chunk->size, maxsize, n_samples, src_datas[i]); | ||||
| 
 | ||||
| 		SPA_FLAG_SET(res, SPA_STATUS_NEED_BUFFER); | ||||
| 		SPA_FLAG_SET(res, SPA_STATUS_NEED_DATA); | ||||
| 	} | ||||
| 
 | ||||
| 	for (i = 0; i < this->monitor_count; i++) | ||||
|  | @ -995,7 +995,7 @@ static int impl_node_process(void *object) | |||
| 	if (!this->is_passthrough) | ||||
| 		convert_process(&this->conv, dst_datas, src_datas, n_samples); | ||||
| 
 | ||||
| 	return res | SPA_STATUS_HAVE_BUFFER; | ||||
| 	return res | SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -723,11 +723,11 @@ static int impl_node_process(void *object) | |||
| 	spa_log_trace_fp(this->log, NAME " %p: status %d %d %d", | ||||
| 			this, inio->status, outio->status, inio->buffer_id); | ||||
| 
 | ||||
| 	if (outio->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (outio->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (inio->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 	if (inio->status != SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	/* recycle */ | ||||
| 	if (outio->buffer_id < outport->n_buffers) { | ||||
|  | @ -794,19 +794,19 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	inport->offset += in_len * sizeof(float); | ||||
| 	if (inport->offset >= size || flush_in) { | ||||
| 		inio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		inio->status = SPA_STATUS_NEED_DATA; | ||||
| 		inport->offset = 0; | ||||
| 		SPA_FLAG_SET(res, SPA_STATUS_NEED_BUFFER); | ||||
| 		SPA_FLAG_SET(res, SPA_STATUS_NEED_DATA); | ||||
| 		spa_log_trace_fp(this->log, NAME " %p: return input buffer", this); | ||||
| 	} | ||||
| 
 | ||||
| 	outport->offset += out_len * sizeof(float); | ||||
| 	if (outport->offset > 0 && (outport->offset >= maxsize || flush_out)) { | ||||
| 		outio->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		outio->status = SPA_STATUS_HAVE_DATA; | ||||
| 		outio->buffer_id = dbuf->id; | ||||
| 		dequeue_buffer(this, dbuf); | ||||
| 		outport->offset = 0; | ||||
| 		SPA_FLAG_SET(res, SPA_STATUS_HAVE_BUFFER); | ||||
| 		SPA_FLAG_SET(res, SPA_STATUS_HAVE_DATA); | ||||
| 		spa_log_trace_fp(this->log, NAME " %p: have output buffer", this); | ||||
| 	} | ||||
| 
 | ||||
|  |  | |||
|  | @ -833,8 +833,8 @@ static int impl_node_process(void *object) | |||
| 	spa_log_trace_fp(this->log, NAME " %p: status %p %d %d", this, | ||||
| 			inio, inio->status, inio->buffer_id); | ||||
| 
 | ||||
| 	if (inio->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 	if (inio->status != SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 	if (inio->buffer_id >= inport->n_buffers) | ||||
| 		return inio->status = -EINVAL; | ||||
| 
 | ||||
|  | @ -865,8 +865,8 @@ static int impl_node_process(void *object) | |||
| 		spa_log_trace_fp(this->log, NAME " %p: %d %p %d %d %d", this, i, | ||||
| 				outio, outio->status, outio->buffer_id, outport->stride); | ||||
| 
 | ||||
| 		if (outio->status == SPA_STATUS_HAVE_BUFFER) { | ||||
| 			res |= SPA_STATUS_HAVE_BUFFER; | ||||
| 		if (outio->status == SPA_STATUS_HAVE_DATA) { | ||||
| 			res |= SPA_STATUS_HAVE_DATA; | ||||
| 			goto empty; | ||||
| 		} | ||||
| 
 | ||||
|  | @ -897,9 +897,9 @@ static int impl_node_process(void *object) | |||
| 			dd[j].chunk->size = n_samples * outport->stride; | ||||
| 		} | ||||
| 
 | ||||
| 		outio->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		outio->status = SPA_STATUS_HAVE_DATA; | ||||
| 		outio->buffer_id = dbuf->id; | ||||
| 		res |= SPA_STATUS_HAVE_BUFFER; | ||||
| 		res |= SPA_STATUS_HAVE_DATA; | ||||
| 	} | ||||
| 	while (n_dst_datas < this->port_count) { | ||||
| 		spa_log_trace_fp(this->log, NAME" %p: %d fill output", this, n_dst_datas); | ||||
|  | @ -913,8 +913,8 @@ static int impl_node_process(void *object) | |||
| 	if (!this->is_passthrough) | ||||
| 		convert_process(&this->conv, dst_datas, src_datas, n_samples); | ||||
| 
 | ||||
| 	inio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	res |= SPA_STATUS_NEED_BUFFER; | ||||
| 	inio->status = SPA_STATUS_NEED_DATA; | ||||
| 	res |= SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	return res; | ||||
| } | ||||
|  |  | |||
|  | @ -753,7 +753,7 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	spa_log_trace_fp(this->log, NAME " %p: status %d", this, io->status); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		goto done; | ||||
| 
 | ||||
| 	/* recycle */ | ||||
|  | @ -765,11 +765,11 @@ static int impl_node_process(void *object) | |||
| 	if ((buf = dequeue_buffer(this, port)) == NULL) | ||||
| 		return io->status = -EPIPE; | ||||
| 
 | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 	io->buffer_id = buf->id; | ||||
| 
 | ||||
|       done: | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -768,9 +768,9 @@ static int mix_output(struct impl *this, size_t n_bytes) | |||
| 	od[0].chunk->stride = 0; | ||||
| 
 | ||||
| 	outio->buffer_id = outbuf->id; | ||||
| 	outio->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	outio->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static int impl_node_process(void *object) | ||||
|  | @ -789,7 +789,7 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	spa_log_trace(this->log, NAME " %p: status %d", this, outio->status); | ||||
| 
 | ||||
| 	if (outio->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (outio->status == SPA_STATUS_HAVE_DATA) | ||||
| 		goto done; | ||||
| 
 | ||||
| 	/* recycle */ | ||||
|  | @ -823,10 +823,10 @@ static int impl_node_process(void *object) | |||
| 				      i, inport->queued_bytes, inio->status); | ||||
| 
 | ||||
| 			if (inport->queued_bytes == 0) { | ||||
| 				inio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 				inio->status = SPA_STATUS_NEED_DATA; | ||||
| 			} | ||||
| 		} | ||||
| 		outio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		outio->status = SPA_STATUS_NEED_DATA; | ||||
| 	} | ||||
|       done: | ||||
| 	return outio->status; | ||||
|  |  | |||
|  | @ -373,7 +373,7 @@ static int make_buffer(struct impl *this) | |||
| 	set_timer(this, true); | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return io->status; | ||||
| } | ||||
|  | @ -385,7 +385,7 @@ static void on_output(struct spa_source *source) | |||
| 
 | ||||
| 	res = make_buffer(this); | ||||
| 
 | ||||
| 	if (res == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (res == SPA_STATUS_HAVE_DATA) | ||||
| 		spa_node_call_ready(&this->callbacks, res); | ||||
| } | ||||
| 
 | ||||
|  | @ -891,15 +891,15 @@ static int impl_node_process(void *object) | |||
| 	if (port->io_control) | ||||
| 		process_control(this, &port->io_control->sequence); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) { | ||||
| 		reuse_buffer(this, port, io->buffer_id); | ||||
| 		io->buffer_id = SPA_ID_INVALID; | ||||
| 	} | ||||
| 
 | ||||
| 	if (!this->props.live && (io->status == SPA_STATUS_NEED_BUFFER)) | ||||
| 	if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA)) | ||||
| 		return make_buffer(this); | ||||
| 	else | ||||
| 		return SPA_STATUS_OK; | ||||
|  |  | |||
|  | @ -699,9 +699,9 @@ static void a2dp_on_timeout(struct spa_source *source) | |||
| 	if (spa_list_is_empty(&port->ready) || port->need_data) { | ||||
| 		spa_log_trace(this->log, NAME " %p: %d", this, io->status); | ||||
| 
 | ||||
| 		io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER); | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA); | ||||
| 	} | ||||
| 	flush_data(this, now_time); | ||||
| } | ||||
|  | @ -1304,7 +1304,7 @@ static int impl_node_process(void *object) | |||
| 	if (!spa_list_is_empty(&port->ready)) | ||||
| 		flush_data(this, now_time); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER && io->buffer_id < port->n_buffers) { | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) { | ||||
| 		struct buffer *b = &port->buffers[io->buffer_id]; | ||||
| 
 | ||||
| 		if (!b->outstanding) { | ||||
|  | @ -1326,7 +1326,7 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 		io->status = SPA_STATUS_OK; | ||||
| 	} | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -374,21 +374,21 @@ static void decode_sbc_data(struct impl *this, uint8_t *src, size_t src_size) | |||
| 	} | ||||
| 
 | ||||
| 	/* Process a buffer if there is one ready and IO does not have one */ | ||||
| 	if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_DATA) { | ||||
| 		/* Get the ready buffer and remove it from the ready list */ | ||||
| 		buffer = spa_list_first(&port->ready, struct buffer, link); | ||||
| 		spa_list_remove(&buffer->link); | ||||
| 
 | ||||
| 		/* Mark the buffer to be processed */ | ||||
| 		io->buffer_id = buffer->id; | ||||
| 		io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 		/* Add the buffer to the free list */ | ||||
| 		spa_list_append(&port->free, &buffer->link); | ||||
| 		buffer->outstanding = false; | ||||
| 
 | ||||
| 		/* Set the done status as have buffer */ | ||||
| 		io_done_status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io_done_status = SPA_STATUS_HAVE_DATA; | ||||
| 	} | ||||
| 
 | ||||
| 	spa_node_call_ready(&this->callbacks, io_done_status); | ||||
|  | @ -983,8 +983,8 @@ static int impl_node_process(void *object) | |||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	/* Return if we already have a buffer */ | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	/* Return if there is not buffers ready to be processed */ | ||||
| 	if (spa_list_is_empty(&port->ready)) | ||||
|  | @ -996,14 +996,14 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	/* Set the new buffer in IO */ | ||||
| 	io->buffer_id = buffer->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	/* Add the buffer to the free list */ | ||||
| 	spa_list_append(&port->free, &buffer->link); | ||||
| 	buffer->outstanding = false; | ||||
| 
 | ||||
| 	/* Notify we have a buffer ready to be processed */ | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -483,8 +483,8 @@ static void sco_on_timeout(struct spa_source *source) | |||
| 
 | ||||
| 	/* Notify we need a new buffer if we have processed all of them */ | ||||
| 	if (spa_list_is_empty(&port->ready) || port->need_data) { | ||||
| 		io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER); | ||||
| 		io->status = SPA_STATUS_NEED_DATA; | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA); | ||||
| 	} | ||||
| 
 | ||||
| 	/* Render the buffers */ | ||||
|  | @ -994,7 +994,7 @@ static int impl_node_process(void *object) | |||
| 	if (!spa_list_is_empty(&port->ready)) | ||||
| 		render_buffers(this, now_time); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER && io->buffer_id < port->n_buffers) { | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) { | ||||
| 		struct buffer *b = &port->buffers[io->buffer_id]; | ||||
| 
 | ||||
| 		if (!b->outstanding) { | ||||
|  | @ -1017,7 +1017,7 @@ static int impl_node_process(void *object) | |||
| 		io->status = SPA_STATUS_OK; | ||||
| 	} | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -379,21 +379,21 @@ static void sco_on_ready_read(struct spa_source *source) | |||
| 	} | ||||
| 
 | ||||
| 	/* Process a buffer if there is one ready and IO does not have one */ | ||||
| 	if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (!spa_list_is_empty(&port->ready) && io->status != SPA_STATUS_HAVE_DATA) { | ||||
| 		/* Get the ready buffer and remove it from the ready list */ | ||||
| 		buffer = spa_list_first(&port->ready, struct buffer, link); | ||||
| 		spa_list_remove(&buffer->link); | ||||
| 
 | ||||
| 		/* Mark the buffer to be processed */ | ||||
| 		io->buffer_id = buffer->id; | ||||
| 		io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 		/* Add the buffer to the free list */ | ||||
| 		spa_list_append(&port->free, &buffer->link); | ||||
| 		buffer->outstanding = false; | ||||
| 
 | ||||
| 		/* Set the done status as have buffer */ | ||||
| 		io_done_status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io_done_status = SPA_STATUS_HAVE_DATA; | ||||
| 	} | ||||
| 
 | ||||
| 	/* Notify the current status */ | ||||
|  | @ -903,8 +903,8 @@ static int impl_node_process(void *object) | |||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	/* Return if we already have a buffer */ | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	/* Return if there is not buffers ready to be processed */ | ||||
| 	if (spa_list_is_empty(&port->ready)) | ||||
|  | @ -916,14 +916,14 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	/* Set the new buffer in IO */ | ||||
| 	io->buffer_id = buffer->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	/* Add the buffer to the free list */ | ||||
| 	spa_list_append(&port->free, &buffer->link); | ||||
| 	buffer->outstanding = false; | ||||
| 
 | ||||
| 	/* Notify we have a buffer ready to be processed */ | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -353,7 +353,7 @@ static void client_process(void *data) | |||
| 			s->bar.beat = jp->bar * jp->beats_per_bar + jp->beat; | ||||
| 		} | ||||
| 	} | ||||
| 	spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER); | ||||
| 	spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA); | ||||
| } | ||||
| 
 | ||||
| static const struct spa_jack_client_events client_events = { | ||||
|  | @ -730,7 +730,7 @@ static int impl_node_process(void *object) | |||
| 		dst = jack_port_get_buffer(port->jack_port, n_frames); | ||||
| 
 | ||||
| 		if (io == NULL || | ||||
| 		    io->status != SPA_STATUS_HAVE_BUFFER || | ||||
| 		    io->status != SPA_STATUS_HAVE_DATA || | ||||
| 		    io->buffer_id >= port->n_buffers) { | ||||
| 			memset(dst, 0, n_frames * sizeof(float)); | ||||
| 			continue; | ||||
|  | @ -742,9 +742,9 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 		memcpy(dst, src->data, n_frames * port->stride); | ||||
| 
 | ||||
| 		io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 		res |= SPA_STATUS_NEED_BUFFER; | ||||
| 		res |= SPA_STATUS_NEED_DATA; | ||||
| 	} | ||||
| 	return res; | ||||
| } | ||||
|  |  | |||
|  | @ -741,7 +741,7 @@ static int impl_node_process(void *object) | |||
| 		const void *src; | ||||
| 		uint32_t n_frames = this->client->buffer_size; | ||||
| 
 | ||||
| 		if (io == NULL || io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		if (io == NULL || io->status == SPA_STATUS_HAVE_DATA) | ||||
| 			continue; | ||||
| 
 | ||||
| 		if (io->buffer_id < port->n_buffers) { | ||||
|  | @ -765,9 +765,9 @@ static int impl_node_process(void *object) | |||
| 		d->chunk->flags = 0; | ||||
| 
 | ||||
| 		io->buffer_id = b->id; | ||||
| 		io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 		res |= SPA_STATUS_HAVE_BUFFER; | ||||
| 		res |= SPA_STATUS_HAVE_DATA; | ||||
| 	} | ||||
| 	return res; | ||||
| } | ||||
|  |  | |||
|  | @ -232,8 +232,8 @@ static int consume_buffer(struct impl *this) | |||
| 	read_timer(this); | ||||
| 
 | ||||
| 	if (spa_list_is_empty(&port->ready)) { | ||||
| 		io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_BUFFER); | ||||
| 		io->status = SPA_STATUS_NEED_DATA; | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_NEED_DATA); | ||||
| 	} | ||||
| 	if (spa_list_is_empty(&port->ready)) { | ||||
| 		spa_log_error(this->log, NAME " %p: no buffers", this); | ||||
|  | @ -264,10 +264,10 @@ static int consume_buffer(struct impl *this) | |||
| 	set_timer(this, true); | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	io->status = SPA_STATUS_NEED_DATA; | ||||
| 	b->outstanding = true; | ||||
| 
 | ||||
| 	return SPA_STATUS_NEED_BUFFER; | ||||
| 	return SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static void on_input(struct spa_source *source) | ||||
|  | @ -636,7 +636,7 @@ static int impl_node_process(void *object) | |||
| 	io = port->io; | ||||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER && io->buffer_id < port->n_buffers) { | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA && io->buffer_id < port->n_buffers) { | ||||
| 		struct buffer *b = &port->buffers[io->buffer_id]; | ||||
| 
 | ||||
| 		if (!b->outstanding) { | ||||
|  |  | |||
|  | @ -276,9 +276,9 @@ static int make_buffer(struct impl *this) | |||
| 	set_timer(this, true); | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static void on_output(struct spa_source *source) | ||||
|  | @ -288,7 +288,7 @@ static void on_output(struct spa_source *source) | |||
| 
 | ||||
| 	res = make_buffer(this); | ||||
| 
 | ||||
| 	if (res == SPA_STATUS_HAVE_BUFFER && this->callbacks.funcs) | ||||
| 	if (res == SPA_STATUS_HAVE_DATA && this->callbacks.funcs) | ||||
| 		spa_node_call_ready(&this->callbacks, res); | ||||
| } | ||||
| 
 | ||||
|  | @ -679,8 +679,8 @@ static int impl_node_process(void *object) | |||
| 	io = port->io; | ||||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) { | ||||
| 		reuse_buffer(this, port, io->buffer_id); | ||||
|  | @ -688,7 +688,7 @@ static int impl_node_process(void *object) | |||
| 	} | ||||
| 
 | ||||
| 	if (this->callbacks.funcs == NULL && | ||||
| 			(io->status == SPA_STATUS_NEED_BUFFER)) | ||||
| 			(io->status == SPA_STATUS_NEED_DATA)) | ||||
| 		return make_buffer(this); | ||||
| 	else | ||||
| 		return SPA_STATUS_OK; | ||||
|  |  | |||
|  | @ -842,8 +842,8 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	spa_log_trace(this->log, NAME " %p; status %d", this, io->status); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) { | ||||
| 		if ((res = spa_v4l2_buffer_recycle(this, io->buffer_id)) < 0) | ||||
|  | @ -861,9 +861,9 @@ static int impl_node_process(void *object) | |||
| 	spa_log_trace(this->log, NAME " %p: dequeue buffer %d", this, b->id); | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -1214,16 +1214,16 @@ static int mmap_read(struct impl *this) | |||
| 	SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUTSTANDING); | ||||
| 
 | ||||
| 	io = port->io; | ||||
| 	if (io != NULL && io->status != SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (io != NULL && io->status != SPA_STATUS_HAVE_DATA) { | ||||
| 		io->buffer_id = b->id; | ||||
| 		io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io->status = SPA_STATUS_HAVE_DATA; | ||||
| 	} | ||||
| 	else { | ||||
| 		spa_list_append(&port->queue, &b->link); | ||||
| 	} | ||||
| 
 | ||||
| 	spa_log_trace(this->log, "v4l2 %p: now queued %d", this, b->id); | ||||
| 	spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_BUFFER); | ||||
| 	spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA); | ||||
| 
 | ||||
| 	return 0; | ||||
| } | ||||
|  |  | |||
|  | @ -770,7 +770,7 @@ static int impl_node_process(void *object) | |||
| 	status = spa_node_process(this->slave); | ||||
| 
 | ||||
| 	if (this->monitor) | ||||
| 		status |= SPA_STATUS_HAVE_BUFFER; | ||||
| 		status |= SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (this->direction == SPA_DIRECTION_OUTPUT && !this->master) { | ||||
| 		if (this->use_converter) | ||||
|  |  | |||
|  | @ -324,7 +324,7 @@ static int make_buffer(struct impl *this) | |||
| 	set_timer(this, true); | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return io->status; | ||||
| } | ||||
|  | @ -336,7 +336,7 @@ static void on_output(struct spa_source *source) | |||
| 
 | ||||
| 	res = make_buffer(this); | ||||
| 
 | ||||
| 	if (res == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (res == SPA_STATUS_HAVE_DATA) | ||||
| 		spa_node_call_ready(&this->callbacks, res); | ||||
| } | ||||
| 
 | ||||
|  | @ -776,15 +776,15 @@ static int impl_node_process(void *object) | |||
| 	io = port->io; | ||||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) { | ||||
| 		reuse_buffer(this, port, io->buffer_id); | ||||
| 		io->buffer_id = SPA_ID_INVALID; | ||||
| 	} | ||||
| 
 | ||||
| 	if (!this->props.live && (io->status == SPA_STATUS_NEED_BUFFER)) | ||||
| 	if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA)) | ||||
| 		return make_buffer(this); | ||||
| 	else | ||||
| 		return SPA_STATUS_OK; | ||||
|  |  | |||
|  | @ -680,8 +680,8 @@ static int impl_node_process(void *object) | |||
| 	output = out_port->io; | ||||
| 	spa_return_val_if_fail(output != NULL, -EIO); | ||||
| 
 | ||||
| 	if (output->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (output->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	/* recycle */ | ||||
| 	if (output->buffer_id < out_port->n_buffers) { | ||||
|  | @ -693,8 +693,8 @@ static int impl_node_process(void *object) | |||
| 	input = in_port->io; | ||||
| 	spa_return_val_if_fail(input != NULL, -EIO); | ||||
| 
 | ||||
| 	if (input->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 	if (input->status != SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	if (input->buffer_id >= in_port->n_buffers) { | ||||
| 		input->status = -EINVAL; | ||||
|  | @ -712,11 +712,11 @@ static int impl_node_process(void *object) | |||
| 	do_volume(this, dbuf->outbuf, sbuf->outbuf); | ||||
| 
 | ||||
| 	output->buffer_id = dbuf->id; | ||||
| 	output->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	output->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	input->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	input->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -308,7 +308,7 @@ static int make_buffer(struct impl *this) | |||
| 		SPA_FLAG_SET(b->flags, BUFFER_FLAG_OUT); | ||||
| 		spa_list_append(&port->ready, &b->link); | ||||
| 
 | ||||
| 		res = SPA_STATUS_HAVE_BUFFER; | ||||
| 		res = SPA_STATUS_HAVE_DATA; | ||||
| 	} | ||||
| next: | ||||
| 	this->frame_count++; | ||||
|  | @ -343,7 +343,7 @@ static void on_output(struct spa_source *source) | |||
| 	if (io == NULL) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) { | ||||
|  | @ -358,7 +358,7 @@ static void on_output(struct spa_source *source) | |||
| 		spa_list_remove(&b->link); | ||||
| 
 | ||||
| 		io->buffer_id = b->id; | ||||
| 		io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 		io->status = SPA_STATUS_HAVE_DATA; | ||||
|         } | ||||
| 	spa_node_call_ready(&this->callbacks, res); | ||||
| } | ||||
|  | @ -789,15 +789,15 @@ static int impl_node_process(void *object) | |||
| 	io = port->io; | ||||
| 	spa_return_val_if_fail(io != NULL, -EIO); | ||||
| 
 | ||||
| 	if (io->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_HAVE_BUFFER; | ||||
| 	if (io->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	if (io->buffer_id < port->n_buffers) { | ||||
| 		reuse_buffer(this, port, io->buffer_id); | ||||
| 		io->buffer_id = SPA_ID_INVALID; | ||||
| 	} | ||||
| 
 | ||||
| 	if (!this->props.live && (io->status == SPA_STATUS_NEED_BUFFER)) | ||||
| 	if (!this->props.live && (io->status == SPA_STATUS_NEED_DATA)) | ||||
| 		return make_buffer(this); | ||||
| 	else | ||||
| 		return SPA_STATUS_OK; | ||||
|  |  | |||
|  | @ -428,11 +428,11 @@ static int impl_node_process(void *object) | |||
| 	struct spa_buffer *buf; | ||||
| 	int res; | ||||
| 
 | ||||
| 	if (d->io->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 	if (d->io->status != SPA_STATUS_HAVE_DATA) | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	if (d->io->buffer_id >= d->n_buffers) | ||||
| 		return SPA_STATUS_NEED_BUFFER; | ||||
| 		return SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	buf = d->buffers[d->io->buffer_id]; | ||||
| 
 | ||||
|  | @ -443,7 +443,7 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	update_param(d); | ||||
| 
 | ||||
| 	return d->io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	return d->io->status = SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -442,11 +442,11 @@ static int impl_node_process(void *object) | |||
| 	od[0].chunk->stride = 0; | ||||
| 
 | ||||
| 	io->buffer_id = b->id; | ||||
| 	io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	io->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	update_volume(d); | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -316,9 +316,9 @@ static int impl_node_process(void *object) | |||
| 
 | ||||
| 	handle_events(d); | ||||
| 
 | ||||
| 	d->io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	d->io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_NEED_BUFFER; | ||||
| 	return SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -707,7 +707,7 @@ static int impl_node_process(void *object) | |||
| 	spa_log_trace_fp(this->log, NAME " %p: status %p %d %d", | ||||
| 			this, outio, outio->status, outio->buffer_id); | ||||
| 
 | ||||
| 	if (outio->status == SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (outio->status == SPA_STATUS_HAVE_DATA) | ||||
| 		return outio->status; | ||||
| 
 | ||||
| 	/* recycle */ | ||||
|  | @ -729,7 +729,7 @@ static int impl_node_process(void *object) | |||
| 		if (!inport->valid || | ||||
| 		    (inio = inport->io) == NULL || | ||||
| 		    inio->buffer_id >= inport->n_buffers || | ||||
| 		    inio->status != SPA_STATUS_HAVE_BUFFER) { | ||||
| 		    inio->status != SPA_STATUS_HAVE_DATA) { | ||||
| 			spa_log_trace_fp(this->log, NAME " %p: skip input %d %d %p %d %d %d", this, | ||||
| 				i, inport->valid, inio, | ||||
| 				inio ? inio->status : -1, | ||||
|  | @ -746,7 +746,7 @@ static int impl_node_process(void *object) | |||
| 		maxsize = SPA_MIN(inb->buffer->datas[0].chunk->size, maxsize); | ||||
| 
 | ||||
| 		buffers[n_buffers++] = inb; | ||||
| 		inio->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		inio->status = SPA_STATUS_NEED_DATA; | ||||
| 	} | ||||
| 
 | ||||
| 	outb = dequeue_buffer(this, outport); | ||||
|  | @ -786,9 +786,9 @@ static int impl_node_process(void *object) | |||
| 	} | ||||
| 
 | ||||
| 	outio->buffer_id = outb->id; | ||||
| 	outio->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 	outio->status = SPA_STATUS_HAVE_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA | SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_node = { | ||||
|  |  | |||
|  | @ -1074,7 +1074,7 @@ static void node_on_data_fd_events(struct spa_source *source) | |||
| 			spa_log_warn(this->log, NAME" %p: read %"PRIu64" failed %m", this, cmd); | ||||
| 
 | ||||
| 		spa_log_trace_fp(this->log, NAME" %p: got ready", this); | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_BUFFER); | ||||
| 		spa_node_call_ready(&this->callbacks, SPA_STATUS_HAVE_DATA); | ||||
| 	} | ||||
| } | ||||
| 
 | ||||
|  | @ -1325,7 +1325,7 @@ static int port_init_mix(void *data, struct pw_port_mix *mix) | |||
| 	mix->io = SPA_MEMBER(impl->io_areas->map->ptr, | ||||
| 			mix->id * sizeof(struct spa_io_buffers), void); | ||||
| 	mix->io->buffer_id = SPA_ID_INVALID; | ||||
| 	mix->io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	mix->io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	pw_log_debug(NAME " %p: init mix io %d %p %p", impl, mix->id, mix->io, | ||||
| 			impl->io_areas->map->ptr); | ||||
|  | @ -1453,7 +1453,7 @@ impl_mix_port_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id) | |||
| 
 | ||||
| static int impl_mix_process(void *object) | ||||
| { | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static const struct spa_node_methods impl_port_mix = { | ||||
|  |  | |||
|  | @ -1044,7 +1044,7 @@ static int node_ready(void *d, int status) | |||
| 	pw_log_trace("node %p: ready driver:%d exported:%d status:%d", node, | ||||
| 			node->driver, node->exported, status); | ||||
| 
 | ||||
| 	if (status == SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (status == SPA_STATUS_HAVE_DATA) { | ||||
| 		spa_list_for_each(p, &node->rt.output_mix, rt.node_link) | ||||
| 			spa_node_process(p->mix); | ||||
| 	} | ||||
|  |  | |||
|  | @ -1325,7 +1325,7 @@ struct pw_link *pw_link_new(struct pw_core *core, | |||
| 	this->info.props = &this->properties->dict; | ||||
| 
 | ||||
| 	impl->io.buffer_id = SPA_ID_INVALID; | ||||
| 	impl->io.status = SPA_STATUS_NEED_BUFFER; | ||||
| 	impl->io.status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	pw_port_init_mix(output, &this->rt.out_mix); | ||||
| 	pw_port_init_mix(input, &this->rt.in_mix); | ||||
|  |  | |||
|  | @ -844,7 +844,7 @@ static inline int process_node(void *data) | |||
| 	status = spa_node_process(this->node); | ||||
| 	a->state[0].status = status; | ||||
| 
 | ||||
| 	if (status & SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (status & SPA_STATUS_HAVE_DATA) { | ||||
| 		spa_list_for_each(p, &this->rt.output_mix, rt.node_link) | ||||
| 			spa_node_process(p->mix); | ||||
| 	} | ||||
|  | @ -1351,7 +1351,7 @@ static int node_ready(void *data, int status) | |||
| 	if (node->driver && !node->master) | ||||
| 		return 0; | ||||
| 
 | ||||
| 	if (status & SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (status & SPA_STATUS_HAVE_DATA) { | ||||
| 		spa_list_for_each(p, &node->rt.output_mix, rt.node_link) | ||||
| 			spa_node_process(p->mix); | ||||
| 	} | ||||
|  |  | |||
|  | @ -126,9 +126,9 @@ static int tee_process(void *object) | |||
| 				mix->port.port_id, io, mix->io, mix->io->buffer_id); | ||||
| 		*mix->io = *io; | ||||
| 	} | ||||
| 	io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
|         return SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER; | ||||
|         return SPA_STATUS_HAVE_DATA | SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static int tee_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id) | ||||
|  | @ -156,16 +156,16 @@ static int schedule_mix_input(void *object) | |||
| 	struct pw_port_mix *mix; | ||||
| 
 | ||||
| 	if (PW_PORT_IS_CONTROL(this)) | ||||
| 		return SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER; | ||||
| 		return SPA_STATUS_HAVE_DATA | SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	spa_list_for_each(mix, &this->rt.mix_list, rt_link) { | ||||
| 		pw_log_trace_fp(NAME" %p: mix input %d %p->%p %d %d", this, | ||||
| 				mix->port.port_id, mix->io, io, mix->io->status, mix->io->buffer_id); | ||||
| 		*io = *mix->io; | ||||
| 		mix->io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 		mix->io->status = SPA_STATUS_NEED_DATA; | ||||
| 		break; | ||||
| 	} | ||||
|         return SPA_STATUS_HAVE_BUFFER | SPA_STATUS_NEED_BUFFER; | ||||
|         return SPA_STATUS_HAVE_DATA | SPA_STATUS_NEED_DATA; | ||||
| } | ||||
| 
 | ||||
| static int schedule_mix_reuse_buffer(void *object, uint32_t port_id, uint32_t buffer_id) | ||||
|  | @ -427,7 +427,7 @@ struct pw_port *pw_port_new(enum pw_direction direction, | |||
| 
 | ||||
| 	pw_map_init(&this->mix_port_map, 64, 64); | ||||
| 
 | ||||
| 	this->rt.io.status = SPA_STATUS_NEED_BUFFER; | ||||
| 	this->rt.io.status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	if (info) | ||||
| 		update_info(this, info); | ||||
|  |  | |||
|  | @ -371,7 +371,7 @@ static int impl_send_command(void *object, const struct spa_command *command) | |||
| 			pw_log_debug(NAME" %p: start %d", stream, impl->direction); | ||||
| 
 | ||||
| 			if (impl->direction == SPA_DIRECTION_INPUT) { | ||||
| 				impl->io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 				impl->io->status = SPA_STATUS_NEED_DATA; | ||||
| 				impl->io->buffer_id = SPA_ID_INVALID; | ||||
| 			} | ||||
| 			else { | ||||
|  | @ -752,7 +752,7 @@ static int impl_node_process_input(void *object) | |||
| 	pw_log_trace(NAME" %p: process in status:%d id:%d ticks:%"PRIu64" delay:%"PRIi64" size:%"PRIi64, | ||||
| 			stream, io->status, io->buffer_id, impl->time.ticks, impl->time.delay, size); | ||||
| 
 | ||||
| 	if (io->status != SPA_STATUS_HAVE_BUFFER) | ||||
| 	if (io->status != SPA_STATUS_HAVE_DATA) | ||||
| 		goto done; | ||||
| 
 | ||||
| 	if ((b = get_buffer(stream, io->buffer_id)) == NULL) | ||||
|  | @ -773,9 +773,9 @@ done: | |||
| 	} | ||||
| 
 | ||||
| 	io->buffer_id = b ? b->id : SPA_ID_INVALID; | ||||
| 	io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 	io->status = SPA_STATUS_NEED_DATA; | ||||
| 
 | ||||
| 	return SPA_STATUS_HAVE_BUFFER; | ||||
| 	return SPA_STATUS_HAVE_DATA; | ||||
| } | ||||
| 
 | ||||
| static int impl_node_process_output(void *object) | ||||
|  | @ -792,7 +792,7 @@ again: | |||
| 			io->status, io->buffer_id, impl->time.ticks, impl->time.delay); | ||||
| 
 | ||||
| 	res = 0; | ||||
| 	if (io->status != SPA_STATUS_HAVE_BUFFER) { | ||||
| 	if (io->status != SPA_STATUS_HAVE_DATA) { | ||||
| 		/* recycle old buffer */ | ||||
| 		if ((b = get_buffer(stream, io->buffer_id)) != NULL) { | ||||
| 			pw_log_trace(NAME" %p: recycle buffer %d", stream, b->id); | ||||
|  | @ -802,11 +802,11 @@ again: | |||
| 		/* pop new buffer */ | ||||
| 		if ((b = pop_queue(impl, &impl->queued)) != NULL) { | ||||
| 			io->buffer_id = b->id; | ||||
| 			io->status = SPA_STATUS_HAVE_BUFFER; | ||||
| 			io->status = SPA_STATUS_HAVE_DATA; | ||||
| 			pw_log_trace(NAME" %p: pop %d %p", stream, b->id, io); | ||||
| 		} else { | ||||
| 			io->buffer_id = SPA_ID_INVALID; | ||||
| 			io->status = SPA_STATUS_NEED_BUFFER; | ||||
| 			io->status = SPA_STATUS_NEED_DATA; | ||||
| 			pw_log_trace(NAME" %p: no more buffers %p", stream, io); | ||||
| 			if (impl->draining) { | ||||
| 				call_drained(impl); | ||||
|  | @ -818,7 +818,7 @@ again: | |||
| 	if (!impl->draining && !SPA_FLAG_CHECK(impl->flags, PW_STREAM_FLAG_DRIVER)) { | ||||
| 		call_process(impl); | ||||
| 		if (spa_ringbuffer_get_read_index(&impl->queued.ring, &index) >= MIN_QUEUED && | ||||
| 		    io->status == SPA_STATUS_NEED_BUFFER) | ||||
| 		    io->status == SPA_STATUS_NEED_DATA) | ||||
| 			goto again; | ||||
| 	} | ||||
| exit: | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Wim Taymans
						Wim Taymans