struct ChromaConvert {
module: *mut c_void,
kernel: *mut c_void,
kernel_tex: *mut c_void,
layout: ConvertLayout,
surface: CUdeviceptr,
pitch: usize,
registered: NV_ENC_REGISTERED_PTR,
mapped: NV_ENC_INPUT_PTR,
}Fields§
§module: *mut c_void§kernel: *mut c_void§kernel_tex: *mut c_void§layout: ConvertLayout§surface: CUdeviceptr§pitch: usize§registered: NV_ENC_REGISTERED_PTR§mapped: NV_ENC_INPUT_PTRImplementations§
Source§impl ChromaConvert
impl ChromaConvert
Sourceunsafe fn new(
cuda: &CudaFunctions,
funcs: &NV_ENCODE_API_FUNCTION_LIST,
session: *mut c_void,
width: u32,
height: u32,
layout: ConvertLayout,
) -> Option<Self>
unsafe fn new( cuda: &CudaFunctions, funcs: &NV_ENCODE_API_FUNCTION_LIST, session: *mut c_void, width: u32, height: u32, layout: ConvertLayout, ) -> Option<Self>
JIT the module, allocate the widthxheight surface of layout, and register it with
the session. None where any step refuses: the session then encodes the packed RGB itself,
which sites chroma at the left of each block but converts with the matrix the session
declares all the same.
Sourcefn input(&self) -> (NV_ENC_INPUT_PTR, NV_ENC_BUFFER_FORMAT)
fn input(&self) -> (NV_ENC_INPUT_PTR, NV_ENC_BUFFER_FORMAT)
The registered surface and its format, as NVENC is handed them.
Sourceunsafe fn run(
&self,
cuda: &CudaFunctions,
src: CUdeviceptr,
src_pitch: usize,
width: u32,
height: u32,
swap_rb: bool,
) -> Result<(), String>
unsafe fn run( &self, cuda: &CudaFunctions, src: CUdeviceptr, src_pitch: usize, width: u32, height: u32, swap_rb: bool, ) -> Result<(), String>
Convert the widthxheight packed surface at src/src_pitch into the surface,
on the default stream so it is ordered behind the upload and ahead of the encode.
swap_rb marks an RGBA byte order rather than BGRA.
Sourceunsafe fn run_texture(
&self,
cuda: &CudaFunctions,
tex: CUtexObject,
width: u32,
height: u32,
swap_rb: bool,
) -> Result<(), String>
unsafe fn run_texture( &self, cuda: &CudaFunctions, tex: CUtexObject, width: u32, height: u32, swap_rb: bool, ) -> Result<(), String>
The same convert reading an array-typed import through tex, which leaves its RGB where
the compositor put it instead of copying it into linear memory first.
Sourceunsafe fn launch(
&self,
cuda: &CudaFunctions,
kernel: *mut c_void,
params: &mut [*mut c_void],
width: u32,
height: u32,
) -> Result<(), String>
unsafe fn launch( &self, cuda: &CudaFunctions, kernel: *mut c_void, params: &mut [*mut c_void], width: u32, height: u32, ) -> Result<(), String>
One chroma sample per thread, on the default stream so the convert is ordered behind whatever produced the source and ahead of the encode.
Sourceunsafe fn texture_for(cuda: &CudaFunctions, array: CUarray) -> CUtexObject
unsafe fn texture_for(cuda: &CudaFunctions, array: CUarray) -> CUtexObject
A point-sampled, byte-valued texture over an array-typed import, or zero where the driver refuses one — the frame then stays on NVENC’s own conversion.
Sourceunsafe fn release(
&self,
cuda: &CudaFunctions,
funcs: &NV_ENCODE_API_FUNCTION_LIST,
session: *mut c_void,
)
unsafe fn release( &self, cuda: &CudaFunctions, funcs: &NV_ENCODE_API_FUNCTION_LIST, session: *mut c_void, )
Inner handle before outer, as the rest of the teardown does.
Auto Trait Implementations§
impl !Send for ChromaConvert
impl !Sync for ChromaConvert
impl Freeze for ChromaConvert
impl RefUnwindSafe for ChromaConvert
impl Unpin for ChromaConvert
impl UnsafeUnpin for ChromaConvert
impl UnwindSafe for ChromaConvert
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more