Skip to main content

Module boundary

Module boundary 

Source
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§

SendPayloadTooLarge
Payload for PacketBuildError::SendPayloadTooLarge.
SendSideDataTooLarge
Payload for PacketBuildError::SendSideDataTooLarge.
SideDataAlloc
Payload for PacketBuildError::SideDataAlloc.
UnknownSideData
Payload for PacketBuildError::UnknownSideData.

Enums§

MediaKind
What a track is, folded from AVCodecParameters.codec_type read as the integer it is on the wire.
PacketBuildError
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 a mediadecode::packet::AudioPacket. Same shape as video_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 a FfmpegVideoStreamDecoder fills.
ffmpeg_packet_from_audio_packet
Builds an ffmpeg::Packet from a [mediadecode::AudioPacket]. Same shape as ffmpeg_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_packet on the owned lane.
ffmpeg_packet_from_owned_subtitle_packet
ffmpeg_packet_from_subtitle_packet on the owned lane.
ffmpeg_packet_from_owned_video_packet
ffmpeg_packet_from_video_packet on the owned lane.
ffmpeg_packet_from_subtitle_packet
Builds an ffmpeg::Packet from a [mediadecode::SubtitlePacket]. Bytes copied; pts/duration/flags/stream_index and side data forwarded. Subtitle packets have no dts in the mediadecode model. Same failure modes as ffmpeg_packet_from_video_packet.
ffmpeg_packet_from_video_packet
Builds an ffmpeg::Packet from a [mediadecode::VideoPacket] parameterized by crate::extras::VideoPacketExtra and FfmpegBytes.
from_av_pixel_format
Maps a raw AVFrame.format integer (i.e. the value of an AVPixelFormat enum variant) onto mediadecode::PixelFormat.
is_hardware_pix_fmt
Returns true when raw is 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 triggering av_hwframe_transfer_data.
owned_attachment_packet_from_ffmpeg
attachment_packet_from_ffmpeg on the owned lane, borrowing its source.
owned_audio_packet_from_ffmpeg_in
audio_packet_from_ffmpeg with the stream’s timebase and explicit budgets.
owned_data_packet_from_ffmpeg_in
data_packet_from_ffmpeg_in on the owned lane, borrowing its source.
owned_subtitle_packet_from_ffmpeg_in
subtitle_packet_from_ffmpeg with the stream’s timebase and explicit budgets.
owned_video_packet_from_ffmpeg_in
video_packet_from_ffmpeg with the stream’s timebase and explicit budgets.
subtitle_packet_from_ffmpeg
Carries a borrowed [ffmpeg::Packet] out as a mediadecode::packet::SubtitlePacket. Subtitle packets have no dts in the mediadecode model; everything else mirrors video_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 a mediadecode::packet::VideoPacket on the view lane: the payload is a refcounted window onto the source AVPacket’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.