pub struct NvencEncoder {
encoder: Option<Video>,
width: u32,
height: u32,
encoder_name: String,
quality: QualityPreset,
encoded_frame_recv: Option<Receiver<EncodedVideoFrame>>,
encoded_frame_sender: Sender<EncodedVideoFrame>,
cuda_ctx: Context,
graphics_resource: CUgraphicsResource,
egl_context: Option<Box<EglContext>>,
egl_texture: u32,
}Expand description
Encoder which provides frames encoded using Nvenc
Only available for Nvidia GPUs
Fields§
§encoder: Option<Video>§width: u32§height: u32§encoder_name: String§quality: QualityPreset§encoded_frame_recv: Option<Receiver<EncodedVideoFrame>>§encoded_frame_sender: Sender<EncodedVideoFrame>§cuda_ctx: Context§graphics_resource: CUgraphicsResource§egl_context: Option<Box<EglContext>>§egl_texture: u32Implementations§
Source§impl NvencEncoder
impl NvencEncoder
pub(crate) fn new( width: u32, height: u32, quality: QualityPreset, ) -> Result<Self>
fn create_encoder( width: u32, height: u32, encoder: &str, quality: &QualityPreset, cuda_ctx: &Context, ) -> Result<Video>
fn get_encoder_params(quality: &QualityPreset) -> Dictionary<'_>
fn init_gl(&mut self, texture_id: Option<u32>) -> Result<()>
Sourcefn make_current(&self) -> Result<()>
fn make_current(&self) -> Result<()>
Set cuda context to current thread
Trait Implementations§
Source§impl Drop for NvencEncoder
impl Drop for NvencEncoder
Source§impl PipewireSPA for NvencEncoder
impl PipewireSPA for NvencEncoder
fn get_spa_definition() -> Result<Object>
Source§impl ProcessingThread for NvencEncoder
impl ProcessingThread for NvencEncoder
Source§impl VideoEncoder for NvencEncoder
impl VideoEncoder for NvencEncoder
impl Send for NvencEncoder
impl Sync for NvencEncoder
Auto Trait Implementations§
impl Freeze for NvencEncoder
impl !RefUnwindSafe for NvencEncoder
impl Unpin for NvencEncoder
impl !UnwindSafe for NvencEncoder
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
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>
Converts
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>
Converts
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