camera: work around target_ mishandling

A driver node should use the target_duration and target_rate to adjust
the quantum and rate when the graph starts.

The camera nodes don't currently support any of this and simply enforce
a specific rate and duration for the graph clock. Mark this with a
FIXME. Otherwise, pipewire will complain that the node is ignoring the
configured graph rate.

We should really look at the graph target rate/quantum and only produce
a buffer when it is inside the current graph cycle. This would make it
possible to join audio and camera nodes and have them be in sync.
This commit is contained in:
Wim Taymans 2023-03-27 09:54:06 +02:00
parent 6363bbd1b9
commit a0457a3bdf
2 changed files with 10 additions and 2 deletions

View file

@ -1289,6 +1289,11 @@ static int mmap_read(struct impl *this)
spa_log_trace(this->log, "v4l2 %p: have output %d", this, buf.index);
if (this->clock) {
/* FIXME, we should follow the driver clock and target_ values.
* for now we ignore and use our own. */
this->clock->target_rate = port->rate;
this->clock->target_duration = 1;
this->clock->nsec = pts;
this->clock->rate = port->rate;
this->clock->position = buf.sequence;