Skip to main content

attachment_packet_from_ffmpeg

Function attachment_packet_from_ffmpeg 

Source
pub fn attachment_packet_from_ffmpeg(
    packet: &Packet,
) -> Result<Option<AttachmentPacket<AttachmentPacketExtra, FfmpegBuffer>>, PacketBufferError>
Expand description

Wraps a borrowed [ffmpeg::Packet] from an attachment track — cover art that the container really does store as a packet — as a mediadecode::demuxer::AttachmentPacket.

No timestamps are forwarded, and there is nowhere to put them: an attachment is not on the timeline. synthesized is false, because this payload came from a real packet; the demuxer sets it true for the packets it builds out of codec extradata.

The one arm where a payload-less packet really is nothing. The four timed conversions deliver a side-data-only packet, because codec-control side data is content a decoder must see. An attachment is not decoded and is not on a timeline: it is its bytes, so a packet carrying none carries no attachment, and this answers Ok(None). AttachmentPacketExtra accordingly has no side-data seat — a deliberate absence, not an oversight.