Skip to content

Commit 1949991

Browse files
PeterBee97xiaoxiang781216
authored andcommitted
drivers/video: add sequence number to video frames
Signed-off-by: Peter Bee <[email protected]>
1 parent 2ebccd8 commit 1949991

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/video/video.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct video_type_inf_s
119119
struct v4l2_fract frame_interval;
120120
video_framebuff_t bufinf;
121121
FAR uint8_t *bufheap; /* for V4L2_MEMORY_MMAP buffers */
122+
uint32_t seqnum;
122123
};
123124

124125
typedef struct video_type_inf_s video_type_inf_t;
@@ -701,6 +702,7 @@ static void change_video_state(FAR video_mng_t *vmng,
701702
video_framebuff_get_vacant_container(&vmng->video_inf.bufinf);
702703
if (container != NULL)
703704
{
705+
vmng->video_inf.seqnum = 0;
704706
start_capture(V4L2_BUF_TYPE_VIDEO_CAPTURE,
705707
vmng->video_inf.nr_fmt,
706708
vmng->video_inf.fmt,
@@ -1280,6 +1282,7 @@ static int video_qbuf(FAR struct video_mng_s *vmng,
12801282
video_framebuff_get_vacant_container(&type_inf->bufinf);
12811283
if (container != NULL)
12821284
{
1285+
type_inf->seqnum = 0;
12831286
start_capture(buf->type,
12841287
type_inf->nr_fmt,
12851288
type_inf->fmt,
@@ -3310,6 +3313,7 @@ static int video_complete_capture(uint8_t err_code, uint32_t datasize,
33103313
IMGDATA_SET_BUF(g_video_data,
33113314
(FAR uint8_t *)container->buf.m.userptr,
33123315
container->buf.length);
3316+
container->buf.sequence = type_inf->seqnum++;
33133317
}
33143318
}
33153319

0 commit comments

Comments
 (0)