Skip to content

Commit

Permalink
Videodev: workaround stride issue
Browse files Browse the repository at this point in the history
Happens on exotic resolutions when receiver allocate larger buffer most
probably to align on memory.

Signed-off-by: Sylvain Petinot <[email protected]>
  • Loading branch information
Sylvain Petinot committed Dec 12, 2024
1 parent 92f8f6c commit 8875a62
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion v4l2/videodev.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,10 @@ def set_format(self):
assert pix.pixelformat == self.format.v4l2_fourcc, f'{pix.pixelformat} != {self.format.v4l2_fourcc}'
assert pix.width == self.width
assert pix.height == self.height
assert pix.bytesperline == self.strides[0], f'{pix.bytesperline} != {self.strides[0]}'
# TODO: find better workaround
if pix.bytesperline != self.strides[0]:
print(f'WARNING - stride issue: {pix.bytesperline} != {self.strides[0]}')
self.strides[0] = pix.bytesperline

def queue(self, vbuf: VideoBuffer):
assert(vbuf in self.vbuffers)
Expand Down

0 comments on commit 8875a62

Please sign in to comment.