Skip to content

Commit

Permalink
Videodev: allow to filter image formats enum to corresponding mbus code
Browse files Browse the repository at this point in the history
Signed-off-by: Sylvain Petinot <[email protected]>
Signed-off-by: Tomi Valkeinen <[email protected]>
  • Loading branch information
Sylvain Petinot authored and tomba committed Dec 12, 2024
1 parent 145d010 commit cea59a0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion v4l2/videodev.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ def find_video_device(key: str, value: str) -> str:

raise FileNotFoundError(f'No video device "{key}" = "{value}" found')

def get_formats(self, buf_type: v4l2.BufType):
def get_formats(self, buf_type: v4l2.BufType,
mbus_code: v4l2.BusFormat | None = None):
fmt = v4l2.uapi.v4l2_fmtdesc()
fmt.type = buf_type.value
fmt.mbus_code = mbus_code if mbus_code else 0
fmt.index = 0

fmts = []
Expand Down

0 comments on commit cea59a0

Please sign in to comment.