Template Function spdl::core::deserialize_packets_view¶
Defined in File packets.h
Function Documentation¶
-
template<MediaType media>
std::unique_ptr<Packets<media>> spdl::core::deserialize_packets_view(const uint8_t *data, size_t size)¶ Deserialize a byte buffer without copying payloads: each AVPacket points directly into
data(AVPacket::buf == NULL, non-owning). The returned Packets hasis_view == true.The caller MUST keep
dataalive and unmodified for the entire lifetime of the returned Packets (and of any non-clone references taken from it). The buffer must have been produced byserialize_packets(which writes the required trailing payload padding). Cloning/re-referencing a view packet deep-copies (FFmpeg copies whenbuf == NULL), so derived packets are safe.- Template Parameters:
media – Media type (Audio, Video, or Image).
- Parameters:
data – Pointer to the serialized buffer.
size – Size of the serialized buffer in bytes.
- Returns:
Deserialized Packets viewing
data.