Base Decoder
mosaicolabs.bridges.mcap.decoders.decoder_base ¶
MCAPMsgDecoderBase ¶
Bases: ABC, Generic[NativeType]
Encoding-specific runtime behavior needed to decode MCAP messages into plain dicts.
Each MCAPDecoder is associated to a specification of mcap.decoder.DecoderFactory:
- ProtobufDecoderFactory() (from mcap_protobuf.decoder)
- JsonDecoderFactory() (user defined for jsonschema)
that are passed to McapReader (from mcap.reader), allowing to turn MCAP agnostic
data to domain specific data through iter_decoded_messages().
The resulting domain specific data (Message from google.protobuf.message or
bytes for jsonschema) are then turned into a Python dict using one of the MCAPMsgDecoderBase.decode().
supported_encoding
classmethod
¶
The channel.message_encoding value this decoder handles (e.g. "protobuf").
decoder_factory
abstractmethod
staticmethod
¶
The mcap.decoder.DecoderFactory to register on the shared reader.
register_schema ¶
Optional per-schema bookkeeping needed before iteration starts. No-op by default.
decode ¶
Turns decoded_msg produced by iter_decoded_messages() of mcap.reader into a plain dictionary
after checking that the passed message encoding is supported by the decoder.