roboto.formats.mcap.msgpack_decoder_factory#
MCAP decoder factory for msgpack-encoded messages.
Exposes an mcap.decoder.DecoderFactory that decodes msgpack
messages (typically described by a jsonschema schema), for use by
McapReader. Decoding is delegated to the
shared Rust decoder (the mcap_codec extension built from
roboto-mcap-codec), which returns nested dict / list / scalar values.
Known limitation: msgpack-numpy ndarray fields — nested maps with binary keys
(nd/type/shape/data), used by compressed-video packet payloads —
are silently dropped by the codec: the field decodes to an empty {} and the
payload bytes are unrecoverable downstream. Every other field of such a message
decodes normally. Tracked in
roboto-ai/roboto-mcap-codec#5; until that lands,
consumers must treat non-bytes payload fields as undecodable rather than
assume frame data is present.
Module Contents#
- exception roboto.formats.mcap.msgpack_decoder_factory.MsgpackDecodeError#
Bases:
mcap.exceptions.McapErrorRaised when a
msgpackmessage cannot be decoded.
- class roboto.formats.mcap.msgpack_decoder_factory.MsgpackDecoderFactory#
Bases:
mcap.decoder.DecoderFactoryDecode msgpack-encoded MCAP messages via the shared Rust
mcap_codecdecoder.Supply an instance to
mcap.reader.make_reader(). The schema is parsed once per schema id; the returned callable then decodes each message into nesteddict/list/ scalar values.- decoder_for(message_encoding, schema)#
If the message encoding and schema arguments can be decoded by this decoder factory, returns a callable to decode message bytes.
- Parameters:
message_encoding (str)
schema (Optional[mcap.records.Schema])
- Return type:
Optional[Callable[[bytes], Any]]
- roboto.formats.mcap.msgpack_decoder_factory.make_msgpack_decoder_factory()#
Build a decoder factory for msgpack-encoded messages, backed by the shared Rust
mcap_codecdecoder.- Return type: