pub struct Display {
    handle: *mut c_void,
    drm_file: File,
}
Expand description

A VADisplay opened over DRM.

A Display is the starting point to using libva. This struct is essentially a safe wrapper over VADisplay, from which Surfaces and Contexts can be allocated in order to perform actual work using Display::create_surfaces and Display::create_context, respectively.

Although libva offers several ways to create a display, this struct currently only supports opening through DRM. It may be extended to support other display types (X11, Wayland) in the future.

Fields

handle: *mut c_void

Handle to interact with the underlying VADisplay.

drm_file: File

DRM file that must be kept open while the display is in use.

Implementations

Opens and initializes a specific DRM Display.

path is the path to a DRM device that supports VAAPI, e.g. /dev/dri/renderD128.

Opens the first device that succeeds and returns its Display.

If an error occurs on a given device, it is ignored and the next one is tried until one succeeds or we reach the end of the iterator.

Returns the handle of this display.

Queries supported profiles by this display.

Returns a string describing some aspects of the VA implemenation on the specific hardware accelerator used by this display.

The format of the returned string is vendor specific and at the discretion of the implementer. e.g. for the Intel GMA500 implementation, an example would be: Intel GMA500 - 2.0.0.32L.0005.

Query supported entrypoints for a given profile.

Writes attributes for a given profile/entrypoint pair into attributes.

Entries of attributes must have their type_ member initialized to the desired attribute to retrieve.

Creates Surfaces by wrapping around a vaCreateSurfaces call.

Arguments
  • rt_format - The desired surface format. See VA_RT_FORMAT_*
  • va_fourcc - The desired pixel format (optional). See VA_FOURCC_*
  • width - Width for the create surfaces
  • height - Height for the created surfaces
  • usage_hint - Optional hint of intended usage to optimize allocation (e.g. tiling)
  • num_surfaces - Number of surfaces to create

Creates a Context by wrapping around a vaCreateContext call.

Arguments
  • config - The configuration for the context
  • coded_width - The coded picture width
  • coded_height - The coded picture height
  • surfaces - Optional hint for the amount of surfaces tied to the context
  • progressive - Whether only progressive frame pictures are present in the sequence

Creates a Config by wrapping around the vaCreateConfig call.

attrs describe the attributes to set for this config. A list of the supported attributes for a given profile/entrypoint pair can be retrieved using Display::get_config_attributes. Other attributes will take their default values, and attrs can be empty in order to obtain a default configuration.

Returns available image formats for this display by wrapping around vaQueryImageFormats.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.