Skip to content

Commit dba6a79

Browse files
naushirdavidplowman
authored andcommitted
v4l2_encoder: Use the correct field name for timestamp values
This follows the videobuf2.h naming convention. Signed-off-by: Naushir Patuck <[email protected]>
1 parent edb89d1 commit dba6a79

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

picamera2/encoders/v4l2_encoder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,7 @@ def thread_poll(self, buf_available):
254254
b = self.bufs[buf.index][0].read(buf.m.planes[0].bytesused)
255255
self.bufs[buf.index][0].seek(0)
256256
if self._check_for_picture(b):
257-
self.outputframe(b, keyframe, (buf.timestamp.secs * 1000000) + buf.timestamp.usecs)
257+
self.outputframe(b, keyframe, (buf.timestamp.tv_sec * 1000000) + buf.timestamp.tv_usec)
258258

259259
# Requeue encoded buffer
260260
buf = v4l2_buffer()
@@ -299,8 +299,8 @@ def _encode(self, stream, request):
299299
buf.field = V4L2_FIELD_NONE
300300
buf.memory = V4L2_MEMORY_DMABUF
301301
buf.length = 1
302-
buf.timestamp.secs = timestamp_us // 1000000
303-
buf.timestamp.usecs = timestamp_us % 1000000
302+
buf.timestamp.tv_sec = timestamp_us // 1000000
303+
buf.timestamp.tv_usec = timestamp_us % 1000000
304304
buf.m.planes = planes
305305
buf.m.planes[0].m.fd = fd
306306
buf.m.planes[0].bytesused = cfg.frame_size

0 commit comments

Comments
 (0)