Expand description
The unsafe boundary between the native binding and FFmpeg.
It holds what rsmpeg’s safe surface lacks: frame, plane and packet copies,
codec-open and side-data helpers, container I/O, and the C shims that read
hardware frames (Vulkan, D3D12, VideoToolbox). Keeping these operations in
one private crate lets the rest of the native binding retain the
workspace-wide unsafe_code = "forbid" policy.
Structs§
- D3D12
Frame Info - D3D12 resource and decode fence retained by one hardware frame.
- Decoded
Frame - A frame a decoder returned, and whether every byte of its buffers, row padding included, is written.
- Demux
Input - A container opened for reading under an input policy: only the demuxers
it names, only the
fileprotocol, and an interrupt callback the reader binds to its own cancellation. - Display
Rotation - The rotation a display matrix asks for, in
FFmpeg’s convention. - Frame
Plane - One plane of a decoded frame.
- Native
GpuFailure - A platform GPU call that failed inside a native interop helper.
- Output
File - A container opened for writing whose file is closed without panicking.
- Sample
Profile - Chroma layout, component depth, and alpha of one pixel format.
- Video
Toolbox Frame Info CoreVideopixel-buffer identity retained by oneVideoToolboxframe.- Vulkan
Device Info - Raw shared-device description used to initialize
FFmpeg’s Vulkan context. - Vulkan
Encode Frame Access - One encoder-pool frame held open for a native GPU write.
- Vulkan
Frame Access - Locked
FFmpegVulkan surface state passed to the native GPU boundary. - Vulkan
Frame Access Guard - Guard for one locked
FFmpegframe and queue handoff. - Vulkan
Frame Info - Opaque Vulkan handles and synchronization state for one
FFmpeghardware frame. - Vulkan
Frame Lease - Ref-counted ownership of an opaque
FFmpegVulkan frame. - Vulkan
Queue Guard - One hold of a
VulkanQueueLock, released when it drops. - Vulkan
Queue Lock - Serializes one shared Vulkan queue family across
FFmpegand the renderer. - Yuv420p
Frame Buffer - A reusable
FFmpegYUV420P frame the caller writes into directly. - Yuv420p
Frame Planes - Writable plane memory for one reusable frame.
- YuvPlane
Layout - How a planar or semi-planar YCbCr pixel format stores its samples, as
yuv_layoutreads it fromFFmpeg’s descriptor. - YuvPlanes
- The planes of a YCbCr
AVFrame: luma first, then chroma.
Enums§
- Bridge
Error - Failure returned by an operation of this crate.
- GpuFault
- What a failed GPU call says about the device it ran on, read from the
platform’s own status for that call (a
VkResult,HRESULT, orCVReturn) where it failed, not from any message. - Native
GpuBackend - The graphics API a native interop helper called.
- Open
Input Error - Why
open_inputopened nothing.
Constants§
- MAX_
VULKAN_ PLANES - Maximum number of Vulkan images described by an
FFmpeghardware frame. - VULKAN_
ENCODE_ INPUT_ USAGE VkImageUsageFlagsan encoder-input pool needs beyondFFmpeg’s own.
Functions§
- audio_
f32_ interleaved - Copies a packed
AV_SAMPLE_FMT_FLTframe into an owned interleaved vector. - audio_
frame_ f32p - Copies planar
f32samples into an ownedFFmpegaudio frame. - bitstream_
filter_ list - Opens a bitstream filter chain, written in
FFmpeg’s list syntax (name=option=value:option=value,name..., asffmpeg -bsftakes it), for a stream thatparametersdescribes and whose packets are timed intime_base. - channel_
layout_ channels - The
FFmpegchannel (enum AVChannel) of each channel oflayout, in its order; empty for a layout that gives only a count (AV_CHANNEL_ORDER_UNSPEC). - channel_
layout_ of - A channel layout of
channelsin this order:FFmpeg’s native order when they are in it, a custom order otherwise. - codec_
parameters_ extradata - A copy of a stream’s codec extradata: the sample description’s parameter sets for H.264 and HEVC.
- configure_
colorspace - Applies explicit matrix and range coefficients to a scaling context.
- create_
vulkan_ ⚠device_ context - Initializes an
FFmpegVulkan device context over an application-owned device. - display_
rotation - Reads a stream display matrix.
- exit_
without_ handlers - Ends the process now with
code, without running its exit handlers. - frame_
display_ rotation - Reads the display matrix a decoder attached to one frame, as the JPEG
decoder does for an Exif
Orientation. - hardware_
device_ type_ name - Returns
FFmpeg’s stable name for a hardware device type. - open_
codec_ context - Opens
contextwithoptions, returning whatFFmpegdid not consume. - open_
input - Opens
urland reads its stream information with only the demuxers named informats(comma-separatedFFmpegshort names) and only thefileprotocol, for the input and anything it opens in turn. - packet_
bytes - Copies one packet’s payload out of
FFmpeg’s buffer. - packet_
has_ side_ data - Whether
packetcarries side data ofkind, as a demuxer marks the packet where a stream’s sample description changes (AV_PKT_DATA_NEW_EXTRADATA). - pixel_
format_ name - Returns
FFmpeg’s stable name for a pixel-format value. - planar_
frame - A frame of
formatholding a copy ofplanes(bytes and stride each),widthbyheightpictures in the planesformatstores. - rgba_
frame - Copies tightly packed RGBA bytes into an owned
FFmpegframe. - runtime_
configuration - Returns the linked libavcodec configure string.
- runtime_
version - Returns the linked
FFmpegruntime version string. - sample_
profile - Describes a pixel format, or
Nonewhen the value has no descriptor. - scale_
frame_ packed - Converts the whole of
framewithcontextintooutput:target’s planes one after another without row padding, the layoutav_image_copy_to_bufferwrites at alignment 1, so the caller’s buffer is the only one the picture is written to. - set_
output_ stream_ extradata - Replaces the extradata (the sample description’s parameter sets, for
H.264 and HEVC) of
output’s streamindexwith a copy ofdata, for a muxer whose header is not written yet. - set_
packet_ side_ data - Gives
packetside data ofkindholdingdata, replacing any it had. - set_
stream_ codec_ tag - Sets the codec tag (sample entry) a stream is written with; zero lets the output muxer pick the first tag its container uses for the codec.
- set_
stream_ display_ matrix - Gives a stream the display matrix
displaydescribes, as coded side data a muxer writes (MP4’stkhdmatrix): the rotation, then a horizontal flip when it mirrors, asdisplay_rotationreads one back. Replaces any matrix the stream had. - take_
packet_ side_ data - Takes
packet’s side data ofkindoff it: a copy of its bytes, orNonewhen it carries none. - vulkan_
frame_ info - Reads Vulkan image and synchronization metadata from an opaque hardware frame.
- vulkan_
frames_ add_ usage - Adds
usageto a Vulkan frames context before it allocates its pool. - vulkan_
frames_ usage - Usage the pool was created with.
- vulkan_
get_ format_ callback - Returns the callback used by a Vulkan hardware decoder to select its opaque format.
- yuv420p_
frame - Copies owned planar 8-bit 4:2:0 samples into an
FFmpegvideo frame. - yuv_
layout - Reads the plane layout of a YCbCr pixel format the renderer samples
directly, or
Nonefor any other format. - yuv_
pixel_ format - The pixel format whose planes are laid out as
layout: the first inFFmpeg’s table, which for 8-bit planar YUV is the limited-range format (yuv420p) rather than its deprecated full-range twin (yuvj420p). - yuv_
planes - Copies the planes of a frame whose format
yuv_layoutaccepts into tightly packed, forward rows of its samples, or returnsOk(None)for any other format so callers can convert it explicitly. Odd coded dimensions use ceil-divided chroma dimensions.
Type Aliases§
- Vulkan
Frame Descriptor - Vulkan image and synchronization state of one hardware frame, as the shim reads it under the frame lock.