pub struct UserPtrSurface {
    pub buffers: Vec<*mut u8>,
    pub mem_layout: Layout,
    pub layout: SurfaceLayout,
}
Expand description

A structure that holds user-allocated memory for a surface as well as its layout.

Fields§

§buffers: Vec<*mut u8>§mem_layout: Layout§layout: SurfaceLayout

Implementations§

source§

impl UserPtrSurface

source

pub fn new_nv12(size: Resolution) -> Self

Allocate enough memory to back a NV12 surface of size dimension.

Trait Implementations§

source§

impl Debug for UserPtrSurface

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for UserPtrSurface

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl ExternalBufferDescriptor for UserPtrSurface

source§

const MEMORY_TYPE: MemoryType = libva::MemoryType::UserPtr

Memory type to set for VASurfaceAttribMemoryType.
§

type DescriptorAttribute = _VASurfaceAttribExternalBuffers

Type of the descriptor to be set with VASurfaceAttribExternalBuffers.
source§

fn va_surface_attribute(&mut self) -> Self::DescriptorAttribute

Returns the Self::DescriptorAttribute instance allowing this memory to be imported into VAAPI.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T> SurfaceMemoryDescriptor for Twhere T: ExternalBufferDescriptor, <T as ExternalBufferDescriptor>::DescriptorAttribute: 'static,

source§

fn add_attrs( &mut self, attrs: &mut Vec<_VASurfaceAttrib, Global> ) -> Option<Box<dyn Any, Global>>

Add the required attributes to attr in order to attach the memory of this descriptor to the surface when it is created. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.