diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-18 09:15:56 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-07-28 13:47:48 +0300 |
commit | 38987e165c2835d3d172be8a39c64c50903c86d6 (patch) | |
tree | 7d5aa193924139c376de98338d42870c51c68260 /test/v4l2_videodevice/stream_on_off.cpp | |
parent | 6724800f14bc603699cae41f7e588660135720ab (diff) |
libcamera: yaml_parser: Preserve order of items in dictionary
The std::map container used to store dictionary items in YamlObject
doesn't preserve the YAML data order, as maps are ordered by key, not by
insertion order. While this is compliant with the YAML specification
which doesn't guarantee ordering of mappings, the Raspberry Pi IPA
relies on elements being ordered as in the YAML data. To replace the
dependency on boost with the YamlParser class, we thus need to guarantee
that the order is preserved.
Preserve the order by storing items in list_ unconditionally. Turn the
list_ vector from storing YamlObject unique pointers to storing
key-value pairs, with the key being absent when the object is a list,
not a dictionary.
The YamlObject implementation is updated to preserve the existing API,
with the only difference being that YamlObject::memberNames() now
returns member names in the same order as in the YAML file.
The ordering is an implementation detail, so changing it doesn't violate
the YAML specification. The documentation is not updated to reflect
this, as we don't want any new user to rely on a particular ordering.
This commit could be reverted if desired when the Raspberry Pi IPA
updates to a new tuning data format and drops support for the old
format.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Tested-by: Naushir Patuck <naush@raspberrypi.com>
Diffstat (limited to 'test/v4l2_videodevice/stream_on_off.cpp')
0 files changed, 0 insertions, 0 deletions