forked from marfrit/libva-v4l2-request-fourier
Implement proper timestamping for references
Reference frames are now identified using their timestamp: set the timestamp when queuing the output buffer and use it to identify the frame later on. Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
This commit is contained in:
+5
-2
@@ -330,8 +330,8 @@ int v4l2_request_buffers(int video_fd, unsigned int type,
|
||||
}
|
||||
|
||||
int v4l2_queue_buffer(int video_fd, int request_fd, unsigned int type,
|
||||
unsigned int index, unsigned int size,
|
||||
unsigned int buffers_count)
|
||||
struct timeval *timestamp, unsigned int index,
|
||||
unsigned int size, unsigned int buffers_count)
|
||||
{
|
||||
struct v4l2_plane planes[buffers_count];
|
||||
struct v4l2_buffer buffer;
|
||||
@@ -358,6 +358,9 @@ int v4l2_queue_buffer(int video_fd, int request_fd, unsigned int type,
|
||||
buffer.request_fd = request_fd;
|
||||
}
|
||||
|
||||
if (timestamp != NULL)
|
||||
buffer.timestamp = *timestamp;
|
||||
|
||||
rc = ioctl(video_fd, VIDIOC_QBUF, &buffer);
|
||||
if (rc < 0) {
|
||||
request_log("Unable to queue buffer: %s\n", strerror(errno));
|
||||
|
||||
Reference in New Issue
Block a user