v4l2: first probe and then update port flags

The probe is to decide it we can use EXPBUF or not and this is used to
decide on the flags.

This got broken with 842ac9e110
This commit is contained in:
Wim Taymans 2024-11-07 11:13:44 +01:00
parent af69f15dc2
commit 5759a88f27

View file

@ -1048,6 +1048,8 @@ static int spa_v4l2_set_format(struct impl *this, struct spa_video_info *format,
size->width = fmt.fmt.pix.width;
size->height = fmt.fmt.pix.height;
probe_expbuf(this);
port->fmt = fmt;
port->info.change_mask |= SPA_PORT_CHANGE_MASK_FLAGS | SPA_PORT_CHANGE_MASK_RATE;
port->info.flags = (port->alloc_buffers ? SPA_PORT_FLAG_CAN_ALLOC_BUFFERS : 0) |
@ -1057,8 +1059,6 @@ static int spa_v4l2_set_format(struct impl *this, struct spa_video_info *format,
port->info.rate.num = streamparm.parm.capture.timeperframe.numerator;
port->info.rate.denom = streamparm.parm.capture.timeperframe.denominator;
probe_expbuf(this);
return match ? 0 : 1;
}