public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* vb2: holding buffers until after start_streaming()
@ 2011-06-17 18:57 Jonathan Corbet
  2011-06-20  1:28 ` Pawel Osciak
  2011-06-20  8:20 ` Sylwester Nawrocki
  0 siblings, 2 replies; 11+ messages in thread
From: Jonathan Corbet @ 2011-06-17 18:57 UTC (permalink / raw)
  To: Pawel Osciak, Marek Szyprowski; +Cc: linux-media

Here's another videobuf2 question...I've been trying to track down some
weird behavior, the roots of which were in the fact that start_streaming()
gets called even though no buffers have been queued.  This behavior is
quite explicit in the code:

	/*
	 * Let driver notice that streaming state has been enabled.
	 */
	ret = call_qop(q, start_streaming, q);
	if (ret) {
		dprintk(1, "streamon: driver refused to start streaming\n");
		return ret;
	}

	q->streaming = 1;

	/*
	 * If any buffers were queued before streamon,
	 * we can now pass them to driver for processing.
	 */
	list_for_each_entry(vb, &q->queued_list, queued_entry)
		__enqueue_in_driver(vb);

Pretty much every v4l2 capture application I've ever encountered passes all
of its buffers to VIDIOC_QBUF before starting streaming for a reason - it
makes little sense to start if there's nothing to stream to.  It's really
tempting to reorder that code, but...  it seems you must have done things
this way for a reason.  Why did you need to reorder the operations in this
way?

(Yes, my driver's current tendency to go oops when start_streaming() gets
called with no buffers is a bug, I'll fix it regardless).

Thanks,

jon

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2011-06-22 12:48 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-17 18:57 vb2: holding buffers until after start_streaming() Jonathan Corbet
2011-06-20  1:28 ` Pawel Osciak
2011-06-20  5:30   ` Marek Szyprowski
2011-06-20 15:48     ` Jonathan Corbet
2011-06-21 16:07       ` Marek Szyprowski
2011-06-21 17:14         ` Jonathan Corbet
2011-06-22  9:43           ` Marek Szyprowski
2011-06-22 12:38             ` Jonathan Corbet
2011-06-22 12:48               ` Hans Verkuil
2011-06-20 17:18     ` Hans Verkuil
2011-06-20  8:20 ` Sylwester Nawrocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox