mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	a2dpsource: add RateMatch IO
This commit is contained in:
		
							parent
							
								
									e17688a43b
								
							
						
					
					
						commit
						60eb8dae87
					
				
					 1 changed files with 25 additions and 1 deletions
				
			
		| 
						 | 
					@ -80,6 +80,7 @@ struct port {
 | 
				
			||||||
	uint64_t info_all;
 | 
						uint64_t info_all;
 | 
				
			||||||
	struct spa_port_info info;
 | 
						struct spa_port_info info;
 | 
				
			||||||
	struct spa_io_buffers *io;
 | 
						struct spa_io_buffers *io;
 | 
				
			||||||
 | 
						struct spa_io_rate_match *rate_match;
 | 
				
			||||||
	struct spa_param_info params[8];
 | 
						struct spa_param_info params[8];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct buffer buffers[MAX_BUFFERS];
 | 
						struct buffer buffers[MAX_BUFFERS];
 | 
				
			||||||
| 
						 | 
					@ -780,6 +781,25 @@ impl_node_port_enum_params(void *object, int seq,
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						case SPA_PARAM_IO:
 | 
				
			||||||
 | 
							switch (result.index) {
 | 
				
			||||||
 | 
							case 0:
 | 
				
			||||||
 | 
								param = spa_pod_builder_add_object(&b,
 | 
				
			||||||
 | 
									SPA_TYPE_OBJECT_ParamIO, id,
 | 
				
			||||||
 | 
									SPA_PARAM_IO_id,   SPA_POD_Id(SPA_IO_Buffers),
 | 
				
			||||||
 | 
									SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_buffers)));
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
							case 1:
 | 
				
			||||||
 | 
								param = spa_pod_builder_add_object(&b,
 | 
				
			||||||
 | 
									SPA_TYPE_OBJECT_ParamIO, id,
 | 
				
			||||||
 | 
									SPA_PARAM_IO_id,   SPA_POD_Id(SPA_IO_RateMatch),
 | 
				
			||||||
 | 
									SPA_PARAM_IO_size, SPA_POD_Int(sizeof(struct spa_io_rate_match)));
 | 
				
			||||||
 | 
								break;
 | 
				
			||||||
 | 
							default:
 | 
				
			||||||
 | 
								return 0;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -939,6 +959,9 @@ impl_node_port_set_io(void *object,
 | 
				
			||||||
	case SPA_IO_Buffers:
 | 
						case SPA_IO_Buffers:
 | 
				
			||||||
		port->io = data;
 | 
							port->io = data;
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
 | 
						case SPA_IO_RateMatch:
 | 
				
			||||||
 | 
							port->rate_match = data;
 | 
				
			||||||
 | 
							break;
 | 
				
			||||||
	default:
 | 
						default:
 | 
				
			||||||
		return -ENOENT;
 | 
							return -ENOENT;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1138,8 +1161,9 @@ impl_init(const struct spa_handle_factory *factory,
 | 
				
			||||||
	this->info.flags = SPA_NODE_FLAG_RT;
 | 
						this->info.flags = SPA_NODE_FLAG_RT;
 | 
				
			||||||
	this->params[0] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, SPA_PARAM_INFO_READ);
 | 
						this->params[0] = SPA_PARAM_INFO(SPA_PARAM_PropInfo, SPA_PARAM_INFO_READ);
 | 
				
			||||||
	this->params[1] = SPA_PARAM_INFO(SPA_PARAM_Props, SPA_PARAM_INFO_READWRITE);
 | 
						this->params[1] = SPA_PARAM_INFO(SPA_PARAM_Props, SPA_PARAM_INFO_READWRITE);
 | 
				
			||||||
 | 
						this->params[2] = SPA_PARAM_INFO(SPA_PARAM_IO, SPA_PARAM_INFO_READ);
 | 
				
			||||||
	this->info.params = this->params;
 | 
						this->info.params = this->params;
 | 
				
			||||||
	this->info.n_params = 2;
 | 
						this->info.n_params = 3;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* set the port info */
 | 
						/* set the port info */
 | 
				
			||||||
	port = &this->port;
 | 
						port = &this->port;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue