All of lore.kernel.org
 help / color / mirror / Atom feed
* MEM2MEM devices: how to handle sequence number?
@ 2011-12-22 14:34 javier Martin
  2011-12-23  7:09 ` Marek Szyprowski
  0 siblings, 1 reply; 12+ messages in thread
From: javier Martin @ 2011-12-22 14:34 UTC (permalink / raw)
  To: linux-media, m.szyprowski, laurent.pinchart, s.nawrocki, hverkuil,
	kyungmin.park, shawn.guo, richard.zhao, fabio.estevam, kernel,
	s.hauer, r.schwebel

Hi,
we have a processing chain composed of three v4l2 devices:

---------------------           -----------------------
----------------------
| v4l2 source  |            |     v4l2 fixer   |               |  v4l2 encoder |
|  (capture)     |---------->|  (mem2mem)| ------------>|  (mem2mem) |
------------>
|___________|            |____________|              |____________|


"v4l2 source" generates consecutive sequence numbers so that we can
detect whether a frame has been lost or not.
"v4l2 fixer" and "v4l2 encoder" cannot lose frames because they don't
interact with an external sensor.

How should "v4l2 fixer" and "v4l2 encoder" behave regarding frame
sequence number? Should they just copy the sequence number from the
input buffer to the output buffer or should they maintain their own
count for the CAPTURE queue?

If the former option is chosen we should apply a patch like the
following so that the sequence number of the input buffer is passed to
the videobuf2 layer:

diff --git a/drivers/media/video/videobuf2-core.c
b/drivers/media/video/videobuf2-core.c
index 1250662..7d8a88b 100644
--- a/drivers/media/video/videobuf2-core.c
+++ b/drivers/media/video/videobuf2-core.c
@@ -1127,6 +1127,7 @@ int vb2_qbuf(struct vb2_queue *q, struct v4l2_buffer *b)
         */
        list_add_tail(&vb->queued_entry, &q->queued_list);
        vb->state = VB2_BUF_STATE_QUEUED;
+       vb->v4l2_buf.sequence = b->sequence;

        /*
         * If already streaming, give the buffer to driver for processing.

Regards.
-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

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

end of thread, other threads:[~2012-01-03 14:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-22 14:34 MEM2MEM devices: how to handle sequence number? javier Martin
2011-12-23  7:09 ` Marek Szyprowski
2011-12-23 11:28   ` Laurent Pinchart
2011-12-23 11:35     ` Marek Szyprowski
2011-12-23 11:54       ` Laurent Pinchart
2011-12-23 15:55         ` Sylwester Nawrocki
2011-12-25 21:19           ` Laurent Pinchart
2012-01-02 10:22             ` javier Martin
2012-01-02 11:06               ` Laurent Pinchart
2012-01-02 11:44                 ` javier Martin
2012-01-03 14:00                   ` Laurent Pinchart
2011-12-23 11:57       ` Andy Walls

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.