mirror of
				https://gitlab.freedesktop.org/pipewire/pipewire.git
				synced 2025-11-03 09:01:54 -05:00 
			
		
		
		
	v4l2: add some more debug
This commit is contained in:
		
							parent
							
								
									ce89ce3844
								
							
						
					
					
						commit
						44f49a3ea0
					
				
					 2 changed files with 16 additions and 6 deletions
				
			
		| 
						 | 
					@ -298,10 +298,14 @@ static int impl_node_send_command(void *object, const struct spa_command *comman
 | 
				
			||||||
	{
 | 
						{
 | 
				
			||||||
		struct port *port = GET_OUT_PORT(this, 0);
 | 
							struct port *port = GET_OUT_PORT(this, 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if (!port->have_format)
 | 
							if (!port->have_format) {
 | 
				
			||||||
 | 
								spa_log_error(this->log, "no format");
 | 
				
			||||||
			return -EIO;
 | 
								return -EIO;
 | 
				
			||||||
		if (port->n_buffers == 0)
 | 
							}
 | 
				
			||||||
 | 
							if (port->n_buffers == 0) {
 | 
				
			||||||
 | 
								spa_log_error(this->log, "no buffers");
 | 
				
			||||||
			return -EIO;
 | 
								return -EIO;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		if ((res = spa_v4l2_stream_on(this)) < 0)
 | 
							if ((res = spa_v4l2_stream_on(this)) < 0)
 | 
				
			||||||
			return res;
 | 
								return res;
 | 
				
			||||||
| 
						 | 
					@ -621,8 +625,8 @@ static int port_set_format(void *object,
 | 
				
			||||||
		port->have_format = false;
 | 
							port->have_format = false;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (spa_v4l2_set_format(this, &info, flags) < 0)
 | 
						if ((res = spa_v4l2_set_format(this, &info, flags)) < 0)
 | 
				
			||||||
		return -EINVAL;
 | 
							return res;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (!SPA_FLAG_IS_SET(flags, SPA_NODE_PARAM_FLAG_TEST_ONLY)) {
 | 
						if (!SPA_FLAG_IS_SET(flags, SPA_NODE_PARAM_FLAG_TEST_ONLY)) {
 | 
				
			||||||
		port->current_format = info;
 | 
							port->current_format = info;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1374,8 +1374,11 @@ static int spa_v4l2_use_buffers(struct impl *this, struct spa_buffer **buffers,
 | 
				
			||||||
		else if (port->memtype == V4L2_MEMORY_DMABUF) {
 | 
							else if (port->memtype == V4L2_MEMORY_DMABUF) {
 | 
				
			||||||
			b->v4l2_buffer.m.fd = d[0].fd;
 | 
								b->v4l2_buffer.m.fd = d[0].fd;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		else
 | 
							else {
 | 
				
			||||||
 | 
								spa_log_error(this->log, "v4l2: invalid port memory %d",
 | 
				
			||||||
 | 
										port->memtype);
 | 
				
			||||||
			return -EIO;
 | 
								return -EIO;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		spa_v4l2_buffer_recycle(this, i);
 | 
							spa_v4l2_buffer_recycle(this, i);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -1542,8 +1545,11 @@ spa_v4l2_alloc_buffers(struct impl *this,
 | 
				
			||||||
	} else if (dev->cap.capabilities & V4L2_CAP_READWRITE) {
 | 
						} else if (dev->cap.capabilities & V4L2_CAP_READWRITE) {
 | 
				
			||||||
		if ((res = read_init(this)) < 0)
 | 
							if ((res = read_init(this)) < 0)
 | 
				
			||||||
			return res;
 | 
								return res;
 | 
				
			||||||
	} else
 | 
						} else {
 | 
				
			||||||
 | 
							spa_log_error(this->log, "v4l2: invalid capabilities %08x",
 | 
				
			||||||
 | 
										dev->cap.capabilities);
 | 
				
			||||||
		return -EIO;
 | 
							return -EIO;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue