#[repr(C)]pub struct _NV_ENC_REGISTER_RESOURCE {Show 14 fields
pub version: u32,
pub resourceType: NV_ENC_INPUT_RESOURCE_TYPE,
pub width: u32,
pub height: u32,
pub pitch: u32,
pub subResourceIndex: u32,
pub resourceToRegister: *mut c_void,
pub registeredResource: NV_ENC_REGISTERED_PTR,
pub bufferFormat: NV_ENC_BUFFER_FORMAT,
pub bufferUsage: NV_ENC_BUFFER_USAGE,
pub pInputFencePoint: *mut NV_ENC_FENCE_POINT_D3D12,
pub chromaOffset: [u32; 2],
pub reserved1: [u32; 245],
pub reserved2: [*mut c_void; 61],
}Fields§
§version: u32§resourceType: NV_ENC_INPUT_RESOURCE_TYPE§width: u32§height: u32§pitch: u32§subResourceIndex: u32§resourceToRegister: *mut c_void§registeredResource: NV_ENC_REGISTERED_PTR§bufferFormat: NV_ENC_BUFFER_FORMAT§bufferUsage: NV_ENC_BUFFER_USAGE§pInputFencePoint: *mut NV_ENC_FENCE_POINT_D3D12§chromaOffset: [u32; 2]§reserved1: [u32; 245]§reserved2: [*mut c_void; 61]Implementations§
Source§impl _NV_ENC_REGISTER_RESOURCE
impl _NV_ENC_REGISTER_RESOURCE
Sourcepub fn new(
resource_type: NV_ENC_INPUT_RESOURCE_TYPE,
width: u32,
height: u32,
resource_to_register: *mut c_void,
buffer_format: NV_ENC_BUFFER_FORMAT,
) -> Self
pub fn new( resource_type: NV_ENC_INPUT_RESOURCE_TYPE, width: u32, height: u32, resource_to_register: *mut c_void, buffer_format: NV_ENC_BUFFER_FORMAT, ) -> Self
Builder for NV_ENC_REGISTER_RESOURCE.
§Arguments
resource_type- Specifies the type of resource to be registered. Supported values are:width- Input frame width.height- Input frame height.resource_to_register- Handle to the resource that is being registered. In the case ofNV_ENC_INPUT_RESOURCE_TYPE::NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTR, this should be aCUdeviceptrwhich you can get fromcuExternalMemoryGetMappedBuffer.buffer_format- Buffer format of resource to be registered.
Sourcepub fn pitch(self, pitch: u32) -> Self
pub fn pitch(self, pitch: u32) -> Self
Set the input buffer pitch.
- For
NV_ENC_INPUT_RESOURCE_TYPE::NV_ENC_INPUT_RESOURCE_TYPE_DIRECTXresources, set this to 0. - For
NV_ENC_INPUT_RESOURCE_TYPE::NV_ENC_INPUT_RESOURCE_TYPE_CUDADEVICEPTRresources, set this to the pitch as obtained fromcuMemAllocPitch(), or to the width in bytes (if this resource was created by usingcuMemAlloc()). This value must be a multiple of 4. - For
NV_ENC_INPUT_RESOURCE_TYPE::NV_ENC_INPUT_RESOURCE_TYPE_OPENGL_TEXresources, set this to the texture width multiplied by the number of components in the texture format.
Trait Implementations§
Source§impl Clone for _NV_ENC_REGISTER_RESOURCE
impl Clone for _NV_ENC_REGISTER_RESOURCE
Source§fn clone(&self) -> _NV_ENC_REGISTER_RESOURCE
fn clone(&self) -> _NV_ENC_REGISTER_RESOURCE
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for _NV_ENC_REGISTER_RESOURCE
impl Debug for _NV_ENC_REGISTER_RESOURCE
Source§impl Default for _NV_ENC_REGISTER_RESOURCE
impl Default for _NV_ENC_REGISTER_RESOURCE
Source§impl Hash for _NV_ENC_REGISTER_RESOURCE
impl Hash for _NV_ENC_REGISTER_RESOURCE
Source§impl Ord for _NV_ENC_REGISTER_RESOURCE
impl Ord for _NV_ENC_REGISTER_RESOURCE
Source§fn cmp(&self, other: &_NV_ENC_REGISTER_RESOURCE) -> Ordering
fn cmp(&self, other: &_NV_ENC_REGISTER_RESOURCE) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for _NV_ENC_REGISTER_RESOURCE
impl PartialOrd for _NV_ENC_REGISTER_RESOURCE
impl Copy for _NV_ENC_REGISTER_RESOURCE
impl Eq for _NV_ENC_REGISTER_RESOURCE
impl StructuralPartialEq for _NV_ENC_REGISTER_RESOURCE
Auto Trait Implementations§
impl Freeze for _NV_ENC_REGISTER_RESOURCE
impl RefUnwindSafe for _NV_ENC_REGISTER_RESOURCE
impl !Send for _NV_ENC_REGISTER_RESOURCE
impl !Sync for _NV_ENC_REGISTER_RESOURCE
impl Unpin for _NV_ENC_REGISTER_RESOURCE
impl UnwindSafe for _NV_ENC_REGISTER_RESOURCE
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more