pub fn video_packet_from_ffmpeg(
packet: &Packet,
) -> Result<Option<VideoPacket<VideoPacketExtra, FfmpegBuffer>>, PacketBufferError>Expand description
Wraps a borrowed [ffmpeg::Packet] as a
mediadecode::packet::VideoPacket. The compressed payload is
shared with the source AVPacket via refcount bump (no copy).
Timestamps, duration, key/corrupt flags, and the source stream
index are forwarded to the produced packet.
Returns Ok(None) when the source packet has no payload at all
(an empty packet — typical after EOF), and
PacketBufferError when a payload that is there could not be
referenced: the two are never the same answer. Caller can also fill
in VideoPacketExtra::byte_pos / side_data post-construction if
they need those.