v4l2: improve debug a little

This commit is contained in:
Wim Taymans 2024-11-07 15:42:33 +01:00
parent b9df297e2a
commit c4df4a0371

View file

@ -1415,6 +1415,8 @@ static int mmap_read(struct impl *this)
if (xioctl(dev->fd, VIDIOC_DQBUF, &buf) < 0) if (xioctl(dev->fd, VIDIOC_DQBUF, &buf) < 0)
return -errno; return -errno;
spa_log_trace(this->log, "v4l2 %p: have output %d/%d", this, buf.index, buf.sequence);
/* Drop the first frame in order to work around common firmware /* Drop the first frame in order to work around common firmware
* timestamp issues */ * timestamp issues */
if (port->first_buffer) { if (port->first_buffer) {
@ -1425,7 +1427,6 @@ static int mmap_read(struct impl *this)
} }
pts = SPA_TIMEVAL_TO_NSEC(&buf.timestamp); pts = SPA_TIMEVAL_TO_NSEC(&buf.timestamp);
spa_log_trace(this->log, "v4l2 %p: have output %d", this, buf.index);
if (this->clock) { if (this->clock) {
/* FIXME, we should follow the driver clock and target_ values. /* FIXME, we should follow the driver clock and target_ values.
@ -1474,6 +1475,7 @@ static void v4l2_on_fd_events(struct spa_source *source)
struct spa_io_buffers *io; struct spa_io_buffers *io;
struct port *port = &this->out_ports[0]; struct port *port = &this->out_ports[0];
struct buffer *b; struct buffer *b;
int res;
if (source->rmask & SPA_IO_ERR) { if (source->rmask & SPA_IO_ERR) {
struct port *port = &this->out_ports[0]; struct port *port = &this->out_ports[0];
@ -1488,8 +1490,10 @@ static void v4l2_on_fd_events(struct spa_source *source)
return; return;
} }
if (mmap_read(this) < 0) if ((res = mmap_read(this)) < 0) {
spa_log_warn(this->log, "v4l2 %p: mmap read error:%s", this, spa_strerror(res));
return; return;
}
if (spa_list_is_empty(&port->queue)) if (spa_list_is_empty(&port->queue))
return; return;