Skip to main content

Crate alpha2_ffmpeg_bridge

Crate alpha2_ffmpeg_bridge 

Source
Expand description

The unsafe boundary between the native binding and FFmpeg.

It holds what rsmpeg’s safe surface lacks (frame and packet copies, codec and side-data helpers, container I/O, hardware-frame shims) so the rest of the binding can forbid unsafe.

Structs§

D3D12FrameInfo
D3D12 resource and decode fence retained by one hardware frame.
DecodedFrame
A decoded frame, and whether every byte of its buffers, row padding included, is written.
DemuxInput
A container opened for reading with only the named demuxers, only the file protocol, and an interrupt callback.
DisplayRotation
The rotation a display matrix asks for, in FFmpeg’s convention.
EncoderContext
An AVCodecContext closed under the MediaFoundation lock when it is an _mf encoder.
FramePlane
One plane of a decoded frame.
LogLine
One warning or error line FFmpeg logged.
LogMark
A point in the log for log_since.
NativeGpuFailure
A platform GPU call that failed inside a native interop helper.
OutputFile
A container opened for writing whose file is closed without panicking.
SampleProfile
Chroma layout, component depth, and alpha of one pixel format.
VideoStreamDescription
Codec parameters for a video stream not produced by an FFmpeg encoder.
VideoToolboxFrameInfo
CoreVideo pixel-buffer identity retained by one VideoToolbox frame.
VulkanDeviceInfo
Raw shared-device description used to initialize FFmpeg’s Vulkan context.
VulkanEncodeFrameAccess
One encoder-pool frame held open for a native GPU write.
VulkanFrameAccess
Locked FFmpeg Vulkan surface state passed to the native GPU boundary.
VulkanFrameAccessGuard
Guard for one locked FFmpeg frame and queue handoff.
VulkanFrameInfo
Opaque Vulkan handles and synchronization state for one FFmpeg hardware frame.
VulkanFrameLease
Ref-counted ownership of an opaque FFmpeg Vulkan frame.
VulkanQueueGuard
One hold of a VulkanQueueLock, released on drop on the thread that took it.
VulkanQueueLock
Serializes one shared Vulkan queue family across FFmpeg and the renderer.
Yuv420pFrameBuffer
A reusable FFmpeg YUV420P frame the caller writes into directly.
Yuv420pFramePlanes
Writable plane memory for one reusable frame.
YuvPlaneLayout
How a planar or semi-planar YCbCr pixel format stores its samples.
YuvPlanes
The planes of a YCbCr AVFrame: luma first, then chroma.

Enums§

BridgeError
Failure returned by an operation of this crate.
CreateOutputError
Why OutputFile::create created nothing.
GpuFault
What a failed GPU call says about its device, read from the platform status (VkResult, HRESULT or CVReturn) rather than from any message.
NativeGpuBackend
The graphics API a native interop helper called.
OpenInputError
Why open_input opened nothing.
PathError
Why a path cannot be passed to FFmpeg as a UTF-8 C string.

Constants§

MAX_VULKAN_PLANES
Maximum number of Vulkan images described by an FFmpeg hardware frame.
VULKAN_ENCODE_INPUT_USAGE
VkImageUsageFlags an encoder-input pool needs beyond FFmpeg’s own.

Functions§

audio_f32_interleaved
Copies a packed AV_SAMPLE_FMT_FLT frame into an owned interleaved vector.
audio_frame
Copies planar f32 samples into an audio frame of format (FLTP, FLT or S16). 16-bit samples are clamped to [-1, 1] and rounded.
bitstream_filter_list
Opens a bitstream filter chain in ffmpeg -bsf list syntax for a stream described by parameters with packets in time_base.
channel_layout_channels
The AVChannel of each channel of layout, in order; empty for AV_CHANNEL_ORDER_UNSPEC.
channel_layout_of
A channel layout of channels in order, native when possible, else custom.
codec_parameters_extradata
A copy of a stream’s codec extradata (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 FFmpeg Vulkan device context over an application-owned device.
display_rotation
Reads a stream display matrix.
file_url
file: plus the absolute path, so a name like take:1.mov is never read as a protocol.
frame_display_rotation
Reads a frame’s display matrix, such as the JPEG decoder attaches for Exif Orientation.
hardware_device_type_name
Returns FFmpeg’s stable name for a hardware device type.
install_log_capture
Routes FFmpeg’s log through the capture. Idempotent; log_mark calls it.
log_detail
Formats the last four lines as an error message tail ("; FFmpeg said: [class] text | ..."), each cut to 200 characters with non-ASCII escaped. Empty when there are no lines.
log_mark
The current end of the log. Installs the capture first.
log_since
Lines logged since mark by one of classes (any when empty), oldest first. Lines the ring has dropped are missing.
muxer_accepts_codec
Whether muxer format can store codec at normal compliance; None when it is not linked.
open_codec_context
Opens context with options, returning what FFmpeg did not consume.
open_input
Opens path and reads its stream information using only the demuxers in formats (comma-separated FFmpeg short names) and only the file protocol.
packet_bytes
Copies one packet’s payload out of FFmpeg’s buffer.
packet_from_bytes
A packet holding a copy of data, every other field at its default.
packet_has_side_data
Whether packet carries side data of kind.
pixel_format_name
Returns FFmpeg’s stable name for a pixel-format value.
planar_frame
A width by height frame of format holding a copy of planes (bytes and stride each).
rgba_frame
Copies tightly packed RGBA bytes into an owned FFmpeg frame.
runtime_configuration
Returns the linked libavcodec configure string.
runtime_version
Returns the linked FFmpeg runtime version string.
sample_profile
Describes a pixel format, or None when the value has no descriptor.
scale_frame_packed
Converts frame into output as target’s planes packed without row padding (the av_image_copy_to_buffer layout at alignment 1).
set_output_stream_extradata
Replaces the extradata of output’s stream index before the header is written.
set_packet_side_data
Gives packet side data of kind holding data, replacing any it had.
set_stream_codec_tag
Sets a stream’s codec tag (sample entry); zero lets the muxer pick its default.
set_stream_display_matrix
Replaces a stream’s display matrix (MP4’s tkhd matrix) with display’s rotation and flip, as display_rotation reads it back.
shrink_packet_to
Replaces packet’s payload with data, no longer than it, keeping timestamps and side data.
take_packet_side_data
Removes and returns packet’s side data of kind.
video_codec_parameters
Codec parameters for a video stream description describes.
vulkan_frame_info
Reads Vulkan image and synchronization metadata from an opaque hardware frame.
vulkan_frames_add_usage
Adds usage to a Vulkan frames context before it allocates its pool.
vulkan_frames_usage
Usage the pool was created with, including the default FFmpeg picks for zero.
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 FFmpeg video frame.
yuv_layout
The plane layout of a YCbCr format the renderer samples directly, or None.
yuv_pixel_format
The first pixel format in FFmpeg’s table laid out as layout (yuv420p, not the deprecated yuvj420p).
yuv_planes
Copies the samples of a frame whose format yuv_layout accepts into packed forward rows, or returns Ok(None) for other formats. Odd dimensions round chroma up.

Type Aliases§

VulkanFrameDescriptor
Vulkan image and synchronization state of one hardware frame, read under the frame lock.