Template Function spdl::core::serialize_packets¶
Defined in File packets.h
Function Documentation¶
-
template<MediaType media>
std::vector<uint8_t> spdl::core::serialize_packets(const Packets<media> &packets)¶ Serialize Packets to a byte vector for IPC (e.g., multiprocessing).
NOTE: This byte format is internal and process-local. It is only ever produced and consumed by the same build (e.g. an
iterate_in_subprocessworker and its parent), and is not stable for on-disk persistence or cross-version exchange. The layout may change without a version bump; the embedded magic/version bytes are an internal sanity check, not a compatibility contract. Each packet payload is written followed byAV_INPUT_BUFFER_PADDING_SIZEzeroed bytes so it can be restored as a zero-copy view (seedeserialize_packets_view).Throws std::runtime_error if any non-serializable pointer field (AVPacket::opaque, AVPacket::opaque_ref) is non-NULL.
- Template Parameters:
media – Media type (Audio, Video, or Image).
- Parameters:
packets – Packets to serialize.
- Returns:
Serialized byte vector.