From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Muralidharan Karicheri <mkaricheri@gmail.com>
Cc: Mauro Carvalho Chehab <mchehab@infradead.org>,
Pawel Osciak <p.osciak@samsung.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
linux-media@vger.kernel.org
Subject: Re: More videobuf and streaming I/O questions
Date: Fri, 26 Feb 2010 15:29:05 +0100 [thread overview]
Message-ID: <201002261529.08099.laurent.pinchart@ideasonboard.com> (raw)
In-Reply-To: <55a3e0ce1002260505s798e3945ueb1e929dd87e6ea6@mail.gmail.com>
Hi,
On Friday 26 February 2010 14:05:30 Muralidharan Karicheri wrote:
> On Fri, Feb 26, 2010 at 7:04 AM, Mauro Carvalho Chehab wrote:
> > Pawel Osciak wrote:
> >>> On Tuesday 23 February 2010 08:41:49 Pawel Osciak wrote:
> >>>>> On Mon, 22 Feb 2010 00:12:18 +0100
> >>>>
> >>>>> Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:
> >>>> As for the REQBUF, I've always thought it'd be nice to be able to ask
> >>>> the driver for the "recommended" number of buffers that should be
> >>>> used by issuing a REQBUF with count=0...
> >>>
> >>> How would the driver come up with the number of recommended buffers ?
> >>
> >> From the top of my head: when encoding a video stream, a codec driver
> >> could decide on the minimum number of input frames required (including
> >> reference frames, etc.).
> >>
> >> Or maybe I am missing something, what is your opinion on that?
> >
> > There are some cases where this feature could be useful. For example,
> > there are some devices used for surveillance that have one decoder
> > connected to several inputs. For example, several bttv boards have one
> > bt848 chip for each 8 inputs. Each input is connected to one camera. The
> > minimum recommended number of buffers is 16 (2 per each input). This is
> > poorly documented, on some wikis for some of the boards with such usage.
> >
> > That's said, there's currently a few missing features for surveillance:
> > the user software need to manually switch from one input to another, and
> > the video buffer metadata doesn't indicate the input.
> >
> > The better would be to provide a way to let the driver to switch to the
> > next camera just after the reception of a new buffer (generally at the
> > IRQ time), instead of letting the userspace software to do it at the
> > DQBUF.
>
> This is an interesting use case and I would like to know some details
> on this use case.
> When you say application manually switch the input, Is it implementing some
> kind of input multiplexing during the session (open, stream on - stream off,
> close) ?
No, applications just call VIDIOC_S_INPUT while the stream is active.
> We have encountered a similar use case and I was wondering how this can be
> implemented in v4l2 driver. In my understanding, a v4l2 device is not
> allowed to switch input while streaming.
Switching input while streaming is allowed (if I'm not mistaken), as long as
the format and size don't change (not sure about lowering the size, that needs
to be double-checked).
This being said, VIDIOC_S_INPUT was designed to switch analog sources. I'm not
sure it would be the best would to multiplex streams from two digital sensors
for instance. Even for analog signals, using the ioctl from userspace usually
results in at least one corrupt frame if you don't synchronize the switching
to the analog signals, which requires hardware support.
Can you give us more details about the use case you're thinking about ?
> Does it require 2 buffers per input because every frame period, you have
> multiple frames to queue from the different inputs?
In this case there's a single video stream, so I don't think it would require
2 buffers per input.
> Usually a minimum of 3 buffers are typically required in a SoC case to do
> streaming. Could you share the details if possible?
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2010-02-26 14:28 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-20 14:00 More videobuf and streaming I/O questions Hans Verkuil
2010-02-21 23:12 ` Laurent Pinchart
2010-02-22 9:47 ` Jean-Francois Moine
2010-02-23 12:45 ` Laurent Pinchart
2010-02-23 7:41 ` Pawel Osciak
2010-02-25 23:46 ` Laurent Pinchart
2010-02-26 7:36 ` Pawel Osciak
2010-02-26 12:04 ` Mauro Carvalho Chehab
2010-02-26 13:05 ` Muralidharan Karicheri
2010-02-26 14:29 ` Laurent Pinchart [this message]
2010-02-26 14:41 ` Karicheri, Muralidharan
2010-02-26 14:24 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201002261529.08099.laurent.pinchart@ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=hverkuil@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@infradead.org \
--cc=mkaricheri@gmail.com \
--cc=p.osciak@samsung.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox