Expand description
Boundary conversions between FFmpeg’s bindgen integers and the
unified mediadecode vocabulary.
Centralised so the rest of the crate never compares raw
AVPixelFormat integers against literals or transmutes back into
the bindgen enum (UB hazard when the value isn’t in the enum’s
discriminant set).
Structs§
- Send
Payload TooLarge - Payload for
PacketBuildError::SendPayloadTooLarge. - Send
Side Data TooLarge - Payload for
PacketBuildError::SendSideDataTooLarge. - Side
Data Alloc - Payload for
PacketBuildError::SideDataAlloc. - Unknown
Side Data - Payload for
PacketBuildError::UnknownSideData.
Enums§
- Media
Kind - What a track is, folded from
AVCodecParameters.codec_typeread as the integer it is on the wire. - Packet
Build Error - Why a portable packet could not be rebuilt as an
AVPacket.
Functions§
- attachment_
packet_ from_ ffmpeg - [
attachment_packet_from_ffmpeg_as] on the view lane. - audio_
packet_ from_ ffmpeg - Carries a borrowed [
ffmpeg::Packet] out as amediadecode::packet::AudioPacket. Same shape asvideo_packet_from_ffmpeg— shared payload, forwarded metadata, default budgets. - audio_
packet_ from_ ffmpeg_ in - [
audio_packet_from_ffmpeg_as] on the view lane. - data_
packet_ from_ ffmpeg_ in - [
data_packet_from_ffmpeg_as] on the view lane. - empty_
audio_ frame - [
empty_audio_frame_as] on the view lane. - empty_
owned_ audio_ frame - [
empty_audio_frame_as] on the owned lane. - empty_
owned_ subtitle_ frame - [
empty_subtitle_frame_as] on the owned lane. - empty_
owned_ video_ frame - [
empty_video_frame_as] on the owned lane. - empty_
subtitle_ frame - [
empty_subtitle_frame_as] on the view lane. - empty_
video_ frame - [
empty_video_frame_as] on the view lane — the destination aFfmpegVideoStreamDecoderfills. - ffmpeg_
packet_ from_ audio_ packet - Builds an
ffmpeg::Packetfrom a [mediadecode::AudioPacket]. Same shape asffmpeg_packet_from_video_packet— bytes are copied; pts/dts/duration/flags/stream_index and side data are forwarded. Same failure modes. - ffmpeg_
packet_ from_ owned_ audio_ packet ffmpeg_packet_from_audio_packeton the owned lane.- ffmpeg_
packet_ from_ owned_ subtitle_ packet ffmpeg_packet_from_subtitle_packeton the owned lane.- ffmpeg_
packet_ from_ owned_ video_ packet ffmpeg_packet_from_video_packeton the owned lane.- ffmpeg_
packet_ from_ subtitle_ packet - Builds an
ffmpeg::Packetfrom a [mediadecode::SubtitlePacket]. Bytes copied; pts/duration/flags/stream_index and side data forwarded. Subtitle packets have nodtsin the mediadecode model. Same failure modes asffmpeg_packet_from_video_packet. - ffmpeg_
packet_ from_ video_ packet - Builds an
ffmpeg::Packetfrom a [mediadecode::VideoPacket] parameterized bycrate::extras::VideoPacketExtraandFfmpegBytes. - from_
av_ pixel_ format - Maps a raw
AVFrame.formatinteger (i.e. the value of anAVPixelFormatenum variant) ontomediadecode::PixelFormat. - is_
hardware_ pix_ fmt - Returns
truewhenrawis one of FFmpeg’s hardware-frame markers (AV_PIX_FMT_VIDEOTOOLBOX/_VAAPI/_CUDA/_D3D11/_DRM_PRIME/_MEDIACODEC/_VULKAN). Used by the HW probe to identify GPU-resident frames before triggeringav_hwframe_transfer_data. - owned_
attachment_ packet_ from_ ffmpeg attachment_packet_from_ffmpegon the owned lane, borrowing its source.- owned_
audio_ packet_ from_ ffmpeg_ in audio_packet_from_ffmpegwith the stream’s timebase and explicit budgets.- owned_
data_ packet_ from_ ffmpeg_ in data_packet_from_ffmpeg_inon the owned lane, borrowing its source.- owned_
subtitle_ packet_ from_ ffmpeg_ in subtitle_packet_from_ffmpegwith the stream’s timebase and explicit budgets.- owned_
video_ packet_ from_ ffmpeg_ in video_packet_from_ffmpegwith the stream’s timebase and explicit budgets.- subtitle_
packet_ from_ ffmpeg - Carries a borrowed [
ffmpeg::Packet] out as amediadecode::packet::SubtitlePacket. Subtitle packets have nodtsin the mediadecode model; everything else mirrorsvideo_packet_from_ffmpeg, shared payload included. - subtitle_
packet_ from_ ffmpeg_ in - [
subtitle_packet_from_ffmpeg_as] on the view lane. - video_
packet_ from_ ffmpeg - Carries a borrowed [
ffmpeg::Packet] out as amediadecode::packet::VideoPacketon the view lane: the payload is a refcounted window onto the sourceAVPacket’s own buffer, which is why the delivered packet’s lifetime is answerable to libavformat’s — see the two carrier lanes. For a packet that must outlive the demuxer, ask for the owned lane by name:video_packet_from_ffmpeg_as::<Owned>, whose payload is copied and which the D-seat amputation contract governs. - video_
packet_ from_ ffmpeg_ in - [
video_packet_from_ffmpeg_as] on the view lane, with the stream’s timebase stamped onto every timestamp.