umlaeute/v4l2loopback — pull request #49 by amcinnes (2013-10-25 22:26:27+00:00)
Title: Make vidioc_g_fmt_out not change the format

I'm trying to send data to the loopback device using v4l2-ctl.

v4l2-ctl calls VIDIOC_S_FMT on the device, then VIDIOC_G_FMT, then VIDIOC_STREAMON.

When vidioc_g_fmt_out is called after vidioc_s_fmt_out but before
vidioc_streamon, it resets the format to default, because ready_for_capture is not set yet. This is incorrect
behaviour. VIDIOC_G_FMT should only read the current state, not change it.

I moved the setting of initial format to v4l2_loopback_init instead. I don't know v4l2loopback well; is there a reason I've missed for why this code was in vidioc_g_fmt_out?