RE: vb2: holding buffers until after start_streaming()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

On Tuesday, June 21, 2011 7:14 PM Jonathan Corbet wrote:

> On Tue, 21 Jun 2011 18:07:03 +0200
> Marek Szyprowski <m.szyprowski@xxxxxxxxxxx> wrote:
> 
> > I have an idea to introduce a new flags to let device driver tell vb2
> > weather it supports 'streaming without buffers' or not. This way the
> > order of operations in vb2_streamon() function can be switched and vb2
> > can also return an error if one will try to enable streaming on device
> > that cannot do it without buffers pre-queued.
> 
> Do you really need a flag?  If a driver absolutely cannot stream without
> buffers queued (and can't be fixed to start streaming for real when the
> buffers show up) it should just return -EINVAL from start_streaming() or
> some such.  The driver must be aware of its limitations regardless, but
> there's no need to push that awareness into vb2 as well.

The main idea behind vb2 was to move all common error handling code to
the framework and provide simple functions that can be used by the driver
directly without the need for additional checks.

> (FWIW, I wouldn't switch the order of operations in vb2_streamon(); I
> would just take out the "if (q->streaming)" test at the end of vb2_qbuf()
> and pass the buffers through directly.  But maybe that's just me.)

I want to keep the current version of vb2_qbuf() and change the order of
operations in streamon().

The only problem that still need to be resolved is what should happen with
the buffers if start_streaming() fails. The ownership for these buffers have
been already given to the driver, but they might have been in dirty state.
Probably vb2 should assume that the buffers are lost and reinitialize them.

Best regards
-- 
Marek Szyprowski
Samsung Poland R&D Center



--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux