Skip to content
Roboto
Esc
↑↓navigate↵open⌘Jpreview
On this page

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 https://github.com/roboto-ai/roboto-mcap-codec/issues/5; until that lands, consumers must treat non-bytes payload fields as undecodable rather than assume frame data is present.

Module Contents

MsgpackDecodeError

exception roboto.formats.mcap.msgpack_decoder_factory.MsgpackDecodeError#View Source

Bases: mcap.exceptions.McapError

Raised when a msgpack message cannot be decoded.

MsgpackDecoderFactory

class roboto.formats.mcap.msgpack_decoder_factory.MsgpackDecoderFactory#View Source

Bases: mcap.decoder.DecoderFactory

Decode msgpack-encoded MCAP messages via the shared Rust mcap_codec decoder.

Supply an instance to mcap.reader.make_reader(). The schema is parsed once per schema id; the returned callable then decodes each message into nested dict / list / scalar values.

MsgpackDecoderFactory.decoder_for()

decoder_for(message_encoding, schema)#View Source

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]]

make_msgpack_decoder_factory()

roboto.formats.mcap.msgpack_decoder_factory.make_msgpack_decoder_factory()#View Source

Build a decoder factory for msgpack-encoded messages, backed by the shared Rust mcap_codec decoder.

Was this page helpful?