XU XUv0.16.0

#gpu/video

import: #gpu/video

counts: 7 functions, 0 methods, 5 types, 10 constants, 0 method sets

Portable multi-plane video surface descriptors and external hardware-memory surface kinds (IOSurface / DMA-BUF / D3D12) for zero-copy GPU video pipelines.

const PIXEL_NV12

XuAPI
pub const PIXEL_NV12 = 1

Purpose

Constant PIXEL_NV12, defining protocol or algorithm parameters.

const PIXEL_P010

XuAPI
pub const PIXEL_P010 = 2

Purpose

Constant PIXEL_P010, defining protocol or algorithm parameters.

const PIXEL_YUV420P

XuAPI
pub const PIXEL_YUV420P = 3

Purpose

Constant PIXEL_YUV420P, defining protocol or algorithm parameters.

const PIXEL_YUV420P10

XuAPI
pub const PIXEL_YUV420P10 = 4

Purpose

Constant PIXEL_YUV420P10, defining protocol or algorithm parameters.

const PIXEL_BGRA8

XuAPI
pub const PIXEL_BGRA8 = 5

Purpose

Constant PIXEL_BGRA8, defining protocol or algorithm parameters.

const PIXEL_RGBA16F

XuAPI
pub const PIXEL_RGBA16F = 6

Purpose

Constant PIXEL_RGBA16F, defining protocol or algorithm parameters.

const EXT_NONE

XuAPI
pub const EXT_NONE = 0

Purpose

Constant EXT_NONE, defining protocol or algorithm parameters.

const EXT_IOSURFACE

XuAPI
pub const EXT_IOSURFACE = 1

Purpose

Constant EXT_IOSURFACE, defining protocol or algorithm parameters.

const EXT_DMABUF

XuAPI
pub const EXT_DMABUF = 2

Purpose

Constant EXT_DMABUF, defining protocol or algorithm parameters.

const EXT_D3D12_RESOURCE

XuAPI
pub const EXT_D3D12_RESOURCE = 3

Purpose

Constant EXT_D3D12_RESOURCE, defining protocol or algorithm parameters.

struct PlaneDesc

XuAPI
pub struct PlaneDesc {
    pub index int
    pub gpu_format int
    pub width int
    pub height int
    pub bytes_per_pixel int
}

Purpose

Structure encapsulating index, gpu_format, width, height, bytes_per_pixel.

Public fields

index int
field (int)
gpu_format int
field (int)
width int
field (int)
height int
field (int)
bytes_per_pixel int
field (int)

struct VideoSurfaceDesc

XuAPI
pub struct VideoSurfaceDesc {
    pub pixel_format int
    pub width int
    pub height int
    pub bit_depth int
    pub planes []PlaneDesc
}

Purpose

Structure encapsulating pixel_format, width, height, bit_depth, planes.

Public fields

pixel_format int
field (int)
width int
field (int)
height int
field (int)
bit_depth int
field (int)
planes []PlaneDesc
field ([]PlaneDesc)

format_name

XuAPI
pub fn format_name(pixel_format int) string

Purpose

Format as name.

Parameters

pixel_format int
pixel_format (int)

Returns

string — result string

describe

XuAPI
pub fn describe(pixel_format int, width int, height int) VideoSurfaceDesc

Purpose

Execute describe. Throws on failure; handle the error or propagate it to the caller.

Parameters

pixel_format int
pixel_format (int)
width int
width (int)
height int
height (int)

Returns

VideoSurfaceDesc — a value of this type

struct ExternalPlaneHandle

XuAPI
pub struct ExternalPlaneHandle {
    pub kind int
    pub plane_index int
    pub native_handle c_ptr
    pub fd int
    pub stride_bytes int
    pub offset_bytes int
    pub modifier u64
}

Purpose

Structure encapsulating kind, plane_index, native_handle, fd, stride_bytes.

Public fields

kind int
kind tag
plane_index int
field (int)
native_handle c_ptr
field (c_ptr)
fd int
file descriptor
stride_bytes int
field (int)
offset_bytes int
field (int)
modifier u64
field (u64)

struct ExternalFenceDesc

XuAPI
pub struct ExternalFenceDesc {
    pub kind int
    pub native_handle c_ptr
    pub fd int
    pub timeline_value u64
}

Purpose

Structure encapsulating kind, native_handle, fd, timeline_value.

Public fields

kind int
kind tag
native_handle c_ptr
field (c_ptr)
fd int
file descriptor
timeline_value u64
field (u64)

struct ExternalSurfaceDesc

XuAPI
pub struct ExternalSurfaceDesc {
    pub surface VideoSurfaceDesc
    pub kind int
    pub planes []ExternalPlaneHandle
    pub sync ExternalFenceDesc
}

Purpose

Structure encapsulating surface, kind, planes, sync.

Public fields

surface VideoSurfaceDesc
field (VideoSurfaceDesc)
kind int
kind tag
planes []ExternalPlaneHandle
field ([]ExternalPlaneHandle)
sync ExternalFenceDesc
field (ExternalFenceDesc)

kind_name

XuAPI
pub fn kind_name(kind int) string

Purpose

Kind name.

Parameters

kind int
kind tag (int)

Returns

string — result string

native_kind_for_os

XuAPI
pub fn native_kind_for_os(target_os int) int

Purpose

Native kind for os.

Parameters

target_os int
target_os (int)

Returns

int — a value of this type

is_compute_video_format

XuAPI
pub fn is_compute_video_format(format int) bool

Purpose

Whether it is compute video format.

Parameters

format int
format (int)

Returns

bool — true or false

validate_external_plane

XuAPI
pub fn validate_external_plane(plane &PlaneDesc, ext &ExternalPlaneHandle) int

Purpose

Validate external plane. Throws on failure; handle the error or propagate it to the caller.

Parameters

plane &PlaneDesc
plane (read-only borrow; caller keeps the original; type &PlaneDesc)
ext &ExternalPlaneHandle
ext (read-only borrow; caller keeps the original; type &ExternalPlaneHandle)

Returns

int — a value of this type

validate_external_surface

XuAPI
pub fn validate_external_surface(desc &ExternalSurfaceDesc) int

Purpose

Validate external surface. Throws on failure; handle the error or propagate it to the caller.

Parameters

desc &ExternalSurfaceDesc
desc (read-only borrow; caller keeps the original; type &ExternalSurfaceDesc)

Returns

int — a value of this type