v4l2_ext_control needs _pack_ attribute

Bug #603311 reported by Pete Eberlein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-v4l2
Fix Released
High
tamask

Bug Description

In the videodev2.h header, the struct v4l2_ext_control has __attribute__ ((packed));
and this needs to be reflected in the class v4l2_ext_control ctypes.Structure by adding an attribute _pack_ = True
like this:

class v4l2_ext_control(ctypes.Structure):
    class _u(ctypes.Union):
        _fields_ = [
            ('value', ctypes.c_int32),
            ('value64', ctypes.c_int64),
            ('reserved', ctypes.c_void_p),
        ]

    _fields_ = [
        ('id', ctypes.c_uint32),
        ('reserved2', ctypes.c_uint32 * 2),
        ('_u', _u)
    ]

    _anonymous_ = ('_u',)

    _pack_ = True

Revision history for this message
Pete Eberlein (pete-eberlein) wrote :

Also, _pack_ should probably also be added to the classes v4l2_register and v4l2_chip_ident as well.

tamask (tamask)
Changed in python-v4l2:
assignee: nobody → tamask (tamask)
importance: Undecided → High
tamask (tamask)
Changed in python-v4l2:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.