pub struct Display { /* private fields */ }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 can be allocated with Display::create_surfaces.
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.
Implementations§
Source§impl Display
impl Display
Sourcepub fn open_drm_display<P: AsRef<Path>>(
path: P,
) -> Result<Arc<Self>, OpenDrmDisplayError>
pub fn open_drm_display<P: AsRef<Path>>( path: P, ) -> Result<Arc<Self>, OpenDrmDisplayError>
Opens and initializes a specific DRM Display.
path is the path to a DRM device that supports VAAPI, e.g. /dev/dri/renderD128.
Sourcepub fn open() -> Option<Arc<Self>>
pub fn open() -> Option<Arc<Self>>
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.
Sourcepub fn query_config_profiles(&self) -> Result<Vec<Type>, VaError>
pub fn query_config_profiles(&self) -> Result<Vec<Type>, VaError>
Queries supported profiles by this display by wrapping vaQueryConfigProfiles.
Sourcepub fn query_vendor_string(&self) -> Result<String, &'static str>
pub fn query_vendor_string(&self) -> Result<String, &'static str>
Returns a string describing some aspects of the VA implemenation on the specific hardware
accelerator used by this display. Wrapper over vaQueryVendorString.
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.
Sourcepub fn query_config_entrypoints(
&self,
profile: Type,
) -> Result<Vec<Type>, VaError>
pub fn query_config_entrypoints( &self, profile: Type, ) -> Result<Vec<Type>, VaError>
Query supported entrypoints for a given profile by wrapping vaQueryConfigEntrypoints.
Sourcepub fn create_surfaces<D: SurfaceMemoryDescriptor>(
self: &Arc<Self>,
rt_format: u32,
va_fourcc: Option<u32>,
width: u32,
height: u32,
usage_hint: Option<UsageHint>,
descriptors: Vec<D>,
) -> Result<Vec<Surface<D>>, VaError>
pub fn create_surfaces<D: SurfaceMemoryDescriptor>( self: &Arc<Self>, rt_format: u32, va_fourcc: Option<u32>, width: u32, height: u32, usage_hint: Option<UsageHint>, descriptors: Vec<D>, ) -> Result<Vec<Surface<D>>, VaError>
Creates Surfaces by wrapping around a vaCreateSurfaces call.
The number of surfaces created will be equal to the length of descriptors.
§Arguments
rt_format- The desired surface format. SeeVA_RT_FORMAT_*va_fourcc- The desired pixel format (optional). SeeVA_FOURCC_*width- Width for the create surfacesheight- Height for the created surfacesusage_hint- Optional hint of intended usage to optimize allocation (e.g. tiling)num_surfaces- Number of surfaces to createdescriptors- Memory descriptors used as surface memory backing.
§Return value
Returns as many surfaces as the length of descriptors.
Note that the descriptors’s ownership is irrevocably given to the surfaces, and that in
case of error the descriptors will be destroyed. Make sure to duplicate the descriptors
if you need something outside of libva to access them.
Sourcepub fn query_image_formats(&self) -> Result<Vec<VAImageFormat>, VaError>
pub fn query_image_formats(&self) -> Result<Vec<VAImageFormat>, VaError>
Returns available image formats for this display by wrapping around vaQueryImageFormats.